[POWERPC] cell: cbe_cpufreq cleanup and crash fix
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4bd4aa1967628fa85a40936410acab6b8bbae6f5 Commit: 4bd4aa1967628fa85a40936410acab6b8bbae6f5 Parent: d169d140944a67edd6f88f78b65b3117059f4380 Author: Olof Johansson [EMAIL PROTECTED] AuthorDate: Sat Apr 28 12:49:03 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:05 2007 +1000 [POWERPC] cell: cbe_cpufreq cleanup and crash fix cbe_cpufreq cleanups: * comment format * whitespace * don't init on non-cell platforms Signed-off-by: Olof Johansson [EMAIL PROTECTED] Acked-by: Christian Krafft [EMAIL PROTECTED] Signed-off-by: Arnd Bergmann [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/platforms/cell/cbe_cpufreq.c | 24 ++-- 1 files changed, 14 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c index 4495973..f9ac3fe 100644 --- a/arch/powerpc/platforms/cell/cbe_cpufreq.c +++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c @@ -25,6 +25,7 @@ #include asm/hw_irq.h #include asm/io.h +#include asm/machdep.h #include asm/processor.h #include asm/prom.h #include asm/time.h @@ -155,7 +156,7 @@ static int set_pmode_reg(int cpu, unsigned int pmode) } static int set_pmode(int cpu, unsigned int slow_mode) { - if(pmi_dev) + if (pmi_dev) return set_pmode_pmi(cpu, slow_mode); else return set_pmode_reg(cpu, slow_mode); @@ -167,7 +168,7 @@ static void cbe_cpufreq_handle_pmi(struct of_device *dev, pmi_message_t pmi_msg) u8 cpu; u8 cbe_pmode_new; - BUG_ON (pmi_msg.type != PMI_TYPE_FREQ_CHANGE); + BUG_ON(pmi_msg.type != PMI_TYPE_FREQ_CHANGE); cpu = cbe_node_to_cpu(pmi_msg.data1); cbe_pmode_new = pmi_msg.data2; @@ -191,7 +192,7 @@ static struct pmi_handler cbe_pmi_handler = { * cpufreq functions */ -static int cbe_cpufreq_cpu_init (struct cpufreq_policy *policy) +static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) { const u32 *max_freqp; u32 max_freq; @@ -200,7 +201,7 @@ static int cbe_cpufreq_cpu_init (struct cpufreq_policy *policy) cpu = of_get_cpu_node(policy-cpu, NULL); - if(!cpu) + if (!cpu) return -ENODEV; pr_debug(init cpufreq on CPU %d\n, policy-cpu); @@ -210,13 +211,13 @@ static int cbe_cpufreq_cpu_init (struct cpufreq_policy *policy) if (!max_freqp) return -EINVAL; - // we need the freq in kHz + /* we need the freq in kHz */ max_freq = *max_freqp / 1000; pr_debug(max clock-frequency is at %u kHz\n, max_freq); pr_debug(initializing frequency table\n); - // initialize frequency table + /* initialize frequency table */ for (i=0; cbe_freqs[i].frequency!=CPUFREQ_TABLE_END; i++) { cbe_freqs[i].frequency = max_freq / cbe_freqs[i].index; pr_debug(%d: %d\n, i, cbe_freqs[i].frequency); @@ -235,10 +236,10 @@ static int cbe_cpufreq_cpu_init (struct cpufreq_policy *policy) policy-cpus = cpu_sibling_map[policy-cpu]; #endif - cpufreq_frequency_table_get_attr (cbe_freqs, policy-cpu); + cpufreq_frequency_table_get_attr(cbe_freqs, policy-cpu); /* this ensures that policy-cpuinfo_min and policy-cpuinfo_max are set correctly */ - return cpufreq_frequency_table_cpuinfo (policy, cbe_freqs); + return cpufreq_frequency_table_cpuinfo(policy, cbe_freqs); } static int cbe_cpufreq_cpu_exit(struct cpufreq_policy *policy) @@ -270,7 +271,7 @@ static int cbe_cpufreq_target(struct cpufreq_policy *policy, unsigned int target freqs.new = cbe_freqs[cbe_pmode_new].frequency; freqs.cpu = policy-cpu; - mutex_lock (cbe_switch_mutex); + mutex_lock(cbe_switch_mutex); cpufreq_notify_transition(freqs, CPUFREQ_PRECHANGE); pr_debug(setting frequency for cpu %d to %d kHz, 1/%d of max frequency\n, @@ -303,6 +304,9 @@ static int __init cbe_cpufreq_init(void) { struct device_node *np; + if (!machine_is(cell)) + return -ENODEV; + np = of_find_node_by_type(NULL, ibm,pmi); pmi_dev = of_find_device_by_node(np); @@ -315,7 +319,7 @@ static int __init cbe_cpufreq_init(void) static void __exit cbe_cpufreq_exit(void) { - if(pmi_dev) + if (pmi_dev) pmi_unregister_handler(pmi_dev, cbe_pmi_handler); cpufreq_unregister_driver(cbe_cpufreq_driver); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] arch/powerpc/sysdev/timer.c build fix
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=738925b6855f989d3f90a3330eeff34010309be3 Commit: 738925b6855f989d3f90a3330eeff34010309be3 Parent: 12d371a69e6df96cd949af6bcb569e978e8f9d41 Author: Srinivasa Ds [EMAIL PROTECTED] AuthorDate: Thu Apr 26 00:07:04 2007 -0700 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:05 2007 +1000 [POWERPC] arch/powerpc/sysdev/timer.c build fix arch/powerpc/sysdev/timer.c:51: error: variable `timer_sysclass' has initializer but incomplete type arch/powerpc/sysdev/timer.c:52: error: unknown field `resume' specified in initializer etc Signed-off-by: Srinivasa Ds [EMAIL PROTECTED] Acked-by: Johannes Berg [EMAIL PROTECTED] Cc: Benjamin Herrenschmidt [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/sysdev/timer.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/sysdev/timer.c b/arch/powerpc/sysdev/timer.c index bdbf8fe..4a01748 100644 --- a/arch/powerpc/sysdev/timer.c +++ b/arch/powerpc/sysdev/timer.c @@ -7,6 +7,7 @@ */ #include linux/time.h +#include linux/sysdev.h #include asm/rtc.h static unsigned long suspend_rtc_time; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] Don't define a custom bd_t for Xilixn Virtex based boards.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9be4dcb606e647854760fafd0bb1cb3e1a804d16 Commit: 9be4dcb606e647854760fafd0bb1cb3e1a804d16 Parent: 30fea61fd01955cc35c6a63260b374d7a6d12c8b Author: Grant Likely [EMAIL PROTECTED] AuthorDate: Sat Apr 28 05:50:05 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:04 2007 +1000 [POWERPC] Don't define a custom bd_t for Xilixn Virtex based boards. Why create a platform specific board_info structure that is hacked together, ugly, and dangerous, when we've got a perfectly fine common board_info structure that is hacked-together, ugly and dangerous. Signed-off-by: Grant Likely [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/ppc/platforms/4xx/virtex.h | 15 +-- 1 files changed, 1 insertions(+), 14 deletions(-) diff --git a/arch/ppc/platforms/4xx/virtex.h b/arch/ppc/platforms/4xx/virtex.h index 4fc76da..7382804 100644 --- a/arch/ppc/platforms/4xx/virtex.h +++ b/arch/ppc/platforms/4xx/virtex.h @@ -14,6 +14,7 @@ #define __ASM_VIRTEX_H__ #include asm/ibm405.h +#include asm/ppcboot.h /* Ugly, ugly, ugly! BASE_BAUD defined here to keep 8250.c happy. */ #if !defined(BASE_BAUD) @@ -21,22 +22,8 @@ #endif #ifndef __ASSEMBLY__ -typedef struct board_info { - unsigned int bi_memsize;/* DRAM installed, in bytes */ - unsigned charbi_enetaddr[6];/* Local Ethernet MAC address */ - unsigned int bi_intfreq;/* Processor speed, in Hz */ - unsigned int bi_busfreq;/* PLB Bus speed, in Hz */ - unsigned int bi_pci_busfreq;/* PCI Bus speed, in Hz */ -} bd_t; - -/* Some 4xx parts use a different timebase frequency from the internal clock. - * the Virtex 405 does not, so just use a macro to make tbfreq match intfreq -*/ -#define bi_tbfreq bi_intfreq - extern const char* virtex_machine_name; #define PPC4xx_MACHINE_NAME (virtex_machine_name) - #endif /* !__ASSEMBLY__ */ /* We don't need anything mapped. Size of zero will accomplish that. */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] Add uartlite boot console driver for the zImage wrapper
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b01653ab01eebc781c5a375ff336d0837f30c4e Commit: 8b01653ab01eebc781c5a375ff336d0837f30c4e Parent: 8c38fc2b7429b26105fe244890c8d5ab3043f099 Author: Grant Likely [EMAIL PROTECTED] AuthorDate: Sat Apr 28 05:50:03 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:04 2007 +1000 [POWERPC] Add uartlite boot console driver for the zImage wrapper Signed-off-by: Grant Likely [EMAIL PROTECTED] Acked-by: Peter Korsgaard [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/ppc/boot/common/misc-common.c | 15 + arch/ppc/boot/simple/Makefile |1 + arch/ppc/boot/simple/uartlite_tty.c | 37 +++ 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/arch/ppc/boot/common/misc-common.c b/arch/ppc/boot/common/misc-common.c index 8e1fccd..9589969 100644 --- a/arch/ppc/boot/common/misc-common.c +++ b/arch/ppc/boot/common/misc-common.c @@ -57,7 +57,8 @@ unsigned char *ISA_io = NULL; #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \ || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ - || defined(CONFIG_SERIAL_MPSC_CONSOLE) + || defined(CONFIG_SERIAL_MPSC_CONSOLE) \ + || defined(CONFIG_SERIAL_UARTLITE_CONSOLE) extern unsigned long com_port; extern int serial_tstc(unsigned long com_port); @@ -80,7 +81,8 @@ int tstc(void) { #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \ || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ - || defined(CONFIG_SERIAL_MPSC_CONSOLE) + || defined(CONFIG_SERIAL_MPSC_CONSOLE) \ + || defined(CONFIG_SERIAL_UARTLITE_CONSOLE) if(keyb_present) return (CRT_tstc() || serial_tstc(com_port)); else @@ -95,7 +97,8 @@ int getc(void) while (1) { #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \ || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ - || defined(CONFIG_SERIAL_MPSC_CONSOLE) + || defined(CONFIG_SERIAL_MPSC_CONSOLE) \ + || defined(CONFIG_SERIAL_UARTLITE_CONSOLE) if (serial_tstc(com_port)) return (serial_getc(com_port)); #endif /* serial console */ @@ -112,7 +115,8 @@ putc(const char c) #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \ || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ - || defined(CONFIG_SERIAL_MPSC_CONSOLE) + || defined(CONFIG_SERIAL_MPSC_CONSOLE) \ + || defined(CONFIG_SERIAL_UARTLITE_CONSOLE) serial_putc(com_port, c); if ( c == '\n' ) serial_putc(com_port, '\r'); @@ -161,7 +165,8 @@ void puts(const char *s) while ( ( c = *s++ ) != '\0' ) { #if defined(CONFIG_SERIAL_CPM_CONSOLE) || defined(CONFIG_SERIAL_8250_CONSOLE) \ || defined(CONFIG_SERIAL_MPC52xx_CONSOLE) \ - || defined(CONFIG_SERIAL_MPSC_CONSOLE) + || defined(CONFIG_SERIAL_MPSC_CONSOLE) \ + || defined(CONFIG_SERIAL_UARTLITE_CONSOLE) serial_putc(com_port, c); if ( c == '\n' ) serial_putc(com_port, '\r'); #endif /* serial console */ diff --git a/arch/ppc/boot/simple/Makefile b/arch/ppc/boot/simple/Makefile index bcfb6cd..5b87779 100644 --- a/arch/ppc/boot/simple/Makefile +++ b/arch/ppc/boot/simple/Makefile @@ -201,6 +201,7 @@ boot-$(CONFIG_8260) += m8260_tty.o endif boot-$(CONFIG_SERIAL_MPC52xx_CONSOLE) += mpc52xx_tty.o boot-$(CONFIG_SERIAL_MPSC_CONSOLE) += mv64x60_tty.o +boot-$(CONFIG_SERIAL_UARTLITE_CONSOLE) += uartlite_tty.o LIBS := $(common)/lib.a $(bootlib)/lib.a ifeq ($(CONFIG_PPC_PREP),y) diff --git a/arch/ppc/boot/simple/uartlite_tty.c b/arch/ppc/boot/simple/uartlite_tty.c new file mode 100644 index 000..0eae1ea --- /dev/null +++ b/arch/ppc/boot/simple/uartlite_tty.c @@ -0,0 +1,37 @@ +/* + * Xilinx UARTLITE bootloader driver + * + * Copyright (c) 2007 Secret Lab Technologies Ltd. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/types.h +#include asm/serial.h +#include asm/io.h +#include platforms/4xx/xparameters/xparameters.h + +#define UARTLITE_BASEADDR ((void*)(XPAR_UARTLITE_0_BASEADDR)) + +void +serial_putc(unsigned long com_port, unsigned char c) +{ + while ((in_be32(UARTLITE_BASEADDR + 0x8) 0x08) != 0); /* spin */ + out_be32(UARTLITE_BASEADDR + 0x4, c); +} + +unsigned char +serial_getc(unsigned long com_port) +{ + while ((in_be32(UARTLITE_BASEADDR + 0x8) 0x01) == 0); /* spin */ + return in_be32(UARTLITE_BASEADDR); +} + +int +serial_tstc(unsigned long com_port) +{ + return
[POWERPC] Stop using ppc_sys for Xilinx Virtex boards
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8c38fc2b7429b26105fe244890c8d5ab3043f099 Commit: 8c38fc2b7429b26105fe244890c8d5ab3043f099 Parent: d26cd57071b4358bcf3a9140a90b38514c7f345e Author: Grant Likely [EMAIL PROTECTED] AuthorDate: Sat Apr 28 05:50:02 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:04 2007 +1000 [POWERPC] Stop using ppc_sys for Xilinx Virtex boards The arch/ppc/syslib/ppc_sys.c infrastructure does not work well for the virtex ports. Move the ml300 and ml403 board ports over to use the new virtex_devices infrastructure. Signed-off-by: Grant Likely [EMAIL PROTECTED] Acked-by: Peter Korsgaard [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/ppc/platforms/4xx/Makefile |1 - arch/ppc/platforms/4xx/virtex.c | 56 arch/ppc/platforms/4xx/virtex.h |7 +--- arch/ppc/platforms/4xx/xilinx_ml300.c | 64 ++-- arch/ppc/platforms/4xx/xilinx_ml403.c | 65 ++--- arch/ppc/syslib/Makefile |3 +- include/asm-ppc/ppc_sys.h |2 - 7 files changed, 11 insertions(+), 187 deletions(-) diff --git a/arch/ppc/platforms/4xx/Makefile b/arch/ppc/platforms/4xx/Makefile index fa6610b..723ad79 100644 --- a/arch/ppc/platforms/4xx/Makefile +++ b/arch/ppc/platforms/4xx/Makefile @@ -28,5 +28,4 @@ obj-$(CONFIG_440SP) += ibm440sp.o obj-$(CONFIG_440SPE) += ppc440spe.o obj-$(CONFIG_405EP)+= ibm405ep.o obj-$(CONFIG_405GPR) += ibm405gpr.o -obj-$(CONFIG_XILINX_VIRTEX)+= virtex.o diff --git a/arch/ppc/platforms/4xx/virtex.c b/arch/ppc/platforms/4xx/virtex.c deleted file mode 100644 index 133a831..000 --- a/arch/ppc/platforms/4xx/virtex.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Virtex-II Pro Virtex-4 FX common infrastructure - * - * Maintainer: Grant Likely [EMAIL PROTECTED] - * - * Copyright 2005 Secret Lab Technologies Ltd. - * Copyright 2005 General Dynamics Canada Ltd. - * Copyright 2005 Freescale Semiconductor Inc. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - */ - -#include linux/init.h -#include linux/module.h -#include linux/device.h -#include linux/serial_8250.h -#include asm/ppc_sys.h -#include platforms/4xx/virtex.h -#include platforms/4xx/xparameters/xparameters.h - -#define XPAR_UART(num) { \ - .mapbase = XPAR_UARTNS550_##num##_BASEADDR + 3, \ - .irq = XPAR_INTC_0_UARTNS550_##num##_VEC_ID, \ - .iotype = UPIO_MEM, \ - .uartclk = XPAR_UARTNS550_##num##_CLOCK_FREQ_HZ, \ - .flags= UPF_BOOT_AUTOCONF, \ - .regshift = 2, \ - } - -struct plat_serial8250_port serial_platform_data[] = { -#ifdef XPAR_UARTNS550_0_BASEADDR - XPAR_UART(0), -#endif -#ifdef XPAR_UARTNS550_1_BASEADDR - XPAR_UART(1), -#endif -#ifdef XPAR_UARTNS550_2_BASEADDR - XPAR_UART(2), -#endif -#ifdef XPAR_UARTNS550_3_BASEADDR - XPAR_UART(3), -#endif - { }, /* terminated by empty record */ -}; - -struct platform_device ppc_sys_platform_devices[] = { - [VIRTEX_UART] = { - .name = serial8250, - .id = 0, - .dev.platform_data = serial_platform_data, - }, -}; - diff --git a/arch/ppc/platforms/4xx/virtex.h b/arch/ppc/platforms/4xx/virtex.h index e9f58a7..4fc76da 100644 --- a/arch/ppc/platforms/4xx/virtex.h +++ b/arch/ppc/platforms/4xx/virtex.h @@ -19,13 +19,8 @@ #if !defined(BASE_BAUD) #define BASE_BAUD (0) /* dummy value; not used */ #endif - -/* Device type enumeration for platform bus definitions */ + #ifndef __ASSEMBLY__ -enum ppc_sys_devices { - VIRTEX_UART, NUM_PPC_SYS_DEVS, -}; - typedef struct board_info { unsigned int bi_memsize;/* DRAM installed, in bytes */ unsigned charbi_enetaddr[6];/* Local Ethernet MAC address */ diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.c b/arch/ppc/platforms/4xx/xilinx_ml300.c index 4e4aca4..6e522fe 100644 --- a/arch/ppc/platforms/4xx/xilinx_ml300.c +++ b/arch/ppc/platforms/4xx/xilinx_ml300.c @@ -18,9 +18,9 @@ #include linux/serialP.h #include asm/io.h #include asm/machdep.h -#include asm/ppc_sys.h #include syslib/gen550.h +#include syslib/virtex_devices.h #include platforms/4xx/xparameters/xparameters.h /* @@ -53,25 +53,9 @@ * ppc4xx_pic_initarch/ppc/syslib/xilinx_pic.c */ -/* Board specifications structures */ -struct ppc_sys_spec *cur_ppc_sys_spec; -struct ppc_sys_spec ppc_sys_specs[] = { - { - /* Only one
[POWERPC] Merge common virtex header files
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5ff084f21da25ffcc5e0cb0293a0ea588cb46272 Commit: 5ff084f21da25ffcc5e0cb0293a0ea588cb46272 Parent: 2b10caf380b0dbe3923b0ceefed17e3eaa7f2d4b Author: Grant Likely [EMAIL PROTECTED] AuthorDate: Sat Apr 28 05:50:00 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:04 2007 +1000 [POWERPC] Merge common virtex header files The header files for the ml403 and ml300 are virtually identical, merge them into a single file. Signed-off-by: Grant Likely [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/ppc/platforms/4xx/virtex.h | 40 +++--- arch/ppc/platforms/4xx/xilinx_ml300.c |1 + arch/ppc/platforms/4xx/xilinx_ml300.h | 45 -- arch/ppc/platforms/4xx/xilinx_ml403.c |1 + arch/ppc/platforms/4xx/xilinx_ml403.h | 49 - include/asm-ppc/ibm4xx.h |8 + 6 files changed, 33 insertions(+), 111 deletions(-) diff --git a/arch/ppc/platforms/4xx/virtex.h b/arch/ppc/platforms/4xx/virtex.h index c14325d..e9f58a7 100644 --- a/arch/ppc/platforms/4xx/virtex.h +++ b/arch/ppc/platforms/4xx/virtex.h @@ -1,22 +1,18 @@ /* - * arch/ppc/platforms/4xx/virtex.h + * Basic Virtex platform defines, included by asm/ibm4xx.h * - * Include file that defines the Xilinx Virtex-II Pro processor + * 2005-2007 (c) Secret Lab Technologies Ltd. + * 2002-2004 (c) MontaVista Software, Inc. * - * Author: MontaVista Software, Inc. - * [EMAIL PROTECTED] - * - * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under the - * terms of the GNU General Public License version 2. This program is licensed - * as is without any warranty of any kind, whether express or implied. + * This file is licensed under the terms of the GNU General Public License + * version 2. This program is licensed as is without any warranty of any + * kind, whether express or implied. */ #ifdef __KERNEL__ #ifndef __ASM_VIRTEX_H__ #define __ASM_VIRTEX_H__ -/* serial defines */ - #include asm/ibm405.h /* Ugly, ugly, ugly! BASE_BAUD defined here to keep 8250.c happy. */ @@ -29,7 +25,29 @@ enum ppc_sys_devices { VIRTEX_UART, NUM_PPC_SYS_DEVS, }; -#endif +typedef struct board_info { + unsigned int bi_memsize;/* DRAM installed, in bytes */ + unsigned charbi_enetaddr[6];/* Local Ethernet MAC address */ + unsigned int bi_intfreq;/* Processor speed, in Hz */ + unsigned int bi_busfreq;/* PLB Bus speed, in Hz */ + unsigned int bi_pci_busfreq;/* PCI Bus speed, in Hz */ +} bd_t; + +/* Some 4xx parts use a different timebase frequency from the internal clock. + * the Virtex 405 does not, so just use a macro to make tbfreq match intfreq +*/ +#define bi_tbfreq bi_intfreq + +extern const char* virtex_machine_name; +#define PPC4xx_MACHINE_NAME (virtex_machine_name) + +#endif /* !__ASSEMBLY__ */ + +/* We don't need anything mapped. Size of zero will accomplish that. */ +#define PPC4xx_ONB_IO_PADDR0u +#define PPC4xx_ONB_IO_VADDR0u +#define PPC4xx_ONB_IO_SIZE 0u + #endif /* __ASM_VIRTEX_H__ */ #endif /* __KERNEL__ */ diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.c b/arch/ppc/platforms/4xx/xilinx_ml300.c index fb5f0b5..4e4aca4 100644 --- a/arch/ppc/platforms/4xx/xilinx_ml300.c +++ b/arch/ppc/platforms/4xx/xilinx_ml300.c @@ -68,6 +68,7 @@ struct ppc_sys_spec ppc_sys_specs[] = { }, }, }; +const char* virtex_machine_name = ML300 Reference Design; #if defined(XPAR_POWER_0_POWERDOWN_BASEADDR) diff --git a/arch/ppc/platforms/4xx/xilinx_ml300.h b/arch/ppc/platforms/4xx/xilinx_ml300.h deleted file mode 100644 index 3d57332..000 --- a/arch/ppc/platforms/4xx/xilinx_ml300.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Include file that defines the Xilinx ML300 evaluation board - * - * Author: MontaVista Software, Inc. - * [EMAIL PROTECTED] - * - * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under the - * terms of the GNU General Public License version 2. This program is licensed - * as is without any warranty of any kind, whether express or implied. - */ - -#ifdef __KERNEL__ -#ifndef __ASM_XILINX_ML300_H__ -#define __ASM_XILINX_ML300_H__ - -/* ML300 has a Xilinx Virtex-II Pro processor */ -#include platforms/4xx/virtex.h - -#ifndef __ASSEMBLY__ - -#include linux/types.h - -typedef struct board_info { - unsigned int bi_memsize;/* DRAM installed, in bytes */ - unsigned charbi_enetaddr[6];/* Local Ethernet MAC address */ - unsigned int bi_intfreq;/* Processor speed, in Hz */ - unsigned int bi_busfreq;/* PLB Bus speed, in Hz */ - unsigned int
[POWERPC] New registration for common Xilinx Virtex ppc405 platform devices
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d26cd57071b4358bcf3a9140a90b38514c7f345e Commit: d26cd57071b4358bcf3a9140a90b38514c7f345e Parent: 5ff084f21da25ffcc5e0cb0293a0ea588cb46272 Author: Grant Likely [EMAIL PROTECTED] AuthorDate: Sat Apr 28 05:50:01 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:04 2007 +1000 [POWERPC] New registration for common Xilinx Virtex ppc405 platform devices Currently virtex support in mainline make use of the infrastructure in arch/ppc/syslib/ppc_sys.c for registering common devices on virtex ppc405 platforms. The ppc_sys.c code is not well suited to the dynamic nature of FPGA designs and makes adding new board ports more complex. This patch adds a new listing of common devices which does not depend on the ppc_sys.c infrastructure. Signed-off-by: Grant Likely [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/ppc/syslib/virtex_devices.c | 233 ++ arch/ppc/syslib/virtex_devices.h | 27 + 2 files changed, 260 insertions(+), 0 deletions(-) diff --git a/arch/ppc/syslib/virtex_devices.c b/arch/ppc/syslib/virtex_devices.c new file mode 100644 index 000..1654678 --- /dev/null +++ b/arch/ppc/syslib/virtex_devices.c @@ -0,0 +1,233 @@ +/* + * Virtex hard ppc405 core common device listing + * + * Copyright 2005-2007 Secret Lab Technologies Ltd. + * Copyright 2005 Freescale Semiconductor Inc. + * Copyright 2002-2004 MontaVista Software, Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/init.h +#include linux/module.h +#include linux/device.h +#include linux/serial_8250.h +#include syslib/virtex_devices.h +#include platforms/4xx/xparameters/xparameters.h +#include asm/io.h + +/* + * UARTLITE: shortcut macro for single instance + */ +#define XPAR_UARTLITE(num) { \ + .name = uartlite, \ + .id = num, \ + .num_resources = 2, \ + .resource = (struct resource[]) { \ + { \ + .start = XPAR_UARTLITE_##num##_BASEADDR + 3, \ + .end = XPAR_UARTLITE_##num##_HIGHADDR, \ + .flags = IORESOURCE_MEM, \ + }, \ + { \ + .start = XPAR_INTC_0_UARTLITE_##num##_VEC_ID, \ + .flags = IORESOURCE_IRQ, \ + }, \ + }, \ +} + +/* + * Full UART: shortcut macro for single instance + platform data structure + */ +#define XPAR_UART(num) { \ + .mapbase = XPAR_UARTNS550_##num##_BASEADDR + 3, \ + .irq = XPAR_INTC_0_UARTNS550_##num##_VEC_ID, \ + .iotype = UPIO_MEM, \ + .uartclk = XPAR_UARTNS550_##num##_CLOCK_FREQ_HZ, \ + .flags = UPF_BOOT_AUTOCONF, \ + .regshift = 2, \ +} + +/* + * SystemACE: shortcut macro for single instance + */ +#define XPAR_SYSACE(num) { \ + .name = xsysace, \ + .id = XPAR_SYSACE_##num##_DEVICE_ID, \ + .num_resources = 2, \ + .resource = (struct resource[]) { \ + { \ + .start = XPAR_SYSACE_##num##_BASEADDR, \ + .end= XPAR_SYSACE_##num##_HIGHADDR, \ + .flags = IORESOURCE_MEM, \ + }, \ + { \ + .start = XPAR_INTC_0_SYSACE_##num##_VEC_ID, \ + .flags = IORESOURCE_IRQ, \ + }, \ + }, \ +} + + +/* UART 8250 driver platform data table */ +struct plat_serial8250_port virtex_serial_platform_data[] = { +#if defined(XPAR_UARTNS550_0_BASEADDR) + XPAR_UART(0), +#endif +#if defined(XPAR_UARTNS550_1_BASEADDR) + XPAR_UART(1), +#endif +#if defined(XPAR_UARTNS550_2_BASEADDR) + XPAR_UART(2), +#endif +#if defined(XPAR_UARTNS550_3_BASEADDR) + XPAR_UART(3), +#endif +#if defined(XPAR_UARTNS550_4_BASEADDR) + XPAR_UART(4), +#endif +#if defined(XPAR_UARTNS550_5_BASEADDR) + XPAR_UART(5), +#endif +#if defined(XPAR_UARTNS550_6_BASEADDR) + XPAR_UART(6), +#endif +#if defined(XPAR_UARTNS550_7_BASEADDR) + XPAR_UART(7), +#endif + { }, /* terminated by empty record */ +}; + + +struct platform_device virtex_platform_devices[] = { + /* UARTLITE instances */ +#if defined(XPAR_UARTLITE_0_BASEADDR) + XPAR_UARTLITE(0), +#endif +#if defined(XPAR_UARTLITE_1_BASEADDR) + XPAR_UARTLITE(1), +#endif +#if defined(XPAR_UARTLITE_2_BASEADDR) + XPAR_UARTLITE(2), +#endif +#if defined(XPAR_UARTLITE_3_BASEADDR) + XPAR_UARTLITE(3), +#endif +#if defined(XPAR_UARTLITE_4_BASEADDR) + XPAR_UARTLITE(4), +#endif +#if defined(XPAR_UARTLITE_5_BASEADDR) + XPAR_UARTLITE(5),
[POWERPC] Clean up cpufreq Kconfig dependencies
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c146c958dc953da172231577d7ee81cf06d7eeb4 Commit: c146c958dc953da172231577d7ee81cf06d7eeb4 Parent: e089ad46dbede9eed650f12d039d1addc05adf43 Author: Olof Johansson [EMAIL PROTECTED] AuthorDate: Fri Apr 27 15:52:43 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:03 2007 +1000 [POWERPC] Clean up cpufreq Kconfig dependencies Shuffle Kconfig order, making the platform drivers menu depend on the global option instead of each driver being dependent on it. Also fix dependency of PPC_PMAC on the G5 one. Signed-off-by: Olof Johansson [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/platforms/Kconfig | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 102a44e..51e3334 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -148,14 +148,14 @@ config GENERIC_IOMAP bool default n -menu CPU Frequency support - depends on PPC64 || CLASSIC32 - source drivers/cpufreq/Kconfig +menu CPU Frequency drivers + depends on CPU_FREQ + config CPU_FREQ_PMAC bool Support for Apple PowerBooks - depends on CPU_FREQ ADB_PMU PPC32 + depends on ADB_PMU PPC32 select CPU_FREQ_TABLE help This adds support for frequency switching on Apple PowerBooks, @@ -164,7 +164,7 @@ config CPU_FREQ_PMAC config CPU_FREQ_PMAC64 bool Support for some Apple G5s - depends on CPU_FREQ PPC64 + depends on PPC_PMAC PPC64 select CPU_FREQ_TABLE help This adds support for frequency switching on Apple iMac G5, @@ -172,7 +172,7 @@ config CPU_FREQ_PMAC64 config PPC_PASEMI_CPUFREQ bool Support for PA Semi PWRficient - depends on CPU_FREQ PPC_PASEMI + depends on PPC_PASEMI default y select CPU_FREQ_TABLE help - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] Generic check_legacy_ioport
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8d8a0241eb019ce9648a77b55f9f76a834207cbb Commit: 8d8a0241eb019ce9648a77b55f9f76a834207cbb Parent: 8d2169e8d6b8a91413df33bc402e0f602ceaabcc Author: Olaf Hering [EMAIL PROTECTED] AuthorDate: Thu Apr 26 06:36:56 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Fri Apr 27 21:14:30 2007 +1000 [POWERPC] Generic check_legacy_ioport check_legacy_ioport makes only sense on PREP, CHRP and pSeries. They may have an isa node with PS/2, parport, floppy and serial ports. Remove the check_legacy_ioport call from ppc_md, it's not needed anymore. Hardware capabilities come from the device-tree. Signed-off-by: Olaf Hering [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/kernel/setup-common.c | 34 -- arch/powerpc/platforms/cell/setup.c | 10 - arch/powerpc/platforms/celleb/setup.c | 10 - arch/powerpc/platforms/iseries/setup.c | 10 - arch/powerpc/platforms/pasemi/setup.c |7 -- arch/powerpc/platforms/powermac/setup.c | 10 - arch/powerpc/platforms/pseries/setup.c | 27 include/asm-powerpc/io.h|7 +- include/asm-powerpc/machdep.h |3 -- 9 files changed, 37 insertions(+), 81 deletions(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 3c8847b..3708037 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -478,11 +478,39 @@ void probe_machine(void) printk(KERN_INFO Using %s machine description\n, ppc_md.name); } +/* Match a class of boards, not a specific device configuration. */ int check_legacy_ioport(unsigned long base_port) { - if (ppc_md.check_legacy_ioport == NULL) - return 0; - return ppc_md.check_legacy_ioport(base_port); + struct device_node *parent, *np = NULL; + int ret = -ENODEV; + + switch(base_port) { + case I8042_DATA_REG: + np = of_find_node_by_type(NULL, 8042); + break; + case FDC_BASE: /* FDC1 */ + np = of_find_node_by_type(NULL, fdc); + break; +#ifdef CONFIG_PPC_PREP + case _PIDXR: + case _PNPWRP: + case PNPBIOS_BASE: + /* implement me */ +#endif + default: + /* ipmi is supposed to fail here */ + break; + } + if (!np) + return ret; + parent = of_get_parent(np); + if (parent) { + if (strcmp(parent-type, isa) == 0) + ret = 0; + of_node_put(parent); + } + of_node_put(np); + return ret; } EXPORT_SYMBOL(check_legacy_ioport); diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 5c5fa34..54b9618 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c @@ -190,15 +190,6 @@ static int __init cell_probe(void) return 1; } -/* - * Cell has no legacy IO; anything calling this function has to - * fail or bad things will happen - */ -static int cell_check_legacy_ioport(unsigned int baseport) -{ - return -ENODEV; -} - define_machine(cell) { .name = Cell, .probe = cell_probe, @@ -211,7 +202,6 @@ define_machine(cell) { .get_rtc_time = rtas_get_rtc_time, .set_rtc_time = rtas_set_rtc_time, .calibrate_decr = generic_calibrate_decr, - .check_legacy_ioport= cell_check_legacy_ioport, .progress = cell_progress, .init_IRQ = cell_init_irq, .pci_setup_phb = rtas_setup_phb, diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c index ab1db9d..596ab2a 100644 --- a/arch/powerpc/platforms/celleb/setup.c +++ b/arch/powerpc/platforms/celleb/setup.c @@ -128,15 +128,6 @@ static int __init celleb_probe(void) return 1; } -/* - * Cell has no legacy IO; anything calling this function has to - * fail or bad things will happen - */ -static int celleb_check_legacy_ioport(unsigned int baseport) -{ - return -ENODEV; -} - #ifdef CONFIG_KEXEC static void celleb_kexec_cpu_down(int crash, int secondary) { @@ -173,7 +164,6 @@ define_machine(celleb) { .get_rtc_time = beat_get_rtc_time, .set_rtc_time = beat_set_rtc_time, .calibrate_decr = generic_calibrate_decr, - .check_legacy_ioport= celleb_check_legacy_ioport, .progress = celleb_progress, .power_save = beat_power_save, .nvram_size = beat_nvram_get_size, diff --git a/arch/powerpc/platforms/iseries/setup.c
[POWERPC] Cleanup and fix breakage in tlbflush.h
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=621023072524fc0155ed16490255e1ea3aa11585 Commit: 621023072524fc0155ed16490255e1ea3aa11585 Parent: 687304014f7ca8e2fbb3feaefef356b4a0da65ad Author: David Gibson [EMAIL PROTECTED] AuthorDate: Tue Apr 24 13:09:12 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Tue Apr 24 22:08:56 2007 +1000 [POWERPC] Cleanup and fix breakage in tlbflush.h BenH's commit a741e67969577163a4cfc78d7fd2753219087ef1 in powerpc.git, although (AFAICT) only intended to affect ppc64, also has side-effects which break 44x. I think 40x, 8xx and Freescale Book E are also affected, though I haven't tested them. The problem lies in unconditionally removing flush_tlb_pending() from the versions of flush_tlb_mm(), flush_tlb_range() and flush_tlb_kernel_range() used on ppc64 - which are also used the embedded platforms mentioned above. The patch below cleans up the convoluted #ifdef logic in tlbflush.h, in the process restoring the necessary flushes for the software TLB platforms. There are three sets of definitions for the flushing hooks: the software TLB versions (revised to avoid using names which appear to related to TLB batching), the 32-bit hash based versions (external functions) amd the 64-bit hash based versions (which implement batching). It also moves the declaration of update_mmu_cache() to always be in tlbflush.h (previously it was in tlbflush.h except for PPC64, where it was in pgtable.h). Booted on Ebony (440GP) and compiled for 64-bit and 32-bit multiplatform. Signed-off-by: David Gibson [EMAIL PROTECTED] Acked-by: Benjamin Herrenschmidt [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/mm/mmu_decl.h |1 + include/asm-powerpc/pgtable.h | 10 --- include/asm-powerpc/tlbflush.h | 135 +++ 3 files changed, 81 insertions(+), 65 deletions(-) diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h index ee55e0b..9c4538b 100644 --- a/arch/powerpc/mm/mmu_decl.h +++ b/arch/powerpc/mm/mmu_decl.h @@ -19,6 +19,7 @@ * 2 of the License, or (at your option) any later version. * */ +#include linux/mm.h #include asm/tlbflush.h #include asm/mmu.h diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h index c7142c7..19edb69 100644 --- a/include/asm-powerpc/pgtable.h +++ b/include/asm-powerpc/pgtable.h @@ -448,16 +448,6 @@ extern pgd_t swapper_pg_dir[]; extern void paging_init(void); -/* - * This gets called at the end of handling a page fault, when - * the kernel has put a new PTE into the page table for the process. - * We use it to put a corresponding HPTE into the hash table - * ahead of time, instead of waiting for the inevitable extra - * hash-table miss exception. - */ -struct vm_area_struct; -extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t); - /* Encode and de-code a swap entry */ #define __swp_type(entry) (((entry).val 1) 0x3f) #define __swp_offset(entry)((entry).val 8) diff --git a/include/asm-powerpc/tlbflush.h b/include/asm-powerpc/tlbflush.h index 0bc5a5e..86e6266 100644 --- a/include/asm-powerpc/tlbflush.h +++ b/include/asm-powerpc/tlbflush.h @@ -17,10 +17,73 @@ */ #ifdef __KERNEL__ - struct mm_struct; +struct vm_area_struct; + +#if defined(CONFIG_4xx) || defined(CONFIG_8xx) || defined(CONFIG_FSL_BOOKE) +/* + * TLB flushing for software loaded TLB chips + * + * TODO: (CONFIG_FSL_BOOKE) determine if flush_tlb_range + * flush_tlb_kernel_range are best implemented as tlbia vs + * specific tlbie's + */ + +extern void _tlbie(unsigned long address); + +#if defined(CONFIG_40x) || defined(CONFIG_8xx) +#define _tlbia() asm volatile (tlbia; sync : : : memory) +#else /* CONFIG_44x || CONFIG_FSL_BOOKE */ +extern void _tlbia(void); +#endif -#ifdef CONFIG_PPC64 +static inline void flush_tlb_mm(struct mm_struct *mm) +{ + _tlbia(); +} + +static inline void flush_tlb_page(struct vm_area_struct *vma, + unsigned long vmaddr) +{ + _tlbie(vmaddr); +} + +static inline void flush_tlb_page_nohash(struct vm_area_struct *vma, +unsigned long vmaddr) +{ + _tlbie(vmaddr); +} + +static inline void flush_tlb_range(struct vm_area_struct *vma, + unsigned long start, unsigned long end) +{ + _tlbia(); +} + +static inline void flush_tlb_kernel_range(unsigned long start, + unsigned long end) +{ + _tlbia(); +} + +#elif defined(CONFIG_PPC32) +/* + * TLB flushing for classic hash-MMMU 32-bit CPUs, 6xx, 7xx, 7xxx + */ +extern void _tlbie(unsigned long address); +extern void _tlbia(void); + +extern void flush_tlb_mm(struct mm_struct *mm); +extern void
[POWERPC] bootwrapper: cuboot-83xx: Exclude upper 1MB from heap.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=173ba87b9584e4cba41ce9a06916eba80baa1bf4 Commit: 173ba87b9584e4cba41ce9a06916eba80baa1bf4 Parent: 4536b937466ff6784d2a9a4bebde924a0d6e01cb Author: Scott Wood [EMAIL PROTECTED] AuthorDate: Fri Apr 27 03:19:31 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Fri Apr 27 21:14:21 2007 +1000 [POWERPC] bootwrapper: cuboot-83xx: Exclude upper 1MB from heap. The uppermost part of memory is where u-boot puts the stack, so don't include that in the heap. It's not currently causing problems, as the current code allocates from the bottom of the heap, but this will keep things from potentially breaking if a future implementation were to allocate from the top. Signed-off-by: Scott Wood [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/boot/cuboot-83xx.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/boot/cuboot-83xx.c b/arch/powerpc/boot/cuboot-83xx.c index 8f11d1e..6cbc20a 100644 --- a/arch/powerpc/boot/cuboot-83xx.c +++ b/arch/powerpc/boot/cuboot-83xx.c @@ -61,7 +61,7 @@ void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, loader_info.cmdline = (char *)r6; loader_info.cmdline_len = r7 - r6; - simple_alloc_init(_end, avail_ram, 32, 64); + simple_alloc_init(_end, avail_ram - 1024*1024, 32, 64); ft_init(_dtb_start, _dtb_end - _dtb_start, 32); serial_console_init(); platform_ops.fixups = platform_fixups; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ACPI: thinkpad-acpi: add infrastructure for the sysfs device attributes
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7252374a39d794879f5e47bcfa0a16e7599b27b5 Commit: 7252374a39d794879f5e47bcfa0a16e7599b27b5 Parent: 176750d68801bfa4a88d1cf54174aa0347d7e5d8 Author: Henrique de Moraes Holschuh [EMAIL PROTECTED] AuthorDate: Tue Apr 24 11:48:14 2007 -0300 Committer: Len Brown [EMAIL PROTECTED] CommitDate: Wed Apr 25 02:00:27 2007 -0400 ACPI: thinkpad-acpi: add infrastructure for the sysfs device attributes Add infrastructure to deal with sysfs attributes and grouping, and helpers for common sysfs parsing. Switch driver attributes to use them. Signed-off-by: Henrique de Moraes Holschuh [EMAIL PROTECTED] Signed-off-by: Len Brown [EMAIL PROTECTED] --- drivers/misc/thinkpad_acpi.c | 86 +++-- drivers/misc/thinkpad_acpi.h | 21 ++ 2 files changed, 102 insertions(+), 5 deletions(-) diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index a31d00d..ca6d15c 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -520,12 +520,8 @@ static ssize_t tpacpi_driver_debug_store(struct device_driver *drv, const char *buf, size_t count) { unsigned long t; - char *endp; - t = simple_strtoul(buf, endp, 0); - while (*endp isspace(*endp)) - endp++; - if (*endp) + if (parse_strtoul(buf, 0x, t)) return -EINVAL; dbg_level = t; @@ -575,6 +571,86 @@ static void tpacpi_remove_driver_attributes(struct device_driver *drv) driver_remove_file(drv, tpacpi_driver_attributes[i]); } +/* + * sysfs support helpers + */ + +struct attribute_set_obj { + struct attribute_set s; + struct attribute *a; +} __attribute__((packed)); + +static struct attribute_set *create_attr_set(unsigned int max_members, + const char* name) +{ + struct attribute_set_obj *sobj; + + if (max_members == 0) + return NULL; + + /* Allocates space for implicit NULL at the end too */ + sobj = kzalloc(sizeof(struct attribute_set_obj) + + max_members * sizeof(struct attribute *), + GFP_KERNEL); + if (!sobj) + return NULL; + sobj-s.max_members = max_members; + sobj-s.group.attrs = sobj-a; + sobj-s.group.name = name; + + return sobj-s; +} + +/* not multi-threaded safe, use it in a single thread per set */ +static int add_to_attr_set(struct attribute_set* s, struct attribute *attr) +{ + if (!s || !attr) + return -EINVAL; + + if (s-members = s-max_members) + return -ENOMEM; + + s-group.attrs[s-members] = attr; + s-members++; + + return 0; +} + +static int add_many_to_attr_set(struct attribute_set* s, + struct attribute **attr, + unsigned int count) +{ + int i, res; + + for (i = 0; i count; i++) { + res = add_to_attr_set(s, attr[i]); + if (res) + return res; + } + + return 0; +} + +static void delete_attr_set(struct attribute_set* s, struct kobject *kobj) +{ + sysfs_remove_group(kobj, s-group); + destroy_attr_set(s); +} + +static int parse_strtoul(const char *buf, + unsigned long max, unsigned long *value) +{ + char *endp; + + *value = simple_strtoul(buf, endp, 0); + while (*endp isspace(*endp)) + endp++; + if (*endp || *value max) + return -EINVAL; + + return 0; +} + / * diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h index 3786058..84fdefe 100644 --- a/drivers/misc/thinkpad_acpi.h +++ b/drivers/misc/thinkpad_acpi.h @@ -134,6 +134,27 @@ static int dispatch_procfs_write(struct file *file, unsigned long count, void *data); static char *next_cmd(char **cmds); +/* sysfs support */ +struct attribute_set { + unsigned int members, max_members; + struct attribute_group group; +}; + +static struct attribute_set *create_attr_set(unsigned int max_members, + const char* name); +#define destroy_attr_set(_set) \ + kfree(_set); +static int add_to_attr_set(struct attribute_set* s, struct attribute *attr); +static int add_many_to_attr_set(struct attribute_set* s, + struct attribute **attr, + unsigned int count); +#define register_attr_set_with_sysfs(_attr_set, _kobj) \ + sysfs_create_group(_kobj, _attr_set-group) +static void
ACPI: thinkpad-acpi: driver sysfs conversion
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=176750d68801bfa4a88d1cf54174aa0347d7e5d8 Commit: 176750d68801bfa4a88d1cf54174aa0347d7e5d8 Parent: 54ae15014c306b3d7ad32c996fea9a5ac8560b60 Author: Henrique de Moraes Holschuh [EMAIL PROTECTED] AuthorDate: Tue Apr 24 11:48:13 2007 -0300 Committer: Len Brown [EMAIL PROTECTED] CommitDate: Wed Apr 25 02:00:27 2007 -0400 ACPI: thinkpad-acpi: driver sysfs conversion Add the sysfs attributes for the platform driver. Signed-off-by: Henrique de Moraes Holschuh [EMAIL PROTECTED] Signed-off-by: Len Brown [EMAIL PROTECTED] --- Documentation/thinkpad-acpi.txt | 42 +- drivers/misc/thinkpad_acpi.c| 90 +++ drivers/misc/thinkpad_acpi.h|3 + 3 files changed, 133 insertions(+), 2 deletions(-) diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt index 0e4e053..cc079af 100644 --- a/Documentation/thinkpad-acpi.txt +++ b/Documentation/thinkpad-acpi.txt @@ -101,11 +101,39 @@ follow all sysfs guidelines and correctly process all errors (the sysfs interface makes extensive use of errors). File descriptors and open / close operations to the sysfs inodes must also be properly implemented. -Driver version -- /proc/acpi/ibm/driver +The version of thinkpad-acpi's sysfs interface is exported by the driver +as a driver attribute (see below). + +Sysfs driver attributes are on the driver's sysfs attribute space, +for 2.6.20 this is /sys/bus/platform/drivers/thinkpad-acpi/. + +Sysfs device attributes are on the driver's sysfs attribute space, +for 2.6.20 this is /sys/devices/platform/thinkpad-acpi/. + +Driver version +-- + +procfs: /proc/acpi/ibm/driver +sysfs driver attribute: version The driver name and version. No commands can be written to this file. +Sysfs interface version +--- + +sysfs driver attribute: interface_version + +Version of the thinkpad-acpi sysfs interface, as an unsigned long +(output in hex format: 0xBBCC), where: + - major revision + BB - minor revision + CC - bugfix revision + +The sysfs interface version changelog for the driver can be found at the +end of this document. Changes to the sysfs interface done by the kernel +subsystems are not documented here, nor are they tracked by this +attribute. + Hot keys -- /proc/acpi/ibm/hotkey - @@ -745,9 +773,19 @@ to enable more than one output class, just add their values. There is also a kernel build option to enable more debugging information, which may be necessary to debug driver problems. +The level of debugging information output by the driver can be changed +at runtime through sysfs, using the driver attribute debug_level. The +attribute takes the same bitmask as the debug module parameter above. + Force loading of module --- If thinkpad-acpi refuses to detect your ThinkPad, you can try to specify the module parameter force_load=1. Regardless of whether this works or not, please contact [EMAIL PROTECTED] with a report. + + +Sysfs interface changelog: + +0x000100: Initial sysfs support, as a single platform driver and + device. diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index e47eaf7..a31d00d 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -22,6 +22,7 @@ */ #define IBM_VERSION 0.14 +#define TPACPI_SYSFS_VERSION 0x000100 /* * Changelog: @@ -493,6 +494,87 @@ static struct platform_driver tpacpi_pdriver = { }; +/* + * thinkpad-acpi driver attributes + */ + +/* interface_version --- */ +static ssize_t tpacpi_driver_interface_version_show( + struct device_driver *drv, + char *buf) +{ + return snprintf(buf, PAGE_SIZE, 0x%08x\n, TPACPI_SYSFS_VERSION); +} + +static DRIVER_ATTR(interface_version, S_IRUGO, + tpacpi_driver_interface_version_show, NULL); + +/* debug_level - */ +static ssize_t tpacpi_driver_debug_show(struct device_driver *drv, + char *buf) +{ + return snprintf(buf, PAGE_SIZE, 0x%04x\n, dbg_level); +} + +static ssize_t tpacpi_driver_debug_store(struct device_driver *drv, + const char *buf, size_t count) +{ + unsigned long t; + char *endp; + + t = simple_strtoul(buf, endp, 0); + while (*endp isspace(*endp)) + endp++; + if (*endp) + return -EINVAL; + + dbg_level = t; + + return count; +} + +static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, +
ACPI: thinkpad-acpi: register with the device model
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=54ae15014c306b3d7ad32c996fea9a5ac8560b60 Commit: 54ae15014c306b3d7ad32c996fea9a5ac8560b60 Parent: 99fba3f8177956170f3d86f83c2cf2f70747105f Author: Henrique de Moraes Holschuh [EMAIL PROTECTED] AuthorDate: Tue Apr 24 11:48:12 2007 -0300 Committer: Len Brown [EMAIL PROTECTED] CommitDate: Wed Apr 25 02:00:27 2007 -0400 ACPI: thinkpad-acpi: register with the device model Register thinkpad-acpi platform driver and platform device for the device model. Also register the platform device with the hwmon class. Signed-off-by: Henrique de Moraes Holschuh [EMAIL PROTECTED] Signed-off-by: Len Brown [EMAIL PROTECTED] --- Documentation/thinkpad-acpi.txt | 40 drivers/misc/Kconfig|1 + drivers/misc/thinkpad_acpi.c| 54 +++ drivers/misc/thinkpad_acpi.h|8 ++ 4 files changed, 97 insertions(+), 6 deletions(-) diff --git a/Documentation/thinkpad-acpi.txt b/Documentation/thinkpad-acpi.txt index 1a42b77..0e4e053 100644 --- a/Documentation/thinkpad-acpi.txt +++ b/Documentation/thinkpad-acpi.txt @@ -1,7 +1,7 @@ ThinkPad ACPI Extras Driver Version 0.14 - March 26th, 2007 + April 21st, 2007 Borislav Deianov [EMAIL PROTECTED] Henrique de Moraes Holschuh [EMAIL PROTECTED] @@ -67,11 +67,39 @@ thinkpad-specific bay functionality. Features -The driver creates the /proc/acpi/ibm directory. There is a file under -that directory for each feature described below. Note that while the -driver is still in the alpha stage, the exact proc file format and -commands supported by the various features is guaranteed to change -frequently. +The driver exports two different interfaces to userspace, which can be +used to access the features it provides. One is a legacy procfs-based +interface, which will be removed at some time in the distant future. +The other is a new sysfs-based interface which is not complete yet. + +The procfs interface creates the /proc/acpi/ibm directory. There is a +file under that directory for each feature it supports. The procfs +interface is mostly frozen, and will change very little if at all: it +will not be extended to add any new functionality in the driver, instead +all new functionality will be implemented on the sysfs interface. + +The sysfs interface tries to blend in the generic Linux sysfs subsystems +and classes as much as possible. Since some of these subsystems are not +yet ready or stabilized, it is expected that this interface will change, +and any and all userspace programs must deal with it. + + +Notes about the sysfs interface: + +Unlike what was done with the procfs interface, correctness when talking +to the sysfs interfaces will be enforced, as will correctness in the +thinkpad-acpi's implementation of sysfs interfaces. + +Also, any bugs in the thinkpad-acpi sysfs driver code or in the +thinkpad-acpi's implementation of the sysfs interfaces will be fixed for +maximum correctness, even if that means changing an interface in +non-compatible ways. As these interfaces mature both in the kernel and +in thinkpad-acpi, such changes should become quite rare. + +Applications interfacing to the thinkpad-acpi sysfs interfaces must +follow all sysfs guidelines and correctly process all errors (the sysfs +interface makes extensive use of errors). File descriptors and open / +close operations to the sysfs inodes must also be properly implemented. Driver version -- /proc/acpi/ibm/driver --- diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 44e4c8f..445c4b1 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -126,6 +126,7 @@ config THINKPAD_ACPI tristate ThinkPad ACPI Laptop Extras depends on X86 ACPI select BACKLIGHT_CLASS_DEVICE + select HWMON ---help--- This is a driver for the IBM and Lenovo ThinkPad laptops. It adds support for Fn-Fx key combinations, Bluetooth control, video diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 9b4eea4..e47eaf7 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -477,6 +477,25 @@ static char *next_cmd(char **cmds) / * + * Device model: hwmon and platform + * + + / + +static struct platform_device *tpacpi_pdev = NULL; +static struct class_device *tpacpi_hwmon = NULL; + +static struct platform_driver tpacpi_pdriver =
[POWERPC] Rename MPIC_BROKEN_U3 to MPIC_U3_HT_IRQS
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6cfef5b27e49e826125f12637ee0d7210a896044 Commit: 6cfef5b27e49e826125f12637ee0d7210a896044 Parent: e3f64788d32f97b31709a45911dabaa37f933359 Author: Michael Ellerman [EMAIL PROTECTED] AuthorDate: Mon Apr 23 18:47:08 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Tue Apr 24 22:06:58 2007 +1000 [POWERPC] Rename MPIC_BROKEN_U3 to MPIC_U3_HT_IRQS Rename MPIC_BROKEN_U3 to something a little more descriptive. Its effect is to enable support for HT irqs behind the PCI-X/HT bridge on U3/U4 (aka. CPC9x5) parts. Signed-off-by: Michael Ellerman [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/configs/g5_defconfig |2 +- arch/powerpc/configs/maple_defconfig|2 +- arch/powerpc/configs/ppc64_defconfig|2 +- arch/powerpc/platforms/Kconfig |2 +- arch/powerpc/platforms/maple/Kconfig|2 +- arch/powerpc/platforms/maple/setup.c|2 +- arch/powerpc/platforms/powermac/Kconfig |2 +- arch/powerpc/platforms/powermac/pic.c |2 +- arch/powerpc/sysdev/mpic.c | 24 include/asm-powerpc/mpic.h | 12 ++-- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/arch/powerpc/configs/g5_defconfig b/arch/powerpc/configs/g5_defconfig index 7724847..3ccf19d 100644 --- a/arch/powerpc/configs/g5_defconfig +++ b/arch/powerpc/configs/g5_defconfig @@ -143,7 +143,7 @@ CONFIG_PPC_NATIVE=y CONFIG_U3_DART=y # CONFIG_PPC_RTAS is not set # CONFIG_MMIO_NVRAM is not set -CONFIG_MPIC_BROKEN_U3=y +CONFIG_MPIC_U3_HT_IRQS=y # CONFIG_PPC_MPC106 is not set CONFIG_PPC_970_NAP=y # CONFIG_PPC_INDIRECT_IO is not set diff --git a/arch/powerpc/configs/maple_defconfig b/arch/powerpc/configs/maple_defconfig index de97f2f..15366f0 100644 --- a/arch/powerpc/configs/maple_defconfig +++ b/arch/powerpc/configs/maple_defconfig @@ -146,7 +146,7 @@ CONFIG_PPC_RTAS=y CONFIG_RTAS_PROC=y # CONFIG_RTAS_FLASH is not set # CONFIG_MMIO_NVRAM is not set -CONFIG_MPIC_BROKEN_U3=y +CONFIG_MPIC_U3_HT_IRQS=y # CONFIG_PPC_MPC106 is not set CONFIG_PPC_970_NAP=y # CONFIG_PPC_INDIRECT_IO is not set diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig index a8da0ae..126b9f8 100644 --- a/arch/powerpc/configs/ppc64_defconfig +++ b/arch/powerpc/configs/ppc64_defconfig @@ -152,7 +152,7 @@ CONFIG_RTAS_ERROR_LOGGING=y CONFIG_RTAS_PROC=y CONFIG_RTAS_FLASH=m CONFIG_MMIO_NVRAM=y -CONFIG_MPIC_BROKEN_U3=y +CONFIG_MPIC_U3_HT_IRQS=y CONFIG_IBMVIO=y # CONFIG_IBMEBUS is not set # CONFIG_PPC_MPC106 is not set diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 86be82a..ac62fa0 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -115,7 +115,7 @@ config MMIO_NVRAM bool default n -config MPIC_BROKEN_U3 +config MPIC_U3_HT_IRQS bool depends on PPC_MAPLE default y diff --git a/arch/powerpc/platforms/maple/Kconfig b/arch/powerpc/platforms/maple/Kconfig index 5f364b8..f7c95eb 100644 --- a/arch/powerpc/platforms/maple/Kconfig +++ b/arch/powerpc/platforms/maple/Kconfig @@ -3,7 +3,7 @@ config PPC_MAPLE bool Maple 970FX Evaluation Board select MPIC select U3_DART - select MPIC_BROKEN_U3 + select MPIC_U3_HT_IRQS select GENERIC_TBSYNC select PPC_UDBG_16550 select PPC_970_NAP diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c index 120cd04..2a30c5b 100644 --- a/arch/powerpc/platforms/maple/setup.c +++ b/arch/powerpc/platforms/maple/setup.c @@ -264,7 +264,7 @@ static void __init maple_init_IRQ(void) flags |= MPIC_BIG_ENDIAN; /* XXX Maple specific bits */ - flags |= MPIC_BROKEN_U3 | MPIC_WANTS_RESET; + flags |= MPIC_U3_HT_IRQS | MPIC_WANTS_RESET; /* All U3/U4 are big-endian, older SLOF firmware doesn't encode this */ flags |= MPIC_BIG_ENDIAN; diff --git a/arch/powerpc/platforms/powermac/Kconfig b/arch/powerpc/platforms/powermac/Kconfig index 02d9c7d..5b7afe5 100644 --- a/arch/powerpc/platforms/powermac/Kconfig +++ b/arch/powerpc/platforms/powermac/Kconfig @@ -12,7 +12,7 @@ config PPC_PMAC64 depends on PPC_PMAC POWER4 select MPIC select U3_DART - select MPIC_BROKEN_U3 + select MPIC_U3_HT_IRQS select GENERIC_TBSYNC select PPC_970_NAP default y diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c index f59d311..ae5097a 100644 --- a/arch/powerpc/platforms/powermac/pic.c +++ b/arch/powerpc/platforms/powermac/pic.c @@ -489,7 +489,7 @@ static struct mpic * __init pmac_setup_one_mpic(struct device_node *np, * but works until I find a better way */ if (master (flags
Revert [POWERPC] Autodetect serial console on efika
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e089ad46dbede9eed650f12d039d1addc05adf43 Commit: e089ad46dbede9eed650f12d039d1addc05adf43 Parent: 8d8a0241eb019ce9648a77b55f9f76a834207cbb Author: Paul Mackerras [EMAIL PROTECTED] AuthorDate: Mon Apr 30 10:24:24 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 10:24:24 2007 +1000 Revert [POWERPC] Autodetect serial console on efika This reverts commit 9414715a7bbb45450015e9bc2676d85d919d08d4, at Olaf Hering's request: Paul, please discard this patch. The optional graphics card may have also device_type 'serial' if it is in VGA mode. I will send an updated patch later. --- arch/powerpc/platforms/52xx/efika.c | 26 -- 1 files changed, 0 insertions(+), 26 deletions(-) diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c index 0eceb1f..a6bba97 100644 --- a/arch/powerpc/platforms/52xx/efika.c +++ b/arch/powerpc/platforms/52xx/efika.c @@ -21,7 +21,6 @@ #include linux/initrd.h #include linux/timer.h #include linux/pci.h -#include linux/console.h #include asm/io.h #include asm/irq.h @@ -221,37 +220,12 @@ static int __init efika_probe(void) return 1; } -static void __init efika_init_early(void) -{ -#ifdef CONFIG_SERIAL_MPC52xx - struct device_node *stdout_node; - const char *device_type; - - if (strstr(cmd_line, console=)) - return; - /* find the boot console from /chosen/stdout */ - if (!of_chosen) - return; - device_type = of_get_property(of_chosen, linux,stdout-path, NULL); - if (!device_type) - return; - stdout_node = of_find_node_by_path(device_type); - if (stdout_node) { - device_type = of_get_property(stdout_node, device_type, NULL); - if (device_type strcmp(device_type, serial) == 0) - add_preferred_console(ttyPSC, 0, NULL); - of_node_put(stdout_node); - } -#endif -} - define_machine(efika) { .name = EFIKA_PLATFORM_NAME, .probe = efika_probe, .setup_arch = efika_setup_arch, .init = mpc52xx_declare_of_platform_devices, - .init_early = efika_init_early, .show_cpuinfo = efika_show_cpuinfo, .init_IRQ = mpc52xx_init_irq, .get_irq= mpc52xx_get_irq, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] Rework Kconfig dependancies for Xilinx Virtex ppc405 platform
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2b10caf380b0dbe3923b0ceefed17e3eaa7f2d4b Commit: 2b10caf380b0dbe3923b0ceefed17e3eaa7f2d4b Parent: c146c958dc953da172231577d7ee81cf06d7eeb4 Author: Grant Likely [EMAIL PROTECTED] AuthorDate: Sat Apr 28 05:49:59 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:04 2007 +1000 [POWERPC] Rework Kconfig dependancies for Xilinx Virtex ppc405 platform Reverse dependency order for Xilinx Virtex parts. For these parts, It makes more sense for boards/chips to specify which features they provide instead of the features listing the parts they are implemented in. I think it also makes adding new board ports simpler. Signed-off-by: Grant Likely [EMAIL PROTECTED] Acked-by: Peter Korsgaard [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/ppc/platforms/4xx/Kconfig | 15 +++ 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig index 705ae56..76551b6 100644 --- a/arch/ppc/platforms/4xx/Kconfig +++ b/arch/ppc/platforms/4xx/Kconfig @@ -29,6 +29,7 @@ config CPCI405 config EP405 bool EP405/EP405PC + select EMBEDDEDBOOT help This option enables support for the EP405/EP405PC boards. @@ -54,11 +55,15 @@ config WALNUT config XILINX_ML300 bool Xilinx-ML300 + select XILINX_VIRTEX_II_PRO + select EMBEDDEDBOOT help This option enables support for the Xilinx ML300 evaluation board. config XILINX_ML403 bool Xilinx-ML403 + select XILINX_VIRTEX_4_FX + select EMBEDDEDBOOT help This option enables support for the Xilinx ML403 evaluation board. endchoice @@ -215,18 +220,14 @@ config 405GPR config XILINX_VIRTEX_II_PRO bool - depends on XILINX_ML300 - default y + select XILINX_VIRTEX config XILINX_VIRTEX_4_FX bool - depends on XILINX_ML403 - default y + select XILINX_VIRTEX config XILINX_VIRTEX bool - depends on XILINX_VIRTEX_II_PRO || XILINX_VIRTEX_4_FX - default y config STB03xxx bool @@ -235,8 +236,6 @@ config STB03xxx config EMBEDDEDBOOT bool - depends on EP405 || XILINX_ML300 || XILINX_ML403 - default y config IBM_OPENBIOS bool - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] Add sane defaults for Xilinx EDK generated xparameters files
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=30fea61fd01955cc35c6a63260b374d7a6d12c8b Commit: 30fea61fd01955cc35c6a63260b374d7a6d12c8b Parent: 8b01653ab01eebc781c5a375ff336d0837f30c4e Author: Grant Likely [EMAIL PROTECTED] AuthorDate: Sat Apr 28 05:50:04 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:04 2007 +1000 [POWERPC] Add sane defaults for Xilinx EDK generated xparameters files Signed-off-by: Grant Likely [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/ppc/platforms/4xx/xparameters/xparameters.h | 60 ++ 1 files changed, 60 insertions(+), 0 deletions(-) diff --git a/arch/ppc/platforms/4xx/xparameters/xparameters.h b/arch/ppc/platforms/4xx/xparameters/xparameters.h index 66ec5f3..01aa043 100644 --- a/arch/ppc/platforms/4xx/xparameters/xparameters.h +++ b/arch/ppc/platforms/4xx/xparameters/xparameters.h @@ -34,3 +34,63 @@ .io_type = SERIAL_IO_MEM, \ }, #endif + +/* + * A few reasonable defaults for the #defines which could be missing depending + * on the IP version or variant (e.g. OPB vs PLB) + */ + +#ifndef XPAR_EMAC_0_CAM_EXIST +#define XPAR_EMAC_0_CAM_EXIST 0 +#endif +#ifndef XPAR_EMAC_0_JUMBO_EXIST +#define XPAR_EMAC_0_JUMBO_EXIST 0 +#endif +#ifndef XPAR_EMAC_0_TX_DRE_TYPE +#define XPAR_EMAC_0_TX_DRE_TYPE 0 +#endif +#ifndef XPAR_EMAC_0_RX_DRE_TYPE +#define XPAR_EMAC_0_RX_DRE_TYPE 0 +#endif +#ifndef XPAR_EMAC_0_TX_INCLUDE_CSUM +#define XPAR_EMAC_0_TX_INCLUDE_CSUM 0 +#endif +#ifndef XPAR_EMAC_0_RX_INCLUDE_CSUM +#define XPAR_EMAC_0_RX_INCLUDE_CSUM 0 +#endif + +#ifndef XPAR_EMAC_1_CAM_EXIST +#define XPAR_EMAC_1_CAM_EXIST 0 +#endif +#ifndef XPAR_EMAC_1_JUMBO_EXIST +#define XPAR_EMAC_1_JUMBO_EXIST 0 +#endif +#ifndef XPAR_EMAC_1_TX_DRE_TYPE +#define XPAR_EMAC_1_TX_DRE_TYPE 0 +#endif +#ifndef XPAR_EMAC_1_RX_DRE_TYPE +#define XPAR_EMAC_1_RX_DRE_TYPE 0 +#endif +#ifndef XPAR_EMAC_1_TX_INCLUDE_CSUM +#define XPAR_EMAC_1_TX_INCLUDE_CSUM 0 +#endif +#ifndef XPAR_EMAC_1_RX_INCLUDE_CSUM +#define XPAR_EMAC_1_RX_INCLUDE_CSUM 0 +#endif + +#ifndef XPAR_GPIO_0_IS_DUAL +#define XPAR_GPIO_0_IS_DUAL 0 +#endif +#ifndef XPAR_GPIO_1_IS_DUAL +#define XPAR_GPIO_1_IS_DUAL 0 +#endif +#ifndef XPAR_GPIO_2_IS_DUAL +#define XPAR_GPIO_2_IS_DUAL 0 +#endif +#ifndef XPAR_GPIO_3_IS_DUAL +#define XPAR_GPIO_3_IS_DUAL 0 +#endif +#ifndef XPAR_GPIO_4_IS_DUAL +#define XPAR_GPIO_4_IS_DUAL 0 +#endif + - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] Add dt_xlate_addr() to bootwrapper
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8895ea483e144f8acca16adfff7c60a993e77b7d Commit: 8895ea483e144f8acca16adfff7c60a993e77b7d Parent: d818d7ec8bb06c1bc10270962e28fb0cbd93b64a Author: Mark A. Greer [EMAIL PROTECTED] AuthorDate: Sat Apr 28 06:48:24 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:05 2007 +1000 [POWERPC] Add dt_xlate_addr() to bootwrapper dt_xlate_reg() looks up the 'reg' property in the specified node to get the address and size to translate. Add dt_xlate_addr() which is passed in the address and size to translate. Signed-off-by: Mark A. Greer [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/boot/devtree.c | 47 ++ arch/powerpc/boot/ops.h |4 +- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/boot/devtree.c b/arch/powerpc/boot/devtree.c index ac4b5ee..c995155 100644 --- a/arch/powerpc/boot/devtree.c +++ b/arch/powerpc/boot/devtree.c @@ -207,12 +207,13 @@ static int find_range(u32 *reg, u32 *ranges, int nregaddr, * In particular, PCI is not supported. Also, only the beginning of the * reg block is tracked; size is ignored except in ranges. */ -int dt_xlate_reg(void *node, int res, unsigned long *addr, - unsigned long *size) +static u32 dt_xlate_buf[MAX_ADDR_CELLS * MAX_RANGES * 3]; + +static int dt_xlate(void *node, int res, int reglen, unsigned long *addr, + unsigned long *size) { u32 last_addr[MAX_ADDR_CELLS]; u32 this_addr[MAX_ADDR_CELLS]; - u32 buf[MAX_ADDR_CELLS * MAX_RANGES * 3]; void *parent; u64 ret_addr, ret_size; u32 naddr, nsize, prev_naddr; @@ -227,19 +228,18 @@ int dt_xlate_reg(void *node, int res, unsigned long *addr, if (nsize 2) return 0; - buflen = getprop(node, reg, buf, sizeof(buf)) / 4; offset = (naddr + nsize) * res; - if (buflen offset + naddr + nsize || - sizeof(buf) offset + naddr + nsize) + if (reglen offset + naddr + nsize || + sizeof(dt_xlate_buf) offset + naddr + nsize) return 0; - copy_val(last_addr, buf + offset, naddr); + copy_val(last_addr, dt_xlate_buf + offset, naddr); - ret_size = buf[offset + naddr]; + ret_size = dt_xlate_buf[offset + naddr]; if (nsize == 2) { ret_size = 32; - ret_size |= buf[offset + naddr + 1]; + ret_size |= dt_xlate_buf[offset + naddr + 1]; } while ((node = get_parent(node))) { @@ -247,24 +247,25 @@ int dt_xlate_reg(void *node, int res, unsigned long *addr, get_reg_format(node, naddr, nsize); - buflen = getprop(node, ranges, buf, sizeof(buf)); + buflen = getprop(node, ranges, dt_xlate_buf, + sizeof(dt_xlate_buf)); if (buflen 0) continue; - if (buflen sizeof(buf)) + if (buflen sizeof(dt_xlate_buf)) return 0; - offset = find_range(last_addr, buf, prev_naddr, + offset = find_range(last_addr, dt_xlate_buf, prev_naddr, naddr, nsize, buflen / 4); if (offset 0) return 0; - copy_val(this_addr, buf + offset, prev_naddr); + copy_val(this_addr, dt_xlate_buf + offset, prev_naddr); if (!sub_reg(last_addr, this_addr)) return 0; - copy_val(this_addr, buf + offset + prev_naddr, naddr); + copy_val(this_addr, dt_xlate_buf + offset + prev_naddr, naddr); if (!add_reg(last_addr, this_addr, naddr)) return 0; @@ -286,3 +287,21 @@ int dt_xlate_reg(void *node, int res, unsigned long *addr, return 1; } + +int dt_xlate_reg(void *node, int res, unsigned long *addr, unsigned long *size) +{ + int reglen; + + reglen = getprop(node, reg, dt_xlate_buf, sizeof(dt_xlate_buf)) / 4; + return dt_xlate(node, res, reglen, addr, size); +} + +int dt_xlate_addr(void *node, u32 *buf, int buflen, unsigned long *xlated_addr) +{ + + if (buflen sizeof(dt_xlate_buf)) + return 0; + + memcpy(dt_xlate_buf, buf, buflen); + return dt_xlate(node, 0, buflen / 4, xlated_addr, NULL); +} diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h index 20e8719..73bd47a 100644 --- a/arch/powerpc/boot/ops.h +++ b/arch/powerpc/boot/ops.h @@ -82,8 +82,8 @@ int ns16550_console_init(void *devp, struct serial_console_data *scdp); void *simple_alloc_init(char *base, unsigned long heap_size, unsigned long granularity, unsigned long max_allocs); extern void flush_cache(void
[POWERPC] bootwrapper: CONFIG_ - CONFIG_DEVICE_TREE
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d818d7ec8bb06c1bc10270962e28fb0cbd93b64a Commit: d818d7ec8bb06c1bc10270962e28fb0cbd93b64a Parent: 9be4dcb606e647854760fafd0bb1cb3e1a804d16 Author: Scott Wood [EMAIL PROTECTED] AuthorDate: Sat Apr 28 06:32:15 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:04 2007 +1000 [POWERPC] bootwrapper: CONFIG_ - CONFIG_DEVICE_TREE A usage of CONFIG_DEVICE_TREE got accidentally truncated; this fix allows out-of-tree dts files to work. Signed-off-by: Scott Wood [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/boot/Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 9d7b877..3716594 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -166,7 +166,7 @@ cuboot-plat-$(CONFIG_83xx) += 83xx cuboot-plat-$(CONFIG_85xx) += 85xx cuboot-plat-y += unknown-platform -dts = $(if $(shell echo $(CONFIG_) | grep '^/'),\ +dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\ ,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE) $(obj)/cuImage: vmlinux $(wrapperbits) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] Declare enable_kernel_spe in a header
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d169d140944a67edd6f88f78b65b3117059f4380 Commit: d169d140944a67edd6f88f78b65b3117059f4380 Parent: 8895ea483e144f8acca16adfff7c60a993e77b7d Author: Johannes Berg [EMAIL PROTECTED] AuthorDate: Sat Apr 28 08:00:03 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:05 2007 +1000 [POWERPC] Declare enable_kernel_spe in a header This patch puts enable_kernel_spe into asm-powerpc/system.h along with enable_kernel_altivec etc. Signed-off-by: Johannes Berg [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- include/asm-powerpc/system.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index f7b1227..d3e0906 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h @@ -131,6 +131,7 @@ extern void enable_kernel_altivec(void); extern void giveup_altivec(struct task_struct *); extern void load_up_altivec(struct task_struct *); extern int emulate_altivec(struct pt_regs *); +extern void enable_kernel_spe(void); extern void giveup_spe(struct task_struct *); extern void load_up_spe(struct task_struct *); extern int fix_alignment(struct pt_regs *); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] get_property cleanups
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=12d371a69e6df96cd949af6bcb569e978e8f9d41 Commit: 12d371a69e6df96cd949af6bcb569e978e8f9d41 Parent: 8d1cea6e1439a113b1f17eab9b4e2f0cfc24bbb0 Author: Stephen Rothwell [EMAIL PROTECTED] AuthorDate: Sun Apr 29 16:29:08 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:05 2007 +1000 [POWERPC] get_property cleanups Just another pass through arch/powerpc for old usages. Signed-off-by: Stephen Rothwell [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/platforms/cell/ras.c |4 ++-- arch/powerpc/platforms/pasemi/cpufreq.c | 11 ++- arch/powerpc/platforms/pasemi/gpio_mdio.c |6 +++--- arch/powerpc/sysdev/uic.c |8 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c index b5ebc91..3961a08 100644 --- a/arch/powerpc/platforms/cell/ras.c +++ b/arch/powerpc/platforms/cell/ras.c @@ -149,7 +149,7 @@ static int __init cbe_ptcal_enable(void) if (!np) return -ENODEV; - size = get_property(np, ibm,cbe-ptcal-size, NULL); + size = of_get_property(np, ibm,cbe-ptcal-size, NULL); if (!size) return -ENODEV; @@ -168,7 +168,7 @@ static int __init cbe_ptcal_enable(void) /* support for older device tree - use cpu nodes */ for_each_node_by_type(np, cpu) { - const u32 *nid = get_property(np, node-id, NULL); + const u32 *nid = of_get_property(np, node-id, NULL); if (!nid) { printk(KERN_ERR %s: node %s is missing node-id?\n, __FUNCTION__, np-full_name); diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c index 4dd5c51..2a57d60 100644 --- a/arch/powerpc/platforms/pasemi/cpufreq.c +++ b/arch/powerpc/platforms/pasemi/cpufreq.c @@ -134,7 +134,8 @@ void restore_astate(int cpu) static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) { - u32 *max_freq; + const u32 *max_freqp; + u32 max_freq; int i, cur_astate; struct resource res; struct device_node *cpu, *dn; @@ -175,16 +176,16 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) pr_debug(init cpufreq on CPU %d\n, policy-cpu); - max_freq = (u32*) get_property(cpu, clock-frequency, NULL); - if (!max_freq) { + max_freqp = of_get_property(cpu, clock-frequency, NULL); + if (!max_freqp) { err = -EINVAL; goto out_unmap_sdcpwr; } /* we need the freq in kHz */ - *max_freq /= 1000; + max_freq = *max_freqp / 1000; - pr_debug(max clock-frequency is at %u kHz\n, *max_freq); + pr_debug(max clock-frequency is at %u kHz\n, max_freq); pr_debug(initializing frequency table\n); /* initialize frequency table */ diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index b1d3b6b..c91a335 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c @@ -258,7 +258,7 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev, new_bus-write = gpio_mdio_write, new_bus-reset = gpio_mdio_reset, - prop = get_property(np, reg, NULL); + prop = of_get_property(np, reg, NULL); new_bus-id = *prop; new_bus-priv = priv; @@ -269,10 +269,10 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev, new_bus-irq[i] = irq_create_mapping(NULL, 10); - prop = get_property(np, mdc-pin, NULL); + prop = of_get_property(np, mdc-pin, NULL); priv-mdc_pin = *prop; - prop = get_property(np, mdio-pin, NULL); + prop = of_get_property(np, mdio-pin, NULL); priv-mdio_pin = *prop; new_bus-dev = dev; diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c index cdbe684..968fb40 100644 --- a/arch/powerpc/sysdev/uic.c +++ b/arch/powerpc/sysdev/uic.c @@ -230,7 +230,7 @@ static struct uic * __init uic_init_one(struct device_node *node) memset(uic, 0, sizeof(*uic)); spin_lock_init(uic-lock); uic-of_node = of_node_get(node); - indexp = get_property(node, cell-index, len); + indexp = of_get_property(node, cell-index, len); if (!indexp || (len != sizeof(u32))) { printk(KERN_ERR uic: Device node %s has missing or invalid cell-index property\n, node-full_name); @@ -238,7 +238,7 @@ static struct uic * __init uic_init_one(struct device_node *node) } uic-index = *indexp; - dcrreg = get_property(node, dcr-reg, len); + dcrreg = of_get_property(node, dcr-reg, len);
[POWERPC] Remove dev_dbg redefinition in drivers/ps3/vuart.c
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f900e9777fc9b65140cb9570438597bc8fae56ab Commit: f900e9777fc9b65140cb9570438597bc8fae56ab Parent: 49e1900d4cc2e7bcecb681fe60f0990bec2dcce8 Author: Paul Mackerras [EMAIL PROTECTED] AuthorDate: Mon Apr 30 13:03:39 2007 +1000 Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 13:03:39 2007 +1000 [POWERPC] Remove dev_dbg redefinition in drivers/ps3/vuart.c Commit 404d5b185b4eb56d6fa2f7bd27833f8df1c38ce4 changed the definition of dev_dbg in the !DEBUG case from being a #define to being a static inline. There was code in drivers/ps3/vuart.c to do exactly that, which fails to compile now. This fixes it by removing the redefinition, as the redefinition is now superfluous. Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- drivers/ps3/vuart.c |8 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/drivers/ps3/vuart.c b/drivers/ps3/vuart.c index 6c12744..7d7cab1 100644 --- a/drivers/ps3/vuart.c +++ b/drivers/ps3/vuart.c @@ -82,14 +82,6 @@ struct ports_bmp { u64 unused[3]; } __attribute__ ((aligned (32))); -/* redefine dev_dbg to do a syntax check */ - -#if !defined(DEBUG) -#undef dev_dbg -static inline int __attribute__ ((format (printf, 2, 3))) dev_dbg( - const struct device *_dev, const char *fmt, ...) {return 0;} -#endif - #define dump_ports_bmp(_b) _dump_ports_bmp(_b, __func__, __LINE__) static void __attribute__ ((unused)) _dump_ports_bmp( const struct ports_bmp* bmp, const char* func, int line) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[POWERPC] Spinlock initializer cleanup
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=057b184a007376562e905aa39f1ba352fb8d78b1 Commit: 057b184a007376562e905aa39f1ba352fb8d78b1 Parent: f139efedb8d34904cf8ea30b174c3ee57204d114 Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Sun Apr 29 16:10:39 2007 + Committer: Paul Mackerras [EMAIL PROTECTED] CommitDate: Mon Apr 30 11:02:06 2007 +1000 [POWERPC] Spinlock initializer cleanup Use DEFINE_SPINLOCK instead of initializing spinlocks to SPIN_LOCK_UNLOCKED, since DEFINE_SPINLOCK is better for lockdep. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Paul Mackerras [EMAIL PROTECTED] --- arch/powerpc/kernel/irq.c |2 +- arch/powerpc/oprofile/op_model_cell.c |2 +- arch/powerpc/platforms/cell/spu_base.c |2 +- arch/powerpc/platforms/ps3/htab.c |2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 1009308..6c83fe2 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -394,7 +394,7 @@ EXPORT_SYMBOL(do_softirq); #ifdef CONFIG_PPC_MERGE static LIST_HEAD(irq_hosts); -static spinlock_t irq_big_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(irq_big_lock); static DEFINE_PER_CPU(unsigned int, irq_radix_reader); static unsigned int irq_radix_writer; struct irq_map_entry irq_map[NR_IRQS]; diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c index fb999e3..626b29f 100644 --- a/arch/powerpc/oprofile/op_model_cell.c +++ b/arch/powerpc/oprofile/op_model_cell.c @@ -131,7 +131,7 @@ static int pm_rtas_token; static u32 reset_value[NR_PHYS_CTRS]; static int num_counters; static int oprofile_running; -static spinlock_t virt_cntr_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(virt_cntr_lock); static u32 ctr_enabled; diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 8086eb1..fec5152 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c @@ -43,7 +43,7 @@ const struct spu_priv1_ops *spu_priv1_ops; static struct list_head spu_list[MAX_NUMNODES]; static LIST_HEAD(spu_full_list); static DEFINE_MUTEX(spu_mutex); -static spinlock_t spu_list_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(spu_list_lock); EXPORT_SYMBOL_GPL(spu_priv1_ops); diff --git a/arch/powerpc/platforms/ps3/htab.c b/arch/powerpc/platforms/ps3/htab.c index e12e59f..ea60c45 100644 --- a/arch/powerpc/platforms/ps3/htab.c +++ b/arch/powerpc/platforms/ps3/htab.c @@ -39,7 +39,7 @@ static unsigned long htab_addr; static unsigned char *bolttab; static unsigned char *inusetab; -static spinlock_t ps3_bolttab_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(ps3_bolttab_lock); #define debug_dump_hpte(_a, _b, _c, _d, _e, _f, _g) \ _debug_dump_hpte(_a, _b, _c, _d, _e, _f, _g, __func__, __LINE__) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[BLOCK] Don't pin lots of memory in mempools
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5972511b77809cb7c9ccdb79b825c54921c5c546 Commit: 5972511b77809cb7c9ccdb79b825c54921c5c546 Parent: b9099ff63c75216d6ca10bce5a1abcd9293c27e6 Author: Jens Axboe [EMAIL PROTECTED] AuthorDate: Mon Apr 2 10:06:42 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Mon Apr 30 09:08:17 2007 +0200 [BLOCK] Don't pin lots of memory in mempools Currently we scale the mempool sizes depending on memory installed in the machine, except for the bio pool itself which sits at a fixed 256 entry pre-allocation. There's really no point in optimizing this OOM path, we just need enough preallocated to make progress. A single unit is enough, lets scale it down to 2 just to be on the safe side. This patch saves ~150kb of pinned kernel memory on a 32-bit box. Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- drivers/md/dm-crypt.c |2 +- drivers/md/dm-io.c |2 +- drivers/md/dm.c |2 +- drivers/scsi/scsi_lib.c |2 +- fs/bio.c| 41 ++--- include/linux/bio.h |2 +- 6 files changed, 11 insertions(+), 40 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 4c2471e..d812123 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -867,7 +867,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) goto bad4; } - cc-bs = bioset_create(MIN_IOS, MIN_IOS, 4); + cc-bs = bioset_create(MIN_IOS, MIN_IOS); if (!cc-bs) { ti-error = Cannot allocate crypt bioset; goto bad_bs; diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c index 4eb73d3..8bdc8a8 100644 --- a/drivers/md/dm-io.c +++ b/drivers/md/dm-io.c @@ -60,7 +60,7 @@ static int resize_pool(unsigned int new_ios) if (!_io_pool) return -ENOMEM; - _bios = bioset_create(16, 16, 4); + _bios = bioset_create(16, 16); if (!_bios) { mempool_destroy(_io_pool); _io_pool = NULL; diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 3668b17..11a98df 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1012,7 +1012,7 @@ static struct mapped_device *alloc_dev(int minor) if (!md-tio_pool) goto bad3; - md-bs = bioset_create(16, 16, 4); + md-bs = bioset_create(16, 16); if (!md-bs) goto bad_no_bioset; diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9f7482d..05d79af 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -31,7 +31,7 @@ #define SG_MEMPOOL_NR ARRAY_SIZE(scsi_sg_pools) -#define SG_MEMPOOL_SIZE32 +#define SG_MEMPOOL_SIZE2 struct scsi_host_sg_pool { size_t size; diff --git a/fs/bio.c b/fs/bio.c index 7618bcb..693940d 100644 --- a/fs/bio.c +++ b/fs/bio.c @@ -28,7 +28,7 @@ #include linux/blktrace_api.h #include scsi/sg.h /* for struct sg_iovec */ -#define BIO_POOL_SIZE 256 +#define BIO_POOL_SIZE 2 static struct kmem_cache *bio_slab __read_mostly; @@ -38,7 +38,7 @@ static struct kmem_cache *bio_slab __read_mostly; * a small number of entries is fine, not going to be performance critical. * basically we just need to survive */ -#define BIO_SPLIT_ENTRIES 8 +#define BIO_SPLIT_ENTRIES 2 mempool_t *bio_split_pool __read_mostly; struct biovec_slab { @@ -1120,7 +1120,7 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) * create memory pools for biovec's in a bio_set. * use the global biovec slabs created for general use. */ -static int biovec_create_pools(struct bio_set *bs, int pool_entries, int scale) +static int biovec_create_pools(struct bio_set *bs, int pool_entries) { int i; @@ -1128,9 +1128,6 @@ static int biovec_create_pools(struct bio_set *bs, int pool_entries, int scale) struct biovec_slab *bp = bvec_slabs + i; mempool_t **bvp = bs-bvec_pools + i; - if (pool_entries 1 i = scale) - pool_entries = 1; - *bvp = mempool_create_slab_pool(pool_entries, bp-slab); if (!*bvp) return -ENOMEM; @@ -1161,7 +1158,7 @@ void bioset_free(struct bio_set *bs) kfree(bs); } -struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size, int scale) +struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size) { struct bio_set *bs = kzalloc(sizeof(*bs), GFP_KERNEL); @@ -1172,7 +1169,7 @@ struct bio_set *bioset_create(int bio_pool_size, int bvec_pool_size, int scale) if (!bs-bio_pool) goto bad; - if (!biovec_create_pools(bs, bvec_pool_size, scale)) + if
cfq-iosched: development update
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d048f5310aa2dda2b5acd947eab3598c25e269f Commit: 6d048f5310aa2dda2b5acd947eab3598c25e269f Parent: 1e3335de05da3dfbe48b8caa03db1834a2133256 Author: Jens Axboe [EMAIL PROTECTED] AuthorDate: Wed Apr 25 12:44:27 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Mon Apr 30 09:01:21 2007 +0200 cfq-iosched: development update - Implement logic for detecting cooperating processes, so we choose the best available queue whenever possible. - Improve residual slice time accounting. - Remove dead code: we no longer see async requests coming in on sync queues. That part was removed a long time ago. That means that we can also remove the difference between cfq_cfqq_sync() and cfq_cfqq_class_sync(), they are now indentical. And we can kill the on_dispatch array, just make it a counter. - Allow a process to go into the current list, if it hasn't been serviced in this scheduler tick yet. Possible future improvements including caching the cfqq lookup in cfq_close_cooperator(), so we don't have to look it up twice. cfq_get_best_queue() should just use that last decision instead of doing it again. Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- block/cfq-iosched.c | 381 +++ 1 files changed, 261 insertions(+), 120 deletions(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index bfb3967..28236f2 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -56,13 +56,7 @@ static struct completion *ioc_gone; #define ASYNC (0) #define SYNC (1) -#define cfq_cfqq_dispatched(cfqq) \ - ((cfqq)-on_dispatch[ASYNC] + (cfqq)-on_dispatch[SYNC]) - -#define cfq_cfqq_class_sync(cfqq) ((cfqq)-key != CFQ_KEY_ASYNC) - -#define cfq_cfqq_sync(cfqq)\ - (cfq_cfqq_class_sync(cfqq) || (cfqq)-on_dispatch[SYNC]) +#define cfq_cfqq_sync(cfqq)((cfqq)-key != CFQ_KEY_ASYNC) #define sample_valid(samples) ((samples) 80) @@ -79,6 +73,7 @@ struct cfq_data { struct list_head busy_rr; struct list_head cur_rr; struct list_head idle_rr; + unsigned long cur_rr_tick; unsigned int busy_queues; /* @@ -98,11 +93,12 @@ struct cfq_data { struct cfq_queue *active_queue; struct cfq_io_context *active_cic; int cur_prio, cur_end_prio; + unsigned long prio_time; unsigned int dispatch_slice; struct timer_list idle_class_timer; - sector_t last_sector; + sector_t last_position; unsigned long last_end_request; /* @@ -117,6 +113,9 @@ struct cfq_data { unsigned int cfq_slice_idle; struct list_head cic_list; + + sector_t new_seek_mean; + u64 new_seek_total; }; /* @@ -133,6 +132,8 @@ struct cfq_queue { unsigned int key; /* member of the rr/busy/cur/idle cfqd list */ struct list_head cfq_list; + /* in what tick we were last serviced */ + unsigned long rr_tick; /* sorted list of pending requests */ struct rb_root sort_list; /* if fifo isn't expired, next request to serve */ @@ -148,10 +149,11 @@ struct cfq_queue { unsigned long slice_end; unsigned long service_last; + unsigned long slice_start; long slice_resid; - /* number of requests that are on the dispatch list */ - int on_dispatch[2]; + /* number of requests that are on the dispatch list or inside driver */ + int dispatched; /* io prio of this group */ unsigned short ioprio, org_ioprio; @@ -159,6 +161,8 @@ struct cfq_queue { /* various state flags, see below */ unsigned int flags; + + sector_t last_request_pos; }; enum cfqq_state_flags { @@ -259,6 +263,8 @@ cfq_set_prio_slice(struct cfq_data *cfqd, struct cfq_queue *cfqq) * easily introduce oscillations. */ cfqq-slice_resid = 0; + + cfqq-slice_start = jiffies; } /* @@ -307,7 +313,7 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2) s1 = rq1-sector; s2 = rq2-sector; - last = cfqd-last_sector; + last = cfqd-last_position; /* * by definition, 1KiB is 2 sectors @@ -398,39 +404,42 @@ cfq_find_next_rq(struct cfq_data *cfqd, struct cfq_queue *cfqq, return cfq_choose_req(cfqd, next, prev); } -static void cfq_resort_rr_list(struct cfq_queue *cfqq, int preempted) +/* + * This function finds out where to insert a BE queue in the service hierarchy + */ +static void cfq_resort_be_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq, + int preempted) { - struct cfq_data *cfqd = cfqq-cfqd; struct list_head *list, *n; struct cfq_queue
cfq-iosched: minor updates
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1afba0451c83cbff622a08f2d86fbb2e680dfd5f Commit: 1afba0451c83cbff622a08f2d86fbb2e680dfd5f Parent: 6d048f5310aa2dda2b5acd947eab3598c25e269f Author: Jens Axboe [EMAIL PROTECTED] AuthorDate: Tue Apr 17 12:47:55 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Mon Apr 30 09:01:21 2007 +0200 cfq-iosched: minor updates - Move the queue_new flag clear to when the queue is selected - Only select the non-first queue in cfq_get_best_queue(), if there's a substantial difference between the best and first. - Get rid of -busy_rr - Only select a close cooperator, if the current queue is known to take a while to think. Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- block/cfq-iosched.c | 81 +++--- 1 files changed, 18 insertions(+), 63 deletions(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 28236f2..9d6f041 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -70,7 +70,6 @@ struct cfq_data { * rr list of queues with requests and the count of them */ struct list_head rr_list[CFQ_PRIO_LISTS]; - struct list_head busy_rr; struct list_head cur_rr; struct list_head idle_rr; unsigned long cur_rr_tick; @@ -410,59 +409,18 @@ cfq_find_next_rq(struct cfq_data *cfqd, struct cfq_queue *cfqq, static void cfq_resort_be_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq, int preempted) { - struct list_head *list, *n; - struct cfq_queue *__cfqq; - int add_tail = 0; - - /* -* if cfqq has requests in flight, don't allow it to be -* found in cfq_set_active_queue before it has finished them. -* this is done to increase fairness between a process that -* has lots of io pending vs one that only generates one -* sporadically or synchronously -*/ - if (cfqq-dispatched) - list = cfqd-busy_rr; - else if (cfqq-ioprio == (cfqd-cur_prio + 1) -cfq_cfqq_sync(cfqq) -(time_before(cfqd-prio_time, cfqq-service_last) || - cfq_cfqq_queue_new(cfqq) || preempted)) { - list = cfqd-cur_rr; - add_tail = 1; - } else - list = cfqd-rr_list[cfqq-ioprio]; - - if (!cfq_cfqq_sync(cfqq) || add_tail) { - /* -* async queue always goes to the end. this wont be overly -* unfair to writes, as the sort of the sync queue wont be -* allowed to pass the async queue again. -*/ - list_add_tail(cfqq-cfq_list, list); - } else if (preempted || cfq_cfqq_queue_new(cfqq)) { - /* -* If this queue was preempted or is new (never been serviced), -* let it be added first for fairness but beind other new -* queues. -*/ - n = list; - while (n-next != list) { - __cfqq = list_entry_cfqq(n-next); - if (!cfq_cfqq_queue_new(__cfqq)) - break; + if (!cfq_cfqq_sync(cfqq)) + list_add_tail(cfqq-cfq_list, cfqd-rr_list[cfqq-ioprio]); + else { + struct list_head *n = cfqd-rr_list[cfqq-ioprio]; - n = n-next; - } - list_add(cfqq-cfq_list, n); - } else { /* * sort by last service, but don't cross a new or async -* queue. we don't cross a new queue because it hasn't been -* service before, and we don't cross an async queue because -* it gets added to the end on expire. +* queue. we don't cross a new queue because it hasn't +* been service before, and we don't cross an async +* queue because it gets added to the end on expire. */ - n = list; - while ((n = n-prev) != list) { + while ((n = n-prev) != cfqd-rr_list[cfqq-ioprio]) { struct cfq_queue *__c = list_entry_cfqq(n); if (!cfq_cfqq_sync(__c) || !__c-service_last) @@ -725,6 +683,7 @@ __cfq_set_active_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq) cfq_clear_cfqq_must_alloc_slice(cfqq); cfq_clear_cfqq_fifo_expire(cfqq); cfq_mark_cfqq_slice_new(cfqq); + cfq_clear_cfqq_queue_new(cfqq); cfqq-rr_tick = cfqd-cur_rr_tick; } @@ -743,7 +702,6 @@ __cfq_slice_expired(struct cfq_data *cfqd, struct cfq_queue *cfqq, cfq_clear_cfqq_must_dispatch(cfqq); cfq_clear_cfqq_wait_request(cfqq); - cfq_clear_cfqq_queue_new(cfqq);
[NETPOLL]: Remove CONFIG_NETPOLL_RX
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d16bfd0c77b35a0a0f0e159b94b9921510bf7934 Commit: d16bfd0c77b35a0a0f0e159b94b9921510bf7934 Parent: 5f286e113fa377e50bd18fc45e5a0d4d83f6950c Author: Sergei Shtylyov [EMAIL PROTECTED] AuthorDate: Sat Apr 28 20:58:22 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Sat Apr 28 20:58:22 2007 -0700 [NETPOLL]: Remove CONFIG_NETPOLL_RX Get rid of the CONFIG_NETPOLL_RX option completely since all the dependencies have been removed long ago... Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED] Acked-by: Jeff Garzik [EMAIL PROTECTED] Acked-by: Matt Mackall [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- drivers/net/Kconfig |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index a3d46ea..32a3003 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -2929,11 +2929,6 @@ endif #NETDEVICES config NETPOLL def_bool NETCONSOLE -config NETPOLL_RX - bool Netpoll support for trapping incoming packets - default n - depends on NETPOLL - config NETPOLL_TRAP bool Netpoll traffic trapping default n - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[NET]: Remove NETIF_F_INTERNAL_STATS, default to internal stats.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5a1b5898ee9e0bf68a86609ecb9775457b1857a5 Commit: 5a1b5898ee9e0bf68a86609ecb9775457b1857a5 Parent: d16bfd0c77b35a0a0f0e159b94b9921510bf7934 Author: Rusty Russell [EMAIL PROTECTED] AuthorDate: Sat Apr 28 21:04:03 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Sat Apr 28 21:04:03 2007 -0700 [NET]: Remove NETIF_F_INTERNAL_STATS, default to internal stats. Herbert Xu conviced me that a new flag was overkill; every driver currently overrides get_stats, so we might as well make the internal one the default. If someone did fail to set get_stats, they would now get all 0 stats instead of No statistics available. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Acked-by: Herbert Xu [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- arch/s390/appldata/appldata_net_sum.c |3 -- drivers/net/bonding/bond_main.c | 59 ++--- drivers/parisc/led.c |2 - include/linux/netdevice.h |1 - net/core/dev.c| 45 +++-- 5 files changed, 45 insertions(+), 65 deletions(-) diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c index 516b3ac..a43f348 100644 --- a/arch/s390/appldata/appldata_net_sum.c +++ b/arch/s390/appldata/appldata_net_sum.c @@ -109,9 +109,6 @@ static void appldata_get_net_sum_data(void *data) read_lock(dev_base_lock); for (dev = dev_base; dev != NULL; dev = dev-next) { stats = dev-get_stats(dev); - if (stats == NULL) { - continue; - } rx_packets += stats-rx_packets; tx_packets += stats-tx_packets; rx_bytes += stats-rx_bytes; diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index cea3783..724bce5 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1360,13 +1360,6 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) goto err_undo_flags; } - if (slave_dev-get_stats == NULL) { - printk(KERN_NOTICE DRV_NAME - : %s: the driver for slave device %s does not provide - get_stats function, network statistics will be - inaccurate.\n, bond_dev-name, slave_dev-name); - } - new_slave = kzalloc(sizeof(struct slave), GFP_KERNEL); if (!new_slave) { res = -ENOMEM; @@ -3641,33 +3634,31 @@ static struct net_device_stats *bond_get_stats(struct net_device *bond_dev) bond_for_each_slave(bond, slave, i) { sstats = slave-dev-get_stats(slave-dev); - if (sstats) { - stats-rx_packets += sstats-rx_packets; - stats-rx_bytes += sstats-rx_bytes; - stats-rx_errors += sstats-rx_errors; - stats-rx_dropped += sstats-rx_dropped; - - stats-tx_packets += sstats-tx_packets; - stats-tx_bytes += sstats-tx_bytes; - stats-tx_errors += sstats-tx_errors; - stats-tx_dropped += sstats-tx_dropped; - - stats-multicast += sstats-multicast; - stats-collisions += sstats-collisions; - - stats-rx_length_errors += sstats-rx_length_errors; - stats-rx_over_errors += sstats-rx_over_errors; - stats-rx_crc_errors += sstats-rx_crc_errors; - stats-rx_frame_errors += sstats-rx_frame_errors; - stats-rx_fifo_errors += sstats-rx_fifo_errors; - stats-rx_missed_errors += sstats-rx_missed_errors; - - stats-tx_aborted_errors += sstats-tx_aborted_errors; - stats-tx_carrier_errors += sstats-tx_carrier_errors; - stats-tx_fifo_errors += sstats-tx_fifo_errors; - stats-tx_heartbeat_errors += sstats-tx_heartbeat_errors; - stats-tx_window_errors += sstats-tx_window_errors; - } + stats-rx_packets += sstats-rx_packets; + stats-rx_bytes += sstats-rx_bytes; + stats-rx_errors += sstats-rx_errors; + stats-rx_dropped += sstats-rx_dropped; + + stats-tx_packets += sstats-tx_packets; + stats-tx_bytes += sstats-tx_bytes; + stats-tx_errors += sstats-tx_errors; + stats-tx_dropped += sstats-tx_dropped; + + stats-multicast += sstats-multicast; + stats-collisions += sstats-collisions; + + stats-rx_length_errors += sstats-rx_length_errors;
[SCTP]: Fix sctp_getsockopt_local_addrs_old() to use local storage.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aad97f38b71dd2ecd730b3a3dce8264d13fbcd56 Commit: aad97f38b71dd2ecd730b3a3dce8264d13fbcd56 Parent: 5a1b5898ee9e0bf68a86609ecb9775457b1857a5 Author: Vlad Yasevich [EMAIL PROTECTED] AuthorDate: Sat Apr 28 21:09:04 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Sat Apr 28 21:09:04 2007 -0700 [SCTP]: Fix sctp_getsockopt_local_addrs_old() to use local storage. sctp_getsockopt_local_addrs_old() in net/sctp/socket.c calls copy_to_user() while the spinlock addr_lock is held. this should not be done as copy_to_user() might sleep. the call to sctp_copy_laddrs_to_user() while holding the lock is also problematic as it calls copy_to_user() Signed-off-by: Vlad Yasevich [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/sctp/socket.c | 96 + 1 files changed, 60 insertions(+), 36 deletions(-) diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 11938fb..2fc0a92 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -3987,7 +3987,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, memcpy(temp, from-ipaddr, sizeof(temp)); sctp_get_pf_specific(sk-sk_family)-addr_v4map(sp, temp); addrlen = sctp_get_af_specific(sk-sk_family)-sockaddr_len; - if(space_left addrlen) + if (space_left addrlen) return -ENOMEM; if (copy_to_user(to, temp, addrlen)) return -EFAULT; @@ -4076,8 +4076,9 @@ done: /* Helper function that copies local addresses to user and returns the number * of addresses copied. */ -static int sctp_copy_laddrs_to_user_old(struct sock *sk, __u16 port, int max_addrs, - void __user *to) +static int sctp_copy_laddrs_old(struct sock *sk, __u16 port, + int max_addrs, void *to, + int *bytes_copied) { struct list_head *pos, *next; struct sctp_sockaddr_entry *addr; @@ -4094,10 +4095,10 @@ static int sctp_copy_laddrs_to_user_old(struct sock *sk, __u16 port, int max_add sctp_get_pf_specific(sk-sk_family)-addr_v4map(sctp_sk(sk), temp); addrlen = sctp_get_af_specific(temp.sa.sa_family)-sockaddr_len; - if (copy_to_user(to, temp, addrlen)) - return -EFAULT; + memcpy(to, temp, addrlen); to += addrlen; + *bytes_copied += addrlen; cnt ++; if (cnt = max_addrs) break; } @@ -4105,8 +4106,8 @@ static int sctp_copy_laddrs_to_user_old(struct sock *sk, __u16 port, int max_add return cnt; } -static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port, - void __user **to, size_t space_left) +static int sctp_copy_laddrs(struct sock *sk, __u16 port, void *to, + size_t space_left, int *bytes_copied) { struct list_head *pos, *next; struct sctp_sockaddr_entry *addr; @@ -4123,14 +4124,14 @@ static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port, sctp_get_pf_specific(sk-sk_family)-addr_v4map(sctp_sk(sk), temp); addrlen = sctp_get_af_specific(temp.sa.sa_family)-sockaddr_len; - if(space_leftaddrlen) + if (space_left addrlen) return -ENOMEM; - if (copy_to_user(*to, temp, addrlen)) - return -EFAULT; + memcpy(to, temp, addrlen); - *to += addrlen; + to += addrlen; cnt ++; space_left -= addrlen; + bytes_copied += addrlen; } return cnt; @@ -4154,6 +4155,8 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len, int addrlen; rwlock_t *addr_lock; int err = 0; + void *addrs; + int bytes_copied = 0; if (len != sizeof(struct sctp_getaddrs_old)) return -EINVAL; @@ -4181,6 +4184,15 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len, to = getaddrs.addrs; + /* Allocate space for a local instance of packed array to hold all +* the data. We store addresses here first and then put write them +* to the user in one shot. +*/ + addrs = kmalloc(sizeof(union sctp_addr) * getaddrs.addr_num, + GFP_KERNEL); + if (!addrs) + return -ENOMEM; + sctp_read_lock(addr_lock); /* If the endpoint is bound to 0.0.0.0 or ::0, get the valid @@
[IPV6]: Track device renames in snmp6.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5632c5152aa621885d87ea0b8fdd5a6bb9f69c6f Commit: 5632c5152aa621885d87ea0b8fdd5a6bb9f69c6f Parent: aad97f38b71dd2ecd730b3a3dce8264d13fbcd56 Author: Stephen Hemminger [EMAIL PROTECTED] AuthorDate: Sat Apr 28 21:16:39 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Sat Apr 28 21:16:39 2007 -0700 [IPV6]: Track device renames in snmp6. When network device's are renamed, the IPV6 snmp6 code gets confused. It doesn't track name changes so it will OOPS when network device's are removed. The fix is trivial, just unregister/re-register in notify handler. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/ipv6/addrconf.c |6 -- net/ipv6/proc.c |1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index e04e493..3452433 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -2359,8 +2359,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, break; case NETDEV_CHANGENAME: -#ifdef CONFIG_SYSCTL if (idev) { + snmp6_unregister_dev(idev); +#ifdef CONFIG_SYSCTL addrconf_sysctl_unregister(idev-cnf); neigh_sysctl_unregister(idev-nd_parms); neigh_sysctl_register(dev, idev-nd_parms, @@ -2368,8 +2369,9 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, ndisc_ifinfo_sysctl_change, NULL); addrconf_sysctl_register(idev, idev-cnf); - } #endif + snmp6_register_dev(idev); + } break; } diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index acb306a..920dc9c 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c @@ -223,6 +223,7 @@ int snmp6_unregister_dev(struct inet6_dev *idev) return -EINVAL; remove_proc_entry(idev-stats.proc_dir_entry-name, proc_net_devsnmp6); + idev-stats.proc_dir_entry = NULL; return 0; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[XFRM]: Export SPD info
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ecfd6b183780c6d9e85873693b3ce6c5f4d08b58 Commit: ecfd6b183780c6d9e85873693b3ce6c5f4d08b58 Parent: 5632c5152aa621885d87ea0b8fdd5a6bb9f69c6f Author: Jamal Hadi Salim [EMAIL PROTECTED] AuthorDate: Sat Apr 28 21:20:32 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Sat Apr 28 21:20:32 2007 -0700 [XFRM]: Export SPD info With this patch you can use iproute2 in user space to efficiently see how many policies exist in different directions. Signed-off-by: Jamal Hadi Salim [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/linux/xfrm.h | 35 ++ include/net/xfrm.h | 13 net/xfrm/xfrm_policy.c | 16 +- net/xfrm/xfrm_user.c | 77 4 files changed, 140 insertions(+), 1 deletions(-) diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 9c656a5..a5d53e0 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h @@ -185,6 +185,11 @@ enum { #define XFRM_MSG_NEWSADINFO XFRM_MSG_NEWSADINFO XFRM_MSG_GETSADINFO, #define XFRM_MSG_GETSADINFO XFRM_MSG_GETSADINFO + + XFRM_MSG_NEWSPDINFO, +#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO + XFRM_MSG_GETSPDINFO, +#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO __XFRM_MSG_MAX }; #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) @@ -290,6 +295,36 @@ enum xfrm_sadattr_type_t { #define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1) }; +/* SPD Table filter flags */ +enum xfrm_spd_ftype_t { + XFRM_SPD_UNSPEC, + XFRM_SPD_HMASK=1, + XFRM_SPD_HMAX=2, + XFRM_SPD_ICNT=4, + XFRM_SPD_OCNT=8, + XFRM_SPD_FCNT=16, + XFRM_SPD_ISCNT=32, + XFRM_SPD_OSCNT=64, + XFRM_SPD_FSCNT=128, + __XFRM_SPD_MAX + +#define XFRM_SPD_MAX (__XFRM_SPD_MAX - 1) +}; +enum xfrm_spdattr_type_t { + XFRMA_SPD_UNSPEC, + XFRMA_SPDHMASK, + XFRMA_SPDHMAX, + XFRMA_SPDICNT, + XFRMA_SPDOCNT, + XFRMA_SPDFCNT, + XFRMA_SPDISCNT, + XFRMA_SPDOSCNT, + XFRMA_SPDFSCNT, + __XFRMA_SPD_MAX + +#define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1) +}; + struct xfrm_usersa_info { struct xfrm_selectorsel; struct xfrm_id id; diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 8287081..9561bf8 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -423,6 +423,18 @@ struct xfrm_sadinfo u32 sadhmcnt; /* max allowed hash bkts */ u32 sadcnt; /* current running count */ }; + +struct xfrm_spdinfo +{ + u32 incnt; + u32 outcnt; + u32 fwdcnt; + u32 inscnt; + u32 outscnt; + u32 fwdscnt; + u32 spdhcnt; + u32 spdhmcnt; +}; #ifdef CONFIG_AUDITSYSCALL extern void xfrm_audit_log(uid_t auid, u32 secid, int type, int result, struct xfrm_policy *xp, struct xfrm_state *x); @@ -946,6 +958,7 @@ extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); extern int xfrm_state_delete(struct xfrm_state *x); extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); extern void xfrm_sad_getinfo(struct xfrm_sadinfo *si); +extern void xfrm_spd_getinfo(struct xfrm_spdinfo *si); extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq); extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); extern void xfrm_replay_notify(struct xfrm_state *x, int event); diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 7629260..dbf9d96 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -579,8 +579,22 @@ static inline int xfrm_byidx_should_resize(int total) return 0; } -static DEFINE_MUTEX(hash_resize_mutex); +void xfrm_spd_getinfo(struct xfrm_spdinfo *si) +{ + read_lock_bh(xfrm_policy_lock); + si-incnt = xfrm_policy_count[XFRM_POLICY_IN]; + si-outcnt = xfrm_policy_count[XFRM_POLICY_OUT]; + si-fwdcnt = xfrm_policy_count[XFRM_POLICY_FWD]; + si-inscnt = xfrm_policy_count[XFRM_POLICY_IN+XFRM_POLICY_MAX]; + si-outscnt = xfrm_policy_count[XFRM_POLICY_OUT+XFRM_POLICY_MAX]; + si-fwdscnt = xfrm_policy_count[XFRM_POLICY_FWD+XFRM_POLICY_MAX]; + si-spdhcnt = xfrm_idx_hmask; + si-spdhmcnt = xfrm_policy_hashmax; + read_unlock_bh(xfrm_policy_lock); +} +EXPORT_SYMBOL(xfrm_spd_getinfo); +static DEFINE_MUTEX(hash_resize_mutex); static void xfrm_hash_resize(struct work_struct *__unused) { int dir, total; diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 69110fe..4210d91 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -672,6 +672,81 @@ static struct sk_buff *xfrm_state_netlink(struct sk_buff *in_skb, return skb; } +static int build_spdinfo(struct sk_buff *skb, u32 pid, u32 seq, u32 flags) +{ + struct xfrm_spdinfo si; + struct nlmsghdr *nlh; + u32 *f; +
[IPV6]: Fix slab corruption running ip6sic
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d0772b70faaf8e9f2013b6c4273d94d5eac8047a Commit: d0772b70faaf8e9f2013b6c4273d94d5eac8047a Parent: 65bb723c9502b7ba0a3aad13bdac8832e213ba74 Author: Eric Sesterhenn [EMAIL PROTECTED] AuthorDate: Sat Apr 28 21:26:23 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Sat Apr 28 21:26:23 2007 -0700 [IPV6]: Fix slab corruption running ip6sic From: Eric Sesterhenn [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/ipv6/xfrm6_tunnel.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index 538499a..5502cc9 100644 --- a/net/ipv6/xfrm6_tunnel.c +++ b/net/ipv6/xfrm6_tunnel.c @@ -261,7 +261,7 @@ static int xfrm6_tunnel_rcv(struct sk_buff *skb) __be32 spi; spi = xfrm6_tunnel_spi_lookup((xfrm_address_t *)iph-saddr); - return xfrm6_rcv_spi(skb, spi); + return xfrm6_rcv_spi(skb, spi) 0 ? : 0; } static int xfrm6_tunnel_err(struct sk_buff *skb, struct inet6_skb_parm *opt, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[AF_IUCV/IUCV]: smp_call_function deadlock
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=04b090d50c88ac8e5ec9c2e985bb65bd153893aa Commit: 04b090d50c88ac8e5ec9c2e985bb65bd153893aa Parent: d0772b70faaf8e9f2013b6c4273d94d5eac8047a Author: Martin Schwidefsky [EMAIL PROTECTED] AuthorDate: Sat Apr 28 23:03:59 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Sat Apr 28 23:03:59 2007 -0700 [AF_IUCV/IUCV]: smp_call_function deadlock Calling smp_call_function can lead to a deadlock if it is called from tasklet context. Fixing this deadlock requires to move the smp_call_function from the tasklet context to a work queue. To do that queue the path pending interrupts to a separate list and move the path cleanup out of iucv_path_sever to iucv_path_connect and iucv_path_pending. This creates a new requirement for iucv_path_connect: it may not be called from tasklet context anymore. Also fixed compile problem for CONFIG_HOTPLUG_CPU=n and another one when walking the cpu_online mask. When doing this, we must disable cpu hotplug. Signed-off-by: Frank Pavlic [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/iucv/iucv.h |2 +- net/iucv/iucv.c | 205 ++- 2 files changed, 133 insertions(+), 74 deletions(-) diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h index 746e741..fd70adb 100644 --- a/include/net/iucv/iucv.h +++ b/include/net/iucv/iucv.h @@ -16,7 +16,7 @@ * completed a register, it can exploit the other functions. * For furthur reference on all IUCV functionality, refer to the * CP Programming Services book, also available on the web thru - * www.ibm.com/s390/vm/pubs, manual # SC24-5760 + * www.vm.ibm.com/pubs, manual # SC24-6084 * * Definition of Return Codes * - All positive return codes including zero are reflected back diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c index 60f2938..903bdb6 100644 --- a/net/iucv/iucv.c +++ b/net/iucv/iucv.c @@ -90,20 +90,43 @@ struct iucv_irq_data { u32 res2[8]; }; -struct iucv_work { +struct iucv_irq_list { struct list_head list; struct iucv_irq_data data; }; -static LIST_HEAD(iucv_work_queue); -static DEFINE_SPINLOCK(iucv_work_lock); - static struct iucv_irq_data *iucv_irq_data; static cpumask_t iucv_buffer_cpumask = CPU_MASK_NONE; static cpumask_t iucv_irq_cpumask = CPU_MASK_NONE; -static void iucv_tasklet_handler(unsigned long); -static DECLARE_TASKLET(iucv_tasklet, iucv_tasklet_handler,0); +/* + * Queue of interrupt buffers lock for delivery via the tasklet + * (fast but can't call smp_call_function). + */ +static LIST_HEAD(iucv_task_queue); + +/* + * The tasklet for fast delivery of iucv interrupts. + */ +static void iucv_tasklet_fn(unsigned long); +static DECLARE_TASKLET(iucv_tasklet, iucv_tasklet_fn,0); + +/* + * Queue of interrupt buffers for delivery via a work queue + * (slower but can call smp_call_function). + */ +static LIST_HEAD(iucv_work_queue); + +/* + * The work element to deliver path pending interrupts. + */ +static void iucv_work_fn(struct work_struct *work); +static DECLARE_WORK(iucv_work, iucv_work_fn); + +/* + * Spinlock protecting task and work queue. + */ +static DEFINE_SPINLOCK(iucv_queue_lock); enum iucv_command_codes { IUCV_QUERY = 0, @@ -147,10 +170,10 @@ static unsigned long iucv_max_pathid; static DEFINE_SPINLOCK(iucv_table_lock); /* - * iucv_tasklet_cpu: contains the number of the cpu executing the tasklet. - * Needed for iucv_path_sever called from tasklet. + * iucv_active_cpu: contains the number of the cpu executing the tasklet + * or the work handler. Needed for iucv_path_sever called from tasklet. */ -static int iucv_tasklet_cpu = -1; +static int iucv_active_cpu = -1; /* * Mutex and wait queue for iucv_register/iucv_unregister. @@ -449,17 +472,19 @@ static void iucv_setmask_mp(void) { int cpu; + preempt_disable(); for_each_online_cpu(cpu) /* Enable all cpus with a declared buffer. */ if (cpu_isset(cpu, iucv_buffer_cpumask) !cpu_isset(cpu, iucv_irq_cpumask)) smp_call_function_on(iucv_allow_cpu, NULL, 0, 1, cpu); + preempt_enable(); } /** * iucv_setmask_up * - * Allow iucv interrupts on a single cpus. + * Allow iucv interrupts on a single cpu. */ static void iucv_setmask_up(void) { @@ -493,8 +518,10 @@ static int iucv_enable(void) goto out; /* Declare per cpu buffers. */ rc = -EIO; + preempt_disable(); for_each_online_cpu(cpu) smp_call_function_on(iucv_declare_cpu, NULL, 0, 1, cpu); + preempt_enable(); if (cpus_empty(iucv_buffer_cpumask)) /* No cpu could declare an iucv buffer. */ goto out_path; @@
[SKB]: Introduce skb_queue_walk_safe()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=46f8914e53c28d0716c586e08a7c819d8ebb9d54 Commit: 46f8914e53c28d0716c586e08a7c819d8ebb9d54 Parent: 04b090d50c88ac8e5ec9c2e985bb65bd153893aa Author: James Chapman [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:07:31 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:07:31 2007 -0700 [SKB]: Introduce skb_queue_walk_safe() This patch provides a method for walking skb lists while inserting or removing skbs from the list. Signed-off-by: James Chapman [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/linux/skbuff.h |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 2694cb3..253a2b9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1471,6 +1471,11 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) prefetch(skb-next), (skb != (struct sk_buff *)(queue)); \ skb = skb-next) +#define skb_queue_walk_safe(queue, skb, tmp) \ + for (skb = (queue)-next, tmp = skb-next; \ +skb != (struct sk_buff *)(queue); \ +skb = tmp, tmp = skb-next) + #define skb_queue_reverse_walk(queue, skb) \ for (skb = (queue)-prev; \ prefetch(skb-prev), (skb != (struct sk_buff *)(queue)); \ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[L2TP]: Add the ability to autoload a pppox protocol module.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=65def812ab25d7565756e5748d91e22e302197ee Commit: 65def812ab25d7565756e5748d91e22e302197ee Parent: 46f8914e53c28d0716c586e08a7c819d8ebb9d54 Author: James Chapman [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:21:02 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:21:02 2007 -0700 [L2TP]: Add the ability to autoload a pppox protocol module. This patch allows a name pppox-proto-nnn to be used in modprobe.conf to autoload a PPPoX protocol nnn. Signed-off-by: James Chapman [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- drivers/net/pppox.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c index 3f8115d..f3e47d0 100644 --- a/drivers/net/pppox.c +++ b/drivers/net/pppox.c @@ -31,6 +31,7 @@ #include linux/ppp_defs.h #include linux/if_ppp.h #include linux/ppp_channel.h +#include linux/kmod.h #include net/sock.h @@ -114,6 +115,13 @@ static int pppox_create(struct socket *sock, int protocol) goto out; rc = -EPROTONOSUPPORT; +#ifdef CONFIG_KMOD + if (!pppox_protos[protocol]) { + char buffer[32]; + sprintf(buffer, pppox-proto-%d, protocol); + request_module(buffer); + } +#endif if (!pppox_protos[protocol] || !try_module_get(pppox_protos[protocol]-owner)) goto out; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] INET : IPV4 UDP lookups converted to a 2 pass algo
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6aaf47fa48d3c44280810b1b470261d340e4ed87 Commit: 6aaf47fa48d3c44280810b1b470261d340e4ed87 Parent: 65def812ab25d7565756e5748d91e22e302197ee Author: Eric Dumazet [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:26:00 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:26:00 2007 -0700 [PATCH] INET : IPV4 UDP lookups converted to a 2 pass algo Some people want to have many UDP sockets, binded to a single port but many different addresses. We currently hash all those sockets into a single chain. Processing of incoming packets is very expensive, because the whole chain must be examined to find the best match. I chose in this patch to hash UDP sockets with a hash function that take into account both their port number and address : This has a drawback because we need two lookups : one with a given address, one with a wildcard (null) address. Signed-off-by: Eric Dumazet [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/ipv4/udp.c | 171 +--- 1 files changed, 114 insertions(+), 57 deletions(-) diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index cec0f2c..1449707 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -114,14 +114,33 @@ DEFINE_RWLOCK(udp_hash_lock); static int udp_port_rover; -static inline int __udp_lib_lport_inuse(__u16 num, struct hlist_head udptable[]) +/* + * Note about this hash function : + * Typical use is probably daddr = 0, only dport is going to vary hash + */ +static inline unsigned int hash_port_and_addr(__u16 port, __be32 addr) +{ + addr ^= addr 16; + addr ^= addr 8; + return port ^ addr; +} + +static inline int __udp_lib_port_inuse(unsigned int hash, int port, + __be32 daddr, struct hlist_head udptable[]) { struct sock *sk; struct hlist_node *node; + struct inet_sock *inet; - sk_for_each(sk, node, udptable[num (UDP_HTABLE_SIZE - 1)]) - if (sk-sk_hash == num) + sk_for_each(sk, node, udptable[hash (UDP_HTABLE_SIZE - 1)]) { + if (sk-sk_hash != hash) + continue; + inet = inet_sk(sk); + if (inet-num != port) + continue; + if (inet-rcv_saddr == daddr) return 1; + } return 0; } @@ -142,6 +161,7 @@ int __udp_lib_get_port(struct sock *sk, unsigned short snum, struct hlist_node *node; struct hlist_head *head; struct sock *sk2; + unsigned int hash; interror = 1; write_lock_bh(udp_hash_lock); @@ -156,7 +176,9 @@ int __udp_lib_get_port(struct sock *sk, unsigned short snum, for (i = 0; i UDP_HTABLE_SIZE; i++, result++) { int size; - head = udptable[result (UDP_HTABLE_SIZE - 1)]; + hash = hash_port_and_addr(result, + inet_sk(sk)-rcv_saddr); + head = udptable[hash (UDP_HTABLE_SIZE - 1)]; if (hlist_empty(head)) { if (result sysctl_local_port_range[1]) result = sysctl_local_port_range[0] + @@ -181,7 +203,10 @@ int __udp_lib_get_port(struct sock *sk, unsigned short snum, result = sysctl_local_port_range[0] + ((result - sysctl_local_port_range[0]) (UDP_HTABLE_SIZE - 1)); - if (! __udp_lib_lport_inuse(result, udptable)) + hash = hash_port_and_addr(result, + inet_sk(sk)-rcv_saddr); + if (! __udp_lib_port_inuse(hash, result, + inet_sk(sk)-rcv_saddr, udptable)) break; } if (i = (1 16) / UDP_HTABLE_SIZE) @@ -189,11 +214,13 @@ int __udp_lib_get_port(struct sock *sk, unsigned short snum, gotit: *port_rover = snum = result; } else { - head = udptable[snum (UDP_HTABLE_SIZE - 1)]; + hash = hash_port_and_addr(snum, inet_sk(sk)-rcv_saddr); + head = udptable[hash (UDP_HTABLE_SIZE - 1)]; sk_for_each(sk2, node, head) - if (sk2-sk_hash == snum + if (sk2-sk_hash == hash sk2 != sk + inet_sk(sk2)-num == snum (!sk2-sk_reuse|| !sk-sk_reuse) (!sk2-sk_bound_dev_if ||
[XFRM]: Restrict upper layer information by bundle.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=157bfc25020f7eb731f94140e099307ade47299e Commit: 157bfc25020f7eb731f94140e099307ade47299e Parent: 34588b4c046c34773e5a1a962da7b78b05c4d1bd Author: Masahide NAKAMURA [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:33:35 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:58:09 2007 -0700 [XFRM]: Restrict upper layer information by bundle. On MIPv6 usage, XFRM sub policy is enabled. When main (IPsec) and sub (MIPv6) policy selectors have the same address set but different upper layer information (i.e. protocol number and its ports or type/code), multiple bundle should be created. However, currently we have issue to use the same bundle created for the first time with all flows covered by the case. It is useful for the bundle to have the upper layer information to be restructured correctly if it does not match with the flow. 1. Bundle was created by two policies Selector from another policy is added to xfrm_dst. If the flow does not match the selector, it goes to slow path to restructure new bundle by single policy. 2. Bundle was created by one policy Flow cache is added to xfrm_dst as originated one. If the flow does not match the cache, it goes to slow path to try searching another policy. Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/flow.h |6 + include/net/xfrm.h | 10 net/xfrm/xfrm_policy.c | 55 3 files changed, 71 insertions(+), 0 deletions(-) diff --git a/include/net/flow.h b/include/net/flow.h index ce4b10d..f3cc1f8 100644 --- a/include/net/flow.h +++ b/include/net/flow.h @@ -97,4 +97,10 @@ extern void *flow_cache_lookup(struct flowi *key, u16 family, u8 dir, extern void flow_cache_flush(void); extern atomic_t flow_cache_genid; +static inline int flow_cache_uli_match(struct flowi *fl1, struct flowi *fl2) +{ + return (fl1-proto == fl2-proto + !memcmp(fl1-uli_u, fl2-uli_u, sizeof(fl1-uli_u))); +} + #endif diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 9561bf8..66c2d3e 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -603,6 +603,10 @@ struct xfrm_dst struct rt6_info rt6; } u; struct dst_entry *route; +#ifdef CONFIG_XFRM_SUB_POLICY + struct flowi *origin; + struct xfrm_selector *partner; +#endif u32 genid; u32 route_mtu_cached; u32 child_mtu_cached; @@ -615,6 +619,12 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) dst_release(xdst-route); if (likely(xdst-u.dst.xfrm)) xfrm_state_put(xdst-u.dst.xfrm); +#ifdef CONFIG_XFRM_SUB_POLICY + kfree(xdst-origin); + xdst-origin = NULL; + kfree(xdst-partner); + xdst-partner = NULL; +#endif } extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index dbf9d96..263e34e 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1344,6 +1344,40 @@ xfrm_bundle_create(struct xfrm_policy *policy, struct xfrm_state **xfrm, int nx, return err; } +static int inline +xfrm_dst_alloc_copy(void **target, void *src, int size) +{ + if (!*target) { + *target = kmalloc(size, GFP_ATOMIC); + if (!*target) + return -ENOMEM; + } + memcpy(*target, src, size); + return 0; +} + +static int inline +xfrm_dst_update_parent(struct dst_entry *dst, struct xfrm_selector *sel) +{ +#ifdef CONFIG_XFRM_SUB_POLICY + struct xfrm_dst *xdst = (struct xfrm_dst *)dst; + return xfrm_dst_alloc_copy((void **)(xdst-partner), + sel, sizeof(*sel)); +#else + return 0; +#endif +} + +static int inline +xfrm_dst_update_origin(struct dst_entry *dst, struct flowi *fl) +{ +#ifdef CONFIG_XFRM_SUB_POLICY + struct xfrm_dst *xdst = (struct xfrm_dst *)dst; + return xfrm_dst_alloc_copy((void **)(xdst-origin), fl, sizeof(*fl)); +#else + return 0; +#endif +} static int stale_bundle(struct dst_entry *dst); @@ -1532,6 +1566,18 @@ restart: err = -EHOSTUNREACH; goto error; } + + if (npols 1) + err = xfrm_dst_update_parent(dst, pols[1]-selector); + else + err = xfrm_dst_update_origin(dst, fl); + if (unlikely(err)) { + write_unlock_bh(policy-lock); + if (dst) + dst_free(dst); + goto error; + } + dst-next = policy-bundles;
[TCP] FRTO: Delay skb available check until it's mandatory
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=575ee7140dabe9b9c4f66f4f867039b97e548867 Commit: 575ee7140dabe9b9c4f66f4f867039b97e548867 Parent: 157bfc25020f7eb731f94140e099307ade47299e Author: Ilpo Järvinen [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:39:55 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:58:12 2007 -0700 [TCP] FRTO: Delay skb available check until it's mandatory No new data is needed until the first ACK comes, so no need to check for application limitedness until then. Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/ipv4/tcp_input.c | 19 +++ 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 051f0f8..6b66989 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -1265,20 +1265,15 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ return flag; } -/* F-RTO can only be used if these conditions are satisfied: - * - there must be some unsent new data - * - the advertised window should allow sending it - * - TCP has never retransmitted anything other than head (SACK enhanced - *variant from Appendix B of RFC4138 is more robust here) +/* F-RTO can only be used if TCP has never retransmitted anything other than + * head (SACK enhanced variant from Appendix B of RFC4138 is more robust here) */ int tcp_use_frto(struct sock *sk) { const struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *skb; - if (!sysctl_tcp_frto || !tcp_send_head(sk) || - after(TCP_SKB_CB(tcp_send_head(sk))-end_seq, - tp-snd_una + tp-snd_wnd)) + if (!sysctl_tcp_frto) return 0; if (IsSackFrto()) @@ -2710,6 +2705,14 @@ static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag) } if (tp-frto_counter == 1) { + /* Sending of the next skb must be allowed or no FRTO */ + if (!tcp_send_head(sk) || + after(TCP_SKB_CB(tcp_send_head(sk))-end_seq, +tp-snd_una + tp-snd_wnd)) { + tcp_enter_frto_loss(sk, tp-frto_counter + 1, flag); + return 1; + } + tp-snd_cwnd = tcp_packets_in_flight(tp) + 2; tp-frto_counter = 2; return 1; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[TCP] FRTO: RFC4138 allows Nagle override when new data must be sent
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d551e4541dd60ae53459f77a971f2d6043431f5f Commit: d551e4541dd60ae53459f77a971f2d6043431f5f Parent: 575ee7140dabe9b9c4f66f4f867039b97e548867 Author: Ilpo Järvinen [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:42:20 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:58:16 2007 -0700 [TCP] FRTO: RFC4138 allows Nagle override when new data must be sent This is a corner case where less than MSS sized new data thingie is awaiting in the send queue. For F-RTO to work correctly, a new data segment must be sent at certain point or F-RTO cannot be used at all. RFC4138 allows overriding of Nagle at that point. Implementation uses frto_counter states 2 and 3 to distinguish when Nagle override is needed. Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/tcp.h |5 + net/ipv4/tcp_input.c | 13 - net/ipv4/tcp_output.c |6 -- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index c6ecd45..ef8f9d4 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1199,9 +1199,14 @@ static inline struct sk_buff *tcp_send_head(struct sock *sk) static inline void tcp_advance_send_head(struct sock *sk, struct sk_buff *skb) { + struct tcp_sock *tp = tcp_sk(sk); + sk-sk_send_head = skb-next; if (sk-sk_send_head == (struct sk_buff *)sk-sk_write_queue) sk-sk_send_head = NULL; + /* Don't override Nagle indefinately with F-RTO */ + if (tp-frto_counter == 2) + tp-frto_counter = 3; } static inline void tcp_check_send_head(struct sock *sk, struct sk_buff *skb_unlinked) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 6b66989..7641b27 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -2637,7 +2637,9 @@ static void tcp_undo_spur_to_response(struct sock *sk, int flag) * algorithm is not part of the F-RTO detection algorithm * given in RFC4138 but can be selected separately). * Otherwise (basically on duplicate ACK), RTO was (likely) caused by a loss - * and TCP falls back to conventional RTO recovery. + * and TCP falls back to conventional RTO recovery. F-RTO allows overriding + * of Nagle, this is done using frto_counter states 2 and 3, when a new data + * segment of any size sent during F-RTO, state 2 is upgraded to 3. * * Rationale: if the RTO was spurious, new ACKs should arrive from the * original window even after we transmit two new data segments. @@ -2666,7 +2668,7 @@ static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag) inet_csk(sk)-icsk_retransmits = 0; if (!before(tp-snd_una, tp-frto_highmark)) { - tcp_enter_frto_loss(sk, tp-frto_counter + 1, flag); + tcp_enter_frto_loss(sk, (tp-frto_counter == 1 ? 2 : 3), flag); return 1; } @@ -2692,7 +2694,7 @@ static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag) return 1; } - if ((tp-frto_counter == 2) + if ((tp-frto_counter = 2) (!(flagFLAG_FORWARD_PROGRESS) || ((flagFLAG_DATA_SACKED) !(flagFLAG_ONLY_ORIG_SACKED { /* RFC4138 shortcoming (see comment above) */ @@ -2709,14 +2711,15 @@ static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag) if (!tcp_send_head(sk) || after(TCP_SKB_CB(tcp_send_head(sk))-end_seq, tp-snd_una + tp-snd_wnd)) { - tcp_enter_frto_loss(sk, tp-frto_counter + 1, flag); + tcp_enter_frto_loss(sk, (tp-frto_counter == 1 ? 2 : 3), + flag); return 1; } tp-snd_cwnd = tcp_packets_in_flight(tp) + 2; tp-frto_counter = 2; return 1; - } else /* frto_counter == 2 */ { + } else { switch (sysctl_tcp_frto_response) { case 2: tcp_undo_spur_to_response(sk, flag); diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index b5fa3c1..0faacf9 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -1035,8 +1035,10 @@ static inline int tcp_nagle_test(struct tcp_sock *tp, struct sk_buff *skb, if (nonagle TCP_NAGLE_PUSH) return 1; - /* Don't use the nagle rule for urgent data (or for the final FIN). */ - if (tp-urg_mode || + /* Don't use the nagle rule for urgent data (or for the final FIN). +* Nagle can be ignored during F-RTO too (see RFC4138). +*/ +
[IPV4] SNMP: Support InTruncatedPkts
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=704aed53b4e43bebfbd425cf95b66794a9cfa2c2 Commit: 704aed53b4e43bebfbd425cf95b66794a9cfa2c2 Parent: e91a47ebb130b90790c7a8c625ade4dcea246842 Author: Mitsuru Chinen [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:46:30 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:58:26 2007 -0700 [IPV4] SNMP: Support InTruncatedPkts An IP datagram which is being discarded because the datagram frame didn't carry enough data should be counted as InTruncatedPkts. Signed-off-by: Mitsuru Chinen [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/ipv4/ip_input.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 63ab523..c8c455d 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -416,7 +416,10 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, goto inhdr_error; len = ntohs(iph-tot_len); - if (skb-len len || len (iph-ihl*4)) + if (skb-len len) { + IP_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS); + goto drop; + } else if (len (iph-ihl*4)) goto inhdr_error; /* Our transport medium may have padded the buffer out. Now we know it - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[IPV4] SNMP: Support InNoRoutes
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e91a47ebb130b90790c7a8c625ade4dcea246842 Commit: e91a47ebb130b90790c7a8c625ade4dcea246842 Parent: 71ff6c0a857d11e70aec0c8f1e0d4ae9a45dd468 Author: Mitsuru Chinen [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:45:49 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:58:22 2007 -0700 [IPV4] SNMP: Support InNoRoutes An IP datagram which is being discarded because of no routes in the forwarding path should be counted as InNoRoutes. Signed-off-by: Mitsuru Chinen [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/ipv4/ip_input.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 324e7e0..63ab523 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -340,6 +340,8 @@ static inline int ip_rcv_finish(struct sk_buff *skb) if (unlikely(err)) { if (err == -EHOSTUNREACH) IP_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS); + else if (err == -ENETUNREACH) + IP_INC_STATS_BH(IPSTATS_MIB_INNOROUTES); goto drop; } } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[IPV4] SNMP: Support OutMcastPkts and OutBcastPkts
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=80787ebc2bbd8e675d8b9ff8cfa40f15134feebe Commit: 80787ebc2bbd8e675d8b9ff8cfa40f15134feebe Parent: 5506b54b36f067b9776935085c9f8e607b026b23 Author: Mitsuru Chinen [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:48:20 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:58:32 2007 -0700 [IPV4] SNMP: Support OutMcastPkts and OutBcastPkts A transmitted IP multicast datagram should be counted as OutMcastPkts. By the same token, a transmitted IP broadcast datagram should be counted as OutBcastPkts. Signed-off-by: Mitsuru Chinen [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/ipv4/ip_output.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 534650c..d6427d9 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -160,9 +160,15 @@ EXPORT_SYMBOL_GPL(ip_build_and_send_pkt); static inline int ip_finish_output2(struct sk_buff *skb) { struct dst_entry *dst = skb-dst; + struct rtable *rt = (struct rtable *)dst; struct net_device *dev = dst-dev; int hh_len = LL_RESERVED_SPACE(dev); + if (rt-rt_type == RTN_MULTICAST) + IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS); + else if (rt-rt_type == RTN_BROADCAST) + IP_INC_STATS(IPSTATS_MIB_OUTBCASTPKTS); + /* Be paranoid, rather than too clever. */ if (unlikely(skb_headroom(skb) hh_len dev-hard_header)) { struct sk_buff *skb2; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[IPV4] SNMP: Support InMcastPkts and InBcastPkts
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5506b54b36f067b9776935085c9f8e607b026b23 Commit: 5506b54b36f067b9776935085c9f8e607b026b23 Parent: 704aed53b4e43bebfbd425cf95b66794a9cfa2c2 Author: Mitsuru Chinen [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:48:10 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:58:29 2007 -0700 [IPV4] SNMP: Support InMcastPkts and InBcastPkts A received IP multicast datagram should be counted as InMcastPkts. By the same token, a received IP broadcast datagram should be counted as InBcastPkts. Signed-off-by: Mitsuru Chinen [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/ipv4/ip_input.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index c8c455d..9706939 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -329,6 +329,7 @@ drop: static inline int ip_rcv_finish(struct sk_buff *skb) { const struct iphdr *iph = ip_hdr(skb); + struct rtable *rt; /* * Initialise the virtual path cache for the packet. It describes @@ -360,6 +361,12 @@ static inline int ip_rcv_finish(struct sk_buff *skb) if (iph-ihl 5 ip_rcv_options(skb)) goto drop; + rt = (struct rtable*)skb-dst; + if (rt-rt_type == RTN_MULTICAST) + IP_INC_STATS_BH(IPSTATS_MIB_INMCASTPKTS); + else if (rt-rt_type == RTN_BROADCAST) + IP_INC_STATS_BH(IPSTATS_MIB_INBCASTPKTS); + return dst_input(skb); drop: - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[SNMP]: Add definitions for {In,Out}BcastPkts
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=71ff6c0a857d11e70aec0c8f1e0d4ae9a45dd468 Commit: 71ff6c0a857d11e70aec0c8f1e0d4ae9a45dd468 Parent: d551e4541dd60ae53459f77a971f2d6043431f5f Author: Mitsuru Chinen [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:45:02 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:58:19 2007 -0700 [SNMP]: Add definitions for {In,Out}BcastPkts The updated IP-MIB RFC (RFC4293) specifys new objects, InBcastPkts and OutBcastPkts. This adds definitions for them. Signed-off-by: Mitsuru Chinen [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/linux/snmp.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 854aa6b..802b3a3 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h @@ -40,6 +40,8 @@ enum IPSTATS_MIB_FRAGCREATES,/* FragCreates */ IPSTATS_MIB_INMCASTPKTS,/* InMcastPkts */ IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */ + IPSTATS_MIB_INBCASTPKTS,/* InBcastPkts */ + IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */ __IPSTATS_MIB_MAX }; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[TCP]: Catch skb with S+L bugs earlier
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=34588b4c046c34773e5a1a962da7b78b05c4d1bd Commit: 34588b4c046c34773e5a1a962da7b78b05c4d1bd Parent: 6aaf47fa48d3c44280810b1b470261d340e4ed87 Author: Ilpo Järvinen [EMAIL PROTECTED] AuthorDate: Mon Apr 30 00:57:33 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:57:33 2007 -0700 [TCP]: Catch skb with S+L bugs earlier SACKED_ACKED and LOST are mutually exclusive with SACK, thus having their sum larger than packets_out is bug with SACK. Eventually these bugs trigger traps in the tcp_clean_rtx_queue with SACK but it's much more informative to do this here. Non-SACK TCP, however, could get more than packets_out duplicate ACKs which each increment sacked_out, so it makes sense to do this kind of limitting for non-SACK TCP but not for SACK enabled one. Perhaps the author had the opposite in mind but did the logic accidently wrong way around? Anyway, the sacked_out incrementer code for non-SACK already deals this issue before calling sync_left_out so this trapping can be done unconditionally. Signed-off-by: Ilpo Järvinen [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/tcp.h |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index a385797..c6ecd45 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -736,9 +736,7 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk) static inline void tcp_sync_left_out(struct tcp_sock *tp) { - if (tp-rx_opt.sack_ok - (tp-sacked_out = tp-packets_out - tp-lost_out)) - tp-sacked_out = tp-packets_out - tp-lost_out; + BUG_ON(tp-sacked_out + tp-lost_out tp-packets_out); tp-left_out = tp-sacked_out + tp-lost_out; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB HID: Logitech MX3000 keyboard needs report descriptor quirk
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=85cbea3952135ecad4b47cb6cc57e25279129e2d Commit: 85cbea3952135ecad4b47cb6cc57e25279129e2d Parent: bf892e60d0b32989bc55ef64cd6557a49806f0cf Author: Jiri Kosina [EMAIL PROTECTED] AuthorDate: Thu Apr 5 12:23:09 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 11 10:36:03 2007 +0200 USB HID: Logitech MX3000 keyboard needs report descriptor quirk Logitech MX3000 contains report descriptor which doesn't cover usages above 0x28c, but emits such usages. Report descriptor needs fixing in the very same way as with receivers shipped with S510 keyboards. This patch also adds a few mappings for multimedia keys that S510 didn't emit. Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/hid-input.c | 18 +- drivers/hid/usbhid/hid-core.c | 24 +--- include/linux/hid.h |2 +- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 220e5a8..a19b65e 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -540,10 +540,26 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x302: map_key_clear(KEY_PROG2); break; case 0x303: map_key_clear(KEY_PROG3); break; - /* Reported on Logitech S510 wireless keyboard */ + /* Reported on certain Logitech wireless keyboards */ + case 0x1001: map_key_clear(KEY_MESSENGER); break; + case 0x1003: map_key_clear(KEY_SOUND); break; + case 0x1004: map_key_clear(KEY_VIDEO); break; + case 0x1005: map_key_clear(KEY_AUDIO); break; + case 0x100a: map_key_clear(KEY_DOCUMENTS); break; + case 0x1011: map_key_clear(KEY_PREVIOUSSONG); break; + case 0x1012: map_key_clear(KEY_NEXTSONG); break; + case 0x1013: map_key_clear(KEY_CAMERA); break; + case 0x1014: map_key_clear(KEY_MESSENGER); break; + case 0x1015: map_key_clear(KEY_RECORD); break; + case 0x1016: map_key_clear(KEY_PLAYER); break; + case 0x1017: map_key_clear(KEY_EJECTCD); break; + case 0x1019: map_key_clear(KEY_PROG1); break; + case 0x101a: map_key_clear(KEY_PROG2); break; + case 0x101b: map_key_clear(KEY_PROG3); break; case 0x101f: map_key_clear(KEY_ZOOMIN); break; case 0x1020: map_key_clear(KEY_ZOOMOUT); break; case 0x1021: map_key_clear(KEY_ZOOMRESET); break; + case 0x1023: map_key_clear(KEY_CLOSE); break; /* this one is marked as 'Rotate' */ case 0x1028: map_key_clear(KEY_ANGLE); break; case 0x1029: map_key_clear(KEY_SHUFFLE); break; diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index c94516c..762cb35 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -225,9 +225,10 @@ MODULE_PARM_DESC(mousepoll, Polling interval of mice); #define USB_DEVICE_ID_LD_MACHINETEST 0x2040 #define USB_VENDOR_ID_LOGITECH 0x046d -#define USB_DEVICE_ID_LOGITECH_USB_RECEIVER0xc101 -#define USB_DEVICE_ID_S510_USB_RECEIVER0xc50c -#define USB_DEVICE_ID_S510_USB_RECEIVER_2 0xc517 +#define USB_DEVICE_ID_LOGITECH_RECEIVER0xc101 +#define USB_DEVICE_ID_S510_RECEIVER0xc50c +#define USB_DEVICE_ID_S510_RECEIVER_2 0xc517 +#define USB_DEVICE_ID_MX3000_RECEIVER 0xc513 #define USB_DEVICE_ID_DINOVO_EDGE 0xc714 #define USB_VENDOR_ID_MCC 0x09db @@ -297,7 +298,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK_5 }, - { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_USB_RECEIVER, HID_QUIRK_BAD_RELATIVE_KEYS }, + { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RECEIVER, HID_QUIRK_BAD_RELATIVE_KEYS }, { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_GAMEPAD, HID_QUIRK_BADPAD }, { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR,
ieee1394: remove declarations of nonexisting functions
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef8153348f82688af87e19d594162ca81741fe6a Commit: ef8153348f82688af87e19d594162ca81741fe6a Parent: f84c922ba16fdadb9e4ebf9dc177e3dbd3282f7c Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Mar 5 03:05:32 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:27 2007 +0200 ieee1394: remove declarations of nonexisting functions Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/highlevel.h |9 - drivers/ieee1394/nodemgr.c |2 +- drivers/ieee1394/nodemgr.h |4 3 files changed, 1 insertions(+), 14 deletions(-) diff --git a/drivers/ieee1394/highlevel.h b/drivers/ieee1394/highlevel.h index 4b33011..5554836 100644 --- a/drivers/ieee1394/highlevel.h +++ b/drivers/ieee1394/highlevel.h @@ -176,11 +176,6 @@ void hpsb_destroy_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host); void hpsb_set_hostinfo_key(struct hpsb_highlevel *hl, struct hpsb_host *host, unsigned long key); -/* Retrieve the alternate lookup key for the hostinfo bound to this - * driver/host */ -unsigned long hpsb_get_hostinfo_key(struct hpsb_highlevel *hl, - struct hpsb_host *host); - /* Retrieve a hostinfo pointer bound to this driver using its alternate key */ void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key); @@ -189,8 +184,4 @@ void *hpsb_get_hostinfo_bykey(struct hpsb_highlevel *hl, unsigned long key); int hpsb_set_hostinfo(struct hpsb_highlevel *hl, struct hpsb_host *host, void *data); -/* Retrieve hpsb_host using a highlevel handle and a key */ -struct hpsb_host *hpsb_get_host_bykey(struct hpsb_highlevel *hl, - unsigned long key); - #endif /* IEEE1394_HIGHLEVEL_H */ diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index dbeba45..874d4d4 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -1756,7 +1756,7 @@ int nodemgr_for_each_host(void *__data, int (*cb)(struct hpsb_host *, void *)) return error; } -/* The following four convenience functions use a struct node_entry +/* The following two convenience functions use a struct node_entry * for addressing a node on the bus. They are intended for use by any * process context, not just the nodemgr thread, so we need to be a * little careful when reading out the node ID and generation. The diff --git a/drivers/ieee1394/nodemgr.h b/drivers/ieee1394/nodemgr.h index 4147303..a31405f 100644 --- a/drivers/ieee1394/nodemgr.h +++ b/drivers/ieee1394/nodemgr.h @@ -167,12 +167,8 @@ static inline int hpsb_node_entry_valid(struct node_entry *ne) */ void hpsb_node_fill_packet(struct node_entry *ne, struct hpsb_packet *pkt); -int hpsb_node_read(struct node_entry *ne, u64 addr, - quadlet_t *buffer, size_t length); int hpsb_node_write(struct node_entry *ne, u64 addr, quadlet_t *buffer, size_t length); -int hpsb_node_lock(struct node_entry *ne, u64 addr, - int extcode, quadlet_t *data, quadlet_t arg); /* Iterate the hosts, calling a given function with supplied data for each * host. */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: de-inline some functions
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c1a37f2c6572031203243dd083585aa4a1c138d5 Commit: c1a37f2c6572031203243dd083585aa4a1c138d5 Parent: 64ff712321875c2457d3a77d3fc4ab4989f7a8c0 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Wed Mar 14 00:20:53 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:28 2007 +0200 ieee1394: de-inline some functions This small reorganization of public csr1212 functions saves one exported symbol and a few bytes in the driver modules. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/csr1212.c | 28 drivers/ieee1394/csr1212.h | 28 +--- drivers/ieee1394/ieee1394_core.c |9 - 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index 54408cb..6c2f55b 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c @@ -518,7 +518,7 @@ void csr1212_detach_keyval_from_directory(struct csr1212_keyval *dir, * will be destroyed as well if their respective refcnts are 0. By means of * list manipulation, this routine will descend a directory structure in a * non-recursive manner. */ -void _csr1212_destroy_keyval(struct csr1212_keyval *kv) +static void csr1212_destroy_keyval(struct csr1212_keyval *kv) { struct csr1212_keyval *k, *a; struct csr1212_dentry dentry; @@ -566,6 +566,14 @@ void _csr1212_destroy_keyval(struct csr1212_keyval *kv) } } +void csr1212_release_keyval(struct csr1212_keyval *kv) +{ + if (kv-refcnt 1) + kv-refcnt--; + else + csr1212_destroy_keyval(kv); +} + void csr1212_destroy_csr(struct csr1212_csr *csr) { struct csr1212_csr_rom_cache *c, *oc; @@ -1251,7 +1259,8 @@ fail: return ret; } -int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) +static int +csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) { struct csr1212_cache_region *cr, *ncr, *newcr = NULL; struct csr1212_keyval_img *kvi = NULL; @@ -1412,6 +1421,17 @@ int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) return csr1212_parse_keyval(kv, cache); } +struct csr1212_keyval * +csr1212_get_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) +{ + if (!kv) + return NULL; + if (!kv-valid) + if (csr1212_read_keyval(csr, kv) != CSR1212_SUCCESS) + return NULL; + return kv; +} + int csr1212_parse_csr(struct csr1212_csr *csr) { static const int mr_map[] = { 4, 64, 1024, 0 }; @@ -1443,7 +1463,7 @@ int csr1212_parse_csr(struct csr1212_csr *csr) csr-root_kv-valid = 0; csr-root_kv-next = csr-root_kv; csr-root_kv-prev = csr-root_kv; - ret = _csr1212_read_keyval(csr, csr-root_kv); + ret = csr1212_read_keyval(csr, csr-root_kv); if (ret != CSR1212_SUCCESS) return ret; @@ -1453,7 +1473,7 @@ int csr1212_parse_csr(struct csr1212_csr *csr) dentry; dentry = dentry-next) { if (dentry-kv-key.id == CSR1212_KV_ID_EXTENDED_ROM !dentry-kv-valid) { - ret = _csr1212_read_keyval(csr, dentry-kv); + ret = csr1212_read_keyval(csr, dentry-kv); if (ret != CSR1212_SUCCESS) return ret; } diff --git a/drivers/ieee1394/csr1212.h b/drivers/ieee1394/csr1212.h index 4ef0949..6558275 100644 --- a/drivers/ieee1394/csr1212.h +++ b/drivers/ieee1394/csr1212.h @@ -313,15 +313,11 @@ extern int csr1212_parse_keyval(struct csr1212_keyval *kv, struct csr1212_csr_rom_cache *cache); extern int csr1212_parse_csr(struct csr1212_csr *csr); -/* These are internal functions referenced by inline functions below. */ -extern int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv); -extern void _csr1212_destroy_keyval(struct csr1212_keyval *kv); - /* This function allocates a new cache which may be used for either parsing or * generating sub-sets of Configuration ROM images. */ -static inline struct csr1212_csr_rom_cache *csr1212_rom_cache_malloc(u32 offset, -size_t size) +static inline struct csr1212_csr_rom_cache * +csr1212_rom_cache_malloc(u32 offset, size_t size) { struct csr1212_csr_rom_cache *cache; @@ -345,16 +341,8 @@ static inline struct csr1212_csr_rom_cache *csr1212_rom_cache_malloc(u32 offset, /* This function ensures that a keyval contains data when referencing a keyval * created by parsing a Configuration ROM. */ -static inline struct csr1212_keyval *csr1212_get_keyval(struct csr1212_csr *csr, -
ieee1394: replace vmalloc by kmalloc in csr1212
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fd2f3bddaeb20564f32e59f64e5063fbe0c8f4cc Commit: fd2f3bddaeb20564f32e59f64e5063fbe0c8f4cc Parent: c1a37f2c6572031203243dd083585aa4a1c138d5 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Sun Mar 11 22:51:24 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:28 2007 +0200 ieee1394: replace vmalloc by kmalloc in csr1212 The biggest chunk ever allocated by CSR1212_MALLOC is 1024 Bytes + sizeof(struct csr1212_csr_rom_cache) big. Most of the time much smaller data structures are allocated. Therefore vmalloc is a waste. The one exception is csr1212_append_new_cache() which is called to append a chunk of CSR1212_EXTENDED_ROM_SIZE + sizeof(struct csr1212_csr_rom_cache) if the currently allocated ROM cache is too small. CSR1212_EXTENDED_ROM_SIZE is generously defined as 256 kBytes. In SVN commit 1220, Steve Kinneberg lowered this to 2 kBytes in the config_rom_2.4 branch. This same commit also switched CSR1212_MALLOC from kmalloc to vmalloc in the SVN trunk branch: r1220 | kberg | 2004-05-31 01:51:44 +0200 (Mon, 31 May 2004) | 13 lines CSR1212 Extended ROM bug fixes: trunk line changes: - Use vmalloc instead of kmalloc - Change delayed_reset_bus() to operate in a work_queue instead of a timer interrupt. - Fix hpsb_allocate_and_register_addrspace() to not allocate space on top of already allocated space. - Fix problems in csr1212.c filling ConfigROM images when extend ROMs are present. config-rom-2.4 changes: - Changed extended rom allocation from 256K to 8K. (It was actually 2 kB, not 8 kB.) - Fix hpsb_allocate_and_register_addrspace() to not allocate space on top of already allocated space. - Fix problems in csr1212.c filling ConfigROM images when extend ROMs are present. I am now setting CSR1212_EXTENDED_ROM_SIZE to 2 kB minus the overhead of struct csr1212_csr_rom_cache. Note, this code path is not used by the in-kernel drivers though. raw1394 could trigger it, but the respective libraw1394 functions don't exist yet. Furthermore, userspace programs can replace the entire local ROM via raw1394. If kmalloc does not fulfill their needs --- well, tough luck. I decree that nobody needs such huge extended ROMs. (Extended ROMs are defined by IEEE 1212 clause 7.7.18. The spec does not impose practically relevant restrictions on the size of extended ROM chunks.) Another potentially demanding use of CSR1212_MALLOC is if external FireWire devices come with Extended ROM entries. If they are too big for kmalloc (or have been too big for vmalloc) we just fail to read their ROM. This is quite unlikely though, to my knowledge. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/csr1212.c |4 +++- drivers/ieee1394/csr1212.h |6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index 6c2f55b..2fd465e 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c @@ -932,7 +932,9 @@ static void csr1212_fill_cache(struct csr1212_csr_rom_cache *cache) } } -#define CSR1212_EXTENDED_ROM_SIZE (0x1 * sizeof(u32)) +/* This size is arbitrarily chosen. + * The struct overhead is subtracted for more economic allocations. */ +#define CSR1212_EXTENDED_ROM_SIZE (2048 - sizeof(struct csr1212_csr_rom_cache)) int csr1212_generate_csr_image(struct csr1212_csr *csr) { diff --git a/drivers/ieee1394/csr1212.h b/drivers/ieee1394/csr1212.h index 6558275..cc23f3a 100644 --- a/drivers/ieee1394/csr1212.h +++ b/drivers/ieee1394/csr1212.h @@ -31,10 +31,10 @@ #define __CSR1212_H__ #include linux/types.h -#include linux/vmalloc.h +#include linux/slab.h -#define CSR1212_MALLOC(size) vmalloc((size)) -#define CSR1212_FREE(ptr) vfree(ptr) +#define CSR1212_MALLOC(size) kmalloc((size), GFP_KERNEL) +#define CSR1212_FREE(ptr) kfree(ptr) #define CSR1212_SUCCESS (0) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: stricter error checks in csr1212
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=64ff712321875c2457d3a77d3fc4ab4989f7a8c0 Commit: 64ff712321875c2457d3a77d3fc4ab4989f7a8c0 Parent: 982610bd0d8e64baff36099f6dc456ea52d22257 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Sun Mar 11 22:50:13 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:28 2007 +0200 ieee1394: stricter error checks in csr1212 return -EINVAL becomes BUG_ON in checks of function call parameters. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/config_roms.c | 14 +--- drivers/ieee1394/csr1212.c | 67 ++- drivers/ieee1394/csr1212.h |4 +- 3 files changed, 34 insertions(+), 51 deletions(-) diff --git a/drivers/ieee1394/config_roms.c b/drivers/ieee1394/config_roms.c index 6a87a27..556658a 100644 --- a/drivers/ieee1394/config_roms.c +++ b/drivers/ieee1394/config_roms.c @@ -63,9 +63,9 @@ int hpsb_default_host_entry(struct hpsb_host *host) return -ENOMEM; } - ret = csr1212_associate_keyval(vend_id, text); + csr1212_associate_keyval(vend_id, text); csr1212_release_keyval(text); - ret |= csr1212_attach_keyval_to_directory(root, vend_id); + ret = csr1212_attach_keyval_to_directory(root, vend_id); csr1212_release_keyval(vend_id); if (ret != CSR1212_SUCCESS) { csr1212_destroy_csr(host-csr.rom); @@ -103,10 +103,12 @@ static int config_rom_ip1394_init(void) if (!ip1394_ud || !spec_id || !spec_desc || !ver || !ver_desc) goto ip1394_fail; - if (csr1212_associate_keyval(spec_id, spec_desc) == CSR1212_SUCCESS - csr1212_associate_keyval(ver, ver_desc) == CSR1212_SUCCESS - csr1212_attach_keyval_to_directory(ip1394_ud, spec_id) == CSR1212_SUCCESS - csr1212_attach_keyval_to_directory(ip1394_ud, ver) == CSR1212_SUCCESS) + csr1212_associate_keyval(spec_id, spec_desc); + csr1212_associate_keyval(ver, ver_desc); + if (csr1212_attach_keyval_to_directory(ip1394_ud, spec_id) + == CSR1212_SUCCESS + csr1212_attach_keyval_to_directory(ip1394_ud, ver) + == CSR1212_SUCCESS) ret = 0; ip1394_fail: diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index 65be507..54408cb 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c @@ -35,6 +35,7 @@ #include linux/errno.h #include linux/string.h +#include asm/bug.h #include asm/byteorder.h #include csr1212.h @@ -305,43 +306,29 @@ struct csr1212_keyval *csr1212_new_directory(u8 key) return kv; } -int csr1212_associate_keyval(struct csr1212_keyval *kv, -struct csr1212_keyval *associate) +void csr1212_associate_keyval(struct csr1212_keyval *kv, + struct csr1212_keyval *associate) { - if (!kv || !associate) - return -EINVAL; - - if (kv-key.id == CSR1212_KV_ID_DESCRIPTOR || - (associate-key.id != CSR1212_KV_ID_DESCRIPTOR - associate-key.id != CSR1212_KV_ID_DEPENDENT_INFO - associate-key.id != CSR1212_KV_ID_EXTENDED_KEY - associate-key.id != CSR1212_KV_ID_EXTENDED_DATA - associate-key.id 0x30)) - return -EINVAL; - - if (kv-key.id == CSR1212_KV_ID_EXTENDED_KEY_SPECIFIER_ID - associate-key.id != CSR1212_KV_ID_EXTENDED_KEY) - return -EINVAL; - - if (kv-key.id == CSR1212_KV_ID_EXTENDED_KEY - associate-key.id != CSR1212_KV_ID_EXTENDED_DATA) - return -EINVAL; - - if (associate-key.id == CSR1212_KV_ID_EXTENDED_KEY - kv-key.id != CSR1212_KV_ID_EXTENDED_KEY_SPECIFIER_ID) - return -EINVAL; - - if (associate-key.id == CSR1212_KV_ID_EXTENDED_DATA - kv-key.id != CSR1212_KV_ID_EXTENDED_KEY) - return -EINVAL; + BUG_ON(!kv || !associate || kv-key.id == CSR1212_KV_ID_DESCRIPTOR || + (associate-key.id != CSR1212_KV_ID_DESCRIPTOR + associate-key.id != CSR1212_KV_ID_DEPENDENT_INFO + associate-key.id != CSR1212_KV_ID_EXTENDED_KEY + associate-key.id != CSR1212_KV_ID_EXTENDED_DATA + associate-key.id 0x30) || + (kv-key.id == CSR1212_KV_ID_EXTENDED_KEY_SPECIFIER_ID + associate-key.id != CSR1212_KV_ID_EXTENDED_KEY) || + (kv-key.id == CSR1212_KV_ID_EXTENDED_KEY + associate-key.id != CSR1212_KV_ID_EXTENDED_DATA) || + (associate-key.id == CSR1212_KV_ID_EXTENDED_KEY + kv-key.id != CSR1212_KV_ID_EXTENDED_KEY_SPECIFIER_ID) || + (associate-key.id == CSR1212_KV_ID_EXTENDED_DATA + kv-key.id != CSR1212_KV_ID_EXTENDED_KEY)); if (kv-associate)
ieee1394: csr1212: warn on unreachable code
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c94ccf9e3389ff55078a049bfe59b82f854436e8 Commit: c94ccf9e3389ff55078a049bfe59b82f854436e8 Parent: a1c6250cb60a52a7f799610f9a4b1f4e8671175f Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Wed Mar 14 00:27:46 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:29 2007 +0200 ieee1394: csr1212: warn on unreachable code We want bugs to show themselves. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/csr1212.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index 63bf11e..3c044fc 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c @@ -772,6 +772,7 @@ csr1212_generate_positions(struct csr1212_csr_rom_cache *cache, default: /* Should never get here */ + WARN_ON(1); break; } @@ -852,7 +853,8 @@ csr1212_generate_tree_subdir(struct csr1212_keyval *dir, u32 *data_buffer) break; default: /* Should never get here */ - break; /* GDB breakpoint */ + WARN_ON(1); + break; } value |= (a-key.id CSR1212_KV_KEY_ID_MASK) @@ -889,7 +891,8 @@ static void csr1212_fill_cache(struct csr1212_csr_rom_cache *cache) case CSR1212_KV_TYPE_IMMEDIATE: case CSR1212_KV_TYPE_CSR_OFFSET: /* Should never get here */ - break; /* GDB breakpoint */ + WARN_ON(1); + break; case CSR1212_KV_TYPE_LEAF: /* Don't copy over Extended ROM areas, they are - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: shrink csr1212_new_string_descriptor_leaf
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a1c6250cb60a52a7f799610f9a4b1f4e8671175f Commit: a1c6250cb60a52a7f799610f9a4b1f4e8671175f Parent: c868ae2a1d1ad3a474d2a17295ac1ab190b30061 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Wed Mar 14 00:27:18 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:28 2007 +0200 ieee1394: shrink csr1212_new_string_descriptor_leaf Make unnecessarily generic code specific and thus simpler. Shrink a lookup table from 128 to 16 bytes. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/csr1212.c | 123 --- 1 files changed, 46 insertions(+), 77 deletions(-) diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index 4887e48..63bf11e 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c @@ -388,101 +388,70 @@ csr1212_new_descriptor_leaf(u8 dtype, u32 specifier_id, CSR1212_DESCRIPTOR_LEAF_SET_TYPE(kv, dtype); CSR1212_DESCRIPTOR_LEAF_SET_SPECIFIER_ID(kv, specifier_id); - if (data) { + if (data) memcpy(CSR1212_DESCRIPTOR_LEAF_DATA(kv), data, data_len); - } - - return kv; -} - -#define CSR1212_TEXTUAL_DESCRIPTOR_LEAF_SET_WIDTH(kv, width) \ - ((kv)-value.leaf.data[1] = \ -((kv)-value.leaf.data[1] \ - cpu_to_be32(~(CSR1212_TEXTUAL_DESCRIPTOR_LEAF_WIDTH_MASK \ - CSR1212_TEXTUAL_DESCRIPTOR_LEAF_WIDTH_SHIFT))) | \ -cpu_to_be32(((width) CSR1212_TEXTUAL_DESCRIPTOR_LEAF_WIDTH_MASK) \ -CSR1212_TEXTUAL_DESCRIPTOR_LEAF_WIDTH_SHIFT)) - -#define CSR1212_TEXTUAL_DESCRIPTOR_LEAF_SET_CHAR_SET(kv, char_set) \ - ((kv)-value.leaf.data[1] = \ -((kv)-value.leaf.data[1] \ - cpu_to_be32(~(CSR1212_TEXTUAL_DESCRIPTOR_LEAF_CHAR_SET_MASK \ - CSR1212_TEXTUAL_DESCRIPTOR_LEAF_CHAR_SET_SHIFT))) | \ -cpu_to_be32(((char_set) \ - CSR1212_TEXTUAL_DESCRIPTOR_LEAF_CHAR_SET_MASK) \ -CSR1212_TEXTUAL_DESCRIPTOR_LEAF_CHAR_SET_SHIFT)) - -#define CSR1212_TEXTUAL_DESCRIPTOR_LEAF_SET_LANGUAGE(kv, language) \ - ((kv)-value.leaf.data[1] = \ -((kv)-value.leaf.data[1] \ - cpu_to_be32(~(CSR1212_TEXTUAL_DESCRIPTOR_LEAF_LANGUAGE_MASK))) | \ -cpu_to_be32(((language) \ - CSR1212_TEXTUAL_DESCRIPTOR_LEAF_LANGUAGE_MASK))) - -static struct csr1212_keyval * -csr1212_new_textual_descriptor_leaf(u8 cwidth, u16 cset, u16 language, - const void *data, size_t data_len) -{ - struct csr1212_keyval *kv; - char *lstr; - - kv = csr1212_new_descriptor_leaf(0, 0, NULL, data_len + - CSR1212_TEXTUAL_DESCRIPTOR_LEAF_OVERHEAD); - if (!kv) - return NULL; - - CSR1212_TEXTUAL_DESCRIPTOR_LEAF_SET_WIDTH(kv, cwidth); - CSR1212_TEXTUAL_DESCRIPTOR_LEAF_SET_CHAR_SET(kv, cset); - CSR1212_TEXTUAL_DESCRIPTOR_LEAF_SET_LANGUAGE(kv, language); - - lstr = (char*)CSR1212_TEXTUAL_DESCRIPTOR_LEAF_DATA(kv); - - /* make sure last quadlet is zeroed out */ - *((u32*)(lstr[(data_len - 1) ~0x3])) = 0; - - /* don't copy the NUL terminator */ - memcpy(lstr, data, data_len); return kv; } +/* Check if string conforms to minimal ASCII as per IEEE 1212 clause 7.4 */ static int csr1212_check_minimal_ascii(const char *s) { static const char minimal_ascii_table[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, - 0x00, 0x00, 0x0a, 0x00, 0x0C, 0x0D, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x21, 0x22, 0x00, 0x00, 0x25, 0x26, 0x27, - 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, - 0x58, 0x59, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x5f, - 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, - 0x78, 0x79, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, + /* 1 2 4 8 16 32 64 128 */ + 128,/* --, --, --, --, --, --, --, 07, */ + 4 + 16 + 32,/* --, --, 0a, --, 0C, 0D, --, --, */ + 0, /* --, --, --, --, --, --, --, --, */ + 0,
ieee1394: small header cleanup
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e167c88ebb2fcc2d98bd9a9970ae29e4fda4bdf9 Commit: e167c88ebb2fcc2d98bd9a9970ae29e4fda4bdf9 Parent: afd6546d8d2d8ba1dbe1d2508baf81eebdca3d79 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Mar 5 03:07:38 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:28 2007 +0200 ieee1394: small header cleanup Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/config_roms.h |3 +-- drivers/ieee1394/eth1394.h |1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ieee1394/config_roms.h b/drivers/ieee1394/config_roms.h index e6cdb5e..02a2187 100644 --- a/drivers/ieee1394/config_roms.h +++ b/drivers/ieee1394/config_roms.h @@ -1,8 +1,7 @@ #ifndef _IEEE1394_CONFIG_ROMS_H #define _IEEE1394_CONFIG_ROMS_H -#include ieee1394_types.h -#include hosts.h +struct hpsb_host; int hpsb_default_host_entry(struct hpsb_host *host); int hpsb_init_config_roms(void); diff --git a/drivers/ieee1394/eth1394.h b/drivers/ieee1394/eth1394.h index 1e83565..2a88ee4 100644 --- a/drivers/ieee1394/eth1394.h +++ b/drivers/ieee1394/eth1394.h @@ -27,6 +27,7 @@ #include linux/netdevice.h #include ieee1394.h +#include ieee1394_types.h /* Register for incoming packets. This is 4096 bytes, which supports up to * S3200 (per Table 16-3 of IEEE 1394b-2002). */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: csr1212: more sensible names for jump targets
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=511f7b3227eef52b56cf336a5313d8ff766c3050 Commit: 511f7b3227eef52b56cf336a5313d8ff766c3050 Parent: c94ccf9e3389ff55078a049bfe59b82f854436e8 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Wed Mar 14 00:28:36 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:29 2007 +0200 ieee1394: csr1212: more sensible names for jump targets Code beneath two labels called fail is actually also reached in case of success. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/csr1212.c | 18 -- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index 3c044fc..43f5b7f 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c @@ -1138,7 +1138,7 @@ csr1212_parse_dir_entry(struct csr1212_keyval *dir, u32 ki, u32 kv_pos) CSR1212_KV_VAL(ki)); if (!k) { ret = -ENOMEM; - goto fail; + goto out; } k-refcnt = 0; /* Don't keep local reference when parsing. */ @@ -1149,7 +1149,7 @@ csr1212_parse_dir_entry(struct csr1212_keyval *dir, u32 ki, u32 kv_pos) CSR1212_KV_VAL(ki)); if (!k) { ret = -ENOMEM; - goto fail; + goto out; } k-refcnt = 0; /* Don't keep local reference when parsing. */ break; @@ -1162,7 +1162,7 @@ csr1212_parse_dir_entry(struct csr1212_keyval *dir, u32 ki, u32 kv_pos) * or Directories. The Config ROM image is most likely * messed up, so we'll just abort here. */ ret = -EIO; - goto fail; + goto out; } k = csr1212_find_keyval_offset(dir, offset); @@ -1177,7 +1177,7 @@ csr1212_parse_dir_entry(struct csr1212_keyval *dir, u32 ki, u32 kv_pos) if (!k) { ret = -ENOMEM; - goto fail; + goto out; } k-refcnt = 0; /* Don't keep local reference when parsing. */ k-valid = 0; /* Contents not read yet so it's not valid. */ @@ -1189,8 +1189,7 @@ csr1212_parse_dir_entry(struct csr1212_keyval *dir, u32 ki, u32 kv_pos) dir-next = k; } ret = csr1212_attach_keyval_to_directory(dir, k); - -fail: +out: if (ret != CSR1212_SUCCESS k != NULL) free_keyval(k); return ret; @@ -1214,7 +1213,7 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv, if ((csr1212_crc16(kvi-data, kvi_len) != kvi-crc) (csr1212_msft_crc16(kvi-data, kvi_len) != kvi-crc)) { ret = -EINVAL; - goto fail; + goto out; } #endif @@ -1241,7 +1240,7 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv, kv-value.leaf.data = CSR1212_MALLOC(size); if (!kv-value.leaf.data) { ret = -ENOMEM; - goto fail; + goto out; } kv-value.leaf.len = kvi_len; @@ -1251,8 +1250,7 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv, } kv-valid = 1; - -fail: +out: return ret; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: csr1212: log if devices have CRC errors in their ROM
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d265250341f83fa904d4fecdfadb46d7ab50765f Commit: d265250341f83fa904d4fecdfadb46d7ab50765f Parent: 511f7b3227eef52b56cf336a5313d8ff766c3050 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Wed Mar 14 00:29:20 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:29 2007 +0200 ieee1394: csr1212: log if devices have CRC errors in their ROM This will point out firmware bugs. I tested with 11 SBP-2 devices and one OS X PC and got these errors from two old CD-RWs only. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/csr1212.c | 27 +-- 1 files changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/ieee1394/csr1212.c b/drivers/ieee1394/csr1212.c index 43f5b7f..d08166b 100644 --- a/drivers/ieee1394/csr1212.c +++ b/drivers/ieee1394/csr1212.c @@ -34,6 +34,7 @@ */ #include linux/errno.h +#include linux/kernel.h #include linux/string.h #include asm/bug.h #include asm/byteorder.h @@ -113,10 +114,7 @@ static u16 csr1212_crc16(const u32 *buffer, size_t length) return cpu_to_be16(crc); } -#if 0 -/* Microsoft computes the CRC with the bytes in reverse order. Therefore we - * have a special version of the CRC algorithm to account for their buggy - * software. */ +/* Microsoft computes the CRC with the bytes in reverse order. */ static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) { int shift; @@ -135,7 +133,6 @@ static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) return cpu_to_be16(crc); } -#endif static struct csr1212_dentry * csr1212_find_keyval(struct csr1212_keyval *dir, struct csr1212_keyval *kv) @@ -1096,13 +1093,11 @@ static int csr1212_parse_bus_info_block(struct csr1212_csr *csr) return ret; } -#if 0 - /* Apparently there are too many differnt wrong implementations of the -* CRC algorithm that verifying them is moot. */ + /* Apparently there are many different wrong implementations of the CRC +* algorithm. We don't fail, we just warn. */ if ((csr1212_crc16(bi-data, bi-crc_length) != bi-crc) (csr1212_msft_crc16(bi-data, bi-crc_length) != bi-crc)) - return -EINVAL; -#endif + printk(KERN_DEBUG IEEE 1394 device has ROM CRC error\n); cr = CSR1212_MALLOC(sizeof(*cr)); if (!cr) @@ -1207,15 +1202,11 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv, cache-data[bytes_to_quads(kv-offset - cache-offset)]; kvi_len = be16_to_cpu(kvi-length); -#if 0 - /* Apparently there are too many differnt wrong implementations of the -* CRC algorithm that verifying them is moot. */ + /* Apparently there are many different wrong implementations of the CRC +* algorithm. We don't fail, we just warn. */ if ((csr1212_crc16(kvi-data, kvi_len) != kvi-crc) - (csr1212_msft_crc16(kvi-data, kvi_len) != kvi-crc)) { - ret = -EINVAL; - goto out; - } -#endif + (csr1212_msft_crc16(kvi-data, kvi_len) != kvi-crc)) + printk(KERN_DEBUG IEEE 1394 device has ROM CRC error\n); switch (kv-key.type) { case CSR1212_KV_TYPE_DIRECTORY: - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: some more includes
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9543a931dcd82bfc5143807440ff63c7721a2e2a Commit: 9543a931dcd82bfc5143807440ff63c7721a2e2a Parent: 3a23a81e83fddb40ec0242c74acb4b1829676bfc Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Tue Apr 10 02:39:07 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:29 2007 +0200 ieee1394: some more includes Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/ieee1394_transactions.c |3 +++ drivers/ieee1394/nodemgr.c |1 + 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c index 8b7511d..0272dac 100644 --- a/drivers/ieee1394/ieee1394_transactions.c +++ b/drivers/ieee1394/ieee1394_transactions.c @@ -10,13 +10,16 @@ */ #include linux/bitops.h +#include linux/compiler.h #include linux/hardirq.h #include linux/spinlock.h +#include linux/string.h #include linux/sched.h /* because linux/wait.h is broken if CONFIG_SMP=n */ #include linux/wait.h #include asm/bug.h #include asm/errno.h +#include asm/system.h #include ieee1394.h #include ieee1394_types.h diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index faaa5c9..ddd7aac 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -16,6 +16,7 @@ #include linux/kthread.h #include linux/module.h #include linux/moduleparam.h +#include linux/mutex.h #include linux/freezer.h #include asm/atomic.h - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: ieee1394_transactions needs sched.h
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3a23a81e83fddb40ec0242c74acb4b1829676bfc Commit: 3a23a81e83fddb40ec0242c74acb4b1829676bfc Parent: 504945c9c6954b83758272d04797f31437dfce9e Author: Torsten Kaiser [EMAIL PROTECTED] AuthorDate: Mon Apr 9 21:03:15 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:29 2007 +0200 ieee1394: ieee1394_transactions needs sched.h drivers/ieee1394/ieee1394_transactions.c fails for me if CONFIG_SMP=n gcc complains: CC drivers/ieee1394/ieee1394_transactions.o drivers/ieee1394/ieee1394_transactions.c: In function 'hpsb_get_tlabel': drivers/ieee1394/ieee1394_transactions.c:183: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function) drivers/ieee1394/ieee1394_transactions.c:183: error: (Each undeclared identifier is reported only once Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Stefan Richter [EMAIL PROTECTED] (added comment) --- drivers/ieee1394/ieee1394_transactions.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c index d1a0d3c..8b7511d 100644 --- a/drivers/ieee1394/ieee1394_transactions.c +++ b/drivers/ieee1394/ieee1394_transactions.c @@ -12,6 +12,7 @@ #include linux/bitops.h #include linux/hardirq.h #include linux/spinlock.h +#include linux/sched.h /* because linux/wait.h is broken if CONFIG_SMP=n */ #include linux/wait.h #include asm/bug.h - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: ieee1394_core printk format
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=504945c9c6954b83758272d04797f31437dfce9e Commit: 504945c9c6954b83758272d04797f31437dfce9e Parent: 7542e0e696d1b6e71e6eb3183cbf2c63ec6b5acb Author: Randy Dunlap [EMAIL PROTECTED] AuthorDate: Tue Apr 3 13:00:47 2007 -0700 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:29 2007 +0200 ieee1394: ieee1394_core printk format Fix printk format string: drivers/ieee1394/ieee1394_core.c:702: warning: format '%d' expects type 'int', but argument 2 has type 'size_t' Signed-off-by: Randy Dunlap [EMAIL PROTECTED] Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/ieee1394_core.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c index d6e3d44..d2240a4 100644 --- a/drivers/ieee1394/ieee1394_core.c +++ b/drivers/ieee1394/ieee1394_core.c @@ -698,7 +698,7 @@ static size_t packet_size_to_data_size(size_t packet_size, size_t header_size, ret = buffer_size; if (unlikely(ret + header_size != packet_size)) - HPSB_ERR(unexpected packet size %d (tcode %d), bug?, + HPSB_ERR(unexpected packet size %zd (tcode %d), bug?, packet_size, tcode); return ret; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: remove usage of skb_queue as packet queue
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7542e0e696d1b6e71e6eb3183cbf2c63ec6b5acb Commit: 7542e0e696d1b6e71e6eb3183cbf2c63ec6b5acb Parent: d265250341f83fa904d4fecdfadb46d7ab50765f Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Sun Mar 25 22:22:40 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:29 2007 +0200 ieee1394: remove usage of skb_queue as packet queue This considerably reduces the memory requirements for a packet and eliminates ieee1394's dependency on CONFIG_NET. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/Kconfig |1 - drivers/ieee1394/hosts.c | 12 +-- drivers/ieee1394/hosts.h |4 +- drivers/ieee1394/ieee1394_core.c | 285 -- drivers/ieee1394/ieee1394_core.h | 27 ++--- drivers/ieee1394/raw1394.c |3 +- 6 files changed, 163 insertions(+), 169 deletions(-) diff --git a/drivers/ieee1394/Kconfig b/drivers/ieee1394/Kconfig index cd84a55..f8ff6b8 100644 --- a/drivers/ieee1394/Kconfig +++ b/drivers/ieee1394/Kconfig @@ -5,7 +5,6 @@ menu IEEE 1394 (FireWire) support config IEEE1394 tristate IEEE 1394 (FireWire) support depends on PCI || BROKEN - select NET help IEEE 1394 describes a high performance serial bus, which is also known as FireWire(tm) or i.Link(tm) and is used for connecting all diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c index 615ba62..1bf4aa3 100644 --- a/drivers/ieee1394/hosts.c +++ b/drivers/ieee1394/hosts.c @@ -94,14 +94,6 @@ static int alloc_hostnum_cb(struct hpsb_host *host, void *__data) return 0; } -/* - * The pending_packet_queue is special in that it's processed - * from hardirq context too (such as hpsb_bus_reset()). Hence - * split the lock class from the usual networking skb-head - * lock class by using a separate key for it: - */ -static struct lock_class_key pending_packet_queue_key; - static DEFINE_MUTEX(host_num_alloc); /** @@ -137,9 +129,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, h-hostdata = h + 1; h-driver = drv; - skb_queue_head_init(h-pending_packet_queue); - lockdep_set_class(h-pending_packet_queue.lock, - pending_packet_queue_key); + INIT_LIST_HEAD(h-pending_packets); INIT_LIST_HEAD(h-addr_space); for (i = 2; i 16; i++) diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h index 6b4e225..feb55d0 100644 --- a/drivers/ieee1394/hosts.h +++ b/drivers/ieee1394/hosts.h @@ -3,7 +3,6 @@ #include linux/device.h #include linux/list.h -#include linux/skbuff.h #include linux/timer.h #include linux/types.h #include linux/workqueue.h @@ -25,8 +24,7 @@ struct hpsb_host { atomic_t generation; - struct sk_buff_head pending_packet_queue; - + struct list_head pending_packets; struct timer_list timeout; unsigned long timeout_interval; diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c index 2708856..d6e3d44 100644 --- a/drivers/ieee1394/ieee1394_core.c +++ b/drivers/ieee1394/ieee1394_core.c @@ -30,7 +30,6 @@ #include linux/moduleparam.h #include linux/bitops.h #include linux/kdev_t.h -#include linux/skbuff.h #include linux/suspend.h #include linux/kthread.h #include linux/preempt.h @@ -103,6 +102,8 @@ static void queue_packet_complete(struct hpsb_packet *packet); * * Set the task that runs when a packet completes. You cannot call this more * than once on a single packet before it is sent. + * + * Typically, the complete @routine is responsible to call hpsb_free_packet(). */ void hpsb_set_packet_complete_task(struct hpsb_packet *packet, void (*routine)(void *), void *data) @@ -115,12 +116,12 @@ void hpsb_set_packet_complete_task(struct hpsb_packet *packet, /** * hpsb_alloc_packet - allocate new packet structure - * @data_size: size of the data block to be allocated + * @data_size: size of the data block to be allocated, in bytes * * This function allocates, initializes and returns a new struct hpsb_packet. - * It can be used in interrupt context. A header block is always included, its - * size is big enough to contain all possible 1394 headers. The data block is - * only allocated when @data_size is not zero. + * It can be used in interrupt context. A header block is always included and + * initialized with zeros. Its size is big enough to contain all possible 1394 + * headers. The data block is only allocated if @data_size is not zero. * * For packets for which responses will be received the @data_size has to be big * enough to contain the response's data block since no further allocation @@ -135,50 +136,42 @@ void hpsb_set_packet_complete_task(struct hpsb_packet *packet, */
USB HID: don't warn on idVendor == 0
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f61c9127b9840661244b1b6571e4304a7f0b5c73 Commit: f61c9127b9840661244b1b6571e4304a7f0b5c73 Parent: 876b9276b993723f7a74d55b3b49b9186f05d09d Author: Jiri Kosina [EMAIL PROTECTED] AuthorDate: Sun Apr 29 13:14:56 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Sun Apr 29 13:14:56 2007 +0200 USB HID: don't warn on idVendor == 0 It turns out that there are broken devices out there that incorrectly report VID/PID as 0x000, see http://lkml.org/lkml/2007/4/27/496 Therefore we should not confuse users by dumping warnings and stacktraces in such situation. It is not possible to add quirks for such horribly broken devices, but currently that's not needed. Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-quirks.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 27188bd..17a8755 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c @@ -477,8 +477,6 @@ static struct hid_blacklist *usbhid_exists_dquirk(const u16 idVendor, struct quirks_list_struct *q; struct hid_blacklist *bl_entry = NULL; - WARN_ON(idVendor == 0); - list_for_each_entry(q, dquirks_list, node) { if (q-hid_bl_item.idVendor == idVendor q-hid_bl_item.idProduct == idProduct) { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
HID: introduce proper zeroing of unused bits in output reports
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=46386b587086c8d2698222a031bf749688464032 Commit: 46386b587086c8d2698222a031bf749688464032 Parent: a21bd69e1509b43823c317c3bf3f7ffa99884356 Author: Simon Budig [EMAIL PROTECTED] AuthorDate: Mon Mar 12 13:52:04 2007 +0100 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 11 10:36:36 2007 +0200 HID: introduce proper zeroing of unused bits in output reports Some HID devices are looking on the unused bits in the HID reports they receive. This is violating the specification, but we want to make those devices work. Well-behaving devices are unaffected, as they don't care about the unused bits. If bitsused % 8 is 0 all bits in data[] get used and we don't need to clear anything. Otherwise (bitsused % 8) bits of the last byte get used. By shifting 1 for (bitsused % 8) bits and subtracting 1 we create a mask consisting of (bitsused % 8) ones and remaining zeroes. By ANDing we clear the upper unused bits. Signed-off-by: Simon Budig [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/hid-core.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 67f3347..c16c949 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -872,8 +872,13 @@ static void hid_output_field(struct hid_field *field, __u8 *data) unsigned count = field-report_count; unsigned offset = field-report_offset; unsigned size = field-report_size; + unsigned bitsused = offset + count * size; unsigned n; + /* make sure the unused bits in the last byte are zeros */ + if (count 0 size 0 (bitsused % 8) != 0) + data[(bitsused-1)/8] = (1 (bitsused % 8)) - 1; + for (n = 0; n count; n++) { if (field-logical_minimum 0) /* signed values */ implement(data, offset + n * size, size, s32ton(field-value[n], size)); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: sbp2: remove unnecessary alignments of struct members
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f412bf440be2dfc0f0ded917410c599c002549e0 Commit: f412bf440be2dfc0f0ded917410c599c002549e0 Parent: b9099ff63c75216d6ca10bce5a1abcd9293c27e6 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Sun Feb 4 13:04:32 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:27 2007 +0200 ieee1394: sbp2: remove unnecessary alignments of struct members The members dma_addr_t command_orb_dma and dma_addr_t sge_dma of sbp2.h::sbp2_command_info do not have to be aligned themselves --- only the memory which they point to has to be. The member struct sbp2_command_orb command_orb has to be aligned on 4 bytes boundary which is guaranteed because it contains u32 members. The member struct sbp2_unrestricted_page_table scatter_gather_element, i.e. the SBP-2 s/g table, has to be aligned on 8 bytes boundary according to the SBP-2 spec. This is not a requirement for FireWire controllers but could be expected by SBP-2 targets. I see no need to align the members command_orb and scatter_gather_element on CPU cacheline boundaries. It could have performance benefits, but on the other hand sbp2 has a somewhat wasteful allocation scheme which should be optimized first before further tweaks like cacheline alignments. (E.g. don't always allocate SG_ALL s/g table elements.) Note, before as well as after the patch, the code relies on the assumption that memory alignment in the virtual address space is preserved in the physical address space after DMA mapping. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/sbp2.h |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h index 9ae8423..44402b9 100644 --- a/drivers/ieee1394/sbp2.h +++ b/drivers/ieee1394/sbp2.h @@ -250,15 +250,15 @@ enum sbp2_dma_types { /* Per SCSI command */ struct sbp2_command_info { struct list_head list; - struct sbp2_command_orb command_orb cacheline_aligned; - dma_addr_t command_orb_dma cacheline_aligned; + struct sbp2_command_orb command_orb; + dma_addr_t command_orb_dma; struct scsi_cmnd *Current_SCpnt; void (*Current_done)(struct scsi_cmnd *); /* Also need s/g structure for each sbp2 command */ struct sbp2_unrestricted_page_table - scatter_gather_element[SG_ALL] cacheline_aligned; - dma_addr_t sge_dma cacheline_aligned; + scatter_gather_element[SG_ALL] __attribute__((aligned(8))); + dma_addr_t sge_dma; void *sge_buffer; dma_addr_t cmd_dma; enum sbp2_dma_types dma_type; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: iso.c needs sched.h
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9e5eb067b6882f564e1daa26e37ad6145f01da4 Commit: b9e5eb067b6882f564e1daa26e37ad6145f01da4 Parent: 9543a931dcd82bfc5143807440ff63c7721a2e2a Author: Andrew Morton [EMAIL PROTECTED] AuthorDate: Thu Apr 26 00:16:04 2007 -0700 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:29 2007 +0200 ieee1394: iso.c needs sched.h alpha: drivers/ieee1394/iso.c: In function 'hpsb_iso_xmit_sync': drivers/ieee1394/iso.c:440: error: invalid use of undefined type 'struct task_struct' drivers/ieee1394/iso.c:440: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function) drivers/ieee1394/iso.c:440: error: (Each undeclared identifier is reported only once drivers/ieee1394/iso.c:440: error: for each function it appears in.) drivers/ieee1394/iso.c:440: warning: implicit declaration of function 'signal_pending' drivers/ieee1394/iso.c:440: error: invalid use of undefined type 'struct task_struct' drivers/ieee1394/iso.c:440: warning: implicit declaration of function 'schedule' drivers/ieee1394/iso.c: In function 'hpsb_iso_wake': drivers/ieee1394/iso.c:562: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function) Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Stefan Richter [EMAIL PROTECTED] (brought into alphabetic order) --- drivers/ieee1394/iso.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/ieee1394/iso.c b/drivers/ieee1394/iso.c index f223f34..07ca35c 100644 --- a/drivers/ieee1394/iso.c +++ b/drivers/ieee1394/iso.c @@ -10,6 +10,7 @@ */ #include linux/pci.h +#include linux/sched.h #include linux/slab.h #include hosts.h - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: sbp2: enforce 32bit DMA mapping
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0555659d63c285ceb7ead3115532e1b71b0f27a7 Commit: 0555659d63c285ceb7ead3115532e1b71b0f27a7 Parent: f412bf440be2dfc0f0ded917410c599c002549e0 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Sun Feb 4 20:25:43 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:27 2007 +0200 ieee1394: sbp2: enforce 32bit DMA mapping In order to use OHCI-1394 physical DMA, all s/g elements, s/g tables, ORBs, and response buffers have to reside within the first 4 GB of the FireWire controller's physical address space. Set the correct mask for DMA mappings. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/sbp2.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 4edfff4..e15b5d7 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c @@ -757,6 +757,11 @@ static struct sbp2_lu *sbp2_alloc_device(struct unit_directory *ud) SBP2_ERR(failed to register lower 4GB address range); goto failed_alloc; } +#else + if (dma_set_mask(hi-host-device.parent, DMA_32BIT_MASK)) { + SBP2_ERR(failed to set 4GB DMA mask); + goto failed_alloc; + } #endif } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: sbp2: optimize DMA direction of s/g tables
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2446a79f4f0a5e88e5d8316dac407d66ac10f70d Commit: 2446a79f4f0a5e88e5d8316dac407d66ac10f70d Parent: 0555659d63c285ceb7ead3115532e1b71b0f27a7 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Sun Feb 4 20:54:57 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:27 2007 +0200 ieee1394: sbp2: optimize DMA direction of s/g tables Unlike the name suggests, cmd-scatter_gather_element holds only the s/g table, not the actual s/g elements. Since the table is only read but never written by the device, DMA_BIDIRECTIONAL can be replaced by DMA_TO_DEVICE which may be cheaper on some architectures. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/sbp2.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index e15b5d7..cae3816 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c @@ -489,7 +489,7 @@ static int sbp2util_create_command_orb_pool(struct sbp2_lu *lu) cmd-sge_dma = dma_map_single(hi-host-device.parent, cmd-scatter_gather_element, sizeof(cmd-scatter_gather_element), - DMA_BIDIRECTIONAL); + DMA_TO_DEVICE); INIT_LIST_HEAD(cmd-list); list_add_tail(cmd-list, lu-cmd_orb_completed); } @@ -514,7 +514,7 @@ static void sbp2util_remove_command_orb_pool(struct sbp2_lu *lu) DMA_TO_DEVICE); dma_unmap_single(host-device.parent, cmd-sge_dma, sizeof(cmd-scatter_gather_element), -DMA_BIDIRECTIONAL); +DMA_TO_DEVICE); kfree(cmd); } spin_unlock_irqrestore(lu-cmd_orb_lock, flags); @@ -1633,7 +1633,7 @@ static void sbp2_link_orb_command(struct sbp2_lu *lu, DMA_TO_DEVICE); dma_sync_single_for_device(hi-host-device.parent, cmd-sge_dma, sizeof(cmd-scatter_gather_element), - DMA_BIDIRECTIONAL); + DMA_TO_DEVICE); /* check to see if there are any previous orbs to use */ spin_lock_irqsave(lu-cmd_orb_lock, flags); @@ -1799,7 +1799,7 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, DMA_TO_DEVICE); dma_sync_single_for_cpu(hi-host-device.parent, cmd-sge_dma, sizeof(cmd-scatter_gather_element), - DMA_BIDIRECTIONAL); + DMA_TO_DEVICE); /* Grab SCSI command pointers and check status. */ /* * FIXME: If the src field in the status is 1, the ORB DMA must @@ -1931,7 +1931,7 @@ static void sbp2scsi_complete_all_commands(struct sbp2_lu *lu, u32 status) DMA_TO_DEVICE); dma_sync_single_for_cpu(hi-host-device.parent, cmd-sge_dma, sizeof(cmd-scatter_gather_element), - DMA_BIDIRECTIONAL); + DMA_TO_DEVICE); sbp2util_mark_command_completed(lu, cmd); if (cmd-Current_SCpnt) { cmd-Current_SCpnt-result = status 16; @@ -2062,7 +2062,7 @@ static int sbp2scsi_abort(struct scsi_cmnd *SCpnt) dma_sync_single_for_cpu(hi-host-device.parent, cmd-sge_dma, sizeof(cmd-scatter_gather_element), - DMA_BIDIRECTIONAL); + DMA_TO_DEVICE); sbp2util_mark_command_completed(lu, cmd); if (cmd-Current_SCpnt) { cmd-Current_SCpnt-result = DID_ABORT 16; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB HID: add FF support for Logitech Force 3D Pro Joystick
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=320c01500c6ecb189c577b921a2357c7a56aaebc Commit: 320c01500c6ecb189c577b921a2357c7a56aaebc Parent: 713c8aad6b7202671ce1ac6109f6b48d8223e938 Author: Jiri Kosina [EMAIL PROTECTED] AuthorDate: Tue Apr 10 16:08:34 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 11 10:36:03 2007 +0200 USB HID: add FF support for Logitech Force 3D Pro Joystick This patch adds support for Logitech Force 3D Pro Joystick (0x046d/0xc286) to hid-lgff driver. Device ID reported by Richard Bolkey [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-ff.c |1 + drivers/hid/usbhid/hid-lgff.c |1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/hid/usbhid/hid-ff.c b/drivers/hid/usbhid/hid-ff.c index 4ff3edb..23431fb 100644 --- a/drivers/hid/usbhid/hid-ff.c +++ b/drivers/hid/usbhid/hid-ff.c @@ -56,6 +56,7 @@ static struct hid_ff_initializer inits[] = { { 0x46d, 0xc211, hid_lgff_init }, /* Logitech Cordless rumble pad */ { 0x46d, 0xc219, hid_lgff_init }, /* Logitech Cordless rumble pad 2 */ { 0x46d, 0xc283, hid_lgff_init }, /* Logitech Wingman Force 3d */ + { 0x46d, 0xc286, hid_lgff_init }, /* Logitech Force 3D Pro Joystick */ { 0x46d, 0xc294, hid_lgff_init }, /* Logitech Formula Force EX */ { 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */ { 0x46d, 0xca03, hid_lgff_init }, /* Logitech MOMO force wheel */ diff --git a/drivers/hid/usbhid/hid-lgff.c b/drivers/hid/usbhid/hid-lgff.c index e6f3af3..92d2553 100644 --- a/drivers/hid/usbhid/hid-lgff.c +++ b/drivers/hid/usbhid/hid-lgff.c @@ -52,6 +52,7 @@ static const struct dev_type devices[] = { { 0x046d, 0xc211, ff_rumble }, { 0x046d, 0xc219, ff_rumble }, { 0x046d, 0xc283, ff_joystick }, + { 0x046d, 0xc286, ff_joystick }, { 0x046d, 0xc294, ff_joystick }, { 0x046d, 0xc295, ff_joystick }, { 0x046d, 0xca03, ff_joystick }, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
HID: update copyright and authorship macro
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f142b3a4f64eca235f5890d9cecb68482f62ed26 Commit: f142b3a4f64eca235f5890d9cecb68482f62ed26 Parent: 42cfb632f0210caa7d979666058075b06fc4680c Author: Jiri Kosina [EMAIL PROTECTED] AuthorDate: Mon Apr 16 11:29:28 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Mon Apr 16 11:29:28 2007 +0200 HID: update copyright and authorship macro Updates Copyright and DRIVER_AUTHOR in HID and USB HID sources. Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/hid-core.c|4 ++-- drivers/hid/usbhid/hid-core.c |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 67f3347..7c0fab1 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -4,7 +4,7 @@ * Copyright (c) 1999 Andreas Gal * Copyright (c) 2000-2005 Vojtech Pavlik [EMAIL PROTECTED] * Copyright (c) 2005 Michael Haboustak [EMAIL PROTECTED] for Concept2, Inc - * Copyright (c) 2006 Jiri Kosina + * Copyright (c) 2006-2007 Jiri Kosina */ /* @@ -37,7 +37,7 @@ */ #define DRIVER_VERSION v2.6 -#define DRIVER_AUTHOR Andreas Gal, Vojtech Pavlik +#define DRIVER_AUTHOR Andreas Gal, Vojtech Pavlik, Jiri Kosina #define DRIVER_DESC HID core driver #define DRIVER_LICENSE GPL diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 82fcb91..315c98c 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -39,7 +39,7 @@ */ #define DRIVER_VERSION v2.6 -#define DRIVER_AUTHOR Andreas Gal, Vojtech Pavlik +#define DRIVER_AUTHOR Andreas Gal, Vojtech Pavlik, Jiri Kosina #define DRIVER_DESC USB HID core driver #define DRIVER_LICENSE GPL - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB HID: EMS USBII device needs HID_QUIRK_MULTI_INPUT
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d5a1be98d8d40a7c558005d423b3daed8ba1ddb Commit: 4d5a1be98d8d40a7c558005d423b3daed8ba1ddb Parent: f142b3a4f64eca235f5890d9cecb68482f62ed26 Author: Paul Zaremba [EMAIL PROTECTED] AuthorDate: Wed Apr 18 15:29:47 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 18 15:29:47 2007 +0200 USB HID: EMS USBII device needs HID_QUIRK_MULTI_INPUT Add HID_QUIRK_MULTI_INPUT to the EMS USBII (0x0b43/0003) so the kernel detects both joystick ports properly. Without it you end up with a single joystick node (js0) that combines the two physical port signals. Signed-off-by: Paul Zaremba [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-core.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 315c98c..ac2493f 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -253,6 +253,9 @@ MODULE_PARM_DESC(mousepoll, Polling interval of mice); #define USB_VENDOR_ID_PANTHERLORD 0x0810 #define USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK0x0001 +#define USB_VENDOR_ID_PLAYDOTCOM 0x0b43 +#define USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII 0x0003 + #define USB_VENDOR_ID_SAITEK 0x06a3 #define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17 @@ -446,6 +449,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, + { USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER, HID_QUIRK_SONY_PS3_CONTROLLER }, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: unroll a weird macro
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d4c60085a97549ad3bb648e0652b9b48b7e42fa8 Commit: d4c60085a97549ad3bb648e0652b9b48b7e42fa8 Parent: b9e5eb067b6882f564e1daa26e37ad6145f01da4 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Sun Mar 18 00:55:15 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:29 2007 +0200 ieee1394: unroll a weird macro This is a coding style touch-up for ieee1394's handle_incoming_packet(). A preprocessor macro contained hardwired variable names and, even worse, the 'break' keyword. This macro is now unrolled and removed. Also, all 'break's which had the effect of a return are replaced by return. And a FIXME comment is brought up to date. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/ieee1394_core.c | 91 +- 1 files changed, 41 insertions(+), 50 deletions(-) diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c index d2240a4..b368958 100644 --- a/drivers/ieee1394/ieee1394_core.c +++ b/drivers/ieee1394/ieee1394_core.c @@ -859,12 +859,9 @@ static void fill_async_lock_resp(struct hpsb_packet *packet, int rcode, int extc packet-data_size = length; } -#define PREP_REPLY_PACKET(length) \ - packet = create_reply_packet(host, data, length); \ - if (packet == NULL) break - static void handle_incoming_packet(struct hpsb_host *host, int tcode, - quadlet_t *data, size_t size, int write_acked) + quadlet_t *data, size_t size, + int write_acked) { struct hpsb_packet *packet; int length, rcode, extcode; @@ -874,74 +871,72 @@ static void handle_incoming_packet(struct hpsb_host *host, int tcode, u16 flags = (u16) data[0]; u64 addr; - /* big FIXME - no error checking is done for an out of bounds length */ + /* FIXME? +* Out-of-bounds lengths are left for highlevel_read|write to cap. */ switch (tcode) { case TCODE_WRITEQ: addr = (((u64)(data[1] 0x)) 32) | data[2]; - rcode = highlevel_write(host, source, dest, data+3, + rcode = highlevel_write(host, source, dest, data + 3, addr, 4, flags); - - if (!write_acked -(NODEID_TO_NODE(data[0] 16) != NODE_MASK) -(rcode = 0)) { - /* not a broadcast write, reply */ - PREP_REPLY_PACKET(0); - fill_async_write_resp(packet, rcode); - send_packet_nocare(packet); - } - break; + goto handle_write_request; case TCODE_WRITEB: addr = (((u64)(data[1] 0x)) 32) | data[2]; - rcode = highlevel_write(host, source, dest, data+4, - addr, data[3]16, flags); - - if (!write_acked -(NODEID_TO_NODE(data[0] 16) != NODE_MASK) -(rcode = 0)) { - /* not a broadcast write, reply */ - PREP_REPLY_PACKET(0); + rcode = highlevel_write(host, source, dest, data + 4, + addr, data[3] 16, flags); +handle_write_request: + if (rcode 0 || write_acked || + NODEID_TO_NODE(data[0] 16) == NODE_MASK) + return; + /* not a broadcast write, reply */ + packet = create_reply_packet(host, data, 0); + if (packet) { fill_async_write_resp(packet, rcode); send_packet_nocare(packet); } - break; + return; case TCODE_READQ: addr = (((u64)(data[1] 0x)) 32) | data[2]; rcode = highlevel_read(host, source, buffer, addr, 4, flags); + if (rcode 0) + return; - if (rcode = 0) { - PREP_REPLY_PACKET(0); + packet = create_reply_packet(host, data, 0); + if (packet) { fill_async_readquad_resp(packet, rcode, buffer); send_packet_nocare(packet); } - break; + return; case TCODE_READB: length = data[3] 16; - PREP_REPLY_PACKET(length); + packet = create_reply_packet(host, data, length); + if (!packet) + return; addr = (((u64)(data[1] 0x)) 32) | data[2]; rcode = highlevel_read(host, source, packet-data, addr,
USB HID: encapsulate quirk handling into hid-quirks.c
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2eb5dc30eb87aa30f67e3dff39d5c9f3fb643260 Commit: 2eb5dc30eb87aa30f67e3dff39d5c9f3fb643260 Parent: 4d5a1be98d8d40a7c558005d423b3daed8ba1ddb Author: Paul Walmsley [EMAIL PROTECTED] AuthorDate: Thu Apr 19 13:27:04 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Thu Apr 19 13:27:04 2007 +0200 USB HID: encapsulate quirk handling into hid-quirks.c Move the USB_VENDOR* and USB_DEVICE* defines and the hid_blacklist[] array there from hid-core.c. Add hid-quirks.c:usbhid_lookup_any_quirks() to return quirk information to hid-core.c. Convert __u32, __u16 types to u32, u16. Signed-off-by: Paul Walmsley [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/Makefile |2 +- drivers/hid/usbhid/hid-core.c | 448 + drivers/hid/usbhid/hid-quirks.c | 483 +++ include/linux/hid.h |2 + 4 files changed, 489 insertions(+), 446 deletions(-) diff --git a/drivers/hid/usbhid/Makefile b/drivers/hid/usbhid/Makefile index de9bc1f..8e6ab5b 100644 --- a/drivers/hid/usbhid/Makefile +++ b/drivers/hid/usbhid/Makefile @@ -3,7 +3,7 @@ # # Multipart objects. -usbhid-objs:= hid-core.o +usbhid-objs:= hid-core.o hid-quirks.o # Optional parts of multipart objects. diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index ac2493f..bf118c0 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -53,437 +53,6 @@ static unsigned int hid_mousepoll_interval; module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); MODULE_PARM_DESC(mousepoll, Polling interval of mice); -#define USB_VENDOR_ID_A4TECH 0x09da -#define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006 - -#define USB_VENDOR_ID_AASHIMA 0x06d6 -#define USB_DEVICE_ID_AASHIMA_GAMEPAD 0x0025 -#define USB_DEVICE_ID_AASHIMA_PREDATOR 0x0026 - -#define USB_VENDOR_ID_ACECAD 0x0460 -#define USB_DEVICE_ID_ACECAD_FLAIR 0x0004 -#define USB_DEVICE_ID_ACECAD_302 0x0008 - -#define USB_VENDOR_ID_AIPTEK 0x08ca -#define USB_DEVICE_ID_AIPTEK_010x0001 -#define USB_DEVICE_ID_AIPTEK_100x0010 -#define USB_DEVICE_ID_AIPTEK_200x0020 -#define USB_DEVICE_ID_AIPTEK_210x0021 -#define USB_DEVICE_ID_AIPTEK_220x0022 -#define USB_DEVICE_ID_AIPTEK_230x0023 -#define USB_DEVICE_ID_AIPTEK_240x0024 - -#define USB_VENDOR_ID_AIRCABLE 0x16CA -#define USB_DEVICE_ID_AIRCABLE10x1502 - -#define USB_VENDOR_ID_ALCOR0x058f -#define USB_DEVICE_ID_ALCOR_USBRS232 0x9720 - -#define USB_VENDOR_ID_ALPS 0x0433 -#define USB_DEVICE_ID_IBM_GAMEPAD 0x1101 - -#define USB_VENDOR_ID_APPLE0x05ac -#define USB_DEVICE_ID_APPLE_MIGHTYMOUSE0x0304 -#define USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI 0x020e -#define USB_DEVICE_ID_APPLE_FOUNTAIN_ISO 0x020f -#define USB_DEVICE_ID_APPLE_GEYSER_ANSI0x0214 -#define USB_DEVICE_ID_APPLE_GEYSER_ISO 0x0215 -#define USB_DEVICE_ID_APPLE_GEYSER_JIS 0x0216 -#define USB_DEVICE_ID_APPLE_GEYSER3_ANSI 0x0217 -#define USB_DEVICE_ID_APPLE_GEYSER3_ISO0x0218 -#define USB_DEVICE_ID_APPLE_GEYSER3_JIS0x0219 -#define USB_DEVICE_ID_APPLE_GEYSER4_ANSI 0x021a -#define USB_DEVICE_ID_APPLE_GEYSER4_ISO0x021b -#define USB_DEVICE_ID_APPLE_GEYSER4_JIS0x021c -#define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a -#define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY0x030b -#define USB_DEVICE_ID_APPLE_IR 0x8240 - -#define USB_VENDOR_ID_ATEN 0x0557 -#define USB_DEVICE_ID_ATEN_UC100KM 0x2004 -#define USB_DEVICE_ID_ATEN_CS124U 0x2202 -#define USB_DEVICE_ID_ATEN_2PORTKVM0x2204 -#define USB_DEVICE_ID_ATEN_4PORTKVM0x2205 -#define USB_DEVICE_ID_ATEN_4PORTKVMC 0x2208 - -#define USB_VENDOR_ID_BELKIN 0x050d -#define USB_DEVICE_ID_FLIP_KVM 0x3201 - -#define USB_VENDOR_ID_BERKSHIRE0x0c98 -#define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140 - -#define USB_VENDOR_ID_CHERRY 0x046a -#define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 - -#define USB_VENDOR_ID_CHIC 0x05fe -#define USB_DEVICE_ID_CHIC_GAMEPAD 0x0014 - -#define USB_VENDOR_ID_CIDC 0x1677 - -#define USB_VENDOR_ID_CODEMERCS0x07c0 -#define USB_DEVICE_ID_CODEMERCS_IOW_FIRST 0x1500 -#define USB_DEVICE_ID_CODEMERCS_IOW_LAST 0x15ff - -#define USB_VENDOR_ID_CYPRESS 0x04b4 -#define USB_DEVICE_ID_CYPRESS_MOUSE0x0001 -#define USB_DEVICE_ID_CYPRESS_HIDCOM 0x5500 -#define USB_DEVICE_ID_CYPRESS_ULTRAMOUSE 0x7417 - -#define USB_VENDOR_ID_DELL 0x413c -#define USB_DEVICE_ID_DELL_W7658 0x2005 - -#define
USB HID: add 'quirks' module parameter
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=876b9276b993723f7a74d55b3b49b9186f05d09d Commit: 876b9276b993723f7a74d55b3b49b9186f05d09d Parent: 8cef908235bcac898a4f4ccc50c781e08022a579 Author: Paul Walmsley [EMAIL PROTECTED] AuthorDate: Thu Apr 19 14:56:12 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Thu Apr 19 14:56:12 2007 +0200 USB HID: add 'quirks' module parameter Add a 'quirks' module parameter for the usbhid module, so users can add or modify quirks at module load time. Signed-off-by: Paul Walmsley [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-core.c | 13 + drivers/hid/usbhid/hid-quirks.c | 38 ++ include/linux/hid.h |8 3 files changed, 59 insertions(+), 0 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index bf118c0..91d6103 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -53,6 +53,13 @@ static unsigned int hid_mousepoll_interval; module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); MODULE_PARM_DESC(mousepoll, Polling interval of mice); +/* Quirks specified at module load time */ +static char *quirks_param[MAX_USBHID_BOOT_QUIRKS] = { [ 0 ... (MAX_USBHID_BOOT_QUIRKS - 1) ] = NULL }; +module_param_array_named(quirks, quirks_param, charp, NULL, 0444); +MODULE_PARM_DESC(quirks, Add/modify USB HID quirks by specifying +quirks=vendorID:productID:quirks +where vendorID, productID, and quirks are all in +0x-prefixed hex); /* * Input submission and I/O error handler. */ @@ -1072,6 +1079,9 @@ static struct usb_driver hid_driver = { static int __init hid_init(void) { int retval; + retval = usbhid_quirks_init(quirks_param); + if (retval) + goto usbhid_quirks_init_fail; retval = hiddev_init(); if (retval) goto hiddev_init_fail; @@ -1084,6 +1094,8 @@ static int __init hid_init(void) usb_register_fail: hiddev_exit(); hiddev_init_fail: + usbhid_quirks_exit(); +usbhid_quirks_init_fail: return retval; } @@ -1091,6 +1103,7 @@ static void __exit hid_exit(void) { usb_deregister(hid_driver); hiddev_exit(); + usbhid_quirks_exit(); } module_init(hid_init); diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index a5fc8b5..27188bd 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c @@ -576,6 +576,44 @@ static void usbhid_remove_all_dquirks(void) } +/** + * usbhid_quirks_init: apply USB HID quirks specified at module load time + */ +int usbhid_quirks_init(char **quirks_param) +{ + u16 idVendor, idProduct; + u32 quirks; + int n = 0, m; + + for (; quirks_param[n] n MAX_USBHID_BOOT_QUIRKS; n++) { + + m = sscanf(quirks_param[n], 0x%hx:0x%hx:0x%x, + idVendor, idProduct, quirks); + + if (m != 3 || + usbhid_modify_dquirk(idVendor, idProduct, quirks) != 0) { + printk(KERN_WARNING + Could not parse HID quirk module param %s\n, + quirks_param[n]); + } + } + + return 0; +} + +/** + * usbhid_quirks_exit: release memory associated with dynamic_quirks + * + * Description: + * Release all memory associated with dynamic quirks. Called upon + * module unload. + * + * Returns: nothing + */ +void usbhid_quirks_exit(void) +{ + usbhid_remove_all_dquirks(); +} /** * usbhid_exists_squirk: return any static quirks for a USB HID device diff --git a/include/linux/hid.h b/include/linux/hid.h index 4ba456d..37076b1 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -247,6 +247,11 @@ struct hid_item { * HID device quirks. */ +/* + * Increase this if you need to configure more HID quirks at module load time + */ +#define MAX_USBHID_BOOT_QUIRKS 4 + #define HID_QUIRK_INVERT 0x0001 #define HID_QUIRK_NOTOUCH 0x0002 #define HID_QUIRK_IGNORE 0x0004 @@ -495,8 +500,11 @@ void hid_output_report(struct hid_report *report, __u8 *data); void hid_free_device(struct hid_device *device); struct hid_device *hid_parse_report(__u8 *start, unsigned size); +/* HID quirks API */ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks); +int usbhid_quirks_init(char **quirks_param); +void usbhid_quirks_exit(void); #ifdef CONFIG_HID_FF int hid_ff_init(struct hid_device *hid); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body
USB HID: fix retry reset logic
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e2a55f25d255a356bdaf2cb04c71b8d76c307a8 Commit: 5e2a55f25d255a356bdaf2cb04c71b8d76c307a8 Parent: 48b4554aca28f721d3dfbab077c05032b3d1cd31 Author: Alan Stern [EMAIL PROTECTED] AuthorDate: Tue Mar 20 19:03:31 2007 +0100 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 11 10:36:02 2007 +0200 USB HID: fix retry reset logic The USB HID driver fails to reset its error-retry timeout when there has been a long time interval between I/O errors with no successful URB completions in the meantime. As a result, the very next error would trigger an immediate reset, even if it was a chance event occurring long after the previous error. More USB keyboards and mice than one might expect end up getting I/O errors. Almost always this results from hardware problems of one sort of another. For example, people attach the device to a USB extension cable, which degrades the signal. Or they simply have poor quality cables to begin with. Or they use a KVM switch which doesn't handle USB messages correctly. Etc... There have been reports from several users in which these I/O errors would occur more or less randomly, at intervals ranging from seconds to minutes. The error-handling code in hid-core.c was originally meant for situations where a single outage would persist for a few hundred ms (electromagnetic interference, for example). It didn't work right when these more sporadic errors occurred, because of a flaw in the logic which this patch fixes. This patch (as873) fixes that oversight. Signed-off-by: Alan Stern [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-core.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 7c0fc11..35a41e6 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -554,6 +554,11 @@ static void hid_io_error(struct hid_device *hid) if (usb_get_intfdata(usbhid-intf) == NULL) goto done; + /* If it has been a while since the last error, we'll assume +* this a brand new error and reset the retry timeout. */ + if (time_after(jiffies, usbhid-stop_retry + HZ/2)) + usbhid-retry_delay = 0; + /* When an error occurs, retry at increasing intervals */ if (usbhid-retry_delay == 0) { usbhid-retry_delay = 13; /* Then 26, 52, 104, 104, ... */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB HID: add support for WiseGroup MP-8800 Quad Joypad
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=42cfb632f0210caa7d979666058075b06fc4680c Commit: 42cfb632f0210caa7d979666058075b06fc4680c Parent: 320c01500c6ecb189c577b921a2357c7a56aaebc Author: Sam Liddicott [EMAIL PROTECTED] AuthorDate: Tue Apr 10 15:50:45 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 11 10:36:04 2007 +0200 USB HID: add support for WiseGroup MP-8800 Quad Joypad This adds support for WiseGroup Quad Joypad (0x0925/0x8800). The same quirks as for Dual Joypad (0x0925/0x8866) are needed. Signed-off-by: Sam Liddicott [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-core.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index cec3bff..82fcb91 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -280,7 +280,8 @@ MODULE_PARM_DESC(mousepoll, Polling interval of mice); #define USB_DEVICE_ID_1_PHIDGETSERVO_200x8101 #define USB_DEVICE_ID_4_PHIDGETSERVO_200x8104 #define USB_DEVICE_ID_8_8_4_IF_KIT 0x8201 -#define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866 +#define USB_DEVICE_ID_QUAD_USB_JOYPAD 0x8800 +#define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866 #define USB_VENDOR_ID_WISEGROUP_LTD0x6677 #define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802 @@ -456,6 +457,8 @@ static const struct hid_blacklist { { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, + { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, + { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB HID: specify explicit size for hid_blacklist.quirks
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4cbe7d28f2c63e801d651b3b56f953a5ff5ae70f Commit: 4cbe7d28f2c63e801d651b3b56f953a5ff5ae70f Parent: 5e2a55f25d255a356bdaf2cb04c71b8d76c307a8 Author: Paul Walmsley [EMAIL PROTECTED] AuthorDate: Tue Mar 20 19:23:16 2007 +0100 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 11 10:36:02 2007 +0200 USB HID: specify explicit size for hid_blacklist.quirks Explicitly specify the size of the hid_blacklist quirks member, to guard against surprises on architectures where unsigned ints aren't 32 bits long. Signed-off-by: Paul Walmsley [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-core.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 35a41e6..5e43081 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -287,7 +287,7 @@ MODULE_PARM_DESC(mousepoll, Polling interval of mice); static const struct hid_blacklist { __u16 idVendor; __u16 idProduct; - unsigned quirks; + __u32 quirks; } hid_blacklist[] = { { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, @@ -1063,7 +1063,8 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) struct usb_device *dev = interface_to_usbdev (intf); struct hid_descriptor *hdesc; struct hid_device *hid; - unsigned quirks = 0, rsize = 0; + __u32 quirks = 0; + unsigned rsize = 0; char *rdesc; int n, len, insize = 0; struct usbhid_device *usbhid; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
HID: enable dead keys on a belkin wireless keyboard
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=daa0bc902c8e9476673b47d3b59c9bb922843563 Commit: daa0bc902c8e9476673b47d3b59c9bb922843563 Parent: 38d4b89e274c7eed99fcf6c3f8686f70edd6ab7c Author: Chris Clayton [EMAIL PROTECTED] AuthorDate: Sun Apr 1 23:07:55 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 11 10:36:02 2007 +0200 HID: enable dead keys on a belkin wireless keyboard Belkin Wireless keyboard, model number F8E849KYBD, USB ID 1020:0006, FCCID: K7SF8E849KYBD emits usages 0x03a-0x03c from Consumer usage page. As of HUT v1.12, these are marked as reserved. If any conflict arises later, the mapping could be made conditional on VID/PID. Signed-off-by: Chris Clayton [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/hid-input.c |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index c843402..220e5a8 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -431,6 +431,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x000: goto ignore; case 0x034: map_key_clear(KEY_SLEEP); break; case 0x036: map_key_clear(BTN_MISC); break; + /* +* The next three are reported by Belkin wireless +* keyboard (1020:0006). These values are reserved +* in HUT 1.12. +*/ + case 0x03a: map_key_clear(KEY_SOUND); break; + case 0x03b: map_key_clear(KEY_CAMERA); break; + case 0x03c: map_key_clear(KEY_DOCUMENTS); break; + case 0x040: map_key_clear(KEY_MENU); break; case 0x045: map_key_clear(KEY_RADIO); break; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB HID: add QUIRK_HIDDEV for Belkin Flip KVM
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=66df514b1dbf51a0a02a8abe1219e46e49710aea Commit: 66df514b1dbf51a0a02a8abe1219e46e49710aea Parent: daa0bc902c8e9476673b47d3b59c9bb922843563 Author: Daniel P. Engel [EMAIL PROTECTED] AuthorDate: Tue Apr 3 23:43:46 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 11 10:36:03 2007 +0200 USB HID: add QUIRK_HIDDEV for Belkin Flip KVM Add HID_QUIRK_HIDDEV for the Belkin Flip USB KVM, which provides for software control of switching via a HID class interface. It overloads three HID LED usages, two of which aren't mapped in the ev_dev input subsection, and which it doesn't make sense to map. In order to force the creation of a hiddev device for controlling the Flip, this quirk flag is needed. Signed-off-by: Daniel P. Engel [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-core.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 5e43081..823e3df 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -106,6 +106,9 @@ MODULE_PARM_DESC(mousepoll, Polling interval of mice); #define USB_DEVICE_ID_ATEN_4PORTKVM0x2205 #define USB_DEVICE_ID_ATEN_4PORTKVMC 0x2208 +#define USB_VENDOR_ID_BELKIN 0x050d +#define USB_DEVICE_ID_FLIP_KVM 0x3201 + #define USB_VENDOR_ID_BERKSHIRE0x0c98 #define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140 @@ -310,6 +313,8 @@ static const struct hid_blacklist { { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_EDGE, HID_QUIRK_DUPLICATE_USAGES }, + { USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM, HID_QUIRK_HIDDEV }, + { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_01, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_10, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_20, HID_QUIRK_IGNORE }, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: nodemgr: unify some error messages
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9be51c5d789a4864a820662460b8896b12a34c9d Commit: 9be51c5d789a4864a820662460b8896b12a34c9d Parent: 9324547235f63b7ebc905feb606291fce5d85ef5 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Fri Mar 30 19:21:05 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:30 2007 +0200 ieee1394: nodemgr: unify some error messages Shrinks object file size a little bit. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/nodemgr.c | 13 + 1 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index 9e24045..6a1a057 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -581,7 +581,7 @@ static void nodemgr_create_drv_files(struct hpsb_protocol_driver *driver) goto fail; return; fail: - HPSB_ERR(Failed to add sysfs attribute for driver %s, driver-name); + HPSB_ERR(Failed to add sysfs attribute); } @@ -605,8 +605,7 @@ static void nodemgr_create_ne_dev_files(struct node_entry *ne) goto fail; return; fail: - HPSB_ERR(Failed to add sysfs attribute for node %016Lx, -(unsigned long long)ne-guid); + HPSB_ERR(Failed to add sysfs attribute); } @@ -620,7 +619,7 @@ static void nodemgr_create_host_dev_files(struct hpsb_host *host) goto fail; return; fail: - HPSB_ERR(Failed to add sysfs attribute for host %d, host-id); + HPSB_ERR(Failed to add sysfs attribute); } @@ -680,8 +679,7 @@ static void nodemgr_create_ud_dev_files(struct unit_directory *ud) } return; fail: - HPSB_ERR(Failed to add sysfs attributes for unit %s, -ud-device.bus_id); + HPSB_ERR(Failed to add sysfs attribute); } @@ -1150,8 +1148,7 @@ static void nodemgr_process_root_directory(struct host_info *hi, struct node_ent dev_attr_ne_vendor_name_kv); if (error error != -EEXIST) - HPSB_ERR(Failed to add sysfs attribute for node -%016Lx, (unsigned long long)ne-guid); + HPSB_ERR(Failed to add sysfs attribute); } } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB HID: extend quirk for Logitech S510 keyboard
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bf892e60d0b32989bc55ef64cd6557a49806f0cf Commit: bf892e60d0b32989bc55ef64cd6557a49806f0cf Parent: 5d6341c606b9eb62fbaa7b2a0da82ac851bf0fc4 Author: Jiri Kosina [EMAIL PROTECTED] AuthorDate: Wed Apr 4 10:56:12 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 11 10:36:03 2007 +0200 USB HID: extend quirk for Logitech S510 keyboard Logitech S510 keyboard is shipped with USB receivers with various product ids, all need their report descriptor to be fixed. This adds PID 0xc50c. Reported by Christophe Colombier in kernel.org bugzilla #7352 Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-core.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 823e3df..c94516c 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -226,7 +226,8 @@ MODULE_PARM_DESC(mousepoll, Polling interval of mice); #define USB_VENDOR_ID_LOGITECH 0x046d #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER0xc101 -#define USB_DEVICE_ID_LOGITECH_USB_RECEIVER_2 0xc517 +#define USB_DEVICE_ID_S510_USB_RECEIVER0xc50c +#define USB_DEVICE_ID_S510_USB_RECEIVER_2 0xc517 #define USB_DEVICE_ID_DINOVO_EDGE 0xc714 #define USB_VENDOR_ID_MCC 0x09db @@ -433,7 +434,8 @@ static const struct hid_blacklist { { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_FLAIR, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_302, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_USB_RECEIVER_2, HID_QUIRK_LOGITECH_S510_DESCRIPTOR }, + { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_USB_RECEIVER, HID_QUIRK_LOGITECH_S510_DESCRIPTOR }, + { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_USB_RECEIVER_2, HID_QUIRK_LOGITECH_S510_DESCRIPTOR }, { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
USB HID: numlock quirk for dell W7658 keyboard
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=713c8aad6b7202671ce1ac6109f6b48d8223e938 Commit: 713c8aad6b7202671ce1ac6109f6b48d8223e938 Parent: 85cbea3952135ecad4b47cb6cc57e25279129e2d Author: Pete Zaitcev [EMAIL PROTECTED] AuthorDate: Fri Apr 6 14:33:18 2007 +0200 Committer: Jiri Kosina [EMAIL PROTECTED] CommitDate: Wed Apr 11 10:36:03 2007 +0200 USB HID: numlock quirk for dell W7658 keyboard On Dell W7658 keyboard, when BIOS sets NumLock LED on, it survives the takeover by kernel and thus confuses users. Eating of an increasibly scarce quirk bit is unfortunate. We do it for safety, given the history of nervous input devices which crash if anything unusual happens. Signed-off-by: Pete Zaitcev [EMAIL PROTECTED] Signed-off-by: Jiri Kosina [EMAIL PROTECTED] --- drivers/hid/usbhid/hid-core.c | 45 + include/linux/hid.h |1 + 2 files changed, 46 insertions(+), 0 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 762cb35..cec3bff 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -129,6 +129,9 @@ MODULE_PARM_DESC(mousepoll, Polling interval of mice); #define USB_DEVICE_ID_CYPRESS_HIDCOM 0x5500 #define USB_DEVICE_ID_CYPRESS_ULTRAMOUSE 0x7417 +#define USB_VENDOR_ID_DELL 0x413c +#define USB_DEVICE_ID_DELL_W7658 0x2005 + #define USB_VENDOR_ID_DELORME 0x1163 #define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100 #define USB_DEVICE_ID_DELORME_EM_LT20 0x0200 @@ -469,6 +472,8 @@ static const struct hid_blacklist { { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, + { USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_W7658, HID_QUIRK_RESET_LEDS }, + { 0, 0 } }; @@ -964,6 +969,44 @@ void usbhid_init_reports(struct hid_device *hid) } /* + * Reset LEDs which BIOS might have left on. For now, just NumLock (0x01). + */ +static int hid_find_field_early(struct hid_device *hid, unsigned int page, +unsigned int hid_code, struct hid_field **pfield) +{ + struct hid_report *report; + struct hid_field *field; + struct hid_usage *usage; + int i, j; + + list_for_each_entry(report, hid-report_enum[HID_OUTPUT_REPORT].report_list, list) { + for (i = 0; i report-maxfield; i++) { + field = report-field[i]; + for (j = 0; j field-maxusage; j++) { + usage = field-usage[j]; + if ((usage-hid HID_USAGE_PAGE) == page + (usage-hid 0x) == hid_code) { + *pfield = field; + return j; + } + } + } + } + return -1; +} + +static void usbhid_set_leds(struct hid_device *hid) +{ + struct hid_field *field; + int offset; + + if ((offset = hid_find_field_early(hid, HID_UP_LED, 0x01, field)) != -1) { + hid_set_field(field, offset, 0); + usbhid_submit_report(hid, field-report, USB_DIR_OUT); + } +} + +/* * Traverse the supplied list of reports and find the longest */ static void hid_find_max_report(struct hid_device *hid, unsigned int type, int *max) @@ -1348,6 +1391,8 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) usbhid_init_reports(hid); hid_dump_device(hid); + if (hid-quirks HID_QUIRK_RESET_LEDS) + usbhid_set_leds(hid); if (!hidinput_connect(hid)) hid-claimed |= HID_CLAIMED_INPUT; diff --git a/include/linux/hid.h b/include/linux/hid.h index 5518441..d73b24b 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -269,6 +269,7 @@ struct hid_item { #define HID_QUIRK_SONY_PS3_CONTROLLER 0x0008 #define HID_QUIRK_LOGITECH_DESCRIPTOR 0x0010 #define HID_QUIRK_DUPLICATE_USAGES 0x0020 +#define HID_QUIRK_RESET_LEDS 0x0040 /* * This is the global environment of the parser. This information is - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: nodemgr: less noise in dmesg
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9324547235f63b7ebc905feb606291fce5d85ef5 Commit: 9324547235f63b7ebc905feb606291fce5d85ef5 Parent: d4c60085a97549ad3bb648e0652b9b48b7e42fa8 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Fri Mar 30 19:19:55 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:29 2007 +0200 ieee1394: nodemgr: less noise in dmesg Everytime when eth1394 or a libraw1394 client updates the configuration ROM, a certain sysfs attribute cannot be added since it already exists. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/nodemgr.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c index ddd7aac..9e24045 100644 --- a/drivers/ieee1394/nodemgr.c +++ b/drivers/ieee1394/nodemgr.c @@ -1145,13 +1145,14 @@ static void nodemgr_process_root_directory(struct host_info *hi, struct node_ent last_key_id = kv-key.id; } - if (ne-vendor_name_kv - device_create_file(ne-device, dev_attr_ne_vendor_name_kv)) - goto fail; - return; -fail: - HPSB_ERR(Failed to add sysfs attribute for node %016Lx, -(unsigned long long)ne-guid); + if (ne-vendor_name_kv) { + int error = device_create_file(ne-device, + dev_attr_ne_vendor_name_kv); + + if (error error != -EEXIST) + HPSB_ERR(Failed to add sysfs attribute for node +%016Lx, (unsigned long long)ne-guid); + } } #ifdef CONFIG_HOTPLUG - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: SPIN_LOCK_UNLOCKED cleanup
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=df18ce85de3deeaf311f96eb3d47e45fc7050f87 Commit: df18ce85de3deeaf311f96eb3d47e45fc7050f87 Parent: 9be51c5d789a4864a820662460b8896b12a34c9d Author: Milind Arun Choudhary [EMAIL PROTECTED] AuthorDate: Wed Apr 11 23:24:34 2007 +0530 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:30 2007 +0200 ieee1394: SPIN_LOCK_UNLOCKED cleanup SPIN_LOCK_UNLOCKED cleanup,use DEFINE_SPINLOCK instead Signed-off-by: Milind Arun Choudhary [EMAIL PROTECTED] Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/ieee1394_transactions.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/ieee1394/ieee1394_transactions.c b/drivers/ieee1394/ieee1394_transactions.c index 0272dac..f144133 100644 --- a/drivers/ieee1394/ieee1394_transactions.c +++ b/drivers/ieee1394/ieee1394_transactions.c @@ -37,7 +37,7 @@ #ifndef HPSB_DEBUG_TLABELS static #endif -spinlock_t hpsb_tlabel_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(hpsb_tlabel_lock); static DECLARE_WAIT_QUEUE_HEAD(tlabel_wq); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: unregister address space in failure case
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=157188cb54b22e5c0c6439ef0500ba97b068097a Commit: 157188cb54b22e5c0c6439ef0500ba97b068097a Parent: ea9057ad622db41745be416e29c5760d141a6514 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Sat Feb 10 23:56:38 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:30 2007 +0200 ieee1394: eth1394: unregister address space in failure case Warn if hpsb_allocate_and_register_addrspace() failed. Unregister the address space if something else failed. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c | 13 ++--- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index a364003..e2b84c9 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -568,8 +568,10 @@ static void ether1394_add_host (struct hpsb_host *host) eth1394_highlevel, host, addr_ops, ETHER1394_REGION_ADDR_LEN, ETHER1394_REGION_ADDR_LEN, CSR1212_INVALID_ADDR_SPACE, CSR1212_INVALID_ADDR_SPACE); - if (fifo_addr == CSR1212_INVALID_ADDR_SPACE) - goto out; + if (fifo_addr == CSR1212_INVALID_ADDR_SPACE) { + ETH1394_PRINT_G(KERN_ERR, Cannot register CSR space\n); + return; + } /* We should really have our own alloc_hpsbdev() function in * net_init.c instead of calling the one for ethernet then hijacking @@ -640,16 +642,13 @@ static void ether1394_add_host (struct hpsb_host *host) else priv-bc_state = ETHER1394_BC_RUNNING; } - return; - out: - if (dev != NULL) + if (dev) free_netdev(dev); if (hi) hpsb_destroy_hostinfo(eth1394_highlevel, host); - - return; + hpsb_unregister_addrspace(eth1394_highlevel, host, fifo_addr); } /* Remove a card from our list */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: clean up host removal
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2cd556ae61c862f4d00bb63863c6e5c67fd55bd4 Commit: 2cd556ae61c862f4d00bb63863c6e5c67fd55bd4 Parent: 157188cb54b22e5c0c6439ef0500ba97b068097a Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Sat Feb 10 23:57:57 2007 +0100 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:30 2007 +0200 ieee1394: eth1394: clean up host removal ether1394_add_host() guarantees that hi-dev != NULL if hi != NULL. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c | 27 ++- 1 files changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index e2b84c9..63fca14 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -655,24 +655,17 @@ out: static void ether1394_remove_host (struct hpsb_host *host) { struct eth1394_host_info *hi; + struct eth1394_priv *priv; hi = hpsb_get_hostinfo(eth1394_highlevel, host); - if (hi != NULL) { - struct eth1394_priv *priv = netdev_priv(hi-dev); - - hpsb_unregister_addrspace(eth1394_highlevel, host, - priv-local_fifo); - - if (priv-iso != NULL) - hpsb_iso_shutdown(priv-iso); - - if (hi-dev) { - unregister_netdev (hi-dev); - free_netdev(hi-dev); - } - } - - return; + if (!hi) + return; + priv = netdev_priv(hi-dev); + hpsb_unregister_addrspace(eth1394_highlevel, host, priv-local_fifo); + if (priv-iso) + hpsb_iso_shutdown(priv-iso); + unregister_netdev(hi-dev); + free_netdev(hi-dev); } /* A reset has just arisen */ @@ -689,7 +682,7 @@ static void ether1394_host_reset (struct hpsb_host *host) hi = hpsb_get_hostinfo(eth1394_highlevel, host); /* This can happen for hosts that we don't use */ - if (hi == NULL) + if (!hi) return; dev = hi-dev; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: contain host reset
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=246a5fdade88cbeba09d07c69f67444a24a57d79 Commit: 246a5fdade88cbeba09d07c69f67444a24a57d79 Parent: 5009d269610b4c89761dcae296d9717f2f48234b Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:16:40 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:31 2007 +0200 ieee1394: eth1394: contain host reset Call only eth1394's own host reset handler from .tx_timeout, not the reset hooks of all other IEEE 1394 drivers. A minor drawback of this patch is that ether1394_host_reset by timeout is not serialized against ether1394_host_reset by bus reset. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 049f095..8f19f5b 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -258,10 +258,8 @@ static void ether1394_tx_timeout(struct net_device *dev) struct hpsb_host *host = ((struct eth1394_priv *)netdev_priv(dev))-host; - ETH1394_PRINT(KERN_ERR, dev-name, Timeout, resetting host %s\n, - host-driver-name); - highlevel_host_reset(host); - netif_wake_queue(dev); + ETH1394_PRINT(KERN_ERR, dev-name, Timeout, resetting host\n); + ether1394_host_reset(host); } static int ether1394_change_mtu(struct net_device *dev, int new_mtu) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: unexport highlevel_host_reset
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f982e5ffcfa9d0a2480d0b8261bd11521f3a1994 Commit: f982e5ffcfa9d0a2480d0b8261bd11521f3a1994 Parent: 246a5fdade88cbeba09d07c69f67444a24a57d79 Author: Adrian Bunk [EMAIL PROTECTED] AuthorDate: Fri Apr 27 01:47:32 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:31 2007 +0200 ieee1394: unexport highlevel_host_reset highlevel_host_reset no longer has any modular users. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/ieee1394_core.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c index b368958..8f71b6a 100644 --- a/drivers/ieee1394/ieee1394_core.c +++ b/drivers/ieee1394/ieee1394_core.c @@ -1335,7 +1335,6 @@ EXPORT_SYMBOL(hpsb_destroy_hostinfo); EXPORT_SYMBOL(hpsb_set_hostinfo_key); EXPORT_SYMBOL(hpsb_get_hostinfo_bykey); EXPORT_SYMBOL(hpsb_set_hostinfo); -EXPORT_SYMBOL(highlevel_host_reset); /** nodemgr.c **/ EXPORT_SYMBOL(hpsb_node_fill_packet); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: allow MTU bigger than 1500
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=17bab407d54ba1320d71a45641ecffc33bd331c1 Commit: 17bab407d54ba1320d71a45641ecffc33bd331c1 Parent: f982e5ffcfa9d0a2480d0b8261bd11521f3a1994 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Tue Apr 3 23:55:40 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:31 2007 +0200 ieee1394: eth1394: allow MTU bigger than 1500 RFC 2734 says: IP-capable nodes may operate with an MTU size larger than the default [1500 octets], but the means by which a larger MTU is configured are beyond the scope of this document. Allow users to set an MTU bigger than 1500. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c | 34 +++--- 1 files changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 8f19f5b..aee8292 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -136,9 +136,6 @@ static const int hdr_type_len[] = { sizeof(struct eth1394_sf_hdr) }; -/* For now, this needs to be 1500, so that XP works with us */ -#define ETH1394_DATA_LEN ETH_DATA_LEN - static const u16 eth1394_speedto_maxpayload[] = { /* S100, S200, S400, S800, S1600, S3200 */ 512, 1024, 2048, 4096, 4096, 4096 @@ -262,17 +259,27 @@ static void ether1394_tx_timeout(struct net_device *dev) ether1394_host_reset(host); } +static inline int ether1394_max_mtu(struct hpsb_host* host) +{ + return (1 (host-csr.max_rec + 1)) + - sizeof(union eth1394_hdr) - ETHER1394_GASP_OVERHEAD; +} + static int ether1394_change_mtu(struct net_device *dev, int new_mtu) { - int max_rec = - ((struct eth1394_priv *)netdev_priv(dev))-host-csr.max_rec; + int max_mtu; - if (new_mtu 68 || - new_mtu ETH1394_DATA_LEN || - new_mtu (1 (max_rec + 1)) - sizeof(union eth1394_hdr) - - ETHER1394_GASP_OVERHEAD) + if (new_mtu 68) return -EINVAL; + max_mtu = ether1394_max_mtu( + ((struct eth1394_priv *)netdev_priv(dev))-host); + if (new_mtu max_mtu) { + ETH1394_PRINT(KERN_INFO, dev-name, + Local node constrains MTU to %d\n, max_mtu); + return -ERANGE; + } + dev-mtu = new_mtu; return 0; } @@ -476,13 +483,10 @@ static void ether1394_reset_priv(struct net_device *dev, int set_mtu) max_speed = host-speed[i]; priv-bc_sspd = max_speed; - /* We'll use our maximum payload as the default MTU */ if (set_mtu) { - int max_payload = 1 (host-csr.max_rec + 1); - - dev-mtu = min(ETH1394_DATA_LEN, - (int)(max_payload - sizeof(union eth1394_hdr) - -ETHER1394_GASP_OVERHEAD)); + /* Use the RFC 2734 default 1500 octets or the maximum payload +* as initial MTU */ + dev-mtu = min(1500, ether1394_max_mtu(host)); /* Set our hardware address while we're at it */ memcpy(dev-dev_addr, guid, sizeof(u64)); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: shorter error messages
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5009d269610b4c89761dcae296d9717f2f48234b Commit: 5009d269610b4c89761dcae296d9717f2f48234b Parent: 027611b84260cf3adf14e30d2480007795829e6e Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:15:53 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:31 2007 +0200 ieee1394: eth1394: shorter error messages Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c | 40 1 files changed, 16 insertions(+), 24 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 9521d8e..049f095 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -196,9 +196,8 @@ static struct hpsb_highlevel eth1394_highlevel = { .host_reset = ether1394_host_reset, }; -static int ether1394_recv_init(struct net_device *dev) +static int ether1394_recv_init(struct eth1394_priv *priv) { - struct eth1394_priv *priv = netdev_priv(dev); unsigned int iso_buf_size; /* FIXME: rawiso limits us to PAGE_SIZE */ @@ -212,9 +211,7 @@ static int ether1394_recv_init(struct net_device *dev) HPSB_ISO_DMA_PACKET_PER_BUFFER, 1, ether1394_iso); if (priv-iso == NULL) { - ETH1394_PRINT(KERN_ERR, dev-name, - Could not allocate isochronous receive - context for the broadcast channel\n); + ETH1394_PRINT_G(KERN_ERR, Failed to allocate IR context\n); priv-bc_state = ETHER1394_BC_ERROR; return -EAGAIN; } @@ -233,7 +230,7 @@ static int ether1394_open(struct net_device *dev) int ret; if (priv-bc_state == ETHER1394_BC_ERROR) { - ret = ether1394_recv_init(dev); + ret = ether1394_recv_init(priv); if (ret) return ret; } @@ -560,9 +557,7 @@ static void ether1394_add_host(struct hpsb_host *host) dev = alloc_etherdev(sizeof (struct eth1394_priv)); if (dev == NULL) { - ETH1394_PRINT_G (KERN_ERR, Out of memory trying to allocate -etherdevice for IEEE 1394 device %s-%d\n, -host-driver-name, host-id); + ETH1394_PRINT_G(KERN_ERR, Out of memory\n); goto out; } @@ -583,21 +578,19 @@ static void ether1394_add_host(struct hpsb_host *host) hi = hpsb_create_hostinfo(eth1394_highlevel, host, sizeof(*hi)); if (hi == NULL) { - ETH1394_PRINT_G (KERN_ERR, Out of memory trying to create -hostinfo for IEEE 1394 device %s-%d\n, -host-driver-name, host-id); + ETH1394_PRINT_G(KERN_ERR, Out of memory\n); goto out; } ether1394_init_dev(dev); - if (register_netdev (dev)) { - ETH1394_PRINT (KERN_ERR, dev-name, Error registering network driver\n); + if (register_netdev(dev)) { + ETH1394_PRINT_G(KERN_ERR, Cannot register the driver\n); goto out; } - ETH1394_PRINT (KERN_INFO, dev-name, IEEE-1394 IPv4 over 1394 Ethernet (fw-host%d)\n, - host-id); + ETH1394_PRINT(KERN_INFO, dev-name, IPv4 over IEEE 1394 (fw-host%d)\n, + host-id); hi-host = host; hi-dev = dev; @@ -606,7 +599,7 @@ static void ether1394_add_host(struct hpsb_host *host) * be checked when the eth device is opened. */ priv-broadcast_channel = host-csr.broadcast_channel 0x3f; - ether1394_recv_init(dev); + ether1394_recv_init(priv); return; out: if (dev) @@ -1084,7 +1077,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid, skb = dev_alloc_skb(len + dev-hard_header_len + 15); if (!skb) { - HPSB_PRINT (KERN_ERR, ether1394 rx: low on mem\n); + ETH1394_PRINT_G(KERN_ERR, Out of memory\n); priv-stats.rx_dropped++; return -1; } @@ -1239,8 +1232,8 @@ static int ether1394_write(struct hpsb_host *host, int srcid, int destid, hi = hpsb_get_hostinfo(eth1394_highlevel, host); if (hi == NULL) { - ETH1394_PRINT_G(KERN_ERR, Could not find net device for host %s\n, - host-driver-name); + ETH1394_PRINT_G(KERN_ERR, No net device at fw-host%d\n, + host-id); return RCODE_ADDRESS_ERROR; } @@ -1265,8 +1258,8 @@ static void ether1394_iso(struct hpsb_iso *iso) hi =
ieee1394: eth1394: CONFIG_INET is always defined
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=599bba9647f7813c09bf921c72351609430c8a33 Commit: 599bba9647f7813c09bf921c72351609430c8a33 Parent: 17bab407d54ba1320d71a45641ecffc33bd331c1 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:19:02 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:31 2007 +0200 ieee1394: eth1394: CONFIG_INET is always defined because CONFIG_IEEE1394_ETH1394 depends on it. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c | 16 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index aee8292..2d226a3 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -711,21 +711,13 @@ static int ether1394_header(struct sk_buff *skb, struct net_device *dev, static int ether1394_rebuild_header(struct sk_buff *skb) { struct eth1394hdr *eth = (struct eth1394hdr *)skb-data; - struct net_device *dev = skb-dev; - - switch (eth-h_proto) { -#ifdef CONFIG_INET - case __constant_htons(ETH_P_IP): + if (eth-h_proto == htons(ETH_P_IP)) return arp_find((unsigned char *)eth-h_dest, skb); -#endif - default: - ETH1394_PRINT(KERN_DEBUG, dev-name, - unable to resolve type %04x addresses.\n, - ntohs(eth-h_proto)); - break; - } + ETH1394_PRINT(KERN_DEBUG, skb-dev-name, + unable to resolve type %04x addresses\n, + ntohs(eth-h_proto)); return 0; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: omit useless set_mac_address callback
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8a62bf7978eaa428e400677d5e5f5441262f79b1 Commit: 8a62bf7978eaa428e400677d5e5f5441262f79b1 Parent: 599bba9647f7813c09bf921c72351609430c8a33 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:19:48 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:31 2007 +0200 ieee1394: eth1394: omit useless set_mac_address callback We can't reconfigure the MAC address, hence we don't need the callback. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c | 14 +- 1 files changed, 1 insertions(+), 13 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 2d226a3..fc6c7fd 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -167,8 +167,6 @@ static int ether1394_header_cache(struct neighbour *neigh, struct hh_cache *hh); static void ether1394_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsigned char *haddr); -static int ether1394_mac_addr(struct net_device *dev, void *p); - static int ether1394_tx(struct sk_buff *skb, struct net_device *dev); static void ether1394_iso(struct hpsb_iso *iso); @@ -512,7 +510,7 @@ static void ether1394_init_dev(struct net_device *dev) dev-hard_header_cache = ether1394_header_cache; dev-header_cache_update= ether1394_header_cache_update; dev-hard_header_parse = ether1394_header_parse; - dev-set_mac_address= ether1394_mac_addr; + dev-set_mac_address= NULL; SET_ETHTOOL_OPS(dev, ethtool_ops); /* Some constants */ @@ -754,16 +752,6 @@ static void ether1394_header_cache_update(struct hh_cache *hh, memcpy((u8 *)hh-hh_data + 16 - ETH1394_HLEN, haddr, dev-addr_len); } -static int ether1394_mac_addr(struct net_device *dev, void *p) -{ - if (netif_running(dev)) - return -EBUSY; - - /* Not going to allow setting the MAC address, we really need to use -* the real one supplied by the hardware */ -return -EINVAL; -} - /** * Datagram reception code **/ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: correct a memset argument
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=027611b84260cf3adf14e30d2480007795829e6e Commit: 027611b84260cf3adf14e30d2480007795829e6e Parent: d06c1ddad9055eef55456abbae795279d6b1bbcf Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:15:21 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:31 2007 +0200 ieee1394: eth1394: correct a memset argument The old argument calculated the correct value in a wrong way. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 66c4cca..9521d8e 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -472,7 +472,7 @@ static void ether1394_reset_priv(struct net_device *dev, int set_mtu) spin_lock_irqsave(priv-lock, flags); - memset(priv-ud_list, 0, sizeof(struct node_entry*) * ALL_NODES); + memset(priv-ud_list, 0, sizeof(priv-ud_list)); priv-bc_maxpayload = 512; /* Determine speed limit */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: refactor .probe and .update
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d06c1ddad9055eef55456abbae795279d6b1bbcf Commit: d06c1ddad9055eef55456abbae795279d6b1bbcf Parent: 5e7abccd38f7f2ce838eb49a657eea70b22f0803 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:14:45 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:31 2007 +0200 ieee1394: eth1394: refactor .probe and .update Move common code into an extra function. This implicitly adds a missing node_info-fifo = CSR1212_INVALID_ADDR_SPACE; to .update. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c | 48 ++- 1 files changed, 16 insertions(+), 32 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index e1fdfb5..66c4cca 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -340,20 +340,13 @@ static struct eth1394_node_ref *eth1394_find_node_nodeid(struct list_head *inl, return NULL; } -static int eth1394_probe(struct device *dev) +static int eth1394_new_node(struct eth1394_host_info *hi, + struct unit_directory *ud) { - struct unit_directory *ud; - struct eth1394_host_info *hi; struct eth1394_priv *priv; struct eth1394_node_ref *new_node; struct eth1394_node_info *node_info; - ud = container_of(dev, struct unit_directory, device); - - hi = hpsb_get_hostinfo(eth1394_highlevel, ud-ne-host); - if (!hi) - return -ENOENT; - new_node = kmalloc(sizeof(*new_node), GFP_KERNEL); if (!new_node) return -ENOMEM; @@ -374,10 +367,22 @@ static int eth1394_probe(struct device *dev) priv = netdev_priv(hi-dev); list_add_tail(new_node-list, priv-ip_node_list); - return 0; } +static int eth1394_probe(struct device *dev) +{ + struct unit_directory *ud; + struct eth1394_host_info *hi; + + ud = container_of(dev, struct unit_directory, device); + hi = hpsb_get_hostinfo(eth1394_highlevel, ud-ne-host); + if (!hi) + return -ENOENT; + + return eth1394_new_node(hi, ud); +} + static int eth1394_remove(struct device *dev) { struct unit_directory *ud; @@ -421,38 +426,17 @@ static int eth1394_update(struct unit_directory *ud) struct eth1394_host_info *hi; struct eth1394_priv *priv; struct eth1394_node_ref *node; - struct eth1394_node_info *node_info; hi = hpsb_get_hostinfo(eth1394_highlevel, ud-ne-host); if (!hi) return -ENOENT; priv = netdev_priv(hi-dev); - node = eth1394_find_node(priv-ip_node_list, ud); if (node) return 0; - node = kmalloc(sizeof(*node), GFP_KERNEL); - if (!node) - return -ENOMEM; - - node_info = kmalloc(sizeof(*node_info), GFP_KERNEL); - if (!node_info) { - kfree(node); - return -ENOMEM; - } - - spin_lock_init(node_info-pdg.lock); - INIT_LIST_HEAD(node_info-pdg.list); - node_info-pdg.sz = 0; - - ud-device.driver_data = node_info; - node-ud = ud; - - priv = netdev_priv(hi-dev); - list_add_tail(node-list, priv-ip_node_list); - return 0; + return eth1394_new_node(hi, ud); } static struct ieee1394_device_id eth1394_id_table[] = { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: .probe and .update may sleep
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e7abccd38f7f2ce838eb49a657eea70b22f0803 Commit: 5e7abccd38f7f2ce838eb49a657eea70b22f0803 Parent: efbeccf174bac803421a5f35076a17af47c9ce00 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:13:51 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:30 2007 +0200 ieee1394: eth1394: .probe and .update may sleep Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c | 12 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index ce146b3..e1fdfb5 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -354,13 +354,11 @@ static int eth1394_probe(struct device *dev) if (!hi) return -ENOENT; - new_node = kmalloc(sizeof(*new_node), - in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); + new_node = kmalloc(sizeof(*new_node), GFP_KERNEL); if (!new_node) return -ENOMEM; - node_info = kmalloc(sizeof(*node_info), - in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); + node_info = kmalloc(sizeof(*node_info), GFP_KERNEL); if (!node_info) { kfree(new_node); return -ENOMEM; @@ -435,13 +433,11 @@ static int eth1394_update(struct unit_directory *ud) if (node) return 0; - node = kmalloc(sizeof(*node), - in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); + node = kmalloc(sizeof(*node), GFP_KERNEL); if (!node) return -ENOMEM; - node_info = kmalloc(sizeof(*node_info), - in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); + node_info = kmalloc(sizeof(*node_info), GFP_KERNEL); if (!node_info) { kfree(node); return -ENOMEM; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: don't use alloc_etherdev
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=01590d20b42400be46cf4e565b39764e38ca87fe Commit: 01590d20b42400be46cf4e565b39764e38ca87fe Parent: 8a62bf7978eaa428e400677d5e5f5441262f79b1 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:20:37 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:31 2007 +0200 ieee1394: eth1394: don't use alloc_etherdev Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c | 20 +--- 1 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index fc6c7fd..0047343 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -50,7 +50,6 @@ #include linux/netdevice.h #include linux/inetdevice.h -#include linux/etherdevice.h #include linux/if_arp.h #include linux/if_ether.h #include linux/ip.h @@ -494,10 +493,8 @@ static void ether1394_reset_priv(struct net_device *dev, int set_mtu) spin_unlock_irqrestore(priv-lock, flags); } -/* This function is called right before register_netdev */ static void ether1394_init_dev(struct net_device *dev) { - /* Our functions */ dev-open = ether1394_open; dev-stop = ether1394_stop; dev-hard_start_xmit= ether1394_tx; @@ -510,10 +507,9 @@ static void ether1394_init_dev(struct net_device *dev) dev-hard_header_cache = ether1394_header_cache; dev-header_cache_update= ether1394_header_cache_update; dev-hard_header_parse = ether1394_header_parse; - dev-set_mac_address= NULL; + SET_ETHTOOL_OPS(dev, ethtool_ops); - /* Some constants */ dev-watchdog_timeo = ETHER1394_TIMEOUT; dev-flags = IFF_BROADCAST | IFF_MULTICAST; dev-features = NETIF_F_HIGHDMA; @@ -521,7 +517,8 @@ static void ether1394_init_dev(struct net_device *dev) dev-hard_header_len= ETH1394_HLEN; dev-type = ARPHRD_IEEE1394; - ether1394_reset_priv(dev, 1); + /* FIXME: This value was copied from ether_setup(). Is it too much? */ + dev-tx_queue_len = 1000; } /* @@ -551,11 +548,7 @@ static void ether1394_add_host(struct hpsb_host *host) return; } - /* We should really have our own alloc_hpsbdev() function in -* net_init.c instead of calling the one for ethernet then hijacking -* it for ourselves. That way we'd be a real networking device. */ - dev = alloc_etherdev(sizeof (struct eth1394_priv)); - + dev = alloc_netdev(sizeof(*priv), eth%d, ether1394_init_dev); if (dev == NULL) { ETH1394_PRINT_G(KERN_ERR, Out of memory\n); goto out; @@ -568,21 +561,18 @@ static void ether1394_add_host(struct hpsb_host *host) #endif priv = netdev_priv(dev); - INIT_LIST_HEAD(priv-ip_node_list); - spin_lock_init(priv-lock); priv-host = host; priv-local_fifo = fifo_addr; hi = hpsb_create_hostinfo(eth1394_highlevel, host, sizeof(*hi)); - if (hi == NULL) { ETH1394_PRINT_G(KERN_ERR, Out of memory\n); goto out; } - ether1394_init_dev(dev); + ether1394_reset_priv(dev, 1); if (register_netdev(dev)) { ETH1394_PRINT_G(KERN_ERR, Cannot register the driver\n); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: clean up fragment_overlap
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2e2173df68f419aa41558e1fa90d7263b2d0211f Commit: 2e2173df68f419aa41558e1fa90d7263b2d0211f Parent: 01590d20b42400be46cf4e565b39764e38ca87fe Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:21:46 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:31 2007 +0200 ieee1394: eth1394: clean up fragment_overlap offset fi-offset + fi-len - 1 == !(offset fi-offset + fi-len) offset + len - 1 fi-offset == !(offset + len fi-offset) !(A || B) == (!A !B) Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 0047343..08f63c8 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -867,12 +867,12 @@ static u16 ether1394_parse_encap(struct sk_buff *skb, struct net_device *dev, static int fragment_overlap(struct list_head *frag_list, int offset, int len) { struct fragment_info *fi; + int end = offset + len; - list_for_each_entry(fi, frag_list, list) { - if ( ! ((offset (fi-offset + fi-len - 1)) || - ((offset + len - 1) fi-offset))) + list_for_each_entry(fi, frag_list, list) + if (offset fi-offset + fi-len end fi-offset) return 1; - } + return 0; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: some conditions are unlikely
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=099398719bb53119734354bc079840bebf1c7386 Commit: 099398719bb53119734354bc079840bebf1c7386 Parent: 2e2173df68f419aa41558e1fa90d7263b2d0211f Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:22:21 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:32 2007 +0200 ieee1394: eth1394: some conditions are unlikely Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 08f63c8..a6c4a37 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -1023,7 +1023,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid, if (!ud) { struct eth1394_node_ref *node; node = eth1394_find_node_nodeid(priv-ip_node_list, srcid); - if (!node) { + if (unlikely(!node)) { HPSB_PRINT(KERN_ERR, ether1394 rx: sender nodeid lookup failure: NODE_BUS_FMT, NODE_BUS_ARGS(priv-host, srcid)); @@ -1048,7 +1048,7 @@ static int ether1394_data_handler(struct net_device *dev, int srcid, int destid, * high level network layer. */ skb = dev_alloc_skb(len + dev-hard_header_len + 15); - if (!skb) { + if (unlikely(!skb)) { ETH1394_PRINT_G(KERN_ERR, Out of memory\n); priv-stats.rx_dropped++; return -1; @@ -1203,7 +1203,7 @@ static int ether1394_write(struct hpsb_host *host, int srcid, int destid, struct eth1394_host_info *hi; hi = hpsb_get_hostinfo(eth1394_highlevel, host); - if (hi == NULL) { + if (unlikely(!hi)) { ETH1394_PRINT_G(KERN_ERR, No net device at fw-host%d\n, host-id); return RCODE_ADDRESS_ERROR; @@ -1229,7 +1229,7 @@ static void ether1394_iso(struct hpsb_iso *iso) int nready; hi = hpsb_get_hostinfo(eth1394_highlevel, iso-host); - if (hi == NULL) { + if (unlikely(!hi)) { ETH1394_PRINT_G(KERN_ERR, No net device at fw-host%d\n, iso-host-id); return; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: hard_start_xmit is called in atomic context
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=53f374e76c2b37835966382b27efb6bb3715f9d8 Commit: 53f374e76c2b37835966382b27efb6bb3715f9d8 Parent: 099398719bb53119734354bc079840bebf1c7386 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:23:19 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:32 2007 +0200 ieee1394: eth1394: hard_start_xmit is called in atomic context Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index a6c4a37..b5cd107 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -1521,7 +1521,6 @@ static void ether1394_complete_cb(void *__ptask) /* Transmit a packet (called by kernel) */ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) { - gfp_t kmflags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL; struct eth1394hdr *eth; struct eth1394_priv *priv = netdev_priv(dev); __be16 proto; @@ -1537,7 +1536,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) struct eth1394_node_ref *node; struct eth1394_node_info *node_info = NULL; - ptask = kmem_cache_alloc(packet_task_cache, kmflags); + ptask = kmem_cache_alloc(packet_task_cache, GFP_ATOMIC); if (ptask == NULL) { ret = -ENOMEM; goto fail; @@ -1553,7 +1552,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) } #endif - skb = skb_share_check(skb, kmflags); + skb = skb_share_check(skb, GFP_ATOMIC); if (!skb) { ret = -ENOMEM; goto fail; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: correct return codes in hard_start_xmit
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fdc0092bfd68cedfb9929256957f64c2c2760b5c Commit: fdc0092bfd68cedfb9929256957f64c2c2760b5c Parent: 53f374e76c2b37835966382b27efb6bb3715f9d8 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Mon Apr 2 02:24:27 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:32 2007 +0200 ieee1394: eth1394: correct return codes in hard_start_xmit This patch actually doesn't change anything because there was always 0 == NETDEV_TX_OK returned before. TODO: Return NETDEV_TX_BUSY in error case and test in different error conditions. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/eth1394.c | 34 -- 1 files changed, 16 insertions(+), 18 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index b5cd107..1c26322 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -1527,7 +1527,6 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) unsigned long flags; nodeid_t dest_node; eth1394_tx_type tx_type; - int ret = 0; unsigned int tx_len; unsigned int max_payload; u16 dg_size; @@ -1537,26 +1536,20 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) struct eth1394_node_info *node_info = NULL; ptask = kmem_cache_alloc(packet_task_cache, GFP_ATOMIC); - if (ptask == NULL) { - ret = -ENOMEM; + if (ptask == NULL) goto fail; - } /* XXX Ignore this for now. Noticed that when MacOSX is the IRM, * it does not set our validity bit. We need to compensate for * that somewhere else, but not in eth1394. */ #if 0 - if ((priv-host-csr.broadcast_channel 0xc000) != 0xc000) { - ret = -EAGAIN; + if ((priv-host-csr.broadcast_channel 0xc000) != 0xc000) goto fail; - } #endif skb = skb_share_check(skb, GFP_ATOMIC); - if (!skb) { - ret = -ENOMEM; + if (!skb) goto fail; - } /* Get rid of the fake eth1394 header, but save a pointer */ eth = (struct eth1394hdr *)skb-data; @@ -1583,16 +1576,13 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) node = eth1394_find_node_guid(priv-ip_node_list, be64_to_cpu(guid)); - if (!node) { - ret = -EAGAIN; + if (!node) goto fail; - } + node_info = (struct eth1394_node_info *)node-ud-device.driver_data; - if (node_info-fifo == CSR1212_INVALID_ADDR_SPACE) { - ret = -EAGAIN; + if (node_info-fifo == CSR1212_INVALID_ADDR_SPACE) goto fail; - } dest_node = node-ud-ne-nodeid; max_payload = node_info-maxpayload; @@ -1639,7 +1629,7 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev) goto fail; netif_wake_queue(dev); - return 0; + return NETDEV_TX_OK; fail: if (ptask) kmem_cache_free(packet_task_cache, ptask); @@ -1655,7 +1645,15 @@ fail: if (netif_queue_stopped(dev)) netif_wake_queue(dev); - return 0; /* returning non-zero causes serious problems */ + /* +* FIXME: According to a patch from 2003-02-26, returning non-zero +* causes serious problems here, allegedly. Before that patch, +* -ERRNO was returned which is not appropriate under Linux 2.6. +* Perhaps more needs to be done? Stop the queue in serious +* conditions and restart it elsewhere? +*/ + /* return NETDEV_TX_BUSY; */ + return NETDEV_TX_OK; } static void ether1394_get_drvinfo(struct net_device *dev, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ieee1394: eth1394: don't autoload by hotplug when ohci1394 starts
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=70093cfde8af52b0b9030d90f9004cbde38f2ff8 Commit: 70093cfde8af52b0b9030d90f9004cbde38f2ff8 Parent: e00f04a70fa387b3accc81b5c346200f836e2a52 Author: Stefan Richter [EMAIL PROTECTED] AuthorDate: Tue Mar 27 01:36:50 2007 +0200 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:30 2007 +0200 ieee1394: eth1394: don't autoload by hotplug when ohci1394 starts Until now, ieee1394 put an IP-over-1394 capability entry into each new host's config ROM. As soon as the controller was initialized --- i.e. right after modprobe ohci1394 --- this entry triggered a hotplug event which typically caused auto-loading of eth1394. This irritated or annoyed many users and distributors. Of course they could blacklist eth1394, but then ieee1394 wrongly advertized IP-over- 1394 capability to the FireWire bus. Therefore - remove the offending kernel config option IEEE1394_CONFIG_ROM_IP1394, - let eth1394 add the ROM entry by itself, i.e. only after eth1394 was loaded. This fixes http://bugzilla.kernel.org/show_bug.cgi?id=7793 . To emulate the behaviour of older kernels, simply add the following to to /etc/modprobe.conf: install ohci1394 /sbin/modprobe eth1394; \ /sbin/modprobe --ignore-install ohci1394 Note, autoloading of eth1394 when an _external_ IP-over-1394 capable device is discovered is _not_ affected by this patch. Signed-off-by: Stefan Richter [EMAIL PROTECTED] --- drivers/ieee1394/Kconfig | 29 +-- drivers/ieee1394/config_roms.c | 76 drivers/ieee1394/config_roms.h |7 +++- drivers/ieee1394/eth1394.c |7 +++- drivers/ieee1394/hosts.c |3 +- 5 files changed, 36 insertions(+), 86 deletions(-) diff --git a/drivers/ieee1394/Kconfig b/drivers/ieee1394/Kconfig index f8ff6b8..5c0b522 100644 --- a/drivers/ieee1394/Kconfig +++ b/drivers/ieee1394/Kconfig @@ -34,23 +34,6 @@ config IEEE1394_VERBOSEDEBUG Say Y if you really want or need the debugging output, everyone else says N. -config IEEE1394_EXTRA_CONFIG_ROMS - bool Build in extra config rom entries for certain functionality - depends on IEEE1394 - help - Some IEEE1394 functionality depends on extra config rom entries - being available in the host adapters CSR. These options will - allow you to choose which ones. - -config IEEE1394_CONFIG_ROM_IP1394 - bool IP-1394 Entry - depends on IEEE1394_EXTRA_CONFIG_ROMS IEEE1394 - help - Adds an entry for using IP-over-1394. If you want to use your - IEEE1394 bus as a network for IP systems (including interacting - with MacOSX and WinXP IP-over-1394), enable this option and the - eth1394 option below. - comment Device Drivers depends on IEEE1394 @@ -120,11 +103,15 @@ config IEEE1394_SBP2_PHYS_DMA This option is buggy and currently broken on some architectures. If unsure, say N. +config IEEE1394_ETH1394_ROM_ENTRY + depends on IEEE1394 + bool + default n + config IEEE1394_ETH1394 - tristate Ethernet over 1394 + tristate IP over 1394 depends on IEEE1394 EXPERIMENTAL INET - select IEEE1394_CONFIG_ROM_IP1394 - select IEEE1394_EXTRA_CONFIG_ROMS + select IEEE1394_ETH1394_ROM_ENTRY help This driver implements a functional majority of RFC 2734: IPv4 over 1394. It will provide IP connectivity with implementations of RFC @@ -133,6 +120,8 @@ config IEEE1394_ETH1394 This driver is still considered experimental. It does not yet support MCAP, therefore multicast support is significantly limited. + The module is called eth1394 although it does not emulate Ethernet. + config IEEE1394_DV1394 tristate OHCI-DV I/O support (deprecated) depends on IEEE1394 IEEE1394_OHCI1394 diff --git a/drivers/ieee1394/config_roms.c b/drivers/ieee1394/config_roms.c index 556658a..1b98120 100644 --- a/drivers/ieee1394/config_roms.c +++ b/drivers/ieee1394/config_roms.c @@ -26,12 +26,6 @@ struct hpsb_config_rom_entry { /* Base initialization, called at module load */ int (*init)(void); - /* Add entry to specified host */ - int (*add)(struct hpsb_host *host); - - /* Remove entry from specified host */ - void (*remove)(struct hpsb_host *host); - /* Cleanup called at module exit */ void (*cleanup)(void); @@ -78,7 +72,7 @@ int hpsb_default_host_entry(struct hpsb_host *host) } -#ifdef CONFIG_IEEE1394_CONFIG_ROM_IP1394 +#ifdef CONFIG_IEEE1394_ETH1394_ROM_ENTRY #include eth1394.h static struct csr1212_keyval *ip1394_ud; @@ -137,7 +131,7 @@ static void
ieee1394: eth1394: fix error path in module_init
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=809e905ce73eaa13972c2617959f8ec16e7d0d6f Commit: 809e905ce73eaa13972c2617959f8ec16e7d0d6f Parent: fdc0092bfd68cedfb9929256957f64c2c2760b5c Author: Akinobu Mita [EMAIL PROTECTED] AuthorDate: Sat Apr 21 18:36:26 2007 +0900 Committer: Stefan Richter [EMAIL PROTECTED] CommitDate: Mon Apr 30 00:00:32 2007 +0200 ieee1394: eth1394: fix error path in module_init This patch fixes some error handlings in eth1394: - check return value of kmem_cache_create() - cleanup resources if hpsb_register_protocol() fails Signed-off-by: Akinobu Mita [EMAIL PROTECTED] Signed-off-by: Stefan Richter [EMAIL PROTECTED] (whitespace) --- drivers/ieee1394/eth1394.c | 15 --- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/ieee1394/eth1394.c b/drivers/ieee1394/eth1394.c index 1c26322..bd67c86 100644 --- a/drivers/ieee1394/eth1394.c +++ b/drivers/ieee1394/eth1394.c @@ -1667,17 +1667,26 @@ static struct ethtool_ops ethtool_ops = { .get_drvinfo = ether1394_get_drvinfo }; -static int __init ether1394_init_module (void) +static int __init ether1394_init_module(void) { + int err; + packet_task_cache = kmem_cache_create(packet_task, sizeof(struct packet_task), 0, 0, NULL, NULL); + if (!packet_task_cache) + return -ENOMEM; hpsb_register_highlevel(eth1394_highlevel); - return hpsb_register_protocol(eth1394_proto_driver); + err = hpsb_register_protocol(eth1394_proto_driver); + if (err) { + hpsb_unregister_highlevel(eth1394_highlevel); + kmem_cache_destroy(packet_task_cache); + } + return err; } -static void __exit ether1394_exit_module (void) +static void __exit ether1394_exit_module(void) { hpsb_unregister_protocol(eth1394_proto_driver); hpsb_unregister_highlevel(eth1394_highlevel); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html