From 221b3d909d42e7b6536afa967469c7b1e9192982 Mon Sep 17 00:00:00 2001 From: Vivek Kutal Date: Mon, 7 Jan 2008 12:04:00 -0200 Subject: [PATCH] --- yaml --- r: 75594 b: refs/heads/master c: 496bcb81678ae255171de54e637ba1c19c9ed315 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/local_ops.txt | 23 ++ trunk/Documentation/networking/driver.txt | 5 +- trunk/Documentation/watchdog/watchdog-api.txt | 38 ++-- trunk/arch/.gitignore | 2 - trunk/arch/alpha/math-emu/math.c | 2 +- trunk/arch/arm/Kconfig | 2 - trunk/arch/arm/mach-omap1/board-fsample.c | 14 +- trunk/arch/arm/mach-omap1/board-perseus2.c | 14 +- trunk/arch/arm/mach-pxa/sleep.S | 6 +- trunk/arch/cris/arch-v10/vmlinux.lds.S | 33 +-- trunk/arch/sparc64/kernel/sun4v_tlb_miss.S | 2 - trunk/arch/sparc64/kernel/traps.c | 4 - trunk/arch/x86/kernel/traps_32.c | 1 - trunk/arch/x86/kernel/traps_64.c | 1 - trunk/arch/x86/oprofile/nmi_int.c | 2 +- trunk/drivers/ata/pata_pdc202xx_old.c | 19 -- trunk/drivers/cpufreq/cpufreq_conservative.c | 4 - trunk/drivers/cpufreq/cpufreq_ondemand.c | 5 +- trunk/drivers/cpufreq/cpufreq_userspace.c | 4 - trunk/drivers/infiniband/hw/ipath/ipath_ud.c | 44 ++-- trunk/drivers/input/mouse/alps.c | 2 +- trunk/drivers/input/mouse/lifebook.c | 7 +- trunk/drivers/input/mouse/psmouse-base.c | 2 - trunk/drivers/input/mousedev.c | 9 - .../input/touchscreen/usbtouchscreen.c | 55 ++--- trunk/drivers/lguest/Kconfig | 7 + .../media/video/saa7134/saa7134-core.c | 3 +- trunk/drivers/net/3c515.c | 60 +++-- trunk/drivers/net/Kconfig | 3 + trunk/drivers/net/atl1/atl1_main.c | 8 +- trunk/drivers/net/bonding/bond_alb.c | 23 +- trunk/drivers/net/bonding/bond_main.c | 64 ++---- trunk/drivers/net/bonding/bond_sysfs.c | 66 +++--- trunk/drivers/net/bonding/bonding.h | 4 +- trunk/drivers/net/cpmac.c | 2 +- trunk/drivers/net/dl2k.c | 215 +++++++++--------- trunk/drivers/net/dl2k.h | 157 ++++++++++++- trunk/drivers/net/e1000/e1000_main.c | 9 +- trunk/drivers/net/e1000e/netdev.c | 7 +- trunk/drivers/net/ipg.c | 36 ++- trunk/drivers/net/ixgbe/ixgbe_main.c | 7 +- trunk/drivers/net/niu.c | 3 - trunk/drivers/net/pcmcia/3c574_cs.c | 31 ++- trunk/drivers/net/s2io.c | 17 +- trunk/drivers/net/sky2.c | 24 +- trunk/drivers/net/wan/dscc4.c | 94 ++++---- trunk/drivers/net/wan/lmc/lmc_media.c | 12 +- trunk/drivers/net/wan/sbni.h | 12 +- trunk/drivers/net/wireless/b43/rfkill.c | 11 +- .../drivers/net/wireless/hostap/hostap_plx.c | 6 +- trunk/drivers/net/wireless/ipw2200.c | 2 +- trunk/drivers/net/wireless/libertas/if_sdio.c | 4 - trunk/drivers/net/wireless/rt2x00/rt2x00pci.c | 2 +- trunk/drivers/net/wireless/rt2x00/rt2x00usb.c | 11 +- trunk/drivers/pnp/pnpacpi/rsparser.c | 2 - trunk/drivers/video/modedb.c | 4 - trunk/drivers/watchdog/w83697hf_wdt.c | 4 +- trunk/fs/hfs/btree.c | 7 +- trunk/fs/jbd/transaction.c | 2 - trunk/fs/sysfs/dir.c | 8 +- trunk/include/asm-cris/page.h | 7 +- trunk/include/linux/workqueue.h | 14 +- trunk/kernel/kmod.c | 13 +- trunk/kernel/lockdep.c | 12 +- trunk/kernel/workqueue.c | 5 +- trunk/mm/memory.c | 2 - trunk/mm/page_alloc.c | 2 +- 68 files changed, 652 insertions(+), 632 deletions(-) delete mode 100644 trunk/arch/.gitignore diff --git a/[refs] b/[refs] index 28996e8522d7..45a6496f0b17 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: abf07b19de3ae2fcf63142f1f9a3e4ee537f9f55 +refs/heads/master: 496bcb81678ae255171de54e637ba1c19c9ed315 diff --git a/trunk/Documentation/local_ops.txt b/trunk/Documentation/local_ops.txt index 4269a1105b37..1a45f11e645e 100644 --- a/trunk/Documentation/local_ops.txt +++ b/trunk/Documentation/local_ops.txt @@ -45,6 +45,29 @@ long fails. The definition looks like : typedef struct { atomic_long_t a; } local_t; +* Rules to follow when using local atomic operations + +- Variables touched by local ops must be per cpu variables. +- _Only_ the CPU owner of these variables must write to them. +- This CPU can use local ops from any context (process, irq, softirq, nmi, ...) + to update its local_t variables. +- Preemption (or interrupts) must be disabled when using local ops in + process context to make sure the process won't be migrated to a + different CPU between getting the per-cpu variable and doing the + actual local op. +- When using local ops in interrupt context, no special care must be + taken on a mainline kernel, since they will run on the local CPU with + preemption already disabled. I suggest, however, to explicitly + disable preemption anyway to make sure it will still work correctly on + -rt kernels. +- Reading the local cpu variable will provide the current copy of the + variable. +- Reads of these variables can be done from any CPU, because updates to + "long", aligned, variables are always atomic. Since no memory + synchronization is done by the writer CPU, an outdated copy of the + variable can be read when reading some _other_ cpu's variables. + + * Rules to follow when using local atomic operations - Variables touched by local ops must be per cpu variables. diff --git a/trunk/Documentation/networking/driver.txt b/trunk/Documentation/networking/driver.txt index ea72d2e66ca8..4f7da5a2bf4f 100644 --- a/trunk/Documentation/networking/driver.txt +++ b/trunk/Documentation/networking/driver.txt @@ -61,10 +61,7 @@ Transmit path guidelines: 2) Do not forget to update netdev->trans_start to jiffies after each new tx packet is given to the hardware. -3) A hard_start_xmit method must not modify the shared parts of a - cloned SKB. - -4) Do not forget that once you return 0 from your hard_start_xmit +3) Do not forget that once you return 0 from your hard_start_xmit method, it is your driver's responsibility to free up the SKB and in some finite amount of time. diff --git a/trunk/Documentation/watchdog/watchdog-api.txt b/trunk/Documentation/watchdog/watchdog-api.txt index 4cc4ba9d7150..bb7cb1d31ec7 100644 --- a/trunk/Documentation/watchdog/watchdog-api.txt +++ b/trunk/Documentation/watchdog/watchdog-api.txt @@ -42,27 +42,23 @@ like this source file: see Documentation/watchdog/src/watchdog-simple.c A more advanced driver could for example check that a HTTP server is still responding before doing the write call to ping the watchdog. -When the device is closed, the watchdog is disabled, unless the "Magic -Close" feature is supported (see below). This is not always such a -good idea, since if there is a bug in the watchdog daemon and it -crashes the system will not reboot. Because of this, some of the -drivers support the configuration option "Disable watchdog shutdown on -close", CONFIG_WATCHDOG_NOWAYOUT. If it is set to Y when compiling -the kernel, there is no way of disabling the watchdog once it has been -started. So, if the watchdog daemon crashes, the system will reboot -after the timeout has passed. Watchdog devices also usually support -the nowayout module parameter so that this option can be controlled at -runtime. - -Magic Close feature: - -If a driver supports "Magic Close", the driver will not disable the -watchdog unless a specific magic character 'V' has been sent to -/dev/watchdog just before closing the file. If the userspace daemon -closes the file without sending this special character, the driver -will assume that the daemon (and userspace in general) died, and will -stop pinging the watchdog without disabling it first. This will then -cause a reboot if the watchdog is not re-opened in sufficient time. +When the device is closed, the watchdog is disabled. This is not +always such a good idea, since if there is a bug in the watchdog +daemon and it crashes the system will not reboot. Because of this, +some of the drivers support the configuration option "Disable watchdog +shutdown on close", CONFIG_WATCHDOG_NOWAYOUT. If it is set to Y when +compiling the kernel, there is no way of disabling the watchdog once +it has been started. So, if the watchdog daemon crashes, the system +will reboot after the timeout has passed. Watchdog devices also usually +support the nowayout module parameter so that this option can be controlled +at runtime. + +Drivers will not disable the watchdog, unless a specific magic character 'V' +has been sent /dev/watchdog just before closing the file. If the userspace +daemon closes the file without sending this special character, the driver +will assume that the daemon (and userspace in general) died, and will stop +pinging the watchdog without disabling it first. This will then cause a +reboot if the watchdog is not re-opened in sufficient time. The ioctl API: diff --git a/trunk/arch/.gitignore b/trunk/arch/.gitignore deleted file mode 100644 index 741468920320..000000000000 --- a/trunk/arch/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -i386 -x86_64 diff --git a/trunk/arch/alpha/math-emu/math.c b/trunk/arch/alpha/math-emu/math.c index 58c2669a1dd4..ae79dd970b02 100644 --- a/trunk/arch/alpha/math-emu/math.c +++ b/trunk/arch/alpha/math-emu/math.c @@ -225,7 +225,7 @@ alpha_fp_emul (unsigned long pc) FP_UNPACK_SP(SB, &vb); DR_c = DB_c; DR_s = DB_s; - DR_e = DB_e + (1024 - 128); + DR_e = DB_e; DR_f = SB_f << (52 - 23); goto pack_d; } diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig index a04f507e7f2c..3a75a0b2bebb 100644 --- a/trunk/arch/arm/Kconfig +++ b/trunk/arch/arm/Kconfig @@ -1072,8 +1072,6 @@ source "drivers/rtc/Kconfig" source "drivers/dma/Kconfig" -source "drivers/dca/Kconfig" - endmenu source "fs/Kconfig" diff --git a/trunk/arch/arm/mach-omap1/board-fsample.c b/trunk/arch/arm/mach-omap1/board-fsample.c index f65baa95986e..d5f6ea14fc7b 100644 --- a/trunk/arch/arm/mach-omap1/board-fsample.c +++ b/trunk/arch/arm/mach-omap1/board-fsample.c @@ -40,31 +40,29 @@ static int fsample_keymap[] = { KEY(0,1,KEY_RIGHT), KEY(0,2,KEY_LEFT), KEY(0,3,KEY_DOWN), - KEY(0,4,KEY_CENTER), - KEY(0,5,KEY_0_5), - KEY(1,0,KEY_SOFT2), + KEY(0,4,KEY_ENTER), + KEY(1,0,KEY_F10), KEY(1,1,KEY_SEND), KEY(1,2,KEY_END), KEY(1,3,KEY_VOLUMEDOWN), KEY(1,4,KEY_VOLUMEUP), KEY(1,5,KEY_RECORD), - KEY(2,0,KEY_SOFT1), + KEY(2,0,KEY_F9), KEY(2,1,KEY_3), KEY(2,2,KEY_6), KEY(2,3,KEY_9), - KEY(2,4,KEY_SHARP), - KEY(2,5,KEY_2_5), + KEY(2,4,KEY_KPDOT), KEY(3,0,KEY_BACK), KEY(3,1,KEY_2), KEY(3,2,KEY_5), KEY(3,3,KEY_8), KEY(3,4,KEY_0), - KEY(3,5,KEY_HEADSETHOOK), + KEY(3,5,KEY_KPSLASH), KEY(4,0,KEY_HOME), KEY(4,1,KEY_1), KEY(4,2,KEY_4), KEY(4,3,KEY_7), - KEY(4,4,KEY_STAR), + KEY(4,4,KEY_KPASTERISK), KEY(4,5,KEY_POWER), 0 }; diff --git a/trunk/arch/arm/mach-omap1/board-perseus2.c b/trunk/arch/arm/mach-omap1/board-perseus2.c index 1d5c8d509722..e44437e10eef 100644 --- a/trunk/arch/arm/mach-omap1/board-perseus2.c +++ b/trunk/arch/arm/mach-omap1/board-perseus2.c @@ -39,31 +39,29 @@ static int p2_keymap[] = { KEY(0,1,KEY_RIGHT), KEY(0,2,KEY_LEFT), KEY(0,3,KEY_DOWN), - KEY(0,4,KEY_CENTER), - KEY(0,5,KEY_0_5), - KEY(1,0,KEY_SOFT2), + KEY(0,4,KEY_ENTER), + KEY(1,0,KEY_F10), KEY(1,1,KEY_SEND), KEY(1,2,KEY_END), KEY(1,3,KEY_VOLUMEDOWN), KEY(1,4,KEY_VOLUMEUP), KEY(1,5,KEY_RECORD), - KEY(2,0,KEY_SOFT1), + KEY(2,0,KEY_F9), KEY(2,1,KEY_3), KEY(2,2,KEY_6), KEY(2,3,KEY_9), - KEY(2,4,KEY_SHARP), - KEY(2,5,KEY_2_5), + KEY(2,4,KEY_KPDOT), KEY(3,0,KEY_BACK), KEY(3,1,KEY_2), KEY(3,2,KEY_5), KEY(3,3,KEY_8), KEY(3,4,KEY_0), - KEY(3,5,KEY_HEADSETHOOK), + KEY(3,5,KEY_KPSLASH), KEY(4,0,KEY_HOME), KEY(4,1,KEY_1), KEY(4,2,KEY_4), KEY(4,3,KEY_7), - KEY(4,4,KEY_STAR), + KEY(4,4,KEY_KPASTERISK), KEY(4,5,KEY_POWER), 0 }; diff --git a/trunk/arch/arm/mach-pxa/sleep.S b/trunk/arch/arm/mach-pxa/sleep.S index d0447723b73a..aff71fec618a 100644 --- a/trunk/arch/arm/mach-pxa/sleep.S +++ b/trunk/arch/arm/mach-pxa/sleep.S @@ -43,11 +43,11 @@ pxa_cpu_save_cp: pxa_cpu_save_sp: @ preserve phys address of stack mov r0, sp - str lr, [sp, #-4]! + mov r2, lr bl sleep_phys_sp ldr r1, =sleep_save_sp str r0, [r1] - ldr pc, [sp], #4 + mov pc, r2 /* * pxa27x_cpu_suspend() @@ -270,3 +270,5 @@ resume_after_mmu: mar acc0, r2, r3 #endif ldmfd sp!, {r4 - r12, pc} @ return to caller + + diff --git a/trunk/arch/cris/arch-v10/vmlinux.lds.S b/trunk/arch/cris/arch-v10/vmlinux.lds.S index 97a7876ed681..9859d49d088b 100644 --- a/trunk/arch/cris/arch-v10/vmlinux.lds.S +++ b/trunk/arch/cris/arch-v10/vmlinux.lds.S @@ -9,8 +9,7 @@ */ #include -#include - + jiffies = jiffies_64; SECTIONS { @@ -24,7 +23,7 @@ SECTIONS _stext = .; __stext = .; .text : { - TEXT_TEXT + *(.text) SCHED_TEXT LOCK_TEXT *(.fixup) @@ -50,10 +49,10 @@ SECTIONS __edata = . ; /* End of data section */ _edata = . ; - . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned */ + . = ALIGN(8192); /* init_task and stack, must be aligned */ .data.init_task : { *(.data.init_task) } - . = ALIGN(PAGE_SIZE); /* Init code and data */ + . = ALIGN(8192); /* Init code and data */ __init_begin = .; .init.text : { _sinittext = .; @@ -67,7 +66,13 @@ SECTIONS __setup_end = .; .initcall.init : { __initcall_start = .; - INITCALLS + *(.initcall1.init); + *(.initcall2.init); + *(.initcall3.init); + *(.initcall4.init); + *(.initcall5.init); + *(.initcall6.init); + *(.initcall7.init); __initcall_end = .; } @@ -83,18 +88,16 @@ SECTIONS __initramfs_start = .; *(.init.ramfs) __initramfs_end = .; + /* We fill to the next page, so we can discard all init + pages without needing to consider what payload might be + appended to the kernel image. */ + FILL (0); + . = ALIGN (8192); } #endif + __vmlinux_end = .; /* last address of the physical file */ - - /* - * We fill to the next page, so we can discard all init - * pages without needing to consider what payload might be - * appended to the kernel image. - */ - . = ALIGN(PAGE_SIZE); - - __init_end = .; + __init_end = .; __data_end = . ; /* Move to _edata ? */ __bss_start = .; /* BSS */ diff --git a/trunk/arch/sparc64/kernel/sun4v_tlb_miss.S b/trunk/arch/sparc64/kernel/sun4v_tlb_miss.S index fd9430562e0b..9871dbb1ab42 100644 --- a/trunk/arch/sparc64/kernel/sun4v_tlb_miss.S +++ b/trunk/arch/sparc64/kernel/sun4v_tlb_miss.S @@ -215,7 +215,6 @@ sun4v_itlb_error: 1: ba,pt %xcc, etrap 2: or %g7, %lo(2b), %g7 - mov %l4, %o1 call sun4v_itlb_error_report add %sp, PTREGS_OFF, %o0 @@ -242,7 +241,6 @@ sun4v_dtlb_error: 1: ba,pt %xcc, etrap 2: or %g7, %lo(2b), %g7 - mov %l4, %o1 call sun4v_dtlb_error_report add %sp, PTREGS_OFF, %o0 diff --git a/trunk/arch/sparc64/kernel/traps.c b/trunk/arch/sparc64/kernel/traps.c index 2b6abf633343..04998388259f 100644 --- a/trunk/arch/sparc64/kernel/traps.c +++ b/trunk/arch/sparc64/kernel/traps.c @@ -1950,8 +1950,6 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl) printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n", regs->tpc, tl); print_symbol(KERN_EMERG "SUN4V-ITLB: TPC<%s>\n", regs->tpc); - printk(KERN_EMERG "SUN4V-ITLB: O7[%lx]\n", regs->u_regs[UREG_I7]); - print_symbol(KERN_EMERG "SUN4V-ITLB: O7<%s>\n", regs->u_regs[UREG_I7]); printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] " "pte[%lx] error[%lx]\n", sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx, @@ -1973,8 +1971,6 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl) printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n", regs->tpc, tl); print_symbol(KERN_EMERG "SUN4V-DTLB: TPC<%s>\n", regs->tpc); - printk(KERN_EMERG "SUN4V-DTLB: O7[%lx]\n", regs->u_regs[UREG_I7]); - print_symbol(KERN_EMERG "SUN4V-DTLB: O7<%s>\n", regs->u_regs[UREG_I7]); printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] " "pte[%lx] error[%lx]\n", sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx, diff --git a/trunk/arch/x86/kernel/traps_32.c b/trunk/arch/x86/kernel/traps_32.c index 02d1e1e58e81..c88bbffcaa03 100644 --- a/trunk/arch/x86/kernel/traps_32.c +++ b/trunk/arch/x86/kernel/traps_32.c @@ -541,7 +541,6 @@ fastcall void do_##name(struct pt_regs * regs, long error_code) \ info.si_errno = 0; \ info.si_code = sicode; \ info.si_addr = (void __user *)siaddr; \ - trace_hardirqs_fixup(); \ if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ == NOTIFY_STOP) \ return; \ diff --git a/trunk/arch/x86/kernel/traps_64.c b/trunk/arch/x86/kernel/traps_64.c index cc68b92316cd..d11525ad81b4 100644 --- a/trunk/arch/x86/kernel/traps_64.c +++ b/trunk/arch/x86/kernel/traps_64.c @@ -635,7 +635,6 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ info.si_errno = 0; \ info.si_code = sicode; \ info.si_addr = (void __user *)siaddr; \ - trace_hardirqs_fixup(); \ if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ == NOTIFY_STOP) \ return; \ diff --git a/trunk/arch/x86/oprofile/nmi_int.c b/trunk/arch/x86/oprofile/nmi_int.c index 944bbcdd2b8d..2d0eeac7251f 100644 --- a/trunk/arch/x86/oprofile/nmi_int.c +++ b/trunk/arch/x86/oprofile/nmi_int.c @@ -380,7 +380,7 @@ static int __init ppro_init(char ** cpu_type) if (cpu_model == 14) *cpu_type = "i386/core"; - else if (cpu_model == 15 || cpu_model == 23) + else if (cpu_model == 15) *cpu_type = "i386/core_2"; else if (cpu_model > 0xd) return 0; diff --git a/trunk/drivers/ata/pata_pdc202xx_old.c b/trunk/drivers/ata/pata_pdc202xx_old.c index 6c9689b59b06..8f2815601791 100644 --- a/trunk/drivers/ata/pata_pdc202xx_old.c +++ b/trunk/drivers/ata/pata_pdc202xx_old.c @@ -244,24 +244,6 @@ static int pdc2026x_port_start(struct ata_port *ap) return ata_sff_port_start(ap); } -/** - * pdc2026x_check_atapi_dma - Check whether ATAPI DMA can be supported for this command - * @qc: Metadata associated with taskfile to check - * - * Just say no - not supported on older Promise. - * - * LOCKING: - * None (inherited from caller). - * - * RETURNS: 0 when ATAPI DMA can be used - * 1 otherwise - */ - -static int pdc2026x_check_atapi_dma(struct ata_queued_cmd *qc) -{ - return 1; -} - static struct scsi_host_template pdc202xx_sht = { .module = THIS_MODULE, .name = DRV_NAME, @@ -329,7 +311,6 @@ static struct ata_port_operations pdc2026x_port_ops = { .post_internal_cmd = ata_bmdma_post_internal_cmd, .cable_detect = pdc2026x_cable_detect, - .check_atapi_dma= pdc2026x_check_atapi_dma, .bmdma_setup = ata_bmdma_setup, .bmdma_start = pdc2026x_bmdma_start, .bmdma_stop = pdc2026x_bmdma_stop, diff --git a/trunk/drivers/cpufreq/cpufreq_conservative.c b/trunk/drivers/cpufreq/cpufreq_conservative.c index 5d3a04ba6ad2..1bba99747f5b 100644 --- a/trunk/drivers/cpufreq/cpufreq_conservative.c +++ b/trunk/drivers/cpufreq/cpufreq_conservative.c @@ -603,9 +603,5 @@ MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for " "optimised for use in a battery environment"); MODULE_LICENSE ("GPL"); -#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE -fs_initcall(cpufreq_gov_dbs_init); -#else module_init(cpufreq_gov_dbs_init); -#endif module_exit(cpufreq_gov_dbs_exit); diff --git a/trunk/drivers/cpufreq/cpufreq_ondemand.c b/trunk/drivers/cpufreq/cpufreq_ondemand.c index d2af20dda382..369f44595150 100644 --- a/trunk/drivers/cpufreq/cpufreq_ondemand.c +++ b/trunk/drivers/cpufreq/cpufreq_ondemand.c @@ -610,9 +610,6 @@ MODULE_DESCRIPTION("'cpufreq_ondemand' - A dynamic cpufreq governor for " "Low Latency Frequency Transition capable processors"); MODULE_LICENSE("GPL"); -#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND -fs_initcall(cpufreq_gov_dbs_init); -#else module_init(cpufreq_gov_dbs_init); -#endif module_exit(cpufreq_gov_dbs_exit); + diff --git a/trunk/drivers/cpufreq/cpufreq_userspace.c b/trunk/drivers/cpufreq/cpufreq_userspace.c index f8cdde4bf6cd..51bedab6c808 100644 --- a/trunk/drivers/cpufreq/cpufreq_userspace.c +++ b/trunk/drivers/cpufreq/cpufreq_userspace.c @@ -231,9 +231,5 @@ MODULE_AUTHOR ("Dominik Brodowski , Russell King bth[0]) >> 24; - if (qp->ibqp.qp_num > 1 && - opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) { - if (header_in_data) { - wc.imm_data = *(__be32 *) data; - data += sizeof(__be32); - } else - wc.imm_data = ohdr->u.ud.imm_data; - wc.wc_flags = IB_WC_WITH_IMM; - hdrsize += sizeof(u32); - } else if (opcode == IB_OPCODE_UD_SEND_ONLY) { - wc.imm_data = 0; - wc.wc_flags = 0; - } else { - dev->n_pkt_drops++; - goto bail; - } - /* Get the number of bytes the message was padded by. */ pad = (be32_to_cpu(ohdr->bth[0]) >> 20) & 3; if (unlikely(tlen < (hdrsize + pad + 4))) { @@ -503,6 +481,28 @@ void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, */ wc.byte_len = tlen + sizeof(struct ib_grh); + /* + * The opcode is in the low byte when its in network order + * (top byte when in host order). + */ + opcode = be32_to_cpu(ohdr->bth[0]) >> 24; + if (qp->ibqp.qp_num > 1 && + opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) { + if (header_in_data) { + wc.imm_data = *(__be32 *) data; + data += sizeof(__be32); + } else + wc.imm_data = ohdr->u.ud.imm_data; + wc.wc_flags = IB_WC_WITH_IMM; + hdrsize += sizeof(u32); + } else if (opcode == IB_OPCODE_UD_SEND_ONLY) { + wc.imm_data = 0; + wc.wc_flags = 0; + } else { + dev->n_pkt_drops++; + goto bail; + } + /* * Get the next work request entry to find where to put the data. */ diff --git a/trunk/drivers/input/mouse/alps.c b/trunk/drivers/input/mouse/alps.c index b346a3b418ea..2b5ed119c9a9 100644 --- a/trunk/drivers/input/mouse/alps.c +++ b/trunk/drivers/input/mouse/alps.c @@ -54,7 +54,7 @@ static const struct alps_model_info alps_model_data[] = { { { 0x20, 0x02, 0x0e }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* XXX */ { { 0x22, 0x02, 0x0a }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, { { 0x22, 0x02, 0x14 }, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D600 */ - { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FW_BK_1 } /* Dell Vostro 1400 */ + { { 0x73, 0x02, 0x50 }, 0xcf, 0xff, ALPS_FW_BK_1 } /* Dell Vostro 1400 */ }; /* diff --git a/trunk/drivers/input/mouse/lifebook.c b/trunk/drivers/input/mouse/lifebook.c index df81b0aaa9f8..9ec57d80186e 100644 --- a/trunk/drivers/input/mouse/lifebook.c +++ b/trunk/drivers/input/mouse/lifebook.c @@ -225,13 +225,8 @@ static void lifebook_set_resolution(struct psmouse *psmouse, unsigned int resolu static void lifebook_disconnect(struct psmouse *psmouse) { - struct lifebook_data *priv = psmouse->private; - psmouse_reset(psmouse); - if (priv) { - input_unregister_device(priv->dev2); - kfree(priv); - } + kfree(psmouse->private); psmouse->private = NULL; } diff --git a/trunk/drivers/input/mouse/psmouse-base.c b/trunk/drivers/input/mouse/psmouse-base.c index b8628252e10c..21a9c0b69a1f 100644 --- a/trunk/drivers/input/mouse/psmouse-base.c +++ b/trunk/drivers/input/mouse/psmouse-base.c @@ -1247,8 +1247,6 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv) err_pt_deactivate: if (parent && parent->pt_deactivate) parent->pt_deactivate(parent); - input_unregister_device(psmouse->dev); - input_dev = NULL; /* so we don't try to free it below */ err_protocol_disconnect: if (psmouse->disconnect) psmouse->disconnect(psmouse); diff --git a/trunk/drivers/input/mousedev.c b/trunk/drivers/input/mousedev.c index be83516c776c..78c3ea75da2a 100644 --- a/trunk/drivers/input/mousedev.c +++ b/trunk/drivers/input/mousedev.c @@ -1029,15 +1029,6 @@ static const struct input_device_id mousedev_ids[] = { BIT_MASK(ABS_PRESSURE) | BIT_MASK(ABS_TOOL_WIDTH) }, }, /* A touchpad */ - { - .flags = INPUT_DEVICE_ID_MATCH_EVBIT | - INPUT_DEVICE_ID_MATCH_KEYBIT | - INPUT_DEVICE_ID_MATCH_ABSBIT, - .evbit = { BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_SYN) }, - .keybit = { [BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) }, - .absbit = { BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) }, - }, /* Mouse-like device with absolute X and Y but ordinary - clicks, like hp ILO2 High Performance mouse */ { }, /* Terminating entry */ }; diff --git a/trunk/drivers/input/touchscreen/usbtouchscreen.c b/trunk/drivers/input/touchscreen/usbtouchscreen.c index 63f9664a066f..19055e7381f8 100644 --- a/trunk/drivers/input/touchscreen/usbtouchscreen.c +++ b/trunk/drivers/input/touchscreen/usbtouchscreen.c @@ -11,7 +11,6 @@ * - DMC TSC-10/25 * - IRTOUCHSYSTEMS/UNITOP * - IdealTEK URTC1000 - * - General Touch * - GoTop Super_Q2/GogoPen/PenPower tablets * * Copyright (C) 2004-2007 by Daniel Ritz @@ -51,7 +50,7 @@ #include -#define DRIVER_VERSION "v0.6" +#define DRIVER_VERSION "v0.5" #define DRIVER_AUTHOR "Daniel Ritz " #define DRIVER_DESC "USB Touchscreen Driver" @@ -66,21 +65,17 @@ struct usbtouch_device_info { int min_yc, max_yc; int min_press, max_press; int rept_size; + int flags; void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len); - - /* - * used to get the packet len. possible return values: - * > 0: packet len - * = 0: skip one byte - * < 0: -return value more bytes needed - */ int (*get_pkt_len) (unsigned char *pkt, int len); - int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt); int (*init) (struct usbtouch_usb *usbtouch); }; +#define USBTOUCH_FLG_BUFFER 0x01 + + /* a usbtouch device */ struct usbtouch_usb { unsigned char *data; @@ -99,6 +94,15 @@ struct usbtouch_usb { }; +#if defined(CONFIG_TOUCHSCREEN_USB_EGALAX) || defined(CONFIG_TOUCHSCREEN_USB_ETURBO) || defined(CONFIG_TOUCHSCREEN_USB_IDEALTEK) +#define MULTI_PACKET +#endif + +#ifdef MULTI_PACKET +static void usbtouch_process_multi(struct usbtouch_usb *usbtouch, + unsigned char *pkt, int len); +#endif + /* device types */ enum { DEVTPYE_DUMMY = -1, @@ -182,10 +186,6 @@ static struct usb_device_id usbtouch_devices[] = { #ifdef CONFIG_TOUCHSCREEN_USB_EGALAX -#ifndef MULTI_PACKET -#define MULTI_PACKET -#endif - #define EGALAX_PKT_TYPE_MASK 0xFE #define EGALAX_PKT_TYPE_REPT 0x80 #define EGALAX_PKT_TYPE_DIAG 0x0A @@ -323,9 +323,6 @@ static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt) * eTurboTouch part */ #ifdef CONFIG_TOUCHSCREEN_USB_ETURBO -#ifndef MULTI_PACKET -#define MULTI_PACKET -#endif static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt) { unsigned int shift; @@ -464,9 +461,6 @@ static int irtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) * IdealTEK URTC1000 Part */ #ifdef CONFIG_TOUCHSCREEN_USB_IDEALTEK -#ifndef MULTI_PACKET -#define MULTI_PACKET -#endif static int idealtek_get_pkt_len(unsigned char *buf, int len) { if (buf[0] & 0x80) @@ -531,11 +525,6 @@ static int gotop_read_data(struct usbtouch_usb *dev, unsigned char *pkt) /***************************************************************************** * the different device descriptors */ -#ifdef MULTI_PACKET -static void usbtouch_process_multi(struct usbtouch_usb *usbtouch, - unsigned char *pkt, int len); -#endif - static struct usbtouch_device_info usbtouch_dev_info[] = { #ifdef CONFIG_TOUCHSCREEN_USB_EGALAX [DEVTYPE_EGALAX] = { @@ -544,6 +533,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { .min_yc = 0x0, .max_yc = 0x07ff, .rept_size = 16, + .flags = USBTOUCH_FLG_BUFFER, .process_pkt = usbtouch_process_multi, .get_pkt_len = egalax_get_pkt_len, .read_data = egalax_read_data, @@ -592,6 +582,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { .min_yc = 0x0, .max_yc = 0x07ff, .rept_size = 8, + .flags = USBTOUCH_FLG_BUFFER, .process_pkt = usbtouch_process_multi, .get_pkt_len = eturbo_get_pkt_len, .read_data = eturbo_read_data, @@ -639,6 +630,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { .min_yc = 0x0, .max_yc = 0x0fff, .rept_size = 8, + .flags = USBTOUCH_FLG_BUFFER, .process_pkt = usbtouch_process_multi, .get_pkt_len = idealtek_get_pkt_len, .read_data = idealtek_read_data, @@ -746,14 +738,11 @@ static void usbtouch_process_multi(struct usbtouch_usb *usbtouch, pos = 0; while (pos < buf_len) { /* get packet len */ - pkt_len = usbtouch->type->get_pkt_len(buffer + pos, - buf_len - pos); + pkt_len = usbtouch->type->get_pkt_len(buffer + pos, len); - /* unknown packet: skip one byte */ - if (unlikely(!pkt_len)) { - pos++; - continue; - } + /* unknown packet: drop everything */ + if (unlikely(!pkt_len)) + goto out_flush_buf; /* full packet: process */ if (likely((pkt_len > 0) && (pkt_len <= buf_len - pos))) { @@ -868,7 +857,7 @@ static int usbtouch_probe(struct usb_interface *intf, if (!usbtouch->data) goto out_free; - if (type->get_pkt_len) { + if (type->flags & USBTOUCH_FLG_BUFFER) { usbtouch->buffer = kmalloc(type->rept_size, GFP_KERNEL); if (!usbtouch->buffer) goto out_free_buffers; diff --git a/trunk/drivers/lguest/Kconfig b/trunk/drivers/lguest/Kconfig index 6b8dbb9ba73b..7eb9ecff8f4a 100644 --- a/trunk/drivers/lguest/Kconfig +++ b/trunk/drivers/lguest/Kconfig @@ -10,3 +10,10 @@ config LGUEST not "rustyvisor". See Documentation/lguest/lguest.txt. If unsure, say N. If curious, say M. If masochistic, say Y. + +config LGUEST_GUEST + bool + help + The guest needs code built-in, even if the host has lguest + support as a module. The drivers are tiny, so we build them + in too. diff --git a/trunk/drivers/media/video/saa7134/saa7134-core.c b/trunk/drivers/media/video/saa7134/saa7134-core.c index 4f0a9157ecb1..4fd187ac9d70 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-core.c +++ b/trunk/drivers/media/video/saa7134/saa7134-core.c @@ -1202,8 +1202,9 @@ static int saa7134_suspend(struct pci_dev *pci_dev , pm_message_t state) static int saa7134_resume(struct pci_dev *pci_dev) { + struct saa7134_dev *dev = pci_get_drvdata(pci_dev); - unsigned long flags; + unsigned int flags; pci_restore_state(pci_dev); pci_set_power_state(pci_dev, PCI_D0); diff --git a/trunk/drivers/net/3c515.c b/trunk/drivers/net/3c515.c index 684bab781015..275e7510ebaf 100644 --- a/trunk/drivers/net/3c515.c +++ b/trunk/drivers/net/3c515.c @@ -243,16 +243,14 @@ enum eeprom_offset { enum Window3 { /* Window 3: MAC/config bits. */ Wn3_Config = 0, Wn3_MAC_Ctrl = 6, Wn3_Options = 8, }; -enum wn3_config { - Ram_size = 7, - Ram_width = 8, - Ram_speed = 0x30, - Rom_size = 0xc0, - Ram_split_shift = 16, - Ram_split = 3 << Ram_split_shift, - Xcvr_shift = 20, - Xcvr = 7 << Xcvr_shift, - Autoselect = 0x1000000, +union wn3_config { + int i; + struct w3_config_fields { + unsigned int ram_size:3, ram_width:1, ram_speed:2, rom_size:2; + int pad8:8; + unsigned int ram_split:2, pad18:2, xcvr:3, pad21:1, autoselect:1; + int pad24:7; + } u; }; enum Window4 { @@ -616,7 +614,7 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr, /* Read the station address from the EEPROM. */ EL3WINDOW(0); for (i = 0; i < 0x18; i++) { - __be16 *phys_addr = (__be16 *) dev->dev_addr; + short *phys_addr = (short *) dev->dev_addr; int timer; outw(EEPROM_Read + i, ioaddr + Wn0EepromCmd); /* Pause for at least 162 us. for the read to take place. */ @@ -648,22 +646,22 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr, { char *ram_split[] = { "5:3", "3:1", "1:1", "3:5" }; - __u32 config; + union wn3_config config; EL3WINDOW(3); vp->available_media = inw(ioaddr + Wn3_Options); - config = inl(ioaddr + Wn3_Config); + config.i = inl(ioaddr + Wn3_Config); if (corkscrew_debug > 1) printk(KERN_INFO " Internal config register is %4.4x, transceivers %#x.\n", - config, inw(ioaddr + Wn3_Options)); + config.i, inw(ioaddr + Wn3_Options)); printk(KERN_INFO " %dK %s-wide RAM %s Rx:Tx split, %s%s interface.\n", - 8 << config & Ram_size, - config & Ram_width ? "word" : "byte", - ram_split[(config & Ram_split) >> Ram_split_shift], - config & Autoselect ? "autoselect/" : "", - media_tbl[(config & Xcvr) >> Xcvr_shift].name); - vp->default_media = (config & Xcvr) >> Xcvr_shift; - vp->autoselect = config & Autoselect ? 1 : 0; - dev->if_port = vp->default_media; + 8 << config.u.ram_size, + config.u.ram_width ? "word" : "byte", + ram_split[config.u.ram_split], + config.u.autoselect ? "autoselect/" : "", + media_tbl[config.u.xcvr].name); + dev->if_port = config.u.xcvr; + vp->default_media = config.u.xcvr; + vp->autoselect = config.u.autoselect; } if (vp->media_override != 7) { printk(KERN_INFO " Media override to transceiver type %d (%s).\n", @@ -696,14 +694,14 @@ static int corkscrew_open(struct net_device *dev) { int ioaddr = dev->base_addr; struct corkscrew_private *vp = netdev_priv(dev); - __u32 config; + union wn3_config config; int i; /* Before initializing select the active media port. */ EL3WINDOW(3); if (vp->full_duplex) outb(0x20, ioaddr + Wn3_MAC_Ctrl); /* Set the full-duplex bit. */ - config = inl(ioaddr + Wn3_Config); + config.i = inl(ioaddr + Wn3_Config); if (vp->media_override != 7) { if (corkscrew_debug > 1) @@ -729,12 +727,12 @@ static int corkscrew_open(struct net_device *dev) } else dev->if_port = vp->default_media; - config = (config & ~Xcvr) | (dev->if_port << Xcvr_shift); - outl(config, ioaddr + Wn3_Config); + config.u.xcvr = dev->if_port; + outl(config.i, ioaddr + Wn3_Config); if (corkscrew_debug > 1) { printk("%s: corkscrew_open() InternalConfig %8.8x.\n", - dev->name, config); + dev->name, config.i); } outw(TxReset, ioaddr + EL3_CMD); @@ -903,7 +901,7 @@ static void corkscrew_timer(unsigned long data) ok = 1; } if (!ok) { - __u32 config; + union wn3_config config; do { dev->if_port = @@ -930,9 +928,9 @@ static void corkscrew_timer(unsigned long data) ioaddr + Wn4_Media); EL3WINDOW(3); - config = inl(ioaddr + Wn3_Config); - config = (config & ~Xcvr) | (dev->if_port << Xcvr_shift); - outl(config, ioaddr + Wn3_Config); + config.i = inl(ioaddr + Wn3_Config); + config.u.xcvr = dev->if_port; + outl(config.i, ioaddr + Wn3_Config); outw(dev->if_port == 3 ? StartCoax : StopCoax, ioaddr + EL3_CMD); diff --git a/trunk/drivers/net/Kconfig b/trunk/drivers/net/Kconfig index 9ae3166e3162..114771a2a133 100644 --- a/trunk/drivers/net/Kconfig +++ b/trunk/drivers/net/Kconfig @@ -1976,6 +1976,9 @@ config E1000E + More specific information on configuring the driver is in + . + To compile this driver as a module, choose M here. The module will be called e1000e. diff --git a/trunk/drivers/net/atl1/atl1_main.c b/trunk/drivers/net/atl1/atl1_main.c index 9200ee59d854..35b0a7dd4ef4 100644 --- a/trunk/drivers/net/atl1/atl1_main.c +++ b/trunk/drivers/net/atl1/atl1_main.c @@ -120,7 +120,7 @@ static int __devinit atl1_sw_init(struct atl1_adapter *adapter) struct atl1_hw *hw = &adapter->hw; struct net_device *netdev = adapter->netdev; - hw->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; + hw->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN; hw->min_frame_size = ETH_ZLEN + ETH_FCS_LEN; adapter->wol = 0; @@ -688,7 +688,7 @@ static int atl1_change_mtu(struct net_device *netdev, int new_mtu) { struct atl1_adapter *adapter = netdev_priv(netdev); int old_mtu = netdev->mtu; - int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN; + int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) || (max_frame > MAX_JUMBO_FRAME_SIZE)) { @@ -853,8 +853,8 @@ static u32 atl1_configure(struct atl1_adapter *adapter) /* set Interrupt Clear Timer */ iowrite16(adapter->ict, hw->hw_addr + REG_CMBDISDMA_TIMER); - /* set max frame size hw will accept */ - iowrite32(hw->max_frame_size, hw->hw_addr + REG_MTU); + /* set MTU, 4 : VLAN */ + iowrite32(hw->max_frame_size + 4, hw->hw_addr + REG_MTU); /* jumbo size & rrd retirement timer */ value = (((u32) hw->rx_jumbo_th & RXQ_JMBOSZ_TH_MASK) diff --git a/trunk/drivers/net/bonding/bond_alb.c b/trunk/drivers/net/bonding/bond_alb.c index b57bc9467dbe..25b8dbf6cfd7 100644 --- a/trunk/drivers/net/bonding/bond_alb.c +++ b/trunk/drivers/net/bonding/bond_alb.c @@ -979,7 +979,7 @@ static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct /* * Send learning packets after MAC address swap. * - * Called with RTNL and no other locks + * Called with RTNL and bond->lock held for read. */ static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1, struct slave *slave2) @@ -987,8 +987,6 @@ static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1, int slaves_state_differ = (SLAVE_IS_OK(slave1) != SLAVE_IS_OK(slave2)); struct slave *disabled_slave = NULL; - ASSERT_RTNL(); - /* fasten the change in the switch */ if (SLAVE_IS_OK(slave1)) { alb_send_learning_packets(slave1, slave1->dev->dev_addr); @@ -1033,7 +1031,7 @@ static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1, * a slave that has @slave's permanet address as its current address. * We'll make sure that that slave no longer uses @slave's permanent address. * - * Caller must hold RTNL and no other locks + * Caller must hold bond lock */ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *slave) { @@ -1544,12 +1542,7 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave) return 0; } -/* - * Remove slave from tlb and rlb hash tables, and fix up MAC addresses - * if necessary. - * - * Caller must hold RTNL and no other locks - */ +/* Caller must hold bond lock for write */ void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave) { if (bond->slave_cnt > 1) { @@ -1608,6 +1601,9 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave struct slave *swap_slave; int i; + if (new_slave) + ASSERT_RTNL(); + if (bond->curr_active_slave == new_slave) { return; } @@ -1653,8 +1649,6 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave write_unlock_bh(&bond->curr_slave_lock); read_unlock(&bond->lock); - ASSERT_RTNL(); - /* curr_active_slave must be set before calling alb_swap_mac_addr */ if (swap_slave) { /* swap mac address */ @@ -1665,11 +1659,12 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave bond->alb_info.rlb_enabled); } + read_lock(&bond->lock); + if (swap_slave) { alb_fasten_mac_swap(bond, swap_slave, new_slave); - read_lock(&bond->lock); } else { - read_lock(&bond->lock); + /* fasten bond mac on new current slave */ alb_send_learning_packets(new_slave, bond->dev->dev_addr); } diff --git a/trunk/drivers/net/bonding/bond_main.c b/trunk/drivers/net/bonding/bond_main.c index 49a198206e3d..b0b26036266b 100644 --- a/trunk/drivers/net/bonding/bond_main.c +++ b/trunk/drivers/net/bonding/bond_main.c @@ -1746,9 +1746,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) * has been cleared (if our_slave == old_current), * but before a new active slave is selected. */ - write_unlock_bh(&bond->lock); bond_alb_deinit_slave(bond, slave); - write_lock_bh(&bond->lock); } if (oldcurrent == slave) { @@ -1907,12 +1905,6 @@ static int bond_release_all(struct net_device *bond_dev) slave_dev = slave->dev; bond_detach_slave(bond, slave); - /* now that the slave is detached, unlock and perform - * all the undo steps that should not be called from - * within a lock. - */ - write_unlock_bh(&bond->lock); - if ((bond->params.mode == BOND_MODE_TLB) || (bond->params.mode == BOND_MODE_ALB)) { /* must be called only after the slave @@ -1923,6 +1915,12 @@ static int bond_release_all(struct net_device *bond_dev) bond_compute_features(bond); + /* now that the slave is detached, unlock and perform + * all the undo steps that should not be called from + * within a lock. + */ + write_unlock_bh(&bond->lock); + bond_destroy_slave_symlinks(bond_dev, slave_dev); bond_del_vlans_from_slave(bond, slave_dev); @@ -2386,9 +2384,7 @@ void bond_mii_monitor(struct work_struct *work) rtnl_lock(); read_lock(&bond->lock); __bond_mii_monitor(bond, 1); - read_unlock(&bond->lock); - rtnl_unlock(); /* might sleep, hold no other locks */ - read_lock(&bond->lock); + rtnl_unlock(); } delay = ((bond->params.miimon * HZ) / 1000) ? : 1; @@ -3403,7 +3399,9 @@ static int bond_master_netdev_event(unsigned long event, struct net_device *bond case NETDEV_CHANGENAME: return bond_event_changename(event_bond); case NETDEV_UNREGISTER: - bond_release_all(event_bond->dev); + /* + * TODO: remove a bond from the list? + */ break; default: break; @@ -4542,27 +4540,18 @@ static void bond_free_all(void) /* * Convert string input module parms. Accept either the - * number of the mode or its string name. A bit complicated because - * some mode names are substrings of other names, and calls from sysfs - * may have whitespace in the name (trailing newlines, for example). + * number of the mode or its string name. */ -int bond_parse_parm(const char *buf, struct bond_parm_tbl *tbl) +int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl) { - int mode = -1, i, rv; - char modestr[BOND_MAX_MODENAME_LEN + 1] = { 0, }; - - rv = sscanf(buf, "%d", &mode); - if (!rv) { - rv = sscanf(buf, "%20s", modestr); - if (!rv) - return -1; - } + int i; for (i = 0; tbl[i].modename; i++) { - if (mode == tbl[i].mode) - return tbl[i].mode; - if (strcmp(modestr, tbl[i].modename) == 0) + if ((isdigit(*mode_arg) && + tbl[i].mode == simple_strtol(mode_arg, NULL, 0)) || + (strcmp(mode_arg, tbl[i].modename) == 0)) { return tbl[i].mode; + } } return -1; @@ -4876,22 +4865,9 @@ static struct lock_class_key bonding_netdev_xmit_lock_key; int bond_create(char *name, struct bond_params *params, struct bonding **newbond) { struct net_device *bond_dev; - struct bonding *bond, *nxt; int res; rtnl_lock(); - down_write(&bonding_rwsem); - - /* Check to see if the bond already exists. */ - list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) - if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) { - printk(KERN_ERR DRV_NAME - ": cannot add bond %s; it already exists\n", - name); - res = -EPERM; - goto out_rtnl; - } - bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", ether_setup); if (!bond_dev) { @@ -4930,12 +4906,10 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond netif_carrier_off(bond_dev); - up_write(&bonding_rwsem); rtnl_unlock(); /* allows sysfs registration of net device */ res = bond_create_sysfs_entry(bond_dev->priv); if (res < 0) { rtnl_lock(); - down_write(&bonding_rwsem); goto out_bond; } @@ -4946,7 +4920,6 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond out_netdev: free_netdev(bond_dev); out_rtnl: - up_write(&bonding_rwsem); rtnl_unlock(); return res; } @@ -4967,9 +4940,6 @@ static int __init bonding_init(void) #ifdef CONFIG_PROC_FS bond_create_proc_dir(); #endif - - init_rwsem(&bonding_rwsem); - for (i = 0; i < max_bonds; i++) { res = bond_create(NULL, &bonding_defaults, NULL); if (res) diff --git a/trunk/drivers/net/bonding/bond_sysfs.c b/trunk/drivers/net/bonding/bond_sysfs.c index 90a1f31e8e63..11b76b352415 100644 --- a/trunk/drivers/net/bonding/bond_sysfs.c +++ b/trunk/drivers/net/bonding/bond_sysfs.c @@ -109,10 +109,11 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t { char command[IFNAMSIZ + 1] = {0, }; char *ifname; - int rv, res = count; + int res = count; struct bonding *bond; struct bonding *nxt; + down_write(&(bonding_rwsem)); sscanf(buffer, "%16s", command); /* IFNAMSIZ*/ ifname = command + 1; if ((strlen(command) <= 1) || @@ -120,28 +121,39 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t goto err_no_cmd; if (command[0] == '+') { + + /* Check to see if the bond already exists. */ + list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) + if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) { + printk(KERN_ERR DRV_NAME + ": cannot add bond %s; it already exists\n", + ifname); + res = -EPERM; + goto out; + } + printk(KERN_INFO DRV_NAME ": %s is being created...\n", ifname); - rv = bond_create(ifname, &bonding_defaults, &bond); - if (rv) { - printk(KERN_INFO DRV_NAME ": Bond creation failed.\n"); - res = rv; + if (bond_create(ifname, &bonding_defaults, &bond)) { + printk(KERN_INFO DRV_NAME + ": %s interface already exists. Bond creation failed.\n", + ifname); + res = -EPERM; } goto out; } if (command[0] == '-') { - rtnl_lock(); - down_write(&bonding_rwsem); - list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) { + rtnl_lock(); /* check the ref count on the bond's kobject. * If it's > expected, then there's a file open, * and we have to fail. */ if (atomic_read(&bond->dev->dev.kobj.kref.refcount) > expected_refcount){ + rtnl_unlock(); printk(KERN_INFO DRV_NAME ": Unable remove bond %s due to open references.\n", ifname); @@ -152,7 +164,6 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t ": %s is being deleted...\n", bond->dev->name); bond_destroy(bond); - up_write(&bonding_rwsem); rtnl_unlock(); goto out; } @@ -160,8 +171,6 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t printk(KERN_ERR DRV_NAME ": unable to delete non-existent bond %s\n", ifname); res = -ENODEV; - up_write(&bonding_rwsem); - rtnl_unlock(); goto out; } @@ -174,6 +183,7 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t * get called forever, which is bad. */ out: + up_write(&(bonding_rwsem)); return res; } /* class attribute for bond_masters file. This ends up in /sys/class/net */ @@ -261,9 +271,6 @@ static ssize_t bonding_store_slaves(struct device *d, /* Note: We can't hold bond->lock here, as bond_create grabs it. */ - rtnl_lock(); - down_write(&(bonding_rwsem)); - sscanf(buffer, "%16s", command); /* IFNAMSIZ*/ ifname = command + 1; if ((strlen(command) <= 1) || @@ -329,10 +336,12 @@ static ssize_t bonding_store_slaves(struct device *d, dev->mtu = bond->dev->mtu; } } + rtnl_lock(); res = bond_enslave(bond->dev, dev); bond_for_each_slave(bond, slave, i) if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) slave->original_mtu = original_mtu; + rtnl_unlock(); if (res) { ret = res; } @@ -350,10 +359,12 @@ static ssize_t bonding_store_slaves(struct device *d, if (dev) { printk(KERN_INFO DRV_NAME ": %s: Removing slave %s\n", bond->dev->name, dev->name); + rtnl_lock(); if (bond->setup_by_slave) res = bond_release_and_destroy(bond->dev, dev); else res = bond_release(bond->dev, dev); + rtnl_unlock(); if (res) { ret = res; goto out; @@ -378,8 +389,6 @@ static ssize_t bonding_store_slaves(struct device *d, ret = -EPERM; out: - up_write(&(bonding_rwsem)); - rtnl_unlock(); return ret; } @@ -414,7 +423,7 @@ static ssize_t bonding_store_mode(struct device *d, goto out; } - new_value = bond_parse_parm(buf, bond_mode_tbl); + new_value = bond_parse_parm((char *)buf, bond_mode_tbl); if (new_value < 0) { printk(KERN_ERR DRV_NAME ": %s: Ignoring invalid mode value %.*s.\n", @@ -469,7 +478,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d, goto out; } - new_value = bond_parse_parm(buf, xmit_hashtype_tbl); + new_value = bond_parse_parm((char *)buf, xmit_hashtype_tbl); if (new_value < 0) { printk(KERN_ERR DRV_NAME ": %s: Ignoring invalid xmit hash policy value %.*s.\n", @@ -509,7 +518,7 @@ static ssize_t bonding_store_arp_validate(struct device *d, int new_value; struct bonding *bond = to_bond(d); - new_value = bond_parse_parm(buf, arp_validate_tbl); + new_value = bond_parse_parm((char *)buf, arp_validate_tbl); if (new_value < 0) { printk(KERN_ERR DRV_NAME ": %s: Ignoring invalid arp_validate value %s\n", @@ -932,7 +941,7 @@ static ssize_t bonding_store_lacp(struct device *d, goto out; } - new_value = bond_parse_parm(buf, bond_lacp_tbl); + new_value = bond_parse_parm((char *)buf, bond_lacp_tbl); if ((new_value == 1) || (new_value == 0)) { bond->params.lacp_fast = new_value; @@ -1066,10 +1075,7 @@ static ssize_t bonding_store_primary(struct device *d, struct slave *slave; struct bonding *bond = to_bond(d); - rtnl_lock(); - read_lock(&bond->lock); - write_lock_bh(&bond->curr_slave_lock); - + write_lock_bh(&bond->lock); if (!USES_PRIMARY(bond->params.mode)) { printk(KERN_INFO DRV_NAME ": %s: Unable to set primary slave; %s is in mode %d\n", @@ -1103,8 +1109,8 @@ static ssize_t bonding_store_primary(struct device *d, } } out: - write_unlock_bh(&bond->curr_slave_lock); - read_unlock(&bond->lock); + write_unlock_bh(&bond->lock); + rtnl_unlock(); return count; @@ -1184,8 +1190,7 @@ static ssize_t bonding_store_active_slave(struct device *d, struct bonding *bond = to_bond(d); rtnl_lock(); - read_lock(&bond->lock); - write_lock_bh(&bond->curr_slave_lock); + write_lock_bh(&bond->lock); if (!USES_PRIMARY(bond->params.mode)) { printk(KERN_INFO DRV_NAME @@ -1242,8 +1247,7 @@ static ssize_t bonding_store_active_slave(struct device *d, } } out: - write_unlock_bh(&bond->curr_slave_lock); - read_unlock(&bond->lock); + write_unlock_bh(&bond->lock); rtnl_unlock(); return count; @@ -1414,6 +1418,8 @@ int bond_create_sysfs(void) int ret = 0; struct bonding *firstbond; + init_rwsem(&bonding_rwsem); + /* get the netdev class pointer */ firstbond = container_of(bond_dev_list.next, struct bonding, bond_list); if (!firstbond) diff --git a/trunk/drivers/net/bonding/bonding.h b/trunk/drivers/net/bonding/bonding.h index 6d83be49899a..e1e4734e23ce 100644 --- a/trunk/drivers/net/bonding/bonding.h +++ b/trunk/drivers/net/bonding/bonding.h @@ -141,8 +141,6 @@ struct bond_parm_tbl { int mode; }; -#define BOND_MAX_MODENAME_LEN 20 - struct vlan_entry { struct list_head vlan_list; __be32 vlan_ip; @@ -316,7 +314,7 @@ void bond_mii_monitor(struct work_struct *); void bond_loadbalance_arp_mon(struct work_struct *); void bond_activebackup_arp_mon(struct work_struct *); void bond_set_mode_ops(struct bonding *bond, int mode); -int bond_parse_parm(const char *mode_arg, struct bond_parm_tbl *tbl); +int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl); void bond_select_active_slave(struct bonding *bond); void bond_change_active_slave(struct bonding *bond, struct slave *new_active); void bond_register_arp(struct bonding *); diff --git a/trunk/drivers/net/cpmac.c b/trunk/drivers/net/cpmac.c index 6e12d48351b8..6fd95a2c8cec 100644 --- a/trunk/drivers/net/cpmac.c +++ b/trunk/drivers/net/cpmac.c @@ -459,7 +459,7 @@ static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev) return NETDEV_TX_OK; len = max(skb->len, ETH_ZLEN); - queue = skb_get_queue_mapping(skb); + queue = skb->queue_mapping; #ifdef CONFIG_NETDEVICES_MULTIQUEUE netif_stop_subqueue(dev, queue); #else diff --git a/trunk/drivers/net/dl2k.c b/trunk/drivers/net/dl2k.c index e233d04a2132..47cce9cad30f 100644 --- a/trunk/drivers/net/dl2k.c +++ b/trunk/drivers/net/dl2k.c @@ -1316,10 +1316,9 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) ("%02x:cur:%08x next:%08x status:%08x frag1:%08x frag0:%08x", i, (u32) (np->tx_ring_dma + i * sizeof (*desc)), - (u32)le64_to_cpu(desc->next_desc), - (u32)le64_to_cpu(desc->status), - (u32)(le64_to_cpu(desc->fraginfo) >> 32), - (u32)le64_to_cpu(desc->fraginfo)); + (u32) desc->next_desc, + (u32) desc->status, (u32) (desc->fraginfo >> 32), + (u32) desc->fraginfo); printk ("\n"); } printk ("\n"); @@ -1436,7 +1435,7 @@ mii_write (struct net_device *dev, int phy_addr, int reg_num, u16 data) static int mii_wait_link (struct net_device *dev, int wait) { - __u16 bmsr; + BMSR_t bmsr; int phy_addr; struct netdev_private *np; @@ -1444,8 +1443,8 @@ mii_wait_link (struct net_device *dev, int wait) phy_addr = np->phy_addr; do { - bmsr = mii_read (dev, phy_addr, MII_BMSR); - if (bmsr & MII_BMSR_LINK_STATUS) + bmsr.image = mii_read (dev, phy_addr, MII_BMSR); + if (bmsr.bits.link_status) return 0; mdelay (1); } while (--wait > 0); @@ -1454,72 +1453,70 @@ mii_wait_link (struct net_device *dev, int wait) static int mii_get_media (struct net_device *dev) { - __u16 negotiate; - __u16 bmsr; - __u16 mscr; - __u16 mssr; + ANAR_t negotiate; + BMSR_t bmsr; + BMCR_t bmcr; + MSCR_t mscr; + MSSR_t mssr; int phy_addr; struct netdev_private *np; np = netdev_priv(dev); phy_addr = np->phy_addr; - bmsr = mii_read (dev, phy_addr, MII_BMSR); + bmsr.image = mii_read (dev, phy_addr, MII_BMSR); if (np->an_enable) { - if (!(bmsr & MII_BMSR_AN_COMPLETE)) { + if (!bmsr.bits.an_complete) { /* Auto-Negotiation not completed */ return -1; } - negotiate = mii_read (dev, phy_addr, MII_ANAR) & + negotiate.image = mii_read (dev, phy_addr, MII_ANAR) & mii_read (dev, phy_addr, MII_ANLPAR); - mscr = mii_read (dev, phy_addr, MII_MSCR); - mssr = mii_read (dev, phy_addr, MII_MSSR); - if (mscr & MII_MSCR_1000BT_FD && mssr & MII_MSSR_LP_1000BT_FD) { + mscr.image = mii_read (dev, phy_addr, MII_MSCR); + mssr.image = mii_read (dev, phy_addr, MII_MSSR); + if (mscr.bits.media_1000BT_FD & mssr.bits.lp_1000BT_FD) { np->speed = 1000; np->full_duplex = 1; printk (KERN_INFO "Auto 1000 Mbps, Full duplex\n"); - } else if (mscr & MII_MSCR_1000BT_HD && mssr & MII_MSSR_LP_1000BT_HD) { + } else if (mscr.bits.media_1000BT_HD & mssr.bits.lp_1000BT_HD) { np->speed = 1000; np->full_duplex = 0; printk (KERN_INFO "Auto 1000 Mbps, Half duplex\n"); - } else if (negotiate & MII_ANAR_100BX_FD) { + } else if (negotiate.bits.media_100BX_FD) { np->speed = 100; np->full_duplex = 1; printk (KERN_INFO "Auto 100 Mbps, Full duplex\n"); - } else if (negotiate & MII_ANAR_100BX_HD) { + } else if (negotiate.bits.media_100BX_HD) { np->speed = 100; np->full_duplex = 0; printk (KERN_INFO "Auto 100 Mbps, Half duplex\n"); - } else if (negotiate & MII_ANAR_10BT_FD) { + } else if (negotiate.bits.media_10BT_FD) { np->speed = 10; np->full_duplex = 1; printk (KERN_INFO "Auto 10 Mbps, Full duplex\n"); - } else if (negotiate & MII_ANAR_10BT_HD) { + } else if (negotiate.bits.media_10BT_HD) { np->speed = 10; np->full_duplex = 0; printk (KERN_INFO "Auto 10 Mbps, Half duplex\n"); } - if (negotiate & MII_ANAR_PAUSE) { + if (negotiate.bits.pause) { np->tx_flow &= 1; np->rx_flow &= 1; - } else if (negotiate & MII_ANAR_ASYMMETRIC) { + } else if (negotiate.bits.asymmetric) { np->tx_flow = 0; np->rx_flow &= 1; } /* else tx_flow, rx_flow = user select */ } else { - __u16 bmcr = mii_read (dev, phy_addr, MII_BMCR); - switch (bmcr & (MII_BMCR_SPEED_100 | MII_BMCR_SPEED_1000)) { - case MII_BMCR_SPEED_1000: - printk (KERN_INFO "Operating at 1000 Mbps, "); - break; - case MII_BMCR_SPEED_100: + bmcr.image = mii_read (dev, phy_addr, MII_BMCR); + if (bmcr.bits.speed100 == 1 && bmcr.bits.speed1000 == 0) { printk (KERN_INFO "Operating at 100 Mbps, "); - break; - case 0: + } else if (bmcr.bits.speed100 == 0 && bmcr.bits.speed1000 == 0) { printk (KERN_INFO "Operating at 10 Mbps, "); + } else if (bmcr.bits.speed100 == 0 && bmcr.bits.speed1000 == 1) { + printk (KERN_INFO "Operating at 1000 Mbps, "); } - if (bmcr & MII_BMCR_DUPLEX_MODE) { + if (bmcr.bits.duplex_mode) { printk ("Full duplex\n"); } else { printk ("Half duplex\n"); @@ -1540,10 +1537,10 @@ mii_get_media (struct net_device *dev) static int mii_set_media (struct net_device *dev) { - __u16 pscr; - __u16 bmcr; - __u16 bmsr; - __u16 anar; + PHY_SCR_t pscr; + BMCR_t bmcr; + BMSR_t bmsr; + ANAR_t anar; int phy_addr; struct netdev_private *np; np = netdev_priv(dev); @@ -1552,77 +1549,76 @@ mii_set_media (struct net_device *dev) /* Does user set speed? */ if (np->an_enable) { /* Advertise capabilities */ - bmsr = mii_read (dev, phy_addr, MII_BMSR); - anar = mii_read (dev, phy_addr, MII_ANAR) & - ~MII_ANAR_100BX_FD & - ~MII_ANAR_100BX_HD & - ~MII_ANAR_100BT4 & - ~MII_ANAR_10BT_FD & - ~MII_ANAR_10BT_HD; - if (bmsr & MII_BMSR_100BX_FD) - anar |= MII_ANAR_100BX_FD; - if (bmsr & MII_BMSR_100BX_HD) - anar |= MII_ANAR_100BX_HD; - if (bmsr & MII_BMSR_100BT4) - anar |= MII_ANAR_100BT4; - if (bmsr & MII_BMSR_10BT_FD) - anar |= MII_ANAR_10BT_FD; - if (bmsr & MII_BMSR_10BT_HD) - anar |= MII_ANAR_10BT_HD; - anar |= MII_ANAR_PAUSE | MII_ANAR_ASYMMETRIC; - mii_write (dev, phy_addr, MII_ANAR, anar); + bmsr.image = mii_read (dev, phy_addr, MII_BMSR); + anar.image = mii_read (dev, phy_addr, MII_ANAR); + anar.bits.media_100BX_FD = bmsr.bits.media_100BX_FD; + anar.bits.media_100BX_HD = bmsr.bits.media_100BX_HD; + anar.bits.media_100BT4 = bmsr.bits.media_100BT4; + anar.bits.media_10BT_FD = bmsr.bits.media_10BT_FD; + anar.bits.media_10BT_HD = bmsr.bits.media_10BT_HD; + anar.bits.pause = 1; + anar.bits.asymmetric = 1; + mii_write (dev, phy_addr, MII_ANAR, anar.image); /* Enable Auto crossover */ - pscr = mii_read (dev, phy_addr, MII_PHY_SCR); - pscr |= 3 << 5; /* 11'b */ - mii_write (dev, phy_addr, MII_PHY_SCR, pscr); + pscr.image = mii_read (dev, phy_addr, MII_PHY_SCR); + pscr.bits.mdi_crossover_mode = 3; /* 11'b */ + mii_write (dev, phy_addr, MII_PHY_SCR, pscr.image); /* Soft reset PHY */ mii_write (dev, phy_addr, MII_BMCR, MII_BMCR_RESET); - bmcr = MII_BMCR_AN_ENABLE | MII_BMCR_RESTART_AN | MII_BMCR_RESET; - mii_write (dev, phy_addr, MII_BMCR, bmcr); + bmcr.image = 0; + bmcr.bits.an_enable = 1; + bmcr.bits.restart_an = 1; + bmcr.bits.reset = 1; + mii_write (dev, phy_addr, MII_BMCR, bmcr.image); mdelay(1); } else { /* Force speed setting */ /* 1) Disable Auto crossover */ - pscr = mii_read (dev, phy_addr, MII_PHY_SCR); - pscr &= ~(3 << 5); - mii_write (dev, phy_addr, MII_PHY_SCR, pscr); + pscr.image = mii_read (dev, phy_addr, MII_PHY_SCR); + pscr.bits.mdi_crossover_mode = 0; + mii_write (dev, phy_addr, MII_PHY_SCR, pscr.image); /* 2) PHY Reset */ - bmcr = mii_read (dev, phy_addr, MII_BMCR); - bmcr |= MII_BMCR_RESET; - mii_write (dev, phy_addr, MII_BMCR, bmcr); + bmcr.image = mii_read (dev, phy_addr, MII_BMCR); + bmcr.bits.reset = 1; + mii_write (dev, phy_addr, MII_BMCR, bmcr.image); /* 3) Power Down */ - bmcr = 0x1940; /* must be 0x1940 */ - mii_write (dev, phy_addr, MII_BMCR, bmcr); + bmcr.image = 0x1940; /* must be 0x1940 */ + mii_write (dev, phy_addr, MII_BMCR, bmcr.image); mdelay (100); /* wait a certain time */ /* 4) Advertise nothing */ mii_write (dev, phy_addr, MII_ANAR, 0); /* 5) Set media and Power Up */ - bmcr = MII_BMCR_POWER_DOWN; + bmcr.image = 0; + bmcr.bits.power_down = 1; if (np->speed == 100) { - bmcr |= MII_BMCR_SPEED_100; + bmcr.bits.speed100 = 1; + bmcr.bits.speed1000 = 0; printk (KERN_INFO "Manual 100 Mbps, "); } else if (np->speed == 10) { + bmcr.bits.speed100 = 0; + bmcr.bits.speed1000 = 0; printk (KERN_INFO "Manual 10 Mbps, "); } if (np->full_duplex) { - bmcr |= MII_BMCR_DUPLEX_MODE; + bmcr.bits.duplex_mode = 1; printk ("Full duplex\n"); } else { + bmcr.bits.duplex_mode = 0; printk ("Half duplex\n"); } #if 0 /* Set 1000BaseT Master/Slave setting */ - mscr = mii_read (dev, phy_addr, MII_MSCR); - mscr |= MII_MSCR_CFG_ENABLE; - mscr &= ~MII_MSCR_CFG_VALUE = 0; + mscr.image = mii_read (dev, phy_addr, MII_MSCR); + mscr.bits.cfg_enable = 1; + mscr.bits.cfg_value = 0; #endif - mii_write (dev, phy_addr, MII_BMCR, bmcr); + mii_write (dev, phy_addr, MII_BMCR, bmcr.image); mdelay(10); } return 0; @@ -1631,42 +1627,43 @@ mii_set_media (struct net_device *dev) static int mii_get_media_pcs (struct net_device *dev) { - __u16 negotiate; - __u16 bmsr; + ANAR_PCS_t negotiate; + BMSR_t bmsr; + BMCR_t bmcr; int phy_addr; struct netdev_private *np; np = netdev_priv(dev); phy_addr = np->phy_addr; - bmsr = mii_read (dev, phy_addr, PCS_BMSR); + bmsr.image = mii_read (dev, phy_addr, PCS_BMSR); if (np->an_enable) { - if (!(bmsr & MII_BMSR_AN_COMPLETE)) { + if (!bmsr.bits.an_complete) { /* Auto-Negotiation not completed */ return -1; } - negotiate = mii_read (dev, phy_addr, PCS_ANAR) & + negotiate.image = mii_read (dev, phy_addr, PCS_ANAR) & mii_read (dev, phy_addr, PCS_ANLPAR); np->speed = 1000; - if (negotiate & PCS_ANAR_FULL_DUPLEX) { + if (negotiate.bits.full_duplex) { printk (KERN_INFO "Auto 1000 Mbps, Full duplex\n"); np->full_duplex = 1; } else { printk (KERN_INFO "Auto 1000 Mbps, half duplex\n"); np->full_duplex = 0; } - if (negotiate & PCS_ANAR_PAUSE) { + if (negotiate.bits.pause) { np->tx_flow &= 1; np->rx_flow &= 1; - } else if (negotiate & PCS_ANAR_ASYMMETRIC) { + } else if (negotiate.bits.asymmetric) { np->tx_flow = 0; np->rx_flow &= 1; } /* else tx_flow, rx_flow = user select */ } else { - __u16 bmcr = mii_read (dev, phy_addr, PCS_BMCR); + bmcr.image = mii_read (dev, phy_addr, PCS_BMCR); printk (KERN_INFO "Operating at 1000 Mbps, "); - if (bmcr & MII_BMCR_DUPLEX_MODE) { + if (bmcr.bits.duplex_mode) { printk ("Full duplex\n"); } else { printk ("Half duplex\n"); @@ -1687,9 +1684,9 @@ mii_get_media_pcs (struct net_device *dev) static int mii_set_media_pcs (struct net_device *dev) { - __u16 bmcr; - __u16 esr; - __u16 anar; + BMCR_t bmcr; + ESR_t esr; + ANAR_PCS_t anar; int phy_addr; struct netdev_private *np; np = netdev_priv(dev); @@ -1698,37 +1695,41 @@ mii_set_media_pcs (struct net_device *dev) /* Auto-Negotiation? */ if (np->an_enable) { /* Advertise capabilities */ - esr = mii_read (dev, phy_addr, PCS_ESR); - anar = mii_read (dev, phy_addr, MII_ANAR) & - ~PCS_ANAR_HALF_DUPLEX & - ~PCS_ANAR_FULL_DUPLEX; - if (esr & (MII_ESR_1000BT_HD | MII_ESR_1000BX_HD)) - anar |= PCS_ANAR_HALF_DUPLEX; - if (esr & (MII_ESR_1000BT_FD | MII_ESR_1000BX_FD)) - anar |= PCS_ANAR_FULL_DUPLEX; - anar |= PCS_ANAR_PAUSE | PCS_ANAR_ASYMMETRIC; - mii_write (dev, phy_addr, MII_ANAR, anar); + esr.image = mii_read (dev, phy_addr, PCS_ESR); + anar.image = mii_read (dev, phy_addr, MII_ANAR); + anar.bits.half_duplex = + esr.bits.media_1000BT_HD | esr.bits.media_1000BX_HD; + anar.bits.full_duplex = + esr.bits.media_1000BT_FD | esr.bits.media_1000BX_FD; + anar.bits.pause = 1; + anar.bits.asymmetric = 1; + mii_write (dev, phy_addr, MII_ANAR, anar.image); /* Soft reset PHY */ mii_write (dev, phy_addr, MII_BMCR, MII_BMCR_RESET); - bmcr = MII_BMCR_AN_ENABLE | MII_BMCR_RESTART_AN | - MII_BMCR_RESET; - mii_write (dev, phy_addr, MII_BMCR, bmcr); + bmcr.image = 0; + bmcr.bits.an_enable = 1; + bmcr.bits.restart_an = 1; + bmcr.bits.reset = 1; + mii_write (dev, phy_addr, MII_BMCR, bmcr.image); mdelay(1); } else { /* Force speed setting */ /* PHY Reset */ - bmcr = MII_BMCR_RESET; - mii_write (dev, phy_addr, MII_BMCR, bmcr); + bmcr.image = 0; + bmcr.bits.reset = 1; + mii_write (dev, phy_addr, MII_BMCR, bmcr.image); mdelay(10); + bmcr.image = 0; + bmcr.bits.an_enable = 0; if (np->full_duplex) { - bmcr = MII_BMCR_DUPLEX_MODE; + bmcr.bits.duplex_mode = 1; printk (KERN_INFO "Manual full duplex\n"); } else { - bmcr = 0; + bmcr.bits.duplex_mode = 0; printk (KERN_INFO "Manual half duplex\n"); } - mii_write (dev, phy_addr, MII_BMCR, bmcr); + mii_write (dev, phy_addr, MII_BMCR, bmcr.image); mdelay(10); /* Advertise nothing */ diff --git a/trunk/drivers/net/dl2k.h b/trunk/drivers/net/dl2k.h index d66c605b4075..014b77ce96df 100644 --- a/trunk/drivers/net/dl2k.h +++ b/trunk/drivers/net/dl2k.h @@ -298,6 +298,23 @@ enum _pcs_reg { }; /* Basic Mode Control Register */ +typedef union t_MII_BMCR { + u16 image; + struct { + u16 _bit_5_0:6; // bit 5:0 + u16 speed1000:1; // bit 6 + u16 col_test_enable:1; // bit 7 + u16 duplex_mode:1; // bit 8 + u16 restart_an:1; // bit 9 + u16 isolate:1; // bit 10 + u16 power_down:1; // bit 11 + u16 an_enable:1; // bit 12 + u16 speed100:1; // bit 13 + u16 loopback:1; // bit 14 + u16 reset:1; // bit 15 + } bits; +} BMCR_t, *PBMCR_t; + enum _mii_bmcr { MII_BMCR_RESET = 0x8000, MII_BMCR_LOOP_BACK = 0x4000, @@ -316,6 +333,28 @@ enum _mii_bmcr { }; /* Basic Mode Status Register */ +typedef union t_MII_BMSR { + u16 image; + struct { + u16 ext_capability:1; // bit 0 + u16 japper_detect:1; // bit 1 + u16 link_status:1; // bit 2 + u16 an_ability:1; // bit 3 + u16 remote_fault:1; // bit 4 + u16 an_complete:1; // bit 5 + u16 preamble_supp:1; // bit 6 + u16 _bit_7:1; // bit 7 + u16 ext_status:1; // bit 8 + u16 media_100BT2_HD:1; // bit 9 + u16 media_100BT2_FD:1; // bit 10 + u16 media_10BT_HD:1; // bit 11 + u16 media_10BT_FD:1; // bit 12 + u16 media_100BX_HD:1; // bit 13 + u16 media_100BX_FD:1; // bit 14 + u16 media_100BT4:1; // bit 15 + } bits; +} BMSR_t, *PBMSR_t; + enum _mii_bmsr { MII_BMSR_100BT4 = 0x8000, MII_BMSR_100BX_FD = 0x4000, @@ -335,6 +374,24 @@ enum _mii_bmsr { }; /* ANAR */ +typedef union t_MII_ANAR { + u16 image; + struct { + u16 selector:5; // bit 4:0 + u16 media_10BT_HD:1; // bit 5 + u16 media_10BT_FD:1; // bit 6 + u16 media_100BX_HD:1; // bit 7 + u16 media_100BX_FD:1; // bit 8 + u16 media_100BT4:1; // bit 9 + u16 pause:1; // bit 10 + u16 asymmetric:1; // bit 11 + u16 _bit12:1; // bit 12 + u16 remote_fault:1; // bit 13 + u16 _bit14:1; // bit 14 + u16 next_page:1; // bit 15 + } bits; +} ANAR_t, *PANAR_t; + enum _mii_anar { MII_ANAR_NEXT_PAGE = 0x8000, MII_ANAR_REMOTE_FAULT = 0x4000, @@ -350,6 +407,24 @@ enum _mii_anar { }; /* ANLPAR */ +typedef union t_MII_ANLPAR { + u16 image; + struct { + u16 selector:5; // bit 4:0 + u16 media_10BT_HD:1; // bit 5 + u16 media_10BT_FD:1; // bit 6 + u16 media_100BX_HD:1; // bit 7 + u16 media_100BX_FD:1; // bit 8 + u16 media_100BT4:1; // bit 9 + u16 pause:1; // bit 10 + u16 asymmetric:1; // bit 11 + u16 _bit12:1; // bit 12 + u16 remote_fault:1; // bit 13 + u16 _bit14:1; // bit 14 + u16 next_page:1; // bit 15 + } bits; +} ANLPAR_t, *PANLPAR_t; + enum _mii_anlpar { MII_ANLPAR_NEXT_PAGE = MII_ANAR_NEXT_PAGE, MII_ANLPAR_REMOTE_FAULT = MII_ANAR_REMOTE_FAULT, @@ -364,6 +439,18 @@ enum _mii_anlpar { }; /* Auto-Negotiation Expansion Register */ +typedef union t_MII_ANER { + u16 image; + struct { + u16 lp_negotiable:1; // bit 0 + u16 page_received:1; // bit 1 + u16 nextpagable:1; // bit 2 + u16 lp_nextpagable:1; // bit 3 + u16 pdetect_fault:1; // bit 4 + u16 _bit15_5:11; // bit 15:5 + } bits; +} ANER_t, *PANER_t; + enum _mii_aner { MII_ANER_PAR_DETECT_FAULT = 0x0010, MII_ANER_LP_NEXTPAGABLE = 0x0008, @@ -373,6 +460,19 @@ enum _mii_aner { }; /* MASTER-SLAVE Control Register */ +typedef union t_MII_MSCR { + u16 image; + struct { + u16 _bit_7_0:8; // bit 7:0 + u16 media_1000BT_HD:1; // bit 8 + u16 media_1000BT_FD:1; // bit 9 + u16 port_type:1; // bit 10 + u16 cfg_value:1; // bit 11 + u16 cfg_enable:1; // bit 12 + u16 test_mode:3; // bit 15:13 + } bits; +} MSCR_t, *PMSCR_t; + enum _mii_mscr { MII_MSCR_TEST_MODE = 0xe000, MII_MSCR_CFG_ENABLE = 0x1000, @@ -383,6 +483,20 @@ enum _mii_mscr { }; /* MASTER-SLAVE Status Register */ +typedef union t_MII_MSSR { + u16 image; + struct { + u16 idle_err_count:8; // bit 7:0 + u16 _bit_9_8:2; // bit 9:8 + u16 lp_1000BT_HD:1; // bit 10 + u16 lp_1000BT_FD:1; // bit 11 + u16 remote_rcv_status:1; // bit 12 + u16 local_rcv_status:1; // bit 13 + u16 cfg_resolution:1; // bit 14 + u16 cfg_fault:1; // bit 15 + } bits; +} MSSR_t, *PMSSR_t; + enum _mii_mssr { MII_MSSR_CFG_FAULT = 0x8000, MII_MSSR_CFG_RES = 0x4000, @@ -394,6 +508,17 @@ enum _mii_mssr { }; /* IEEE Extened Status Register */ +typedef union t_MII_ESR { + u16 image; + struct { + u16 _bit_11_0:12; // bit 11:0 + u16 media_1000BT_HD:2; // bit 12 + u16 media_1000BT_FD:1; // bit 13 + u16 media_1000BX_HD:1; // bit 14 + u16 media_1000BX_FD:1; // bit 15 + } bits; +} ESR_t, *PESR_t; + enum _mii_esr { MII_ESR_1000BX_FD = 0x8000, MII_ESR_1000BX_HD = 0x4000, @@ -401,7 +526,6 @@ enum _mii_esr { MII_ESR_1000BT_HD = 0x1000, }; /* PHY Specific Control Register */ -#if 0 typedef union t_MII_PHY_SCR { u16 image; struct { @@ -419,7 +543,6 @@ typedef union t_MII_PHY_SCR { u16 xmit_fifo_depth:2; // bit 15:14 } bits; } PHY_SCR_t, *PPHY_SCR_t; -#endif typedef enum t_MII_ADMIN_STATUS { adm_reset, @@ -433,6 +556,21 @@ typedef enum t_MII_ADMIN_STATUS { /* PCS control and status registers bitmap as the same as MII */ /* PCS Extended Status register bitmap as the same as MII */ /* PCS ANAR */ +typedef union t_PCS_ANAR { + u16 image; + struct { + u16 _bit_4_0:5; // bit 4:0 + u16 full_duplex:1; // bit 5 + u16 half_duplex:1; // bit 6 + u16 asymmetric:1; // bit 7 + u16 pause:1; // bit 8 + u16 _bit_11_9:3; // bit 11:9 + u16 remote_fault:2; // bit 13:12 + u16 _bit_14:1; // bit 14 + u16 next_page:1; // bit 15 + } bits; +} ANAR_PCS_t, *PANAR_PCS_t; + enum _pcs_anar { PCS_ANAR_NEXT_PAGE = 0x8000, PCS_ANAR_REMOTE_FAULT = 0x3000, @@ -442,6 +580,21 @@ enum _pcs_anar { PCS_ANAR_FULL_DUPLEX = 0x0020, }; /* PCS ANLPAR */ +typedef union t_PCS_ANLPAR { + u16 image; + struct { + u16 _bit_4_0:5; // bit 4:0 + u16 full_duplex:1; // bit 5 + u16 half_duplex:1; // bit 6 + u16 asymmetric:1; // bit 7 + u16 pause:1; // bit 8 + u16 _bit_11_9:3; // bit 11:9 + u16 remote_fault:2; // bit 13:12 + u16 _bit_14:1; // bit 14 + u16 next_page:1; // bit 15 + } bits; +} ANLPAR_PCS_t, *PANLPAR_PCS_t; + enum _pcs_anlpar { PCS_ANLPAR_NEXT_PAGE = PCS_ANAR_NEXT_PAGE, PCS_ANLPAR_REMOTE_FAULT = PCS_ANAR_REMOTE_FAULT, diff --git a/trunk/drivers/net/e1000/e1000_main.c b/trunk/drivers/net/e1000/e1000_main.c index 0c9a6f7104d2..13d57b0a88fa 100644 --- a/trunk/drivers/net/e1000/e1000_main.c +++ b/trunk/drivers/net/e1000/e1000_main.c @@ -3919,7 +3919,7 @@ e1000_clean(struct napi_struct *napi, int budget) { struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); struct net_device *poll_dev = adapter->netdev; - int tx_cleaned = 0, work_done = 0; + int work_done = 0; /* Must NOT use netdev_priv macro here. */ adapter = poll_dev->priv; @@ -3929,17 +3929,14 @@ e1000_clean(struct napi_struct *napi, int budget) * simultaneously. A failure obtaining the lock means * tx_ring[0] is currently being cleaned anyway. */ if (spin_trylock(&adapter->tx_queue_lock)) { - tx_cleaned = e1000_clean_tx_irq(adapter, - &adapter->tx_ring[0]); + e1000_clean_tx_irq(adapter, + &adapter->tx_ring[0]); spin_unlock(&adapter->tx_queue_lock); } adapter->clean_rx(adapter, &adapter->rx_ring[0], &work_done, budget); - if (tx_cleaned) - work_done = budget; - /* If budget not fully consumed, exit the polling mode */ if (work_done < budget) { if (likely(adapter->itr_setting & 3)) diff --git a/trunk/drivers/net/e1000e/netdev.c b/trunk/drivers/net/e1000e/netdev.c index 2ab3bfbb8a63..4a6fc7453776 100644 --- a/trunk/drivers/net/e1000e/netdev.c +++ b/trunk/drivers/net/e1000e/netdev.c @@ -1384,7 +1384,7 @@ static int e1000_clean(struct napi_struct *napi, int budget) { struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); struct net_device *poll_dev = adapter->netdev; - int tx_cleaned = 0, work_done = 0; + int work_done = 0; /* Must NOT use netdev_priv macro here. */ adapter = poll_dev->priv; @@ -1394,15 +1394,12 @@ static int e1000_clean(struct napi_struct *napi, int budget) * simultaneously. A failure obtaining the lock means * tx_ring is currently being cleaned anyway. */ if (spin_trylock(&adapter->tx_queue_lock)) { - tx_cleaned = e1000_clean_tx_irq(adapter); + e1000_clean_tx_irq(adapter); spin_unlock(&adapter->tx_queue_lock); } adapter->clean_rx(adapter, &work_done, budget); - if (tx_cleaned) - work_done = budget; - /* If budget not fully consumed, exit the polling mode */ if (work_done < budget) { if (adapter->itr_setting & 3) diff --git a/trunk/drivers/net/ipg.c b/trunk/drivers/net/ipg.c index 50f0c17451b1..dbd23bb65d1e 100644 --- a/trunk/drivers/net/ipg.c +++ b/trunk/drivers/net/ipg.c @@ -857,14 +857,21 @@ static void init_tfdlist(struct net_device *dev) static void ipg_nic_txfree(struct net_device *dev) { struct ipg_nic_private *sp = netdev_priv(dev); - unsigned int released, pending, dirty; + void __iomem *ioaddr = sp->ioaddr; + unsigned int curr; + u64 txd_map; + unsigned int released, pending; + + txd_map = (u64)sp->txd_map; + curr = ipg_r32(TFD_LIST_PTR_0) - + do_div(txd_map, sizeof(struct ipg_tx)) - 1; IPG_DEBUG_MSG("_nic_txfree\n"); pending = sp->tx_current - sp->tx_dirty; - dirty = sp->tx_dirty % IPG_TFDLIST_LENGTH; for (released = 0; released < pending; released++) { + unsigned int dirty = sp->tx_dirty % IPG_TFDLIST_LENGTH; struct sk_buff *skb = sp->TxBuff[dirty]; struct ipg_tx *txfd = sp->txd + dirty; @@ -875,8 +882,11 @@ static void ipg_nic_txfree(struct net_device *dev) * If the TFDDone bit is set, free the associated * buffer. */ - if (!(txfd->tfc & cpu_to_le64(IPG_TFC_TFDDONE))) - break; + if (dirty == curr) + break; + + /* Setup TFDDONE for compatible issue. */ + txfd->tfc |= cpu_to_le64(IPG_TFC_TFDDONE); /* Free the transmit buffer. */ if (skb) { @@ -888,7 +898,6 @@ static void ipg_nic_txfree(struct net_device *dev) sp->TxBuff[dirty] = NULL; } - dirty = (dirty + 1) % IPG_TFDLIST_LENGTH; } sp->tx_dirty += released; @@ -1621,8 +1630,6 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst) #ifdef JUMBO_FRAME ipg_nic_rxrestore(dev); #endif - spin_lock(&sp->lock); - /* Get interrupt source information, and acknowledge * some (i.e. TxDMAComplete, RxDMAComplete, RxEarly, * IntRequested, MacControlFrame, LinkEvent) interrupts @@ -1640,7 +1647,9 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst) handled = 1; if (unlikely(!netif_running(dev))) - goto out_unlock; + goto out; + + spin_lock(&sp->lock); /* If RFDListEnd interrupt, restore all used RFDs. */ if (status & IPG_IS_RFD_LIST_END) { @@ -1724,9 +1733,9 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst) ipg_w16(IPG_IE_TX_DMA_COMPLETE | IPG_IE_RX_DMA_COMPLETE | IPG_IE_HOST_ERROR | IPG_IE_INT_REQUESTED | IPG_IE_TX_COMPLETE | IPG_IE_LINK_EVENT | IPG_IE_UPDATE_STATS, INT_ENABLE); -out_unlock: - spin_unlock(&sp->lock); + spin_unlock(&sp->lock); +out: return IRQ_RETVAL(handled); } @@ -1934,7 +1943,10 @@ static int ipg_nic_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) */ if (sp->tenmbpsmode) txfd->tfc |= cpu_to_le64(IPG_TFC_TXINDICATE); - txfd->tfc |= cpu_to_le64(IPG_TFC_TXDMAINDICATE); + else if (!((sp->tx_current - sp->tx_dirty + 1) > + IPG_FRAMESBETWEENTXDMACOMPLETES)) { + txfd->tfc |= cpu_to_le64(IPG_TFC_TXDMAINDICATE); + } /* Based on compilation option, determine if FCS is to be * appended to transmit frame by IPG. */ @@ -1991,7 +2003,7 @@ static int ipg_nic_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ipg_w32(IPG_DC_TX_DMA_POLL_NOW, DMA_CTRL); if (sp->tx_current == (sp->tx_dirty + IPG_TFDLIST_LENGTH)) - netif_stop_queue(dev); + netif_wake_queue(dev); spin_unlock_irqrestore(&sp->lock, flags); diff --git a/trunk/drivers/net/ixgbe/ixgbe_main.c b/trunk/drivers/net/ixgbe/ixgbe_main.c index de3f45e4c5ae..a56491617661 100644 --- a/trunk/drivers/net/ixgbe/ixgbe_main.c +++ b/trunk/drivers/net/ixgbe/ixgbe_main.c @@ -1468,16 +1468,13 @@ static int ixgbe_clean(struct napi_struct *napi, int budget) struct ixgbe_adapter *adapter = container_of(napi, struct ixgbe_adapter, napi); struct net_device *netdev = adapter->netdev; - int tx_cleaned = 0, work_done = 0; + int work_done = 0; /* In non-MSIX case, there is no multi-Tx/Rx queue */ - tx_cleaned = ixgbe_clean_tx_irq(adapter, adapter->tx_ring); + ixgbe_clean_tx_irq(adapter, adapter->tx_ring); ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &work_done, budget); - if (tx_cleaned) - work_done = budget; - /* If budget not fully consumed, exit the polling mode */ if (work_done < budget) { netif_rx_complete(netdev, napi); diff --git a/trunk/drivers/net/niu.c b/trunk/drivers/net/niu.c index 5f6beabf2d17..3bbcea11329f 100644 --- a/trunk/drivers/net/niu.c +++ b/trunk/drivers/net/niu.c @@ -1319,7 +1319,6 @@ static int link_status_10g(struct niu *np, int *link_up_p) static int link_status_1g(struct niu *np, int *link_up_p) { - struct niu_link_config *lp = &np->link_config; u16 current_speed, bmsr; unsigned long flags; u8 current_duplex; @@ -1387,8 +1386,6 @@ static int link_status_1g(struct niu *np, int *link_up_p) link_up = 0; } } - lp->active_speed = current_speed; - lp->active_duplex = current_duplex; err = 0; out: diff --git a/trunk/drivers/net/pcmcia/3c574_cs.c b/trunk/drivers/net/pcmcia/3c574_cs.c index 36a7ba3134ce..288177716a49 100644 --- a/trunk/drivers/net/pcmcia/3c574_cs.c +++ b/trunk/drivers/net/pcmcia/3c574_cs.c @@ -187,16 +187,14 @@ enum Window1 { enum Window3 { /* Window 3: MAC/config bits. */ Wn3_Config=0, Wn3_MAC_Ctrl=6, Wn3_Options=8, }; -enum wn3_config { - Ram_size = 7, - Ram_width = 8, - Ram_speed = 0x30, - Rom_size = 0xc0, - Ram_split_shift = 16, - Ram_split = 3 << Ram_split_shift, - Xcvr_shift = 20, - Xcvr = 7 << Xcvr_shift, - Autoselect = 0x1000000, +union wn3_config { + int i; + struct w3_config_fields { + unsigned int ram_size:3, ram_width:1, ram_speed:2, rom_size:2; + int pad8:8; + unsigned int ram_split:2, pad18:2, xcvr:3, pad21:1, autoselect:1; + int pad24:7; + } u; }; enum Window4 { /* Window 4: Xcvr/media bits. */ @@ -344,7 +342,7 @@ static int tc574_config(struct pcmcia_device *link) kio_addr_t ioaddr; __be16 *phys_addr; char *cardname; - __u32 config; + union wn3_config config; DECLARE_MAC_BUF(mac); phys_addr = (__be16 *)dev->dev_addr; @@ -403,9 +401,9 @@ static int tc574_config(struct pcmcia_device *link) outw(0<<11, ioaddr + RunnerRdCtrl); printk(KERN_INFO " ASIC rev %d,", mcr>>3); EL3WINDOW(3); - config = inl(ioaddr + Wn3_Config); - lp->default_media = (config & Xcvr) >> Xcvr_shift; - lp->autoselect = config & Autoselect ? 1 : 0; + config.i = inl(ioaddr + Wn3_Config); + lp->default_media = config.u.xcvr; + lp->autoselect = config.u.autoselect; } init_timer(&lp->media); @@ -466,9 +464,8 @@ static int tc574_config(struct pcmcia_device *link) dev->name, cardname, dev->base_addr, dev->irq, print_mac(mac, dev->dev_addr)); printk(" %dK FIFO split %s Rx:Tx, %sMII interface.\n", - 8 << config & Ram_size, - ram_split[(config & Ram_split) >> Ram_split_shift], - config & Autoselect ? "autoselect " : ""); + 8 << config.u.ram_size, ram_split[config.u.ram_split], + config.u.autoselect ? "autoselect " : ""); return 0; diff --git a/trunk/drivers/net/s2io.c b/trunk/drivers/net/s2io.c index f2ba944e035e..fa57c49c0c51 100644 --- a/trunk/drivers/net/s2io.c +++ b/trunk/drivers/net/s2io.c @@ -84,7 +84,7 @@ #include "s2io.h" #include "s2io-regs.h" -#define DRV_VERSION "2.0.26.17" +#define DRV_VERSION "2.0.26.10" /* S2io Driver name & version. */ static char s2io_driver_name[] = "Neterion"; @@ -3848,6 +3848,8 @@ static int s2io_open(struct net_device *dev) netif_carrier_off(dev); sp->last_link_state = 0; + napi_enable(&sp->napi); + if (sp->config.intr_type == MSI_X) { int ret = s2io_enable_msi_x(sp); @@ -3890,6 +3892,7 @@ static int s2io_open(struct net_device *dev) return 0; hw_init_failed: + napi_disable(&sp->napi); if (sp->config.intr_type == MSI_X) { if (sp->entries) { kfree(sp->entries); @@ -3929,6 +3932,7 @@ static int s2io_close(struct net_device *dev) return 0; netif_stop_queue(dev); + napi_disable(&sp->napi); /* Reset card, kill tasklet and free Tx and Rx buffers. */ s2io_card_down(sp); @@ -6792,8 +6796,6 @@ static void do_s2io_card_down(struct s2io_nic * sp, int do_io) struct XENA_dev_config __iomem *bar0 = sp->bar0; unsigned long flags; register u64 val64 = 0; - struct config_param *config; - config = &sp->config; if (!is_s2io_card_up(sp)) return; @@ -6805,10 +6807,6 @@ static void do_s2io_card_down(struct s2io_nic * sp, int do_io) } clear_bit(__S2IO_STATE_CARD_UP, &sp->state); - /* Disable napi */ - if (config->napi) - napi_disable(&sp->napi); - /* disable Tx and Rx traffic on the NIC */ if (do_io) stop_nic(sp); @@ -6902,11 +6900,6 @@ static int s2io_card_up(struct s2io_nic * sp) DBG_PRINT(INFO_DBG, "Buf in ring:%d is %d:\n", i, atomic_read(&sp->rx_bufs_left[i])); } - - /* Initialise napi */ - if (config->napi) - napi_enable(&sp->napi); - /* Maintain the state prior to the open */ if (sp->promisc_flg) sp->promisc_flg = 0; diff --git a/trunk/drivers/net/sky2.c b/trunk/drivers/net/sky2.c index bc15940ce1bc..7023bbe545ee 100644 --- a/trunk/drivers/net/sky2.c +++ b/trunk/drivers/net/sky2.c @@ -3949,7 +3949,7 @@ static __exit void sky2_debug_cleanup(void) /* Initialize network device */ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, unsigned port, - int highmem, int wol) + int highmem) { struct sky2_port *sky2; struct net_device *dev = alloc_etherdev(sizeof(*sky2)); @@ -3989,7 +3989,7 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, sky2->speed = -1; sky2->advertising = sky2_supported_modes(hw); sky2->rx_csum = (hw->chip_id != CHIP_ID_YUKON_XL); - sky2->wol = wol; + sky2->wol = sky2_wol_supported(hw) & WAKE_MAGIC; spin_lock_init(&sky2->phy_lock); sky2->tx_pending = TX_DEF_PENDING; @@ -4086,24 +4086,12 @@ static int __devinit sky2_test_msi(struct sky2_hw *hw) return err; } -static int __devinit pci_wake_enabled(struct pci_dev *dev) -{ - int pm = pci_find_capability(dev, PCI_CAP_ID_PM); - u16 value; - - if (!pm) - return 0; - if (pci_read_config_word(dev, pm + PCI_PM_CTRL, &value)) - return 0; - return value & PCI_PM_CTRL_PME_ENABLE; -} - static int __devinit sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { struct net_device *dev; struct sky2_hw *hw; - int err, using_dac = 0, wol_default; + int err, using_dac = 0; err = pci_enable_device(pdev); if (err) { @@ -4136,8 +4124,6 @@ static int __devinit sky2_probe(struct pci_dev *pdev, } } - wol_default = pci_wake_enabled(pdev) ? WAKE_MAGIC : 0; - err = -ENOMEM; hw = kzalloc(sizeof(*hw), GFP_KERNEL); if (!hw) { @@ -4181,7 +4167,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev, sky2_reset(hw); - dev = sky2_init_netdev(hw, 0, using_dac, wol_default); + dev = sky2_init_netdev(hw, 0, using_dac); if (!dev) { err = -ENOMEM; goto err_out_free_pci; @@ -4218,7 +4204,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev, if (hw->ports > 1) { struct net_device *dev1; - dev1 = sky2_init_netdev(hw, 1, using_dac, wol_default); + dev1 = sky2_init_netdev(hw, 1, using_dac); if (!dev1) dev_warn(&pdev->dev, "allocation for second device failed\n"); else if ((err = register_netdev(dev1))) { diff --git a/trunk/drivers/net/wan/dscc4.c b/trunk/drivers/net/wan/dscc4.c index c6f26e28e376..33dc713b5301 100644 --- a/trunk/drivers/net/wan/dscc4.c +++ b/trunk/drivers/net/wan/dscc4.c @@ -139,21 +139,19 @@ struct thingie { }; struct TxFD { - __le32 state; - __le32 next; - __le32 data; - __le32 complete; + u32 state; + u32 next; + u32 data; + u32 complete; u32 jiffies; /* Allows sizeof(TxFD) == sizeof(RxFD) + extra hack */ - /* FWIW, datasheet calls that "dummy" and says that card - * never looks at it; neither does the driver */ }; struct RxFD { - __le32 state1; - __le32 next; - __le32 data; - __le32 state2; - __le32 end; + u32 state1; + u32 next; + u32 data; + u32 state2; + u32 end; }; #define DUMMY_SKB_SIZE 64 @@ -183,7 +181,7 @@ struct RxFD { #define SCC_REG_START(dpriv) (SCC_START+(dpriv->dev_id)*SCC_OFFSET) struct dscc4_pci_priv { - __le32 *iqcfg; + u32 *iqcfg; int cfg_cur; spinlock_t lock; struct pci_dev *pdev; @@ -199,8 +197,8 @@ struct dscc4_dev_priv { struct RxFD *rx_fd; struct TxFD *tx_fd; - __le32 *iqrx; - __le32 *iqtx; + u32 *iqrx; + u32 *iqtx; /* FIXME: check all the volatile are required */ volatile u32 tx_current; @@ -300,7 +298,7 @@ struct dscc4_dev_priv { #define BrrExpMask 0x00000f00 #define BrrMultMask 0x0000003f #define EncodingMask 0x00700000 -#define Hold cpu_to_le32(0x40000000) +#define Hold 0x40000000 #define SccBusy 0x10000000 #define PowerUp 0x80000000 #define Vis 0x00001000 @@ -309,14 +307,14 @@ struct dscc4_dev_priv { #define FrameRdo 0x40 #define FrameCrc 0x20 #define FrameRab 0x10 -#define FrameAborted cpu_to_le32(0x00000200) -#define FrameEnd cpu_to_le32(0x80000000) -#define DataComplete cpu_to_le32(0x40000000) +#define FrameAborted 0x00000200 +#define FrameEnd 0x80000000 +#define DataComplete 0x40000000 #define LengthCheck 0x00008000 #define SccEvt 0x02000000 #define NoAck 0x00000200 #define Action 0x00000001 -#define HiDesc cpu_to_le32(0x20000000) +#define HiDesc 0x20000000 /* SCC events */ #define RxEvt 0xf0000000 @@ -491,8 +489,8 @@ static void dscc4_release_ring(struct dscc4_dev_priv *dpriv) skbuff = dpriv->tx_skbuff; for (i = 0; i < TX_RING_SIZE; i++) { if (*skbuff) { - pci_unmap_single(pdev, le32_to_cpu(tx_fd->data), - (*skbuff)->len, PCI_DMA_TODEVICE); + pci_unmap_single(pdev, tx_fd->data, (*skbuff)->len, + PCI_DMA_TODEVICE); dev_kfree_skb(*skbuff); } skbuff++; @@ -502,7 +500,7 @@ static void dscc4_release_ring(struct dscc4_dev_priv *dpriv) skbuff = dpriv->rx_skbuff; for (i = 0; i < RX_RING_SIZE; i++) { if (*skbuff) { - pci_unmap_single(pdev, le32_to_cpu(rx_fd->data), + pci_unmap_single(pdev, rx_fd->data, RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE); dev_kfree_skb(*skbuff); } @@ -524,10 +522,10 @@ static inline int try_get_rx_skb(struct dscc4_dev_priv *dpriv, dpriv->rx_skbuff[dirty] = skb; if (skb) { skb->protocol = hdlc_type_trans(skb, dev); - rx_fd->data = cpu_to_le32(pci_map_single(dpriv->pci_priv->pdev, - skb->data, len, PCI_DMA_FROMDEVICE)); + rx_fd->data = pci_map_single(dpriv->pci_priv->pdev, skb->data, + len, PCI_DMA_FROMDEVICE); } else { - rx_fd->data = 0; + rx_fd->data = (u32) NULL; ret = -1; } return ret; @@ -589,7 +587,7 @@ static inline int dscc4_xpr_ack(struct dscc4_dev_priv *dpriv) do { if (!(dpriv->flags & (NeedIDR | NeedIDT)) || - (dpriv->iqtx[cur] & cpu_to_le32(Xpr))) + (dpriv->iqtx[cur] & Xpr)) break; smp_rmb(); schedule_timeout_uninterruptible(10); @@ -652,9 +650,8 @@ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv, printk(KERN_DEBUG "%s: skb=0 (%s)\n", dev->name, __FUNCTION__); goto refill; } - pkt_len = TO_SIZE(le32_to_cpu(rx_fd->state2)); - pci_unmap_single(pdev, le32_to_cpu(rx_fd->data), - RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE); + pkt_len = TO_SIZE(rx_fd->state2); + pci_unmap_single(pdev, rx_fd->data, RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE); if ((skb->data[--pkt_len] & FrameOk) == FrameOk) { stats->rx_packets++; stats->rx_bytes += pkt_len; @@ -682,7 +679,7 @@ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv, } dscc4_rx_update(dpriv, dev); rx_fd->state2 = 0x00000000; - rx_fd->end = cpu_to_le32(0xbabeface); + rx_fd->end = 0xbabeface; } static void dscc4_free1(struct pci_dev *pdev) @@ -775,8 +772,8 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev, } /* Global interrupt queue */ writel((u32)(((IRQ_RING_SIZE >> 5) - 1) << 20), ioaddr + IQLENR1); - priv->iqcfg = (__le32 *) pci_alloc_consistent(pdev, - IRQ_RING_SIZE*sizeof(__le32), &priv->iqcfg_dma); + priv->iqcfg = (u32 *) pci_alloc_consistent(pdev, + IRQ_RING_SIZE*sizeof(u32), &priv->iqcfg_dma); if (!priv->iqcfg) goto err_free_irq_5; writel(priv->iqcfg_dma, ioaddr + IQCFG); @@ -789,7 +786,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev, */ for (i = 0; i < dev_per_card; i++) { dpriv = priv->root + i; - dpriv->iqtx = (__le32 *) pci_alloc_consistent(pdev, + dpriv->iqtx = (u32 *) pci_alloc_consistent(pdev, IRQ_RING_SIZE*sizeof(u32), &dpriv->iqtx_dma); if (!dpriv->iqtx) goto err_free_iqtx_6; @@ -797,7 +794,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev, } for (i = 0; i < dev_per_card; i++) { dpriv = priv->root + i; - dpriv->iqrx = (__le32 *) pci_alloc_consistent(pdev, + dpriv->iqrx = (u32 *) pci_alloc_consistent(pdev, IRQ_RING_SIZE*sizeof(u32), &dpriv->iqrx_dma); if (!dpriv->iqrx) goto err_free_iqrx_7; @@ -1159,8 +1156,8 @@ static int dscc4_start_xmit(struct sk_buff *skb, struct net_device *dev) dpriv->tx_skbuff[next] = skb; tx_fd = dpriv->tx_fd + next; tx_fd->state = FrameEnd | TO_STATE_TX(skb->len); - tx_fd->data = cpu_to_le32(pci_map_single(ppriv->pdev, skb->data, skb->len, - PCI_DMA_TODEVICE)); + tx_fd->data = pci_map_single(ppriv->pdev, skb->data, skb->len, + PCI_DMA_TODEVICE); tx_fd->complete = 0x00000000; tx_fd->jiffies = jiffies; mb(); @@ -1511,7 +1508,7 @@ static irqreturn_t dscc4_irq(int irq, void *token) if (state & Cfg) { if (debug > 0) printk(KERN_DEBUG "%s: CfgIV\n", DRV_NAME); - if (priv->iqcfg[priv->cfg_cur++%IRQ_RING_SIZE] & cpu_to_le32(Arf)) + if (priv->iqcfg[priv->cfg_cur++%IRQ_RING_SIZE] & Arf) printk(KERN_ERR "%s: %s failed\n", dev->name, "CFG"); if (!(state &= ~Cfg)) goto out; @@ -1544,7 +1541,7 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv, try: cur = dpriv->iqtx_current%IRQ_RING_SIZE; - state = le32_to_cpu(dpriv->iqtx[cur]); + state = dpriv->iqtx[cur]; if (!state) { if (debug > 4) printk(KERN_DEBUG "%s: Tx ISR = 0x%08x\n", dev->name, @@ -1583,7 +1580,7 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv, tx_fd = dpriv->tx_fd + cur; skb = dpriv->tx_skbuff[cur]; if (skb) { - pci_unmap_single(ppriv->pdev, le32_to_cpu(tx_fd->data), + pci_unmap_single(ppriv->pdev, tx_fd->data, skb->len, PCI_DMA_TODEVICE); if (tx_fd->state & FrameEnd) { stats->tx_packets++; @@ -1714,7 +1711,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv, try: cur = dpriv->iqrx_current%IRQ_RING_SIZE; - state = le32_to_cpu(dpriv->iqrx[cur]); + state = dpriv->iqrx[cur]; if (!state) return; dpriv->iqrx[cur] = 0; @@ -1758,7 +1755,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv, goto try; rx_fd->state1 &= ~Hold; rx_fd->state2 = 0x00000000; - rx_fd->end = cpu_to_le32(0xbabeface); + rx_fd->end = 0xbabeface; //} goto try; } @@ -1837,7 +1834,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv, hdlc_stats(dev)->rx_over_errors++; rx_fd->state1 |= Hold; rx_fd->state2 = 0x00000000; - rx_fd->end = cpu_to_le32(0xbabeface); + rx_fd->end = 0xbabeface; } else dscc4_rx_skb(dpriv, dev); } while (1); @@ -1907,9 +1904,8 @@ static struct sk_buff *dscc4_init_dummy_skb(struct dscc4_dev_priv *dpriv) skb_copy_to_linear_data(skb, version, strlen(version) % DUMMY_SKB_SIZE); tx_fd->state = FrameEnd | TO_STATE_TX(DUMMY_SKB_SIZE); - tx_fd->data = cpu_to_le32(pci_map_single(dpriv->pci_priv->pdev, - skb->data, DUMMY_SKB_SIZE, - PCI_DMA_TODEVICE)); + tx_fd->data = pci_map_single(dpriv->pci_priv->pdev, skb->data, + DUMMY_SKB_SIZE, PCI_DMA_TODEVICE); dpriv->tx_skbuff[last] = skb; } return skb; @@ -1941,8 +1937,8 @@ static int dscc4_init_ring(struct net_device *dev) tx_fd->state = FrameEnd | TO_STATE_TX(2*DUMMY_SKB_SIZE); tx_fd->complete = 0x00000000; /* FIXME: NULL should be ok - to be tried */ - tx_fd->data = cpu_to_le32(dpriv->tx_fd_dma); - (tx_fd++)->next = cpu_to_le32(dpriv->tx_fd_dma + + tx_fd->data = dpriv->tx_fd_dma; + (tx_fd++)->next = (u32)(dpriv->tx_fd_dma + (++i%TX_RING_SIZE)*sizeof(*tx_fd)); } while (i < TX_RING_SIZE); @@ -1955,12 +1951,12 @@ static int dscc4_init_ring(struct net_device *dev) /* size set by the host. Multiple of 4 bytes please */ rx_fd->state1 = HiDesc; rx_fd->state2 = 0x00000000; - rx_fd->end = cpu_to_le32(0xbabeface); + rx_fd->end = 0xbabeface; rx_fd->state1 |= TO_STATE_RX(HDLC_MAX_MRU); // FIXME: return value verifiee mais traitement suspect if (try_get_rx_skb(dpriv, dev) >= 0) dpriv->rx_dirty++; - (rx_fd++)->next = cpu_to_le32(dpriv->rx_fd_dma + + (rx_fd++)->next = (u32)(dpriv->rx_fd_dma + (++i%RX_RING_SIZE)*sizeof(*rx_fd)); } while (i < RX_RING_SIZE); diff --git a/trunk/drivers/net/wan/lmc/lmc_media.c b/trunk/drivers/net/wan/lmc/lmc_media.c index c9c878cd5c72..574737b55f39 100644 --- a/trunk/drivers/net/wan/lmc/lmc_media.c +++ b/trunk/drivers/net/wan/lmc/lmc_media.c @@ -890,8 +890,16 @@ write_av9110 (lmc_softc_t * sc, u_int32_t n, u_int32_t m, u_int32_t v, static void lmc_ssi_watchdog (lmc_softc_t * const sc) { - u_int16_t mii17 = lmc_mii_readreg (sc, 0, 17); - if (((mii17 >> 3) & 7) == 7) + u_int16_t mii17; + struct ssicsr2 + { + unsigned short dtr:1, dsr:1, rts:1, cable:3, crc:1, led0:1, led1:1, + led2:1, led3:1, fifo:1, ll:1, rl:1, tm:1, loop:1; + }; + struct ssicsr2 *ssicsr; + mii17 = lmc_mii_readreg (sc, 0, 17); + ssicsr = (struct ssicsr2 *) &mii17; + if (ssicsr->cable == 7) { lmc_led_off (sc, LMC_MII16_LED2); } diff --git a/trunk/drivers/net/wan/sbni.h b/trunk/drivers/net/wan/sbni.h index 84264510a8ed..27715e70f28b 100644 --- a/trunk/drivers/net/wan/sbni.h +++ b/trunk/drivers/net/wan/sbni.h @@ -44,15 +44,9 @@ enum { #define PR_RES 0x80 struct sbni_csr1 { -#ifdef __LITTLE_ENDIAN_BITFIELD - u8 rxl : 5; - u8 rate : 2; - u8 : 1; -#else - u8 : 1; - u8 rate : 2; - u8 rxl : 5; -#endif + unsigned rxl : 5; + unsigned rate : 2; + unsigned : 1; }; /* fields in frame header */ diff --git a/trunk/drivers/net/wireless/b43/rfkill.c b/trunk/drivers/net/wireless/b43/rfkill.c index 11f53cb1139e..98cf70c5fd47 100644 --- a/trunk/drivers/net/wireless/b43/rfkill.c +++ b/trunk/drivers/net/wireless/b43/rfkill.c @@ -138,11 +138,8 @@ void b43_rfkill_init(struct b43_wldev *dev) rfk->rfkill->user_claim_unsupported = 1; rfk->poll_dev = input_allocate_polled_device(); - if (!rfk->poll_dev) { - rfkill_free(rfk->rfkill); - goto err_freed_rfk; - } - + if (!rfk->poll_dev) + goto err_free_rfk; rfk->poll_dev->private = dev; rfk->poll_dev->poll = b43_rfkill_poll; rfk->poll_dev->poll_interval = 1000; /* msecs */ @@ -178,7 +175,8 @@ void b43_rfkill_init(struct b43_wldev *dev) err_free_polldev: input_free_polled_device(rfk->poll_dev); rfk->poll_dev = NULL; -err_freed_rfk: +err_free_rfk: + rfkill_free(rfk->rfkill); rfk->rfkill = NULL; out_error: rfk->registered = 0; @@ -197,5 +195,6 @@ void b43_rfkill_exit(struct b43_wldev *dev) rfkill_unregister(rfk->rfkill); input_free_polled_device(rfk->poll_dev); rfk->poll_dev = NULL; + rfkill_free(rfk->rfkill); rfk->rfkill = NULL; } diff --git a/trunk/drivers/net/wireless/hostap/hostap_plx.c b/trunk/drivers/net/wireless/hostap/hostap_plx.c index cbf15d703201..040dc3e36410 100644 --- a/trunk/drivers/net/wireless/hostap/hostap_plx.c +++ b/trunk/drivers/net/wireless/hostap/hostap_plx.c @@ -608,7 +608,7 @@ static void prism2_plx_remove(struct pci_dev *pdev) MODULE_DEVICE_TABLE(pci, prism2_plx_id_table); -static struct pci_driver prism2_plx_driver = { +static struct pci_driver prism2_plx_drv_id = { .name = "hostap_plx", .id_table = prism2_plx_id_table, .probe = prism2_plx_probe, @@ -618,13 +618,13 @@ static struct pci_driver prism2_plx_driver = { static int __init init_prism2_plx(void) { - return pci_register_driver(&prism2_plx_driver); + return pci_register_driver(&prism2_plx_drv_id); } static void __exit exit_prism2_plx(void) { - pci_unregister_driver(&prism2_plx_driver); + pci_unregister_driver(&prism2_plx_drv_id); } diff --git a/trunk/drivers/net/wireless/ipw2200.c b/trunk/drivers/net/wireless/ipw2200.c index 003f73f89efa..88062c1318a8 100644 --- a/trunk/drivers/net/wireless/ipw2200.c +++ b/trunk/drivers/net/wireless/ipw2200.c @@ -4935,7 +4935,7 @@ static int ipw_queue_reset(struct ipw_priv *priv) /** * Reclaim Tx queue entries no more used by NIC. * - * When FW advances 'R' index, all entries between old and + * When FW adwances 'R' index, all entries between old and * new 'R' index need to be reclaimed. As result, some free space * forms. If there is enough free space (> low mark), wake Tx queue. * diff --git a/trunk/drivers/net/wireless/libertas/if_sdio.c b/trunk/drivers/net/wireless/libertas/if_sdio.c index 4f1efb108c28..b24425f74883 100644 --- a/trunk/drivers/net/wireless/libertas/if_sdio.c +++ b/trunk/drivers/net/wireless/libertas/if_sdio.c @@ -871,10 +871,6 @@ static int if_sdio_probe(struct sdio_func *func, if (sscanf(func->card->info[i], "ID: %x", &model) == 1) break; - if (!strcmp(func->card->info[i], "IBIS Wireless SDIO Card")) { - model = 4; - break; - } } if (i == func->card->num_info) { diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00pci.c b/trunk/drivers/net/wireless/rt2x00/rt2x00pci.c index 04663eb31950..6d5d9aba0b73 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00pci.c @@ -149,7 +149,7 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) * The data behind the ieee80211 header must be * aligned on a 4 byte boundary. */ - align = header_size % 4; + align = NET_IP_ALIGN + (2 * (header_size % 4 == 0)); /* * Allocate the sk_buffer, initialize it and copy diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c b/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c index 568d73847dca..ab4797ed94c9 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c @@ -245,20 +245,13 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb) * Allocate a new sk buffer to replace the current one. * If allocation fails, we should drop the current frame * so we can recycle the existing sk buffer for the new frame. - * As alignment we use 2 and not NET_IP_ALIGN because we need - * to be sure we have 2 bytes room in the head. (NET_IP_ALIGN - * can be 0 on some hardware). We use these 2 bytes for frame - * alignment later, we assume that the chance that - * header_size % 4 == 2 is bigger then header_size % 2 == 0 - * and thus optimize alignment by reserving the 2 bytes in - * advance. */ frame_size = entry->ring->data_size + entry->ring->desc_size; - skb = dev_alloc_skb(frame_size + 2); + skb = dev_alloc_skb(frame_size + NET_IP_ALIGN); if (!skb) goto skip_entry; - skb_reserve(skb, 2); + skb_reserve(skb, NET_IP_ALIGN); skb_put(skb, frame_size); /* diff --git a/trunk/drivers/pnp/pnpacpi/rsparser.c b/trunk/drivers/pnp/pnpacpi/rsparser.c index 6b9840cce0f4..f7b8648acbfa 100644 --- a/trunk/drivers/pnp/pnpacpi/rsparser.c +++ b/trunk/drivers/pnp/pnpacpi/rsparser.c @@ -215,7 +215,6 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, } else if (!warned) { printk(KERN_ERR "pnpacpi: exceeded the max number of IO " "resources: %d \n", PNP_MAX_PORT); - warned = 1; } } @@ -243,7 +242,6 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res, } else if (!warned) { printk(KERN_ERR "pnpacpi: exceeded the max number of mem " "resources: %d\n", PNP_MAX_MEM); - warned = 1; } } diff --git a/trunk/drivers/video/modedb.c b/trunk/drivers/video/modedb.c index 08d072552233..8d81ef019c6c 100644 --- a/trunk/drivers/video/modedb.c +++ b/trunk/drivers/video/modedb.c @@ -259,10 +259,6 @@ static const struct fb_videomode modedb[] = { /* 1366x768, 60 Hz, 47.403 kHz hsync, WXGA 16:9 aspect ratio */ NULL, 60, 1366, 768, 13806, 120, 10, 14, 3, 32, 5, 0, FB_VMODE_NONINTERLACED - }, { - /* 1280x800, 60 Hz, 47.403 kHz hsync, WXGA 16:10 aspect ratio */ - NULL, 60, 1280, 800, 12048, 200, 64, 24, 1, 136, 3, - 0, FB_VMODE_NONINTERLACED }, }; diff --git a/trunk/drivers/watchdog/w83697hf_wdt.c b/trunk/drivers/watchdog/w83697hf_wdt.c index c622a0e6c9ae..6ea125eabeaa 100644 --- a/trunk/drivers/watchdog/w83697hf_wdt.c +++ b/trunk/drivers/watchdog/w83697hf_wdt.c @@ -382,8 +382,10 @@ wdt_init(void) /* we will autodetect the W83697HF/HG watchdog */ for (i = 0; ((!found) && (w83697hf_ioports[i] != 0)); i++) { wdt_io = w83697hf_ioports[i]; - if (!w83697hf_check_wdt()) + if (!w83697hf_check_wdt()) { found++; + break; + } } } else { if (!w83697hf_check_wdt()) diff --git a/trunk/fs/hfs/btree.c b/trunk/fs/hfs/btree.c index 110dd3515dc8..31284c77bba8 100644 --- a/trunk/fs/hfs/btree.c +++ b/trunk/fs/hfs/btree.c @@ -61,7 +61,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke mapping = tree->inode->i_mapping; page = read_mapping_page(mapping, 0, NULL); if (IS_ERR(page)) - goto free_inode; + goto free_tree; /* Load the header */ head = (struct hfs_btree_header_rec *)(kmap(page) + sizeof(struct hfs_bnode_desc)); @@ -99,12 +99,11 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke page_cache_release(page); return tree; -fail_page: + fail_page: page_cache_release(page); -free_inode: + free_tree: tree->inode->i_mapping->a_ops = &hfs_aops; iput(tree->inode); -free_tree: kfree(tree); return NULL; } diff --git a/trunk/fs/jbd/transaction.c b/trunk/fs/jbd/transaction.c index 038ed7436199..08ff6c7028cc 100644 --- a/trunk/fs/jbd/transaction.c +++ b/trunk/fs/jbd/transaction.c @@ -288,12 +288,10 @@ handle_t *journal_start(journal_t *journal, int nblocks) jbd_free_handle(handle); current->journal_info = NULL; handle = ERR_PTR(err); - goto out; } lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_); -out: return handle; } diff --git a/trunk/fs/sysfs/dir.c b/trunk/fs/sysfs/dir.c index f281cc6584b0..337162935d21 100644 --- a/trunk/fs/sysfs/dir.c +++ b/trunk/fs/sysfs/dir.c @@ -678,10 +678,8 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry, sd = sysfs_find_dirent(parent_sd, dentry->d_name.name); /* no such entry */ - if (!sd) { - ret = ERR_PTR(-ENOENT); + if (!sd) goto out_unlock; - } /* attach dentry and inode */ inode = sysfs_get_inode(sd); @@ -783,7 +781,6 @@ int sysfs_rename_dir(struct kobject * kobj, const char *new_name) old_dentry = sysfs_get_dentry(sd); if (IS_ERR(old_dentry)) { error = PTR_ERR(old_dentry); - old_dentry = NULL; goto out; } @@ -851,7 +848,6 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj) old_dentry = sysfs_get_dentry(sd); if (IS_ERR(old_dentry)) { error = PTR_ERR(old_dentry); - old_dentry = NULL; goto out; } old_parent = old_dentry->d_parent; @@ -859,7 +855,6 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj) new_parent = sysfs_get_dentry(new_parent_sd); if (IS_ERR(new_parent)) { error = PTR_ERR(new_parent); - new_parent = NULL; goto out; } @@ -883,6 +878,7 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj) error = 0; d_add(new_dentry, NULL); d_move(old_dentry, new_dentry); + dput(new_dentry); /* Remove from old parent's list and insert into new parent's list. */ sysfs_unlink_sibling(sd); diff --git a/trunk/include/asm-cris/page.h b/trunk/include/asm-cris/page.h index b84353ef6998..0648e3153f81 100644 --- a/trunk/include/asm-cris/page.h +++ b/trunk/include/asm-cris/page.h @@ -4,11 +4,14 @@ #ifdef __KERNEL__ #include -#include /* PAGE_SHIFT determines the page size */ #define PAGE_SHIFT 13 -#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) +#ifndef __ASSEMBLY__ +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#else +#define PAGE_SIZE (1 << PAGE_SHIFT) +#endif #define PAGE_MASK (~(PAGE_SIZE-1)) #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) diff --git a/trunk/include/linux/workqueue.h b/trunk/include/linux/workqueue.h index 7f28c32d9aca..7daafdc2514b 100644 --- a/trunk/include/linux/workqueue.h +++ b/trunk/include/linux/workqueue.h @@ -149,27 +149,19 @@ struct execute_work { extern struct workqueue_struct * __create_workqueue_key(const char *name, int singlethread, - int freezeable, struct lock_class_key *key, - const char *lock_name); + int freezeable, struct lock_class_key *key); #ifdef CONFIG_LOCKDEP #define __create_workqueue(name, singlethread, freezeable) \ ({ \ static struct lock_class_key __key; \ - const char *__lock_name; \ - \ - if (__builtin_constant_p(name)) \ - __lock_name = (name); \ - else \ - __lock_name = #name; \ \ __create_workqueue_key((name), (singlethread), \ - (freezeable), &__key, \ - __lock_name); \ + (freezeable), &__key); \ }) #else #define __create_workqueue(name, singlethread, freezeable) \ - __create_workqueue_key((name), (singlethread), (freezeable), NULL, NULL) + __create_workqueue_key((name), (singlethread), (freezeable), NULL) #endif #define create_workqueue(name) __create_workqueue((name), 0, 0) diff --git a/trunk/kernel/kmod.c b/trunk/kernel/kmod.c index bb7df2a28bd7..c6a4f8aebeba 100644 --- a/trunk/kernel/kmod.c +++ b/trunk/kernel/kmod.c @@ -451,11 +451,13 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, enum umh_wait wait) { DECLARE_COMPLETION_ONSTACK(done); - int retval = 0; + int retval; helper_lock(); - if (sub_info->path[0] == '\0') + if (sub_info->path[0] == '\0') { + retval = 0; goto out; + } if (!khelper_wq || usermodehelper_disabled) { retval = -EBUSY; @@ -466,14 +468,13 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, sub_info->wait = wait; queue_work(khelper_wq, &sub_info->work); - if (wait == UMH_NO_WAIT) /* task has freed sub_info */ - goto unlock; + if (wait == UMH_NO_WAIT) /* task has freed sub_info */ + return 0; wait_for_completion(&done); retval = sub_info->retval; -out: + out: call_usermodehelper_freeinfo(sub_info); -unlock: helper_unlock(); return retval; } diff --git a/trunk/kernel/lockdep.c b/trunk/kernel/lockdep.c index 4335f12a27c6..723bd9f92556 100644 --- a/trunk/kernel/lockdep.c +++ b/trunk/kernel/lockdep.c @@ -2943,10 +2943,9 @@ void lockdep_free_key_range(void *start, unsigned long size) struct list_head *head; unsigned long flags; int i; - int locked; raw_local_irq_save(flags); - locked = graph_lock(); + graph_lock(); /* * Unhash all classes that were created by this module: @@ -2960,8 +2959,7 @@ void lockdep_free_key_range(void *start, unsigned long size) zap_class(class); } - if (locked) - graph_unlock(); + graph_unlock(); raw_local_irq_restore(flags); } @@ -2971,7 +2969,6 @@ void lockdep_reset_lock(struct lockdep_map *lock) struct list_head *head; unsigned long flags; int i, j; - int locked; raw_local_irq_save(flags); @@ -2990,7 +2987,7 @@ void lockdep_reset_lock(struct lockdep_map *lock) * Debug check: in the end all mapped classes should * be gone. */ - locked = graph_lock(); + graph_lock(); for (i = 0; i < CLASSHASH_SIZE; i++) { head = classhash_table + i; if (list_empty(head)) @@ -3003,8 +3000,7 @@ void lockdep_reset_lock(struct lockdep_map *lock) } } } - if (locked) - graph_unlock(); + graph_unlock(); out_restore: raw_local_irq_restore(flags); diff --git a/trunk/kernel/workqueue.c b/trunk/kernel/workqueue.c index 8db0b597509e..52d5e7c9a8e6 100644 --- a/trunk/kernel/workqueue.c +++ b/trunk/kernel/workqueue.c @@ -722,8 +722,7 @@ static void start_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu) struct workqueue_struct *__create_workqueue_key(const char *name, int singlethread, int freezeable, - struct lock_class_key *key, - const char *lock_name) + struct lock_class_key *key) { struct workqueue_struct *wq; struct cpu_workqueue_struct *cwq; @@ -740,7 +739,7 @@ struct workqueue_struct *__create_workqueue_key(const char *name, } wq->name = name; - lockdep_init_map(&wq->lockdep_map, lock_name, key, 0); + lockdep_init_map(&wq->lockdep_map, name, key, 0); wq->singlethread = singlethread; wq->freezeable = freezeable; INIT_LIST_HEAD(&wq->list); diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c index 6dd1cd88bfb6..4bf0b6d0eb2a 100644 --- a/trunk/mm/memory.c +++ b/trunk/mm/memory.c @@ -392,7 +392,6 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_ return NULL; } -#ifdef CONFIG_DEBUG_VM /* * Add some anal sanity checks for now. Eventually, * we should just do "return pfn_to_page(pfn)", but @@ -403,7 +402,6 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_ print_bad_pte(vma, pte, addr); return NULL; } -#endif /* * NOTE! We still have PageReserved() pages in the page diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index b2838c24e582..e1028fae3ebb 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -2566,7 +2566,7 @@ static void __meminit zone_init_free_lists(struct pglist_data *pgdat, memmap_init_zone((size), (nid), (zone), (start_pfn), MEMMAP_EARLY) #endif -static int zone_batchsize(struct zone *zone) +static int __devinit zone_batchsize(struct zone *zone) { int batch;