From cbb8573ebc79bb03fe74eca0e8955b22bbbc27e2 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Tue, 28 Mar 2006 09:38:45 +0200 Subject: [PATCH] --- yaml --- r: 27025 b: refs/heads/master c: 283a12c53b9abeed89491da4a1eda98f5764947b h: refs/heads/master i: 27023: e9e120e7d3f0a39ff09d84ec5e02c2f83440ed3d v: v3 --- [refs] | 2 +- trunk/Documentation/dvb/get_dvb_firmware | 8 +- trunk/MAINTAINERS | 10 +- trunk/Makefile | 4 +- trunk/arch/i386/kernel/syscall_table.S | 1 - trunk/arch/i386/power/cpu.c | 2 +- trunk/arch/powerpc/kernel/prom_init.c | 48 +- trunk/arch/powerpc/kernel/systbl.S | 2 - .../powerpc/platforms/cell/spu_callbacks.c | 7 +- trunk/arch/powerpc/platforms/powermac/setup.c | 12 - trunk/arch/ppc/kernel/asm-offsets.c | 2 +- trunk/arch/ppc/platforms/mpc8272ads_setup.c | 10 +- trunk/arch/ppc/syslib/pq2_devices.c | 16 +- trunk/arch/ppc/syslib/pq2_sys.c | 8 +- trunk/arch/s390/kernel/time.c | 2 +- trunk/arch/sparc/kernel/systbls.S | 3 +- trunk/arch/sparc64/kernel/pci_iommu.c | 4 +- trunk/arch/sparc64/kernel/pci_sun4v.c | 4 +- trunk/arch/sparc64/kernel/systbls.S | 8 +- trunk/block/ll_rw_blk.c | 7 +- trunk/drivers/char/agp/Kconfig | 2 +- trunk/drivers/char/tpm/tpm_tis.c | 4 + trunk/drivers/char/tty_io.c | 2 +- trunk/drivers/i2c/busses/scx200_acb.c | 2 +- .../infiniband/hw/ipath/ipath_driver.c | 22 +- .../infiniband/hw/ipath/ipath_eeprom.c | 7 +- .../infiniband/hw/ipath/ipath_file_ops.c | 6 +- .../drivers/infiniband/hw/ipath/ipath_ht400.c | 21 +- .../infiniband/hw/ipath/ipath_init_chip.c | 1 + .../infiniband/hw/ipath/ipath_kernel.h | 2 +- .../drivers/infiniband/hw/ipath/ipath_keys.c | 6 + .../drivers/infiniband/hw/ipath/ipath_layer.c | 12 +- .../drivers/infiniband/hw/ipath/ipath_pe800.c | 2 - trunk/drivers/infiniband/hw/ipath/ipath_qp.c | 64 +- trunk/drivers/infiniband/hw/ipath/ipath_rc.c | 15 +- trunk/drivers/infiniband/hw/ipath/ipath_ruc.c | 2 +- .../drivers/infiniband/hw/ipath/ipath_verbs.c | 7 +- trunk/drivers/infiniband/hw/mthca/mthca_srq.c | 41 +- trunk/drivers/input/joystick/sidewinder.c | 11 +- trunk/drivers/input/keyboard/corgikbd.c | 12 +- trunk/drivers/input/keyboard/spitzkbd.c | 12 +- trunk/drivers/input/misc/wistron_btns.c | 19 - trunk/drivers/input/mouse/alps.c | 4 +- trunk/drivers/input/mouse/lifebook.c | 24 - trunk/drivers/input/mouse/logips2pp.c | 6 - trunk/drivers/input/touchscreen/ads7846.c | 53 +- trunk/drivers/md/md.c | 4 +- trunk/drivers/md/raid0.c | 5 +- trunk/drivers/media/Kconfig | 45 +- trunk/drivers/media/common/Kconfig | 3 +- trunk/drivers/media/dvb/Kconfig | 10 +- trunk/drivers/media/dvb/b2c2/Kconfig | 6 +- trunk/drivers/media/dvb/bt8xx/Kconfig | 3 +- trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c | 6 +- trunk/drivers/media/dvb/cinergyT2/cinergyT2.c | 5 +- .../drivers/media/dvb/dvb-core/dvb_frontend.c | 12 - trunk/drivers/media/dvb/dvb-core/dvbdev.c | 4 +- trunk/drivers/media/dvb/dvb-usb/Kconfig | 2 +- trunk/drivers/media/dvb/dvb-usb/cxusb.c | 17 +- trunk/drivers/media/dvb/frontends/cx24123.c | 565 +++++----------- trunk/drivers/media/dvb/frontends/dvb-pll.c | 4 +- trunk/drivers/media/dvb/pluto2/Kconfig | 3 +- trunk/drivers/media/dvb/pluto2/Makefile | 2 +- trunk/drivers/media/dvb/ttpci/Kconfig | 12 +- trunk/drivers/media/dvb/ttpci/budget-av.c | 6 +- trunk/drivers/media/dvb/ttpci/budget-ci.c | 105 +-- .../media/dvb/ttusb-budget/dvb-ttusb-budget.c | 6 +- trunk/drivers/media/radio/Kconfig | 30 +- trunk/drivers/media/video/Kconfig | 79 +-- trunk/drivers/media/video/Makefile | 10 +- trunk/drivers/media/video/bt8xx/Kconfig | 2 +- trunk/drivers/media/video/bt8xx/Makefile | 2 +- trunk/drivers/media/video/bt8xx/bttv-cards.c | 4 +- trunk/drivers/media/video/bt8xx/bttv-risc.c | 14 +- .../media/video/cx25840/cx25840-firmware.c | 49 +- trunk/drivers/media/video/cx88/cx88-cards.c | 2 +- trunk/drivers/media/video/cx88/cx88-core.c | 16 +- trunk/drivers/media/video/cx88/cx88-dvb.c | 2 +- trunk/drivers/media/video/cx88/cx88-video.c | 2 - trunk/drivers/media/video/em28xx/Kconfig | 2 +- .../drivers/media/video/em28xx/em28xx-video.c | 10 +- trunk/drivers/media/video/et61x251/Kconfig | 2 +- trunk/drivers/media/video/pwc/Kconfig | 2 +- trunk/drivers/media/video/pwc/Makefile | 17 + trunk/drivers/media/video/saa7127.c | 1 - .../media/video/saa7134/saa7134-cards.c | 1 - .../media/video/saa7134/saa7134-core.c | 6 +- .../media/video/saa7134/saa7134-video.c | 2 - trunk/drivers/media/video/sn9c102/Kconfig | 2 +- trunk/drivers/media/video/tuner-types.c | 4 +- trunk/drivers/media/video/tveeprom.c | 2 +- trunk/drivers/media/video/usbvideo/Kconfig | 6 +- trunk/drivers/media/video/vivi.c | 5 - trunk/drivers/media/video/zc0301/Kconfig | 2 +- trunk/drivers/mmc/mmc_block.c | 2 +- trunk/drivers/net/bnx2.c | 20 +- trunk/drivers/net/e1000/e1000_main.c | 10 +- trunk/drivers/net/irda/Kconfig | 20 +- trunk/drivers/net/pcnet32.c | 2 + trunk/drivers/net/sky2.c | 19 +- trunk/drivers/net/tg3.c | 8 +- trunk/drivers/net/wireless/arlan-main.c | 4 +- trunk/drivers/net/wireless/orinoco.c | 4 +- trunk/drivers/net/wireless/wavelan.c | 2 +- trunk/drivers/s390/net/ctcmain.c | 26 +- trunk/drivers/s390/net/ctctty.c | 10 +- trunk/drivers/s390/net/cu3088.c | 10 +- trunk/drivers/s390/net/iucv.c | 36 +- trunk/drivers/s390/net/iucv.h | 622 +++++++++--------- trunk/drivers/s390/net/lcs.c | 345 +++++----- trunk/drivers/s390/net/lcs.h | 14 +- trunk/drivers/s390/net/netiucv.c | 36 +- trunk/drivers/s390/net/qeth.h | 18 +- trunk/drivers/s390/net/qeth_eddp.c | 18 +- trunk/drivers/s390/net/qeth_fs.h | 2 +- trunk/drivers/s390/net/qeth_main.c | 107 ++- trunk/drivers/s390/net/qeth_mpc.h | 4 +- trunk/drivers/s390/net/qeth_proc.c | 8 +- trunk/drivers/s390/net/qeth_sys.c | 6 +- trunk/drivers/s390/net/qeth_tso.h | 4 +- trunk/drivers/scsi/libata-core.c | 6 - trunk/drivers/serial/cpm_uart/cpm_uart_core.c | 8 +- trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c | 2 +- trunk/drivers/serial/sunsu.c | 1 - trunk/drivers/spi/spi_s3c24xx.c | 4 +- trunk/fs/affs/namei.c | 3 +- trunk/fs/bio.c | 3 - trunk/fs/cifs/CHANGES | 7 - trunk/fs/cifs/cifsfs.h | 2 +- trunk/fs/cifs/cifsproto.h | 2 +- trunk/fs/cifs/cifssmb.c | 40 +- trunk/fs/cifs/connect.c | 97 +-- trunk/fs/cifs/file.c | 12 +- trunk/fs/jfs/jfs_metapage.c | 20 +- trunk/fs/nfsd/export.c | 4 +- trunk/include/asm-alpha/termbits.h | 1 - trunk/include/asm-powerpc/termbits.h | 1 - trunk/include/asm-powerpc/unistd.h | 4 +- trunk/include/asm-sparc/unistd.h | 8 +- trunk/include/asm-sparc64/dma-mapping.h | 141 +--- trunk/include/asm-sparc64/pci.h | 4 +- trunk/include/asm-sparc64/unistd.h | 8 +- trunk/include/linux/fs.h | 7 +- trunk/include/linux/input.h | 13 +- trunk/include/linux/syscalls.h | 6 - trunk/include/linux/videodev2.h | 5 - trunk/include/net/irda/irlmp.h | 2 +- trunk/kernel/sched.c | 62 +- trunk/net/bridge/br.c | 3 +- trunk/net/core/dev.c | 20 +- trunk/net/ipv4/ipcomp.c | 2 +- trunk/net/ipv4/netfilter/Kconfig | 4 +- trunk/net/ipv4/netfilter/ip_conntrack_core.c | 1 - .../netfilter/ip_conntrack_helper_h323_asn1.c | 36 +- .../ipv4/netfilter/ip_conntrack_helper_pptp.c | 4 +- trunk/net/ipv4/netfilter/ip_nat_snmp_basic.c | 16 +- .../netfilter/nf_conntrack_l3proto_ipv4.c | 1 - trunk/net/ipv4/xfrm4_policy.c | 2 +- trunk/net/ipv6/ipcomp6.c | 2 +- trunk/net/ipv6/route.c | 16 +- trunk/net/irda/iriap.c | 3 +- trunk/net/sunrpc/cache.c | 1 - trunk/net/xfrm/xfrm_input.c | 2 +- 163 files changed, 1390 insertions(+), 2173 deletions(-) diff --git a/[refs] b/[refs] index 4be14ae8124e..93d09ac3762e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2c56554ec596adadd562679ef672d83e290f1732 +refs/heads/master: 283a12c53b9abeed89491da4a1eda98f5764947b diff --git a/trunk/Documentation/dvb/get_dvb_firmware b/trunk/Documentation/dvb/get_dvb_firmware index 4820366b6ae8..15fc8fbef67e 100644 --- a/trunk/Documentation/dvb/get_dvb_firmware +++ b/trunk/Documentation/dvb/get_dvb_firmware @@ -259,9 +259,9 @@ sub dibusb { } sub nxt2002 { - my $sourcefile = "Technisat_DVB-PC_4_4_COMPACT.zip"; + my $sourcefile = "Broadband4PC_4_2_11.zip"; my $url = "http://www.bbti.us/download/windows/$sourcefile"; - my $hash = "476befae8c7c1bb9648954060b1eec1f"; + my $hash = "c6d2ea47a8f456d887ada0cfb718ff2a"; my $outfile = "dvb-fe-nxt2002.fw"; my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); @@ -269,8 +269,8 @@ sub nxt2002 { wgetfile($sourcefile, $url); unzip($sourcefile, $tmpdir); - verify("$tmpdir/SkyNET.sys", $hash); - extract("$tmpdir/SkyNET.sys", 331624, 5908, $outfile); + verify("$tmpdir/SkyNETU.sys", $hash); + extract("$tmpdir/SkyNETU.sys", 375832, 5908, $outfile); $outfile; } diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 74d71cafb17c..bd10b2af2223 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -565,7 +565,7 @@ BROADBAND PROCESSOR ARCHITECTURE P: Arnd Bergmann M: arnd@arndb.de L: linuxppc-dev@ozlabs.org -W: http://www.penguinppc.org/ppc64/ +W: http://linuxppc64.org S: Supported BTTV VIDEO4LINUX DRIVER @@ -1716,7 +1716,7 @@ M: paulus@au.ibm.com P: Anton Blanchard M: anton@samba.org M: anton@au.ibm.com -W: http://www.penguinppc.org/ppc64/ +W: http://linuxppc64.org L: linuxppc-dev@ozlabs.org S: Supported @@ -1899,12 +1899,6 @@ M: James.Bottomley@HansenPartnership.com L: linux-scsi@vger.kernel.org S: Maintained -NETEM NETWORK EMULATOR -P: Stephen Hemminger -M: shemminger@osdl.org -L: netem@osdl.org -S: Maintained - NETFILTER/IPTABLES/IPCHAINS P: Rusty Russell P: Marc Boucher diff --git a/trunk/Makefile b/trunk/Makefile index 435d209f42d8..3494c17c9fb9 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,8 +1,8 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 17 -EXTRAVERSION =-rc5 -NAME=Lordi Rules +EXTRAVERSION =-rc4 +NAME=Sliding Snow Leopard # *DOCUMENTATION* # To see a list of typical targets execute "make help" diff --git a/trunk/arch/i386/kernel/syscall_table.S b/trunk/arch/i386/kernel/syscall_table.S index af56987f69b0..f48bef15b4f0 100644 --- a/trunk/arch/i386/kernel/syscall_table.S +++ b/trunk/arch/i386/kernel/syscall_table.S @@ -315,4 +315,3 @@ ENTRY(sys_call_table) .long sys_splice .long sys_sync_file_range .long sys_tee /* 315 */ - .long sys_vmsplice diff --git a/trunk/arch/i386/power/cpu.c b/trunk/arch/i386/power/cpu.c index 79b2370c7fac..50a0bef8c85f 100644 --- a/trunk/arch/i386/power/cpu.c +++ b/trunk/arch/i386/power/cpu.c @@ -92,7 +92,7 @@ void __restore_processor_state(struct saved_context *ctxt) write_cr4(ctxt->cr4); write_cr3(ctxt->cr3); write_cr2(ctxt->cr2); - write_cr0(ctxt->cr0); + write_cr2(ctxt->cr0); /* * now restore the descriptor tables to their proper values diff --git a/trunk/arch/powerpc/kernel/prom_init.c b/trunk/arch/powerpc/kernel/prom_init.c index 41e9ab40cd54..2d80653aa2af 100644 --- a/trunk/arch/powerpc/kernel/prom_init.c +++ b/trunk/arch/powerpc/kernel/prom_init.c @@ -2057,45 +2057,10 @@ static void __init flatten_device_tree(void) } -#ifdef CONFIG_PPC_MAPLE -/* PIBS Version 1.05.0000 04/26/2005 has an incorrect /ht/isa/ranges property. - * The values are bad, and it doesn't even have the right number of cells. */ -static void __init fixup_device_tree_maple(void) -{ - phandle isa; - u32 isa_ranges[6]; - - isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4")); - if (!PHANDLE_VALID(isa)) - return; - if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges)) - == PROM_ERROR) - return; - - if (isa_ranges[0] != 0x1 || - isa_ranges[1] != 0xf4000000 || - isa_ranges[2] != 0x00010000) - return; - - prom_printf("fixing up bogus ISA range on Maple...\n"); - - isa_ranges[0] = 0x1; - isa_ranges[1] = 0x0; - isa_ranges[2] = 0x01002000; /* IO space; PCI device = 4 */ - isa_ranges[3] = 0x0; - isa_ranges[4] = 0x0; - isa_ranges[5] = 0x00010000; - prom_setprop(isa, "/ht@0/isa@4", "ranges", - isa_ranges, sizeof(isa_ranges)); -} -#else -#define fixup_device_tree_maple() -#endif - -#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) -static void __init fixup_device_tree_pmac(void) +static void __init fixup_device_tree(void) { +#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) phandle u3, i2c, mpic; u32 u3_rev; u32 interrupts[2]; @@ -2132,17 +2097,10 @@ static void __init fixup_device_tree_pmac(void) parent = (u32)mpic; prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent", &parent, sizeof(parent)); -} -#else -#define fixup_device_tree_pmac() #endif - -static void __init fixup_device_tree(void) -{ - fixup_device_tree_maple(); - fixup_device_tree_pmac(); } + static void __init prom_find_boot_cpu(void) { struct prom_t *_prom = &RELOC(prom); diff --git a/trunk/arch/powerpc/kernel/systbl.S b/trunk/arch/powerpc/kernel/systbl.S index 26ed1f5ef16e..cf56a1d499ff 100644 --- a/trunk/arch/powerpc/kernel/systbl.S +++ b/trunk/arch/powerpc/kernel/systbl.S @@ -338,8 +338,6 @@ SYSCALL(symlinkat) SYSCALL(readlinkat) SYSCALL(fchmodat) SYSCALL(faccessat) -COMPAT_SYS(get_robust_list) -COMPAT_SYS(set_robust_list) /* * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c diff --git a/trunk/arch/powerpc/platforms/cell/spu_callbacks.c b/trunk/arch/powerpc/platforms/cell/spu_callbacks.c index b47fcc5ddb78..95b36430aa0f 100644 --- a/trunk/arch/powerpc/platforms/cell/spu_callbacks.c +++ b/trunk/arch/powerpc/platforms/cell/spu_callbacks.c @@ -258,7 +258,6 @@ void *spu_syscall_table[] = { [__NR_futex] sys_futex, [__NR_sched_setaffinity] sys_sched_setaffinity, [__NR_sched_getaffinity] sys_sched_getaffinity, - [224] sys_ni_syscall, [__NR_tuxcall] sys_ni_syscall, [226] sys_ni_syscall, [__NR_io_setup] sys_io_setup, @@ -333,21 +332,19 @@ void *spu_syscall_table[] = { [__NR_readlinkat] sys_readlinkat, [__NR_fchmodat] sys_fchmodat, [__NR_faccessat] sys_faccessat, - [__NR_get_robust_list] sys_get_robust_list, - [__NR_set_robust_list] sys_set_robust_list, }; long spu_sys_callback(struct spu_syscall_block *s) { long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); + syscall = spu_syscall_table[s->nr_ret]; + if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret); return -ENOSYS; } - syscall = spu_syscall_table[s->nr_ret]; - #ifdef DEBUG print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall); printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n", diff --git a/trunk/arch/powerpc/platforms/powermac/setup.c b/trunk/arch/powerpc/platforms/powermac/setup.c index b9200fb07815..4d15e396655c 100644 --- a/trunk/arch/powerpc/platforms/powermac/setup.c +++ b/trunk/arch/powerpc/platforms/powermac/setup.c @@ -463,23 +463,11 @@ static int pmac_pm_finish(suspend_state_t state) return 0; } -static int pmac_pm_valid(suspend_state_t state) -{ - switch (state) { - case PM_SUSPEND_DISK: - return 1; - /* can't do any other states via generic mechanism yet */ - default: - return 0; - } -} - static struct pm_ops pmac_pm_ops = { .pm_disk_mode = PM_DISK_SHUTDOWN, .prepare = pmac_pm_prepare, .enter = pmac_pm_enter, .finish = pmac_pm_finish, - .valid = pmac_pm_valid, }; #endif /* CONFIG_SOFTWARE_SUSPEND */ diff --git a/trunk/arch/ppc/kernel/asm-offsets.c b/trunk/arch/ppc/kernel/asm-offsets.c index 2f5c5e157617..cc7c4aea9397 100644 --- a/trunk/arch/ppc/kernel/asm-offsets.c +++ b/trunk/arch/ppc/kernel/asm-offsets.c @@ -134,7 +134,7 @@ main(void) DEFINE(TI_TASK, offsetof(struct thread_info, task)); DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); - DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags)); + DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, flags)); DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); diff --git a/trunk/arch/ppc/platforms/mpc8272ads_setup.c b/trunk/arch/ppc/platforms/mpc8272ads_setup.c index abb7154de2c7..e62b75707f7a 100644 --- a/trunk/arch/ppc/platforms/mpc8272ads_setup.c +++ b/trunk/arch/ppc/platforms/mpc8272ads_setup.c @@ -279,11 +279,11 @@ static int mpc8272ads_platform_notify(struct device *dev) static const struct platform_notify_dev_map dev_map[] = { { .bus_id = "fsl-cpm-fcc", - .rtn = mpc8272ads_fixup_enet_pdata, + .rtn = mpc8272ads_fixup_enet_pdata }, { .bus_id = "fsl-cpm-scc:uart", - .rtn = mpc8272ads_fixup_uart_pdata, + .rtn = mpc }, { .bus_id = NULL @@ -335,15 +335,15 @@ struct platform_device* early_uart_get_pdev(int index) struct platform_device* pdev = NULL; if(index) { /*assume SCC4 here*/ pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC4]; - pinfo = &mpc8272_uart_pdata[fsid_scc4_uart]; + pinfo = &mpc8272_uart_pdata[1]; } else { /*over SCC1*/ pdev = &ppc_sys_platform_devices[MPC82xx_CPM_SCC1]; - pinfo = &mpc8272_uart_pdata[fsid_scc1_uart]; + pinfo = &mpc8272_uart_pdata[0]; } pinfo->uart_clk = bd->bi_intfreq; pdev->dev.platform_data = pinfo; - ppc_sys_fixup_mem_resource(pdev, CPM_MAP_ADDR); + ppc_sys_fixup_mem_resource(pdev, IMAP_ADDR); return NULL; } diff --git a/trunk/arch/ppc/syslib/pq2_devices.c b/trunk/arch/ppc/syslib/pq2_devices.c index 8692d00c08c4..0636aed7b827 100644 --- a/trunk/arch/ppc/syslib/pq2_devices.c +++ b/trunk/arch/ppc/syslib/pq2_devices.c @@ -121,13 +121,13 @@ struct platform_device ppc_sys_platform_devices[] = { .num_resources = 3, .resource = (struct resource[]) { { - .name = "regs", + .name = "scc_mem", .start = 0x11A00, .end = 0x11A1F, .flags = IORESOURCE_MEM, }, { - .name = "pram", + .name = "scc_pram", .start = 0x8000, .end = 0x80ff, .flags = IORESOURCE_MEM, @@ -145,13 +145,13 @@ struct platform_device ppc_sys_platform_devices[] = { .num_resources = 3, .resource = (struct resource[]) { { - .name = "regs", + .name = "scc_mem", .start = 0x11A20, .end = 0x11A3F, .flags = IORESOURCE_MEM, }, { - .name = "pram", + .name = "scc_pram", .start = 0x8100, .end = 0x81ff, .flags = IORESOURCE_MEM, @@ -169,13 +169,13 @@ struct platform_device ppc_sys_platform_devices[] = { .num_resources = 3, .resource = (struct resource[]) { { - .name = "regs", + .name = "scc_mem", .start = 0x11A40, .end = 0x11A5F, .flags = IORESOURCE_MEM, }, { - .name = "pram", + .name = "scc_pram", .start = 0x8200, .end = 0x82ff, .flags = IORESOURCE_MEM, @@ -193,13 +193,13 @@ struct platform_device ppc_sys_platform_devices[] = { .num_resources = 3, .resource = (struct resource[]) { { - .name = "regs", + .name = "scc_mem", .start = 0x11A60, .end = 0x11A7F, .flags = IORESOURCE_MEM, }, { - .name = "pram", + .name = "scc_pram", .start = 0x8300, .end = 0x83ff, .flags = IORESOURCE_MEM, diff --git a/trunk/arch/ppc/syslib/pq2_sys.c b/trunk/arch/ppc/syslib/pq2_sys.c index fee8948162b9..433b0fa203e1 100644 --- a/trunk/arch/ppc/syslib/pq2_sys.c +++ b/trunk/arch/ppc/syslib/pq2_sys.c @@ -139,13 +139,13 @@ struct ppc_sys_spec ppc_sys_specs[] = { .ppc_sys_name = "8272", .mask = 0x0000ff00, .value = 0x00000c00, - .num_devices = 12, + .num_devices = 11, .device_list = (enum ppc_sys_devices[]) { MPC82xx_CPM_FCC1, MPC82xx_CPM_FCC2, MPC82xx_CPM_SCC1, - MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SCC4, - MPC82xx_CPM_SMC1, MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, - MPC82xx_CPM_I2C, MPC82xx_CPM_USB, MPC82xx_SEC1, + MPC82xx_CPM_SCC2, MPC82xx_CPM_SCC3, MPC82xx_CPM_SMC1, + MPC82xx_CPM_SMC2, MPC82xx_CPM_SPI, MPC82xx_CPM_I2C, + MPC82xx_CPM_USB, MPC82xx_SEC1, }, }, /* below is a list of the 8280 family of processors */ diff --git a/trunk/arch/s390/kernel/time.c b/trunk/arch/s390/kernel/time.c index 2a6c6efb6865..ce19ad4e92ec 100644 --- a/trunk/arch/s390/kernel/time.c +++ b/trunk/arch/s390/kernel/time.c @@ -272,7 +272,7 @@ static inline void stop_hz_timer(void) next = next_timer_interrupt(); do { seq = read_seqbegin_irqsave(&xtime_lock, flags); - timer = ((__u64) next) - ((__u64) jiffies) + jiffies_64; + timer = (__u64 next) - (__u64 jiffies) + jiffies_64; } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); todval = -1ULL; /* Be careful about overflows. */ diff --git a/trunk/arch/sparc/kernel/systbls.S b/trunk/arch/sparc/kernel/systbls.S index 2856551bddf1..6e1135cc03b0 100644 --- a/trunk/arch/sparc/kernel/systbls.S +++ b/trunk/arch/sparc/kernel/systbls.S @@ -79,7 +79,6 @@ sys_call_table: /*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 /*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat /*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare -/*300*/ .long sys_set_robust_list, sys_get_robust_list #ifdef CONFIG_SUNOS_EMUL /* Now the SunOS syscall table. */ @@ -191,6 +190,6 @@ sunos_sys_table: /*290*/ .long sunos_nosys, sunos_nosys, sunos_nosys .long sunos_nosys, sunos_nosys, sunos_nosys .long sunos_nosys, sunos_nosys, sunos_nosys - .long sunos_nosys, sunos_nosys, sunos_nosys + .long sunos_nosys #endif diff --git a/trunk/arch/sparc64/kernel/pci_iommu.c b/trunk/arch/sparc64/kernel/pci_iommu.c index 82e5455134c6..8efbc139769d 100644 --- a/trunk/arch/sparc64/kernel/pci_iommu.c +++ b/trunk/arch/sparc64/kernel/pci_iommu.c @@ -218,7 +218,7 @@ static inline void iommu_free_ctx(struct pci_iommu *iommu, int ctx) * DMA for PCI device PDEV. Return non-NULL cpu-side address if * successful and set *DMA_ADDRP to the PCI side dma address. */ -static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp, gfp_t gfp) +static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) { struct pcidev_cookie *pcp; struct pci_iommu *iommu; @@ -232,7 +232,7 @@ static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr if (order >= 10) return NULL; - first_page = __get_free_pages(gfp, order); + first_page = __get_free_pages(GFP_ATOMIC, order); if (first_page == 0UL) return NULL; memset((char *)first_page, 0, PAGE_SIZE << order); diff --git a/trunk/arch/sparc64/kernel/pci_sun4v.c b/trunk/arch/sparc64/kernel/pci_sun4v.c index 2b7a1f316a93..9e94db2573a2 100644 --- a/trunk/arch/sparc64/kernel/pci_sun4v.c +++ b/trunk/arch/sparc64/kernel/pci_sun4v.c @@ -154,7 +154,7 @@ static void pci_arena_free(struct pci_iommu_arena *arena, unsigned long base, un __clear_bit(i, arena->map); } -static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp, gfp_t gfp) +static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) { struct pcidev_cookie *pcp; struct pci_iommu *iommu; @@ -169,7 +169,7 @@ static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr npages = size >> IO_PAGE_SHIFT; - first_page = __get_free_pages(gfp, order); + first_page = __get_free_pages(GFP_ATOMIC, order); if (unlikely(first_page == 0UL)) return NULL; diff --git a/trunk/arch/sparc64/kernel/systbls.S b/trunk/arch/sparc64/kernel/systbls.S index 1136fc465e37..d4b39cd30310 100644 --- a/trunk/arch/sparc64/kernel/systbls.S +++ b/trunk/arch/sparc64/kernel/systbls.S @@ -78,9 +78,8 @@ sys_call_table32: .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid /*280*/ .word sys32_tee, sys_add_key, sys_request_key, sys_keyctl, compat_sys_openat .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 -/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat +/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare -/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list #endif /* CONFIG_COMPAT */ @@ -148,9 +147,8 @@ sys_call_table: .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid /*280*/ .word sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 -/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat +/*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare -/*300*/ .word sys_set_robust_list, sys_get_robust_list #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ defined(CONFIG_SOLARIS_EMUL_MODULE) @@ -263,5 +261,5 @@ sunos_sys_table: /*290*/ .word sunos_nosys, sunos_nosys, sunos_nosys .word sunos_nosys, sunos_nosys, sunos_nosys .word sunos_nosys, sunos_nosys, sunos_nosys - .word sunos_nosys, sunos_nosys, sunos_nosys + .word sunos_nosys #endif diff --git a/trunk/block/ll_rw_blk.c b/trunk/block/ll_rw_blk.c index 7eb36c53f4b7..eac48bec1479 100644 --- a/trunk/block/ll_rw_blk.c +++ b/trunk/block/ll_rw_blk.c @@ -3452,12 +3452,7 @@ void end_that_request_last(struct request *req, int uptodate) if (unlikely(laptop_mode) && blk_fs_request(req)) laptop_io_completion(); - /* - * Account IO completion. bar_rq isn't accounted as a normal - * IO on queueing nor completion. Accounting the containing - * request is enough. - */ - if (disk && blk_fs_request(req) && req != &req->q->bar_rq) { + if (disk && blk_fs_request(req)) { unsigned long duration = jiffies - req->start_time; const int rw = rq_data_dir(req); diff --git a/trunk/drivers/char/agp/Kconfig b/trunk/drivers/char/agp/Kconfig index 0b9cf9c59a21..7c88c060a9e6 100644 --- a/trunk/drivers/char/agp/Kconfig +++ b/trunk/drivers/char/agp/Kconfig @@ -86,7 +86,7 @@ config AGP_NVIDIA config AGP_SIS tristate "SiS chipset support" - depends on AGP && X86_32 + depends on AGP help This option gives you AGP support for the GLX component of X on Silicon Integrated Systems [SiS] chipsets. diff --git a/trunk/drivers/char/tpm/tpm_tis.c b/trunk/drivers/char/tpm/tpm_tis.c index 8ea70625f7ea..f621168f38ae 100644 --- a/trunk/drivers/char/tpm/tpm_tis.c +++ b/trunk/drivers/char/tpm/tpm_tis.c @@ -457,6 +457,10 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, } vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0)); + if ((vendor & 0xFFFF) == 0xFFFF) { + rc = -ENODEV; + goto out_err; + } /* Default timeouts */ chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT); diff --git a/trunk/drivers/char/tty_io.c b/trunk/drivers/char/tty_io.c index a88b94a82b14..f07637a8f88f 100644 --- a/trunk/drivers/char/tty_io.c +++ b/trunk/drivers/char/tty_io.c @@ -398,7 +398,7 @@ int tty_insert_flip_string_flags(struct tty_struct *tty, while (unlikely(size > copied)); return copied; } -EXPORT_SYMBOL(tty_insert_flip_string_flags); +EXPORT_SYMBOL_GPL(tty_insert_flip_string_flags); void tty_schedule_flip(struct tty_struct *tty) { diff --git a/trunk/drivers/i2c/busses/scx200_acb.c b/trunk/drivers/i2c/busses/scx200_acb.c index 766cc969c4d0..a140e4536a4e 100644 --- a/trunk/drivers/i2c/busses/scx200_acb.c +++ b/trunk/drivers/i2c/busses/scx200_acb.c @@ -491,7 +491,7 @@ static struct pci_device_id divil_pci[] = { #define MSR_LBAR_SMB 0x5140000B -static __init int scx200_add_cs553x(void) +static int scx200_add_cs553x(void) { u32 low, hi; u32 smb_base; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_driver.c b/trunk/drivers/infiniband/hw/ipath/ipath_driver.c index dddcdae736ac..3697edafd6d2 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_driver.c @@ -1905,19 +1905,19 @@ static void __exit infinipath_cleanup(void) } else ipath_dbg("irq is 0, not doing free_irq " "for unit %u\n", dd->ipath_unit); - - /* - * we check for NULL here, because it's outside - * the kregbase check, and we need to call it - * after the free_irq. Thus it's possible that - * the function pointers were never initialized. - */ - if (dd->ipath_f_cleanup) - /* clean up chip-specific stuff */ - dd->ipath_f_cleanup(dd); - dd->pcidev = NULL; } + + /* + * we check for NULL here, because it's outside the kregbase + * check, and we need to call it after the free_irq. Thus + * it's possible that the function pointers were never + * initialized. + */ + if (dd->ipath_f_cleanup) + /* clean up chip-specific stuff */ + dd->ipath_f_cleanup(dd); + spin_lock_irqsave(&ipath_devs_lock, flags); } diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_eeprom.c b/trunk/drivers/infiniband/hw/ipath/ipath_eeprom.c index a2f1ceafcca9..f11a900e8cd7 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_eeprom.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_eeprom.c @@ -505,10 +505,11 @@ static u8 flash_csum(struct ipath_flash *ifp, int adjust) * ipath_get_guid - get the GUID from the i2c device * @dd: the infinipath device * - * We have the capability to use the ipath_nguid field, and get - * the guid from the first chip's flash, to use for all of them. + * When we add the multi-chip support, we will probably have to add + * the ability to use the number of guids field, and get the guid from + * the first chip's flash, to use for all of them. */ -void ipath_get_eeprom_info(struct ipath_devdata *dd) +void ipath_get_guid(struct ipath_devdata *dd) { void *buf; struct ipath_flash *ifp; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c b/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c index ada267e41f6c..c347191f02bf 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c @@ -139,7 +139,7 @@ static int ipath_get_base_info(struct ipath_portdata *pd, kinfo->spi_piosize = dd->ipath_ibmaxlen; kinfo->spi_mtu = dd->ipath_ibmaxlen; /* maxlen, not ibmtu */ kinfo->spi_port = pd->port_port; - kinfo->spi_sw_version = IPATH_KERN_SWVERSION; + kinfo->spi_sw_version = IPATH_USER_SWVERSION; kinfo->spi_hw_version = dd->ipath_revision; if (copy_to_user(ubase, kinfo, sizeof(*kinfo))) @@ -1224,10 +1224,6 @@ static unsigned int ipath_poll(struct file *fp, if (tail == head) { set_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag); - if(dd->ipath_rhdrhead_intr_off) /* arm rcv interrupt */ - (void)ipath_write_ureg(dd, ur_rcvhdrhead, - dd->ipath_rhdrhead_intr_off - | head, pd->port_port); poll_wait(fp, &pd->port_wait, pt); if (test_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag)) { diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_ht400.c b/trunk/drivers/infiniband/hw/ipath/ipath_ht400.c index fac0a2b74de2..4652435998f3 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_ht400.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_ht400.c @@ -607,12 +607,7 @@ static int ipath_ht_boardname(struct ipath_devdata *dd, char *name, case 4: /* Ponderosa is one of the bringup boards */ n = "Ponderosa"; break; - case 5: - /* - * HT-460 original production board; two production levels, with - * different serial number ranges. See ipath_ht_early_init() for - * case where we enable IPATH_GPIO_INTR for later serial # range. - */ + case 5: /* HT-460 original production board */ n = "InfiniPath_HT-460"; break; case 6: @@ -647,7 +642,7 @@ static int ipath_ht_boardname(struct ipath_devdata *dd, char *name, if (n) snprintf(name, namelen, "%s", n); - if (dd->ipath_majrev != 3 || (dd->ipath_minrev < 2 || dd->ipath_minrev > 3)) { + if (dd->ipath_majrev != 3 || dd->ipath_minrev != 2) { /* * This version of the driver only supports the HT-400 * Rev 3.2 @@ -1525,18 +1520,6 @@ static int ipath_ht_early_init(struct ipath_devdata *dd) */ ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, INFINIPATH_S_ABORT); - - ipath_get_eeprom_info(dd); - if(dd->ipath_boardrev == 5 && dd->ipath_serial[0] == '1' && - dd->ipath_serial[1] == '2' && dd->ipath_serial[2] == '8') { - /* - * Later production HT-460 has same changes as HT-465, so - * can use GPIO interrupts. They have serial #'s starting - * with 128, rather than 112. - */ - dd->ipath_flags |= IPATH_GPIO_INTR; - dd->ipath_flags &= ~IPATH_POLL_RX_INTR; - } return 0; } diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_init_chip.c b/trunk/drivers/infiniband/hw/ipath/ipath_init_chip.c index dc83250d26a6..16f640e1c16e 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_init_chip.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_init_chip.c @@ -879,6 +879,7 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit) done: if (!ret) { + ipath_get_guid(dd); *dd->ipath_statusp |= IPATH_STATUS_CHIP_PRESENT; if (!dd->ipath_f_intrsetup(dd)) { /* now we can enable all interrupts from the chip */ diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h b/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h index 5d92d57b6f54..e6507f8115bc 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h @@ -650,7 +650,7 @@ u32 __iomem *ipath_getpiobuf(struct ipath_devdata *, u32 *); void ipath_init_pe800_funcs(struct ipath_devdata *); /* init HT-400-specific func */ void ipath_init_ht400_funcs(struct ipath_devdata *); -void ipath_get_eeprom_info(struct ipath_devdata *); +void ipath_get_guid(struct ipath_devdata *); u64 ipath_snap_cntr(struct ipath_devdata *, ipath_creg); /* diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_keys.c b/trunk/drivers/infiniband/hw/ipath/ipath_keys.c index 5ae8761f9dd2..aa33b0e9f2f6 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_keys.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_keys.c @@ -136,7 +136,9 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge, ret = 1; goto bail; } + spin_lock(&rkt->lock); mr = rkt->table[(sge->lkey >> (32 - ib_ipath_lkey_table_size))]; + spin_unlock(&rkt->lock); if (unlikely(mr == NULL || mr->lkey != sge->lkey)) { ret = 0; goto bail; @@ -182,6 +184,8 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge, * @acc: access flags * * Return 1 if successful, otherwise 0. + * + * The QP r_rq.lock should be held. */ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, u32 len, u64 vaddr, u32 rkey, int acc) @@ -192,7 +196,9 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, size_t off; int ret; + spin_lock(&rkt->lock); mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))]; + spin_unlock(&rkt->lock); if (unlikely(mr == NULL || mr->lkey != rkey)) { ret = 0; goto bail; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_layer.c b/trunk/drivers/infiniband/hw/ipath/ipath_layer.c index 9ec4ac77b87f..9cb5258ffed9 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_layer.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_layer.c @@ -872,13 +872,12 @@ static void copy_io(u32 __iomem *piobuf, struct ipath_sge_state *ss, update_sge(ss, len); length -= len; } - /* Update address before sending packet. */ - update_sge(ss, length); /* must flush early everything before trigger word */ ipath_flush_wc(); __raw_writel(last, piobuf); /* be sure trigger word is written */ ipath_flush_wc(); + update_sge(ss, length); } /** @@ -944,18 +943,17 @@ int ipath_verbs_send(struct ipath_devdata *dd, u32 hdrwords, if (likely(ss->num_sge == 1 && len <= ss->sge.length && !((unsigned long)ss->sge.vaddr & (sizeof(u32) - 1)))) { u32 w; - u32 *addr = (u32 *) ss->sge.vaddr; - /* Update address before sending packet. */ - update_sge(ss, len); /* Need to round up for the last dword in the packet. */ w = (len + 3) >> 2; - __iowrite32_copy(piobuf, addr, w - 1); + __iowrite32_copy(piobuf, ss->sge.vaddr, w - 1); /* must flush early everything before trigger word */ ipath_flush_wc(); - __raw_writel(addr[w - 1], piobuf + w - 1); + __raw_writel(((u32 *) ss->sge.vaddr)[w - 1], + piobuf + w - 1); /* be sure trigger word is written */ ipath_flush_wc(); + update_sge(ss, len); ret = 0; goto bail; } diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_pe800.c b/trunk/drivers/infiniband/hw/ipath/ipath_pe800.c index 02e8c75b24f6..6318067ab5ec 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_pe800.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_pe800.c @@ -1180,8 +1180,6 @@ static int ipath_pe_early_init(struct ipath_devdata *dd) */ dd->ipath_rhdrhead_intr_off = 1ULL<<32; - ipath_get_eeprom_info(dd); - return 0; } diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_qp.c b/trunk/drivers/infiniband/hw/ipath/ipath_qp.c index 9f8855d970c8..18890716db1e 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_qp.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_qp.c @@ -375,10 +375,10 @@ static void ipath_error_qp(struct ipath_qp *qp) spin_lock(&dev->pending_lock); /* XXX What if its already removed by the timeout code? */ - if (!list_empty(&qp->timerwait)) - list_del_init(&qp->timerwait); - if (!list_empty(&qp->piowait)) - list_del_init(&qp->piowait); + if (qp->timerwait.next != LIST_POISON1) + list_del(&qp->timerwait); + if (qp->piowait.next != LIST_POISON1) + list_del(&qp->piowait); spin_unlock(&dev->pending_lock); wc.status = IB_WC_WR_FLUSH_ERR; @@ -427,7 +427,6 @@ static void ipath_error_qp(struct ipath_qp *qp) int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) { - struct ipath_ibdev *dev = to_idev(ibqp->device); struct ipath_qp *qp = to_iqp(ibqp); enum ib_qp_state cur_state, new_state; unsigned long flags; @@ -444,19 +443,6 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, attr_mask)) goto inval; - if (attr_mask & IB_QP_AV) - if (attr->ah_attr.dlid == 0 || - attr->ah_attr.dlid >= IPS_MULTICAST_LID_BASE) - goto inval; - - if (attr_mask & IB_QP_PKEY_INDEX) - if (attr->pkey_index >= ipath_layer_get_npkeys(dev->dd)) - goto inval; - - if (attr_mask & IB_QP_MIN_RNR_TIMER) - if (attr->min_rnr_timer > 31) - goto inval; - switch (new_state) { case IB_QPS_RESET: ipath_reset_qp(qp); @@ -471,8 +457,13 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, } - if (attr_mask & IB_QP_PKEY_INDEX) + if (attr_mask & IB_QP_PKEY_INDEX) { + struct ipath_ibdev *dev = to_idev(ibqp->device); + + if (attr->pkey_index >= ipath_layer_get_npkeys(dev->dd)) + goto inval; qp->s_pkey_index = attr->pkey_index; + } if (attr_mask & IB_QP_DEST_QPN) qp->remote_qpn = attr->dest_qp_num; @@ -488,8 +479,12 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, if (attr_mask & IB_QP_ACCESS_FLAGS) qp->qp_access_flags = attr->qp_access_flags; - if (attr_mask & IB_QP_AV) + if (attr_mask & IB_QP_AV) { + if (attr->ah_attr.dlid == 0 || + attr->ah_attr.dlid >= IPS_MULTICAST_LID_BASE) + goto inval; qp->remote_ah_attr = attr->ah_attr; + } if (attr_mask & IB_QP_PATH_MTU) qp->path_mtu = attr->path_mtu; @@ -504,8 +499,11 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, qp->s_rnr_retry_cnt = qp->s_rnr_retry; } - if (attr_mask & IB_QP_MIN_RNR_TIMER) + if (attr_mask & IB_QP_MIN_RNR_TIMER) { + if (attr->min_rnr_timer > 31) + goto inval; qp->s_min_rnr_timer = attr->min_rnr_timer; + } if (attr_mask & IB_QP_QKEY) qp->qkey = attr->qkey; @@ -712,8 +710,10 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, init_attr->qp_type == IB_QPT_RC ? ipath_do_rc_send : ipath_do_uc_send, (unsigned long)qp); - INIT_LIST_HEAD(&qp->piowait); - INIT_LIST_HEAD(&qp->timerwait); + qp->piowait.next = LIST_POISON1; + qp->piowait.prev = LIST_POISON2; + qp->timerwait.next = LIST_POISON1; + qp->timerwait.prev = LIST_POISON2; qp->state = IB_QPS_RESET; qp->s_wq = swq; qp->s_size = init_attr->cap.max_send_wr + 1; @@ -734,7 +734,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, ipath_reset_qp(qp); /* Tell the core driver that the kernel SMA is present. */ - if (init_attr->qp_type == IB_QPT_SMI) + if (qp->ibqp.qp_type == IB_QPT_SMI) ipath_layer_set_verbs_flags(dev->dd, IPATH_VERBS_KERNEL_SMA); break; @@ -783,10 +783,10 @@ int ipath_destroy_qp(struct ib_qp *ibqp) /* Make sure the QP isn't on the timeout list. */ spin_lock_irqsave(&dev->pending_lock, flags); - if (!list_empty(&qp->timerwait)) - list_del_init(&qp->timerwait); - if (!list_empty(&qp->piowait)) - list_del_init(&qp->piowait); + if (qp->timerwait.next != LIST_POISON1) + list_del(&qp->timerwait); + if (qp->piowait.next != LIST_POISON1) + list_del(&qp->piowait); spin_unlock_irqrestore(&dev->pending_lock, flags); /* @@ -855,10 +855,10 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc) spin_lock(&dev->pending_lock); /* XXX What if its already removed by the timeout code? */ - if (!list_empty(&qp->timerwait)) - list_del_init(&qp->timerwait); - if (!list_empty(&qp->piowait)) - list_del_init(&qp->piowait); + if (qp->timerwait.next != LIST_POISON1) + list_del(&qp->timerwait); + if (qp->piowait.next != LIST_POISON1) + list_del(&qp->piowait); spin_unlock(&dev->pending_lock); ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 1); diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_rc.c b/trunk/drivers/infiniband/hw/ipath/ipath_rc.c index 493b1821a934..a4055ca00614 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_rc.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_rc.c @@ -57,7 +57,7 @@ static void ipath_init_restart(struct ipath_qp *qp, struct ipath_swqe *wqe) qp->s_len = wqe->length - len; dev = to_idev(qp->ibqp.device); spin_lock(&dev->pending_lock); - if (list_empty(&qp->timerwait)) + if (qp->timerwait.next == LIST_POISON1) list_add_tail(&qp->timerwait, &dev->pending[dev->pending_index]); spin_unlock(&dev->pending_lock); @@ -356,7 +356,7 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp, if ((int)(qp->s_psn - qp->s_next_psn) > 0) qp->s_next_psn = qp->s_psn; spin_lock(&dev->pending_lock); - if (list_empty(&qp->timerwait)) + if (qp->timerwait.next == LIST_POISON1) list_add_tail(&qp->timerwait, &dev->pending[dev->pending_index]); spin_unlock(&dev->pending_lock); @@ -726,8 +726,8 @@ void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc) */ dev = to_idev(qp->ibqp.device); spin_lock(&dev->pending_lock); - if (!list_empty(&qp->timerwait)) - list_del_init(&qp->timerwait); + if (qp->timerwait.next != LIST_POISON1) + list_del(&qp->timerwait); spin_unlock(&dev->pending_lock); if (wqe->wr.opcode == IB_WR_RDMA_READ) @@ -886,8 +886,8 @@ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode) * just won't find anything to restart if we ACK everything. */ spin_lock(&dev->pending_lock); - if (!list_empty(&qp->timerwait)) - list_del_init(&qp->timerwait); + if (qp->timerwait.next != LIST_POISON1) + list_del(&qp->timerwait); spin_unlock(&dev->pending_lock); /* @@ -1194,7 +1194,8 @@ static inline void ipath_rc_rcv_resp(struct ipath_ibdev *dev, IB_WR_RDMA_READ)) goto ack_done; spin_lock(&dev->pending_lock); - if (qp->s_rnr_timeout == 0 && !list_empty(&qp->timerwait)) + if (qp->s_rnr_timeout == 0 && + qp->timerwait.next != LIST_POISON1) list_move_tail(&qp->timerwait, &dev->pending[dev->pending_index]); spin_unlock(&dev->pending_lock); diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c b/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c index d38f4f3cfd1d..eb81424b3c5b 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_ruc.c @@ -435,7 +435,7 @@ void ipath_no_bufs_available(struct ipath_qp *qp, struct ipath_ibdev *dev) unsigned long flags; spin_lock_irqsave(&dev->pending_lock, flags); - if (list_empty(&qp->piowait)) + if (qp->piowait.next == LIST_POISON1) list_add_tail(&qp->piowait, &dev->piowait); spin_unlock_irqrestore(&dev->pending_lock, flags); /* diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_verbs.c b/trunk/drivers/infiniband/hw/ipath/ipath_verbs.c index 28fdbdaa789d..cb9e387c301f 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_verbs.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_verbs.c @@ -464,7 +464,7 @@ static void ipath_ib_timer(void *arg) last = &dev->pending[dev->pending_index]; while (!list_empty(last)) { qp = list_entry(last->next, struct ipath_qp, timerwait); - list_del_init(&qp->timerwait); + list_del(&qp->timerwait); qp->timer_next = resend; resend = qp; atomic_inc(&qp->refcount); @@ -474,7 +474,7 @@ static void ipath_ib_timer(void *arg) qp = list_entry(last->next, struct ipath_qp, timerwait); if (--qp->s_rnr_timeout == 0) { do { - list_del_init(&qp->timerwait); + list_del(&qp->timerwait); tasklet_hi_schedule(&qp->s_task); if (list_empty(last)) break; @@ -554,7 +554,7 @@ static int ipath_ib_piobufavail(void *arg) while (!list_empty(&dev->piowait)) { qp = list_entry(dev->piowait.next, struct ipath_qp, piowait); - list_del_init(&qp->piowait); + list_del(&qp->piowait); tasklet_hi_schedule(&qp->s_task); } spin_unlock_irqrestore(&dev->pending_lock, flags); @@ -951,7 +951,6 @@ static void *ipath_register_ib_device(int unit, struct ipath_devdata *dd) idev->dd = dd; strlcpy(dev->name, "ipath%d", IB_DEVICE_NAME_MAX); - dev->owner = THIS_MODULE; dev->node_guid = ipath_layer_get_guid(dd); dev->uverbs_abi_ver = IPATH_UVERBS_ABI_VERSION; dev->uverbs_cmd_mask = diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_srq.c b/trunk/drivers/infiniband/hw/mthca/mthca_srq.c index b292fefa3b41..1ea433291fa7 100644 --- a/trunk/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/trunk/drivers/infiniband/hw/mthca/mthca_srq.c @@ -490,7 +490,26 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, first_ind = srq->first_free; - for (nreq = 0; wr; wr = wr->next) { + for (nreq = 0; wr; ++nreq, wr = wr->next) { + if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) { + nreq = 0; + + doorbell[0] = cpu_to_be32(first_ind << srq->wqe_shift); + doorbell[1] = cpu_to_be32(srq->srqn << 8); + + /* + * Make sure that descriptors are written + * before doorbell is rung. + */ + wmb(); + + mthca_write64(doorbell, + dev->kar + MTHCA_RECEIVE_DOORBELL, + MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); + + first_ind = srq->first_free; + } + ind = srq->first_free; if (ind < 0) { @@ -550,26 +569,6 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, srq->wrid[ind] = wr->wr_id; srq->first_free = next_ind; - - ++nreq; - if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) { - nreq = 0; - - doorbell[0] = cpu_to_be32(first_ind << srq->wqe_shift); - doorbell[1] = cpu_to_be32(srq->srqn << 8); - - /* - * Make sure that descriptors are written - * before doorbell is rung. - */ - wmb(); - - mthca_write64(doorbell, - dev->kar + MTHCA_RECEIVE_DOORBELL, - MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); - - first_ind = srq->first_free; - } } if (likely(nreq)) { diff --git a/trunk/drivers/input/joystick/sidewinder.c b/trunk/drivers/input/joystick/sidewinder.c index 95c0de7964a0..2b2ec1057dee 100644 --- a/trunk/drivers/input/joystick/sidewinder.c +++ b/trunk/drivers/input/joystick/sidewinder.c @@ -589,7 +589,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) struct sw *sw; struct input_dev *input_dev; int i, j, k, l; - int err = 0; + int err; unsigned char *buf = NULL; /* [SW_LENGTH] */ unsigned char *idbuf = NULL; /* [SW_LENGTH] */ unsigned char m = 1; @@ -776,10 +776,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) goto fail4; } - out: kfree(buf); - kfree(idbuf); - - return err; + return 0; fail4: input_free_device(sw->dev[i]); fail3: while (--i >= 0) @@ -787,7 +784,9 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) fail2: gameport_close(gameport); fail1: gameport_set_drvdata(gameport, NULL); kfree(sw); - goto out; + kfree(buf); + kfree(idbuf); + return err; } static void sw_disconnect(struct gameport *gameport) diff --git a/trunk/drivers/input/keyboard/corgikbd.c b/trunk/drivers/input/keyboard/corgikbd.c index 1f0e720267d7..96c6bf77248a 100644 --- a/trunk/drivers/input/keyboard/corgikbd.c +++ b/trunk/drivers/input/keyboard/corgikbd.c @@ -245,9 +245,9 @@ static void corgikbd_hinge_timer(unsigned long data) if (hinge_count >= HINGE_STABLE_COUNT) { spin_lock_irqsave(&corgikbd_data->lock, flags); - input_report_switch(corgikbd_data->input, SW_LID, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0)); - input_report_switch(corgikbd_data->input, SW_TABLET_MODE, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0)); - input_report_switch(corgikbd_data->input, SW_HEADPHONE_INSERT, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0)); + input_report_switch(corgikbd_data->input, SW_0, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0)); + input_report_switch(corgikbd_data->input, SW_1, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0)); + input_report_switch(corgikbd_data->input, SW_2, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0)); input_sync(corgikbd_data->input); spin_unlock_irqrestore(&corgikbd_data->lock, flags); @@ -340,9 +340,9 @@ static int __init corgikbd_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++) set_bit(corgikbd->keycode[i], input_dev->keybit); clear_bit(0, input_dev->keybit); - set_bit(SW_LID, input_dev->swbit); - set_bit(SW_TABLET_MODE, input_dev->swbit); - set_bit(SW_HEADPHONE_INSERT, input_dev->swbit); + set_bit(SW_0, input_dev->swbit); + set_bit(SW_1, input_dev->swbit); + set_bit(SW_2, input_dev->swbit); input_register_device(corgikbd->input); diff --git a/trunk/drivers/input/keyboard/spitzkbd.c b/trunk/drivers/input/keyboard/spitzkbd.c index c5d03fb77bcb..1d238a9d52d6 100644 --- a/trunk/drivers/input/keyboard/spitzkbd.c +++ b/trunk/drivers/input/keyboard/spitzkbd.c @@ -299,9 +299,9 @@ static void spitzkbd_hinge_timer(unsigned long data) if (hinge_count >= HINGE_STABLE_COUNT) { spin_lock_irqsave(&spitzkbd_data->lock, flags); - input_report_switch(spitzkbd_data->input, SW_LID, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); - input_report_switch(spitzkbd_data->input, SW_TABLET_MODE, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); - input_report_switch(spitzkbd_data->input, SW_HEADPHONE_INSERT, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0)); + input_report_switch(spitzkbd_data->input, SW_0, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); + input_report_switch(spitzkbd_data->input, SW_1, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); + input_report_switch(spitzkbd_data->input, SW_2, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0)); input_sync(spitzkbd_data->input); spin_unlock_irqrestore(&spitzkbd_data->lock, flags); @@ -398,9 +398,9 @@ static int __init spitzkbd_probe(struct platform_device *dev) for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++) set_bit(spitzkbd->keycode[i], input_dev->keybit); clear_bit(0, input_dev->keybit); - set_bit(SW_LID, input_dev->swbit); - set_bit(SW_TABLET_MODE, input_dev->swbit); - set_bit(SW_HEADPHONE_INSERT, input_dev->swbit); + set_bit(SW_0, input_dev->swbit); + set_bit(SW_1, input_dev->swbit); + set_bit(SW_2, input_dev->swbit); input_register_device(input_dev); diff --git a/trunk/drivers/input/misc/wistron_btns.c b/trunk/drivers/input/misc/wistron_btns.c index e4e5be111c96..36cd2e07fce8 100644 --- a/trunk/drivers/input/misc/wistron_btns.c +++ b/trunk/drivers/input/misc/wistron_btns.c @@ -318,16 +318,6 @@ static struct key_entry keymap_acer_travelmate_240[] = { { KE_END, 0 } }; -static struct key_entry keymap_aopen_1559as[] = { - { KE_KEY, 0x01, KEY_HELP }, - { KE_KEY, 0x06, KEY_PROG3 }, - { KE_KEY, 0x11, KEY_PROG1 }, - { KE_KEY, 0x12, KEY_PROG2 }, - { KE_WIFI, 0x30, 0 }, - { KE_KEY, 0x31, KEY_MAIL }, - { KE_KEY, 0x36, KEY_WWW }, -}; - /* * If your machine is not here (which is currently rather likely), please send * a list of buttons and their key codes (reported when loading this module @@ -379,15 +369,6 @@ static struct dmi_system_id dmi_ids[] = { }, .driver_data = keymap_acer_travelmate_240 }, - { - .callback = dmi_matched, - .ident = "AOpen 1559AS", - .matches = { - DMI_MATCH(DMI_PRODUCT_NAME, "E2U"), - DMI_MATCH(DMI_BOARD_NAME, "E2U"), - }, - .driver_data = keymap_aopen_1559as - }, { NULL, } }; diff --git a/trunk/drivers/input/mouse/alps.c b/trunk/drivers/input/mouse/alps.c index a0e2e797c6d5..2141501e9f2e 100644 --- a/trunk/drivers/input/mouse/alps.c +++ b/trunk/drivers/input/mouse/alps.c @@ -100,8 +100,8 @@ static void alps_process_packet(struct psmouse *psmouse, struct pt_regs *regs) } if (priv->i->flags & ALPS_OLDPROTO) { - left = packet[2] & 0x10; - right = packet[2] & 0x08; + left = packet[2] & 0x08; + right = packet[2] & 0x10; middle = 0; x = packet[1] | ((packet[0] & 0x07) << 7); y = packet[4] | ((packet[3] & 0x07) << 7); diff --git a/trunk/drivers/input/mouse/lifebook.c b/trunk/drivers/input/mouse/lifebook.c index c14395ba7980..5ccc3ef3b89e 100644 --- a/trunk/drivers/input/mouse/lifebook.c +++ b/trunk/drivers/input/mouse/lifebook.c @@ -21,36 +21,12 @@ #include "lifebook.h" static struct dmi_system_id lifebook_dmi_table[] = { - { - .ident = "LifeBook B", - .matches = { - DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"), - }, - }, { .ident = "Lifebook B", .matches = { DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), }, }, - { - .ident = "Lifebook B213x/B2150", - .matches = { - DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"), - }, - }, - { - .ident = "Zephyr", - .matches = { - DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"), - }, - }, - { - .ident = "CF-18", - .matches = { - DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), - }, - }, { .ident = "Lifebook B142", .matches = { diff --git a/trunk/drivers/input/mouse/logips2pp.c b/trunk/drivers/input/mouse/logips2pp.c index 2f0d28840810..40333d61093c 100644 --- a/trunk/drivers/input/mouse/logips2pp.c +++ b/trunk/drivers/input/mouse/logips2pp.c @@ -19,7 +19,6 @@ #define PS2PP_KIND_WHEEL 1 #define PS2PP_KIND_MX 2 #define PS2PP_KIND_TP3 3 -#define PS2PP_KIND_TRACKMAN 4 /* Logitech mouse features */ #define PS2PP_WHEEL 0x01 @@ -224,7 +223,6 @@ static struct ps2pp_info *get_model_info(unsigned char model) { 73, 0, PS2PP_SIDE_BTN }, { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, - { 79, PS2PP_KIND_TRACKMAN, PS2PP_WHEEL }, /* TrackMan with wheel */ { 80, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL }, { 81, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, { 83, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, @@ -300,10 +298,6 @@ static void ps2pp_set_model_properties(struct psmouse *psmouse, struct ps2pp_inf psmouse->name = "TouchPad 3"; break; - case PS2PP_KIND_TRACKMAN: - psmouse->name = "TrackMan"; - break; - default: /* * Set name to "Mouse" only when using PS2++, diff --git a/trunk/drivers/input/touchscreen/ads7846.c b/trunk/drivers/input/touchscreen/ads7846.c index 161afddd0f44..1494175ac6fe 100644 --- a/trunk/drivers/input/touchscreen/ads7846.c +++ b/trunk/drivers/input/touchscreen/ads7846.c @@ -36,10 +36,13 @@ /* - * This code has been heavily tested on a Nokia 770, and lightly - * tested on other ads7846 devices (OSK/Mistral, Lubbock). + * This code has been tested on an ads7846 / N770 device. * Support for ads7843 and ads7845 has only been stubbed in. * + * Not yet done: How accurate are the temperature and voltage + * readings? (System-specific calibration should support + * accuracy of 0.3 degrees C; otherwise it's 2.0 degrees.) + * * IRQ handling needs a workaround because of a shortcoming in handling * edge triggered IRQs on some platforms like the OMAP1/2. These * platforms don't handle the ARM lazy IRQ disabling properly, thus we @@ -245,13 +248,10 @@ static int ads7846_read12_ser(struct device *dev, unsigned command) if (req->msg.status) status = req->msg.status; - - /* on-wire is a must-ignore bit, a BE12 value, then padding */ sample = be16_to_cpu(req->sample); - sample = sample >> 3; - sample &= 0x0fff; - + sample = sample >> 4; kfree(req); + return status ? status : sample; } @@ -336,13 +336,13 @@ static void ads7846_rx(void *ads) u16 x, y, z1, z2; unsigned long flags; - /* adjust: on-wire is a must-ignore bit, a BE12 value, then padding; - * built from two 8 bit values written msb-first. + /* adjust: 12 bit samples (left aligned), built from + * two 8 bit values writen msb-first. */ - x = (be16_to_cpu(ts->tc.x) >> 3) & 0x0fff; - y = (be16_to_cpu(ts->tc.y) >> 3) & 0x0fff; - z1 = (be16_to_cpu(ts->tc.z1) >> 3) & 0x0fff; - z2 = (be16_to_cpu(ts->tc.z2) >> 3) & 0x0fff; + x = be16_to_cpu(ts->tc.x) >> 4; + y = be16_to_cpu(ts->tc.y) >> 4; + z1 = be16_to_cpu(ts->tc.z1) >> 4; + z2 = be16_to_cpu(ts->tc.z2) >> 4; /* range filtering */ if (x == MAX_12BIT) @@ -420,7 +420,7 @@ static void ads7846_debounce(void *ads) m = &ts->msg[ts->msg_idx]; t = list_entry(m->transfers.prev, struct spi_transfer, transfer_list); - val = (be16_to_cpu(*(__be16 *)t->rx_buf) >> 3) & 0x0fff; + val = (*(u16 *)t->rx_buf) >> 3; if (!ts->read_cnt || (abs(ts->last_read - val) > ts->debounce_tol)) { /* Repeat it, if this was the first read or the read * wasn't consistent enough. */ @@ -469,7 +469,7 @@ static void ads7846_timer(unsigned long handle) spin_lock_irq(&ts->lock); if (unlikely(ts->msg_idx && !ts->pendown)) { - /* measurement cycle ended */ + /* measurment cycle ended */ if (!device_suspended(&ts->spi->dev)) { ts->irq_disabled = 0; enable_irq(ts->spi->irq); @@ -495,10 +495,11 @@ static irqreturn_t ads7846_irq(int irq, void *handle, struct pt_regs *regs) spin_lock_irqsave(&ts->lock, flags); if (likely(ts->get_pendown_state())) { if (!ts->irq_disabled) { - /* The ARM do_simple_IRQ() dispatcher doesn't act - * like the other dispatchers: it will report IRQs - * even after they've been disabled. We work around - * that here. (The "generic irq" framework may help...) + /* REVISIT irq logic for many ARM chips has cloned a + * bug wherein disabling an irq in its handler won't + * work;(it's disabled lazily, and too late to work. + * until all their irq logic is fixed, we must shadow + * that state here. */ ts->irq_disabled = 1; disable_irq(ts->spi->irq); @@ -608,20 +609,16 @@ static int __devinit ads7846_probe(struct spi_device *spi) return -EINVAL; } - /* REVISIT when the irq can be triggered active-low, or if for some - * reason the touchscreen isn't hooked up, we don't need to access - * the pendown state. - */ if (pdata->get_pendown_state == NULL) { dev_dbg(&spi->dev, "no get_pendown_state function?\n"); return -EINVAL; } - /* We'd set TX wordsize 8 bits and RX wordsize to 13 bits ... except - * that even if the hardware can do that, the SPI controller driver - * may not. So we stick to very-portable 8 bit words, both RX and TX. + /* We'd set the wordsize to 12 bits ... except that some controllers + * will then treat the 8 bit command words as 12 bits (and drop the + * four MSBs of the 12 bit result). Result: inputs must be shifted + * to discard the four garbage LSBs. */ - spi->bits_per_word = 8; ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL); input_dev = input_allocate_device(); @@ -775,7 +772,7 @@ static int __devinit ads7846_probe(struct spi_device *spi) if (request_irq(spi->irq, ads7846_irq, SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING, - spi->dev.driver->name, ts)) { + spi->dev.bus_id, ts)) { dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); err = -EBUSY; goto err_free_mem; diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index ec802913f977..3ca3cfb03a7e 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -5028,10 +5028,8 @@ static int md_notify_reboot(struct notifier_block *this, printk(KERN_INFO "md: stopping all md devices.\n"); ITERATE_MDDEV(mddev,tmp) - if (mddev_trylock(mddev)) { + if (mddev_trylock(mddev)) do_md_stop (mddev, 1); - mddev_unlock(mddev); - } /* * certain more exotic SCSI devices are known to be * volatile wrt too early system reboots. While the diff --git a/trunk/drivers/md/raid0.c b/trunk/drivers/md/raid0.c index cb8c6317e4e5..678f4dbbea1d 100644 --- a/trunk/drivers/md/raid0.c +++ b/trunk/drivers/md/raid0.c @@ -331,14 +331,13 @@ static int raid0_run (mddev_t *mddev) goto out_free_conf; size = conf->strip_zone[cur].size; - conf->hash_table[0] = conf->strip_zone + cur; - for (i=1; i< nb_zone; i++) { + for (i=0; i< nb_zone; i++) { + conf->hash_table[i] = conf->strip_zone + cur; while (size <= conf->hash_spacing) { cur++; size += conf->strip_zone[cur].size; } size -= conf->hash_spacing; - conf->hash_table[i] = conf->strip_zone + cur; } if (conf->preshift) { conf->hash_spacing >>= conf->preshift; diff --git a/trunk/drivers/media/Kconfig b/trunk/drivers/media/Kconfig index 344d83aae3ec..fffc711c260c 100644 --- a/trunk/drivers/media/Kconfig +++ b/trunk/drivers/media/Kconfig @@ -8,54 +8,22 @@ config VIDEO_DEV tristate "Video For Linux" ---help--- Support for audio/video capture and overlay devices and FM radio - cards. The exact capabilities of each device vary. + cards. The exact capabilities of each device vary. User tools for + this are available from + . This kernel includes support for the new Video for Linux Two API, (V4L2) as well as the original system. Drivers and applications need to be rewritten to use V4L2, but drivers for popular cards and applications for most video capture functions already exist. - Additional info and docs are available on the web at - - - Documentation for V4L2 is also available on the web at - . + Documentation for the original API is included in the file + . Documentation for V4L2 is + available on the web at . To compile this driver as a module, choose M here: the module will be called videodev. -config VIDEO_V4L1 - boolean "Enable Video For Linux API 1 (DEPRECATED)" - depends on VIDEO_DEV - select VIDEO_V4L1_COMPAT - default y - ---help--- - Enables a compatibility API used by most V4L2 devices to allow - its usage with legacy applications that supports only V4L1 api. - - If you are unsure as to whether this is required, answer Y. - -config VIDEO_V4L1_COMPAT - boolean "Enable Video For Linux API 1 compatible Layer" - depends on VIDEO_DEV - default y - ---help--- - This api were developed to be used at Kernel 2.2 and 2.4, but - lacks support for several video standards. There are several - drivers at kernel that still depends on it. - - Documentation for the original API is included in the file - . - - User tools for this are available from - . - - If you are unsure as to whether this is required, answer Y. - -config VIDEO_V4L2 - tristate - default y - source "drivers/media/video/Kconfig" source "drivers/media/radio/Kconfig" @@ -97,3 +65,4 @@ config USB_DABUSB module will be called dabusb. endmenu + diff --git a/trunk/drivers/media/common/Kconfig b/trunk/drivers/media/common/Kconfig index 1a04db4552da..6a901a0268e1 100644 --- a/trunk/drivers/media/common/Kconfig +++ b/trunk/drivers/media/common/Kconfig @@ -1,10 +1,9 @@ config VIDEO_SAA7146 tristate - depends on I2C + select I2C config VIDEO_SAA7146_VV tristate - select VIDEO_V4L2 select VIDEO_BUF select VIDEO_VIDEOBUF select VIDEO_SAA7146 diff --git a/trunk/drivers/media/dvb/Kconfig b/trunk/drivers/media/dvb/Kconfig index a97c8f5e9a5d..3f0ec6be03ae 100644 --- a/trunk/drivers/media/dvb/Kconfig +++ b/trunk/drivers/media/dvb/Kconfig @@ -22,26 +22,26 @@ config DVB source "drivers/media/dvb/dvb-core/Kconfig" comment "Supported SAA7146 based PCI Adapters" - depends on DVB_CORE && PCI && I2C + depends on DVB_CORE && PCI source "drivers/media/dvb/ttpci/Kconfig" comment "Supported USB Adapters" - depends on DVB_CORE && USB && I2C + depends on DVB_CORE && USB source "drivers/media/dvb/dvb-usb/Kconfig" source "drivers/media/dvb/ttusb-budget/Kconfig" source "drivers/media/dvb/ttusb-dec/Kconfig" source "drivers/media/dvb/cinergyT2/Kconfig" comment "Supported FlexCopII (B2C2) Adapters" - depends on DVB_CORE && (PCI || USB) && I2C + depends on DVB_CORE && (PCI || USB) source "drivers/media/dvb/b2c2/Kconfig" comment "Supported BT878 Adapters" - depends on DVB_CORE && PCI && I2C + depends on DVB_CORE && PCI source "drivers/media/dvb/bt8xx/Kconfig" comment "Supported Pluto2 Adapters" - depends on DVB_CORE && PCI && I2C + depends on DVB_CORE && PCI source "drivers/media/dvb/pluto2/Kconfig" comment "Supported DVB Frontends" diff --git a/trunk/drivers/media/dvb/b2c2/Kconfig b/trunk/drivers/media/dvb/b2c2/Kconfig index d7f1fd5b7b02..2963605c0ecc 100644 --- a/trunk/drivers/media/dvb/b2c2/Kconfig +++ b/trunk/drivers/media/dvb/b2c2/Kconfig @@ -1,6 +1,6 @@ config DVB_B2C2_FLEXCOP tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters" - depends on DVB_CORE && I2C + depends on DVB_CORE select DVB_STV0299 select DVB_MT352 select DVB_MT312 @@ -16,7 +16,7 @@ config DVB_B2C2_FLEXCOP config DVB_B2C2_FLEXCOP_PCI tristate "Technisat/B2C2 Air/Sky/Cable2PC PCI" - depends on DVB_B2C2_FLEXCOP && PCI && I2C + depends on DVB_B2C2_FLEXCOP && PCI help Support for the Air/Sky/CableStar2 PCI card (DVB/ATSC) by Technisat/B2C2. @@ -24,7 +24,7 @@ config DVB_B2C2_FLEXCOP_PCI config DVB_B2C2_FLEXCOP_USB tristate "Technisat/B2C2 Air/Sky/Cable2PC USB" - depends on DVB_B2C2_FLEXCOP && USB && I2C + depends on DVB_B2C2_FLEXCOP && USB help Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by Technisat/B2C2, diff --git a/trunk/drivers/media/dvb/bt8xx/Kconfig b/trunk/drivers/media/dvb/bt8xx/Kconfig index f394002118f8..376ca48f1d1d 100644 --- a/trunk/drivers/media/dvb/bt8xx/Kconfig +++ b/trunk/drivers/media/dvb/bt8xx/Kconfig @@ -1,13 +1,12 @@ config DVB_BT8XX tristate "BT8xx based PCI cards" - depends on DVB_CORE && PCI && I2C && VIDEO_BT848 + depends on DVB_CORE && PCI && VIDEO_BT848 select DVB_MT352 select DVB_SP887X select DVB_NXT6000 select DVB_CX24110 select DVB_OR51211 select DVB_LGDT330X - select DVB_ZL10353 select FW_LOADER help Support for PCI cards based on the Bt8xx PCI bridge. Examples are diff --git a/trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c index ccc7b2eb4a2d..baa8227ef87c 100644 --- a/trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/trunk/drivers/media/dvb/bt8xx/dvb-bt8xx.c @@ -115,7 +115,7 @@ static int is_pci_slot_eq(struct pci_dev* adev, struct pci_dev* bdev) return 0; } -static struct bt878 __devinit *dvb_bt8xx_878_match(unsigned int bttv_nr, struct pci_dev* bttv_pci_dev) +static struct bt878 __init *dvb_bt8xx_878_match(unsigned int bttv_nr, struct pci_dev* bttv_pci_dev) { unsigned int card_nr; @@ -709,7 +709,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) } } -static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) +static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) { int result; @@ -794,7 +794,7 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) return 0; } -static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub) +static int dvb_bt8xx_probe(struct bttv_sub_device *sub) { struct dvb_bt8xx_card *card; struct pci_dev* bttv_pci_dev; diff --git a/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c b/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c index 9325d039ea65..71b575dc22bd 100644 --- a/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/trunk/drivers/media/dvb/cinergyT2/cinergyT2.c @@ -902,10 +902,7 @@ static int cinergyt2_probe (struct usb_interface *intf, return -ENOMEM; } - if ((err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE)) < 0) { - kfree(cinergyt2); - return err; - } + dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE); cinergyt2->demux.priv = cinergyt2; cinergyt2->demux.filternum = 256; diff --git a/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c b/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c index a051790161b0..4f8f257e6795 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/trunk/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -106,8 +106,6 @@ struct dvb_frontend_private { unsigned long tune_mode_flags; unsigned int delay; unsigned int reinitialise; - int tone; - int voltage; /* swzigzag values */ unsigned int state; @@ -539,12 +537,6 @@ static int dvb_frontend_thread(void *data) if (fepriv->reinitialise) { dvb_frontend_init(fe); - if (fepriv->tone != -1) { - fe->ops->set_tone(fe, fepriv->tone); - } - if (fepriv->voltage != -1) { - fe->ops->set_voltage(fe, fepriv->voltage); - } fepriv->reinitialise = 0; } @@ -796,7 +788,6 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, case FE_SET_TONE: if (fe->ops->set_tone) { err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg); - fepriv->tone = (fe_sec_tone_mode_t) parg; fepriv->state = FESTATE_DISEQC; fepriv->status = 0; } @@ -805,7 +796,6 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, case FE_SET_VOLTAGE: if (fe->ops->set_voltage) { err = fe->ops->set_voltage(fe, (fe_sec_voltage_t) parg); - fepriv->voltage = (fe_sec_voltage_t) parg; fepriv->state = FESTATE_DISEQC; fepriv->status = 0; } @@ -1005,8 +995,6 @@ static int dvb_frontend_open(struct inode *inode, struct file *file) /* normal tune mode when opened R/W */ fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT; - fepriv->tone = -1; - fepriv->voltage = -1; } return ret; diff --git a/trunk/drivers/media/dvb/dvb-core/dvbdev.c b/trunk/drivers/media/dvb/dvb-core/dvbdev.c index 3852430d0260..96fe0ecae250 100644 --- a/trunk/drivers/media/dvb/dvb-core/dvbdev.c +++ b/trunk/drivers/media/dvb/dvb-core/dvbdev.c @@ -219,6 +219,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, return -ENOMEM; } + mutex_unlock(&dvbdev_register_lock); + memcpy(dvbdev, template, sizeof(struct dvb_device)); dvbdev->type = type; dvbdev->id = id; @@ -229,8 +231,6 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, list_add_tail (&dvbdev->list_head, &adap->device_list); - mutex_unlock(&dvbdev_register_lock); - devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), S_IFCHR | S_IRUSR | S_IWUSR, "dvb/adapter%d/%s%d", adap->num, dnames[type], id); diff --git a/trunk/drivers/media/dvb/dvb-usb/Kconfig b/trunk/drivers/media/dvb/dvb-usb/Kconfig index e388fb1567d6..d3df12039b06 100644 --- a/trunk/drivers/media/dvb/dvb-usb/Kconfig +++ b/trunk/drivers/media/dvb/dvb-usb/Kconfig @@ -1,6 +1,6 @@ config DVB_USB tristate "Support for various USB DVB devices" - depends on DVB_CORE && USB && I2C + depends on DVB_CORE && USB select FW_LOADER help By enabling this you will be able to choose the various supported diff --git a/trunk/drivers/media/dvb/dvb-usb/cxusb.c b/trunk/drivers/media/dvb/dvb-usb/cxusb.c index 1f0d3e995c8d..7edd6362b9cc 100644 --- a/trunk/drivers/media/dvb/dvb-usb/cxusb.c +++ b/trunk/drivers/media/dvb/dvb-usb/cxusb.c @@ -150,15 +150,6 @@ static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff) return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0); } -static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff) -{ - u8 b = 0; - if (onoff) - return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0); - else - return 0; -} - static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) { u8 buf[2] = { 0x03, 0x00 }; @@ -553,7 +544,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { .size_of_priv = sizeof(struct cxusb_state), .streaming_ctrl = cxusb_streaming_ctrl, - .power_ctrl = cxusb_bluebird_power_ctrl, + .power_ctrl = cxusb_power_ctrl, .frontend_attach = cxusb_lgdt3303_frontend_attach, .tuner_attach = cxusb_lgh064f_tuner_attach, @@ -598,7 +589,7 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { .size_of_priv = sizeof(struct cxusb_state), .streaming_ctrl = cxusb_streaming_ctrl, - .power_ctrl = cxusb_bluebird_power_ctrl, + .power_ctrl = cxusb_power_ctrl, .frontend_attach = cxusb_dee1601_frontend_attach, .tuner_attach = cxusb_dee1601_tuner_attach, @@ -647,7 +638,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = { .size_of_priv = sizeof(struct cxusb_state), .streaming_ctrl = cxusb_streaming_ctrl, - .power_ctrl = cxusb_bluebird_power_ctrl, + .power_ctrl = cxusb_power_ctrl, .frontend_attach = cxusb_mt352_frontend_attach, .tuner_attach = cxusb_lgz201_tuner_attach, @@ -692,7 +683,7 @@ static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = { .size_of_priv = sizeof(struct cxusb_state), .streaming_ctrl = cxusb_streaming_ctrl, - .power_ctrl = cxusb_bluebird_power_ctrl, + .power_ctrl = cxusb_power_ctrl, .frontend_attach = cxusb_mt352_frontend_attach, .tuner_attach = cxusb_dtt7579_tuner_attach, diff --git a/trunk/drivers/media/dvb/frontends/cx24123.c b/trunk/drivers/media/dvb/frontends/cx24123.c index 691dc840dcc0..d661c6f9cbe5 100644 --- a/trunk/drivers/media/dvb/frontends/cx24123.c +++ b/trunk/drivers/media/dvb/frontends/cx24123.c @@ -29,9 +29,6 @@ #include "dvb_frontend.h" #include "cx24123.h" -#define XTAL 10111000 - -static int force_band; static int debug; #define dprintk(args...) \ do { \ @@ -55,7 +52,6 @@ struct cx24123_state u32 VGAarg; u32 bandselectarg; u32 pllarg; - u32 FILTune; /* The Demod/Tuner can't easily provide these, we cache them */ u32 currentfreq; @@ -67,33 +63,43 @@ static struct { u32 symbolrate_low; u32 symbolrate_high; + u32 VCAslope; + u32 VCAoffset; + u32 VGA1offset; + u32 VGA2offset; u32 VCAprogdata; u32 VGAprogdata; - u32 FILTune; } cx24123_AGC_vals[] = { { .symbolrate_low = 1000000, .symbolrate_high = 4999999, - /* the specs recommend other values for VGA offsets, - but tests show they are wrong */ - .VGAprogdata = (1 << 19) | (0x180 << 9) | 0x1e0, - .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x07, - .FILTune = 0x27f /* 0.41 V */ + .VCAslope = 0x07, + .VCAoffset = 0x0f, + .VGA1offset = 0x1f8, + .VGA2offset = 0x1f8, + .VGAprogdata = (2 << 18) | (0x1f8 << 9) | 0x1f8, + .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x07, }, { .symbolrate_low = 5000000, .symbolrate_high = 14999999, - .VGAprogdata = (1 << 19) | (0x180 << 9) | 0x1e0, - .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x1f, - .FILTune = 0x317 /* 0.90 V */ + .VCAslope = 0x1f, + .VCAoffset = 0x1f, + .VGA1offset = 0x1e0, + .VGA2offset = 0x180, + .VGAprogdata = (2 << 18) | (0x180 << 9) | 0x1e0, + .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x1f, }, { .symbolrate_low = 15000000, .symbolrate_high = 45000000, - .VGAprogdata = (1 << 19) | (0x100 << 9) | 0x180, - .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x3f, - .FILTune = 0x145 /* 2.70 V */ + .VCAslope = 0x3f, + .VCAoffset = 0x3f, + .VGA1offset = 0x180, + .VGA2offset = 0x100, + .VGAprogdata = (2 << 18) | (0x100 << 9) | 0x180, + .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x3f, }, }; @@ -106,80 +112,91 @@ static struct { u32 freq_low; u32 freq_high; + u32 bandselect; u32 VCOdivider; + u32 VCOnumber; u32 progdata; } cx24123_bandselect_vals[] = { - /* band 1 */ { .freq_low = 950000, + .freq_high = 1018999, + .bandselect = 0x40, + .VCOdivider = 4, + .VCOnumber = 7, + .progdata = (0 << 18) | (0 << 9) | 0x40, + }, + { + .freq_low = 1019000, .freq_high = 1074999, + .bandselect = 0x80, .VCOdivider = 4, - .progdata = (0 << 19) | (0 << 9) | 0x40, + .VCOnumber = 8, + .progdata = (0 << 18) | (0 << 9) | 0x80, }, - - /* band 2 */ { .freq_low = 1075000, - .freq_high = 1177999, - .VCOdivider = 4, - .progdata = (0 << 19) | (0 << 9) | 0x80, + .freq_high = 1227999, + .bandselect = 0x01, + .VCOdivider = 2, + .VCOnumber = 1, + .progdata = (0 << 18) | (1 << 9) | 0x01, }, - - /* band 3 */ { - .freq_low = 1178000, - .freq_high = 1295999, + .freq_low = 1228000, + .freq_high = 1349999, + .bandselect = 0x02, .VCOdivider = 2, - .progdata = (0 << 19) | (1 << 9) | 0x01, + .VCOnumber = 2, + .progdata = (0 << 18) | (1 << 9) | 0x02, }, - - /* band 4 */ { - .freq_low = 1296000, - .freq_high = 1431999, + .freq_low = 1350000, + .freq_high = 1481999, + .bandselect = 0x04, .VCOdivider = 2, - .progdata = (0 << 19) | (1 << 9) | 0x02, + .VCOnumber = 3, + .progdata = (0 << 18) | (1 << 9) | 0x04, }, - - /* band 5 */ { - .freq_low = 1432000, - .freq_high = 1575999, + .freq_low = 1482000, + .freq_high = 1595999, + .bandselect = 0x08, .VCOdivider = 2, - .progdata = (0 << 19) | (1 << 9) | 0x04, + .VCOnumber = 4, + .progdata = (0 << 18) | (1 << 9) | 0x08, }, - - /* band 6 */ { - .freq_low = 1576000, + .freq_low = 1596000, .freq_high = 1717999, + .bandselect = 0x10, .VCOdivider = 2, - .progdata = (0 << 19) | (1 << 9) | 0x08, + .VCOnumber = 5, + .progdata = (0 << 18) | (1 << 9) | 0x10, }, - - /* band 7 */ { .freq_low = 1718000, .freq_high = 1855999, + .bandselect = 0x20, .VCOdivider = 2, - .progdata = (0 << 19) | (1 << 9) | 0x10, + .VCOnumber = 6, + .progdata = (0 << 18) | (1 << 9) | 0x20, }, - - /* band 8 */ { .freq_low = 1856000, .freq_high = 2035999, + .bandselect = 0x40, .VCOdivider = 2, - .progdata = (0 << 19) | (1 << 9) | 0x20, + .VCOnumber = 7, + .progdata = (0 << 18) | (1 << 9) | 0x40, }, - - /* band 9 */ { .freq_low = 2036000, - .freq_high = 2150000, + .freq_high = 2149999, + .bandselect = 0x80, .VCOdivider = 2, - .progdata = (0 << 19) | (1 << 9) | 0x40, + .VCOnumber = 8, + .progdata = (0 << 18) | (1 << 9) | 0x80, }, }; @@ -190,44 +207,49 @@ static struct { { {0x00, 0x03}, /* Reset system */ {0x00, 0x00}, /* Clear reset */ - {0x03, 0x07}, /* QPSK, DVB, Auto Acquisition (default) */ - {0x04, 0x10}, /* MPEG */ - {0x05, 0x04}, /* MPEG */ - {0x06, 0x31}, /* MPEG (default) */ - {0x0b, 0x00}, /* Freq search start point (default) */ - {0x0c, 0x00}, /* Demodulator sample gain (default) */ - {0x0d, 0x02}, /* Frequency search range = Fsymbol / 4 (default) */ - {0x0e, 0x03}, /* Default non-inverted, FEC 3/4 (default) */ - {0x0f, 0xfe}, /* FEC search mask (all supported codes) */ - {0x10, 0x01}, /* Default search inversion, no repeat (default) */ - {0x16, 0x00}, /* Enable reading of frequency */ - {0x17, 0x01}, /* Enable EsNO Ready Counter */ - {0x1c, 0x80}, /* Enable error counter */ - {0x20, 0x00}, /* Tuner burst clock rate = 500KHz */ - {0x21, 0x15}, /* Tuner burst mode, word length = 0x15 */ - {0x28, 0x00}, /* Enable FILTERV with positive pol., DiSEqC 2.x off */ - {0x29, 0x00}, /* DiSEqC LNB_DC off */ - {0x2a, 0xb0}, /* DiSEqC Parameters (default) */ - {0x2b, 0x73}, /* DiSEqC Tone Frequency (default) */ - {0x2c, 0x00}, /* DiSEqC Message (0x2c - 0x31) */ + {0x01, 0x3b}, /* Apply sensible defaults, from an i2c sniffer */ + {0x03, 0x07}, + {0x04, 0x10}, + {0x05, 0x04}, + {0x06, 0x31}, + {0x0d, 0x02}, + {0x0e, 0x03}, + {0x0f, 0xfe}, + {0x10, 0x01}, + {0x14, 0x01}, + {0x15, 0x98}, + {0x16, 0x00}, + {0x17, 0x01}, + {0x1b, 0x05}, + {0x1c, 0x80}, + {0x1d, 0x00}, + {0x1e, 0x00}, + {0x20, 0x41}, + {0x21, 0x15}, + {0x27, 0x14}, + {0x28, 0x46}, + {0x29, 0x00}, + {0x2a, 0xb0}, + {0x2b, 0x73}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x2f, 0x00}, {0x30, 0x00}, {0x31, 0x00}, - {0x32, 0x8c}, /* DiSEqC Parameters (default) */ - {0x33, 0x00}, /* Interrupts off (0x33 - 0x34) */ + {0x32, 0x8c}, + {0x33, 0x00}, {0x34, 0x00}, - {0x35, 0x03}, /* DiSEqC Tone Amplitude (default) */ - {0x36, 0x02}, /* DiSEqC Parameters (default) */ - {0x37, 0x3a}, /* DiSEqC Parameters (default) */ - {0x3a, 0x00}, /* Enable AGC accumulator (for signal strength) */ - {0x44, 0x00}, /* Constellation (default) */ - {0x45, 0x00}, /* Symbol count (default) */ - {0x46, 0x0d}, /* Symbol rate estimator on (default) */ - {0x56, 0x41}, /* Various (default) */ - {0x57, 0xff}, /* Error Counter Window (default) */ - {0x67, 0x83}, /* Non-DCII symbol clock */ + {0x35, 0x03}, + {0x36, 0x02}, + {0x37, 0x3a}, + {0x3a, 0x00}, /* Enable AGC accumulator */ + {0x44, 0x00}, + {0x45, 0x00}, + {0x46, 0x05}, + {0x56, 0x41}, + {0x57, 0xff}, + {0x67, 0x83}, }; static int cx24123_writereg(struct cx24123_state* state, int reg, int data) @@ -236,10 +258,6 @@ static int cx24123_writereg(struct cx24123_state* state, int reg, int data) struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; int err; - if (debug>1) - printk("cx24123: %s: write reg 0x%02x, value 0x%02x\n", - __FUNCTION__,reg, data); - if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { printk("%s: writereg error(err == %i, reg == 0x%02x," " data == 0x%02x)\n", __FUNCTION__, err, reg, data); @@ -256,10 +274,6 @@ static int cx24123_writelnbreg(struct cx24123_state* state, int reg, int data) struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = buf, .len = 2 }; int err; - if (debug>1) - printk("cx24123: %s: writeln addr=0x08, reg 0x%02x, value 0x%02x\n", - __FUNCTION__,reg, data); - if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { printk("%s: writelnbreg error (err == %i, reg == 0x%02x," " data == 0x%02x)\n", __FUNCTION__, err, reg, data); @@ -289,9 +303,6 @@ static int cx24123_readreg(struct cx24123_state* state, u8 reg) return ret; } - if (debug>1) - printk("cx24123: read reg 0x%02x, value 0x%02x\n",reg, ret); - return b1[0]; } @@ -302,23 +313,17 @@ static int cx24123_readlnbreg(struct cx24123_state* state, u8 reg) static int cx24123_set_inversion(struct cx24123_state* state, fe_spectral_inversion_t inversion) { - u8 nom_reg = cx24123_readreg(state, 0x0e); - u8 auto_reg = cx24123_readreg(state, 0x10); - switch (inversion) { case INVERSION_OFF: - dprintk("%s: inversion off\n",__FUNCTION__); - cx24123_writereg(state, 0x0e, nom_reg & ~0x80); - cx24123_writereg(state, 0x10, auto_reg | 0x80); + cx24123_writereg(state, 0x0e, cx24123_readreg(state, 0x0e) & 0x7f); + cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) | 0x80); break; case INVERSION_ON: - dprintk("%s: inversion on\n",__FUNCTION__); - cx24123_writereg(state, 0x0e, nom_reg | 0x80); - cx24123_writereg(state, 0x10, auto_reg | 0x80); + cx24123_writereg(state, 0x0e, cx24123_readreg(state, 0x0e) | 0x80); + cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) | 0x80); break; case INVERSION_AUTO: - dprintk("%s: inversion auto\n",__FUNCTION__); - cx24123_writereg(state, 0x10, auto_reg & ~0x80); + cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) & 0x7f); break; default: return -EINVAL; @@ -333,191 +338,92 @@ static int cx24123_get_inversion(struct cx24123_state* state, fe_spectral_invers val = cx24123_readreg(state, 0x1b) >> 7; - if (val == 0) { - dprintk("%s: read inversion off\n",__FUNCTION__); + if (val == 0) *inversion = INVERSION_OFF; - } else { - dprintk("%s: read inversion on\n",__FUNCTION__); + else *inversion = INVERSION_ON; - } return 0; } static int cx24123_set_fec(struct cx24123_state* state, fe_code_rate_t fec) { - u8 nom_reg = cx24123_readreg(state, 0x0e) & ~0x07; - if ( (fec < FEC_NONE) || (fec > FEC_AUTO) ) fec = FEC_AUTO; + /* Hardware has 5/11 and 3/5 but are never unused */ switch (fec) { + case FEC_NONE: + return cx24123_writereg(state, 0x0f, 0x01); case FEC_1_2: - dprintk("%s: set FEC to 1/2\n",__FUNCTION__); - cx24123_writereg(state, 0x0e, nom_reg | 0x01); - cx24123_writereg(state, 0x0f, 0x02); - break; + return cx24123_writereg(state, 0x0f, 0x02); case FEC_2_3: - dprintk("%s: set FEC to 2/3\n",__FUNCTION__); - cx24123_writereg(state, 0x0e, nom_reg | 0x02); - cx24123_writereg(state, 0x0f, 0x04); - break; + return cx24123_writereg(state, 0x0f, 0x04); case FEC_3_4: - dprintk("%s: set FEC to 3/4\n",__FUNCTION__); - cx24123_writereg(state, 0x0e, nom_reg | 0x03); - cx24123_writereg(state, 0x0f, 0x08); - break; - case FEC_4_5: - dprintk("%s: set FEC to 4/5\n",__FUNCTION__); - cx24123_writereg(state, 0x0e, nom_reg | 0x04); - cx24123_writereg(state, 0x0f, 0x10); - break; + return cx24123_writereg(state, 0x0f, 0x08); case FEC_5_6: - dprintk("%s: set FEC to 5/6\n",__FUNCTION__); - cx24123_writereg(state, 0x0e, nom_reg | 0x05); - cx24123_writereg(state, 0x0f, 0x20); - break; - case FEC_6_7: - dprintk("%s: set FEC to 6/7\n",__FUNCTION__); - cx24123_writereg(state, 0x0e, nom_reg | 0x06); - cx24123_writereg(state, 0x0f, 0x40); - break; + return cx24123_writereg(state, 0x0f, 0x20); case FEC_7_8: - dprintk("%s: set FEC to 7/8\n",__FUNCTION__); - cx24123_writereg(state, 0x0e, nom_reg | 0x07); - cx24123_writereg(state, 0x0f, 0x80); - break; + return cx24123_writereg(state, 0x0f, 0x80); case FEC_AUTO: - dprintk("%s: set FEC to auto\n",__FUNCTION__); - cx24123_writereg(state, 0x0f, 0xfe); - break; + return cx24123_writereg(state, 0x0f, 0xae); default: return -EOPNOTSUPP; } - - return 0; } static int cx24123_get_fec(struct cx24123_state* state, fe_code_rate_t *fec) { int ret; + u8 val; ret = cx24123_readreg (state, 0x1b); if (ret < 0) return ret; - ret = ret & 0x07; - - switch (ret) { + val = ret & 0x07; + switch (val) { case 1: *fec = FEC_1_2; break; - case 2: - *fec = FEC_2_3; - break; case 3: - *fec = FEC_3_4; + *fec = FEC_2_3; break; case 4: - *fec = FEC_4_5; + *fec = FEC_3_4; break; case 5: - *fec = FEC_5_6; + *fec = FEC_4_5; break; case 6: - *fec = FEC_6_7; + *fec = FEC_5_6; break; case 7: *fec = FEC_7_8; break; + case 2: /* *fec = FEC_3_5; break; */ + case 0: /* *fec = FEC_5_11; break; */ + *fec = FEC_AUTO; + break; default: - /* this can happen when there's no lock */ - *fec = FEC_NONE; + *fec = FEC_NONE; // can't happen } return 0; } -/* Approximation of closest integer of log2(a/b). It actually gives the - lowest integer i such that 2^i >= round(a/b) */ -static u32 cx24123_int_log2(u32 a, u32 b) -{ - u32 exp, nearest = 0; - u32 div = a / b; - if(a % b >= b / 2) ++div; - if(div < (1 << 31)) - { - for(exp = 1; div > exp; nearest++) - exp += exp; - } - return nearest; -} - +/* fixme: Symbol rates < 3MSps may not work because of precision loss */ static int cx24123_set_symbolrate(struct cx24123_state* state, u32 srate) { - u32 tmp, sample_rate, ratio, sample_gain; - u8 pll_mult; - - /* check if symbol rate is within limits */ - if ((srate > state->ops.info.symbol_rate_max) || - (srate < state->ops.info.symbol_rate_min)) - return -EOPNOTSUPP;; - - /* choose the sampling rate high enough for the required operation, - while optimizing the power consumed by the demodulator */ - if (srate < (XTAL*2)/2) - pll_mult = 2; - else if (srate < (XTAL*3)/2) - pll_mult = 3; - else if (srate < (XTAL*4)/2) - pll_mult = 4; - else if (srate < (XTAL*5)/2) - pll_mult = 5; - else if (srate < (XTAL*6)/2) - pll_mult = 6; - else if (srate < (XTAL*7)/2) - pll_mult = 7; - else if (srate < (XTAL*8)/2) - pll_mult = 8; - else - pll_mult = 9; - - - sample_rate = pll_mult * XTAL; - - /* - SYSSymbolRate[21:0] = (srate << 23) / sample_rate - - We have to use 32 bit unsigned arithmetic without precision loss. - The maximum srate is 45000000 or 0x02AEA540. This number has - only 6 clear bits on top, hence we can shift it left only 6 bits - at a time. Borrowed from cx24110.c - */ - - tmp = srate << 6; - ratio = tmp / sample_rate; - - tmp = (tmp % sample_rate) << 6; - ratio = (ratio << 6) + (tmp / sample_rate); - - tmp = (tmp % sample_rate) << 6; - ratio = (ratio << 6) + (tmp / sample_rate); - - tmp = (tmp % sample_rate) << 5; - ratio = (ratio << 5) + (tmp / sample_rate); - - - cx24123_writereg(state, 0x01, pll_mult * 6); + u32 val; - cx24123_writereg(state, 0x08, (ratio >> 16) & 0x3f ); - cx24123_writereg(state, 0x09, (ratio >> 8) & 0xff ); - cx24123_writereg(state, 0x0a, (ratio ) & 0xff ); + val = (srate / 1185) * 100; - /* also set the demodulator sample gain */ - sample_gain = cx24123_int_log2(sample_rate, srate); - tmp = cx24123_readreg(state, 0x0c) & ~0xe0; - cx24123_writereg(state, 0x0c, tmp | sample_gain << 5); + /* Compensate for scaling up, by removing 17 symbols per 1Msps */ + val = val - (17 * (srate / 1000000)); - dprintk("%s: srate=%d, ratio=0x%08x, sample_rate=%i sample_gain=%d\n", __FUNCTION__, srate, ratio, sample_rate, sample_gain); + cx24123_writereg(state, 0x08, (val >> 16) & 0xff ); + cx24123_writereg(state, 0x09, (val >> 8) & 0xff ); + cx24123_writereg(state, 0x0a, (val ) & 0xff ); return 0; } @@ -531,9 +437,6 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa struct cx24123_state *state = fe->demodulator_priv; u32 ndiv = 0, adiv = 0, vco_div = 0; int i = 0; - int pump = 2; - int band = 0; - int num_bands = sizeof(cx24123_bandselect_vals) / sizeof(cx24123_bandselect_vals[0]); /* Defaults for low freq, low rate */ state->VCAarg = cx24123_AGC_vals[0].VCAprogdata; @@ -541,49 +444,38 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa state->bandselectarg = cx24123_bandselect_vals[0].progdata; vco_div = cx24123_bandselect_vals[0].VCOdivider; - /* For the given symbol rate, determine the VCA, VGA and FILTUNE programming bits */ + /* For the given symbolerate, determine the VCA and VGA programming bits */ for (i = 0; i < sizeof(cx24123_AGC_vals) / sizeof(cx24123_AGC_vals[0]); i++) { if ((cx24123_AGC_vals[i].symbolrate_low <= p->u.qpsk.symbol_rate) && - (cx24123_AGC_vals[i].symbolrate_high >= p->u.qpsk.symbol_rate) ) { + (cx24123_AGC_vals[i].symbolrate_high >= p->u.qpsk.symbol_rate) ) { state->VCAarg = cx24123_AGC_vals[i].VCAprogdata; state->VGAarg = cx24123_AGC_vals[i].VGAprogdata; - state->FILTune = cx24123_AGC_vals[i].FILTune; } } - /* determine the band to use */ - if(force_band < 1 || force_band > num_bands) + /* For the given frequency, determine the bandselect programming bits */ + for (i = 0; i < sizeof(cx24123_bandselect_vals) / sizeof(cx24123_bandselect_vals[0]); i++) { - for (i = 0; i < num_bands; i++) - { - if ((cx24123_bandselect_vals[i].freq_low <= p->frequency) && - (cx24123_bandselect_vals[i].freq_high >= p->frequency) ) - band = i; + if ((cx24123_bandselect_vals[i].freq_low <= p->frequency) && + (cx24123_bandselect_vals[i].freq_high >= p->frequency) ) { + state->bandselectarg = cx24123_bandselect_vals[i].progdata; + vco_div = cx24123_bandselect_vals[i].VCOdivider; } } - else - band = force_band - 1; - - state->bandselectarg = cx24123_bandselect_vals[band].progdata; - vco_div = cx24123_bandselect_vals[band].VCOdivider; - - /* determine the charge pump current */ - if ( p->frequency < (cx24123_bandselect_vals[band].freq_low + cx24123_bandselect_vals[band].freq_high)/2 ) - pump = 0x01; - else - pump = 0x02; /* Determine the N/A dividers for the requested lband freq (in kHz). */ - /* Note: the reference divider R=10, frequency is in KHz, XTAL is in Hz */ - ndiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) / 32) & 0x1ff; - adiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) % 32) & 0x1f; + /* Note: 10111 (kHz) is the Crystal Freq and divider of 10. */ + ndiv = ( ((p->frequency * vco_div) / (10111 / 10) / 2) / 32) & 0x1ff; + adiv = ( ((p->frequency * vco_div) / (10111 / 10) / 2) % 32) & 0x1f; if (adiv == 0) - ndiv++; + adiv++; - /* control bits 11, refdiv 11, charge pump polarity 1, charge pump current, ndiv, adiv */ - state->pllarg = (3 << 19) | (3 << 17) | (1 << 16) | (pump << 14) | (ndiv << 5) | adiv; + /* determine the correct pll frequency values. */ + /* Command 11, refdiv 11, cpump polarity 1, cpump current 3mA 10. */ + state->pllarg = (3 << 19) | (3 << 17) | (1 << 16) | (2 << 14); + state->pllarg |= (ndiv << 5) | adiv; return 0; } @@ -597,8 +489,6 @@ static int cx24123_pll_writereg(struct dvb_frontend* fe, struct dvb_frontend_par struct cx24123_state *state = fe->demodulator_priv; unsigned long timeout; - dprintk("%s: pll writereg called, data=0x%08x\n",__FUNCTION__,data); - /* align the 21 bytes into to bit23 boundary */ data = data << 3; @@ -648,9 +538,6 @@ static int cx24123_pll_writereg(struct dvb_frontend* fe, struct dvb_frontend_par static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) { struct cx24123_state *state = fe->demodulator_priv; - u8 val; - - dprintk("frequency=%i\n", p->frequency); if (cx24123_pll_calculate(fe, p) != 0) { printk("%s: cx24123_pll_calcutate failed\n",__FUNCTION__); @@ -665,14 +552,6 @@ static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_paramet cx24123_pll_writereg(fe, p, state->bandselectarg); cx24123_pll_writereg(fe, p, state->pllarg); - /* set the FILTUNE voltage */ - val = cx24123_readreg(state, 0x28) & ~0x3; - cx24123_writereg(state, 0x27, state->FILTune >> 2); - cx24123_writereg(state, 0x28, val | (state->FILTune & 0x3)); - - dprintk("%s: pll tune VCA=%d, band=%d, pll=%d\n",__FUNCTION__,state->VCAarg, - state->bandselectarg,state->pllarg); - return 0; } @@ -681,8 +560,6 @@ static int cx24123_initfe(struct dvb_frontend* fe) struct cx24123_state *state = fe->demodulator_priv; int i; - dprintk("%s: init frontend\n",__FUNCTION__); - /* Configure the demod to a good set of defaults */ for (i = 0; i < sizeof(cx24123_regdata) / sizeof(cx24123_regdata[0]); i++) cx24123_writereg(state, cx24123_regdata[i].reg, cx24123_regdata[i].data); @@ -710,13 +587,10 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage switch (voltage) { case SEC_VOLTAGE_13: - dprintk("%s: isl6421 voltage = 13V\n",__FUNCTION__); return cx24123_writelnbreg(state, 0x0, val & 0x32); /* V 13v */ case SEC_VOLTAGE_18: - dprintk("%s: isl6421 voltage = 18V\n",__FUNCTION__); return cx24123_writelnbreg(state, 0x0, val | 0x04); /* H 18v */ case SEC_VOLTAGE_OFF: - dprintk("%s: isl5421 voltage off\n",__FUNCTION__); return cx24123_writelnbreg(state, 0x0, val & 0x30); default: return -EINVAL; @@ -750,93 +624,13 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage return 0; } -/* wait for diseqc queue to become ready (or timeout) */ -static void cx24123_wait_for_diseqc(struct cx24123_state *state) -{ - unsigned long timeout = jiffies + msecs_to_jiffies(200); - while (!(cx24123_readreg(state, 0x29) & 0x40)) { - if(time_after(jiffies, timeout)) { - printk("%s: diseqc queue not ready, command may be lost.\n", __FUNCTION__); - break; - } - msleep(10); - } -} - -static int cx24123_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) +static int cx24123_send_diseqc_msg(struct dvb_frontend* fe, + struct dvb_diseqc_master_cmd *cmd) { - struct cx24123_state *state = fe->demodulator_priv; - int i, val; - - dprintk("%s:\n",__FUNCTION__); - - /* check if continuous tone has been stopped */ - if (state->config->use_isl6421) - val = cx24123_readlnbreg(state, 0x00) & 0x10; - else - val = cx24123_readreg(state, 0x29) & 0x10; + /* fixme: Implement diseqc */ + printk("%s: No support yet\n",__FUNCTION__); - - if (val) { - printk("%s: ERROR: attempt to send diseqc command before tone is off\n", __FUNCTION__); - return -ENOTSUPP; - } - - /* wait for diseqc queue ready */ - cx24123_wait_for_diseqc(state); - - /* select tone mode */ - cx24123_writereg(state, 0x2a, cx24123_readreg(state, 0x2a) & 0xf8); - - for (i = 0; i < cmd->msg_len; i++) - cx24123_writereg(state, 0x2C + i, cmd->msg[i]); - - val = cx24123_readreg(state, 0x29); - cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40) | ((cmd->msg_len-3) & 3)); - - /* wait for diseqc message to finish sending */ - cx24123_wait_for_diseqc(state); - - return 0; -} - -static int cx24123_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) -{ - struct cx24123_state *state = fe->demodulator_priv; - int val; - - dprintk("%s:\n", __FUNCTION__); - - /* check if continuous tone has been stoped */ - if (state->config->use_isl6421) - val = cx24123_readlnbreg(state, 0x00) & 0x10; - else - val = cx24123_readreg(state, 0x29) & 0x10; - - - if (val) { - printk("%s: ERROR: attempt to send diseqc command before tone is off\n", __FUNCTION__); - return -ENOTSUPP; - } - - cx24123_wait_for_diseqc(state); - - /* select tone mode */ - val = cx24123_readreg(state, 0x2a) & 0xf8; - cx24123_writereg(state, 0x2a, val | 0x04); - - val = cx24123_readreg(state, 0x29); - - if (burst == SEC_MINI_A) - cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40 | 0x00)); - else if (burst == SEC_MINI_B) - cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40 | 0x08)); - else - return -EINVAL; - - cx24123_wait_for_diseqc(state); - - return 0; + return -ENOTSUPP; } static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status) @@ -848,15 +642,13 @@ static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status) *status = 0; if (lock & 0x01) - *status |= FE_HAS_SIGNAL; - if (sync & 0x02) - *status |= FE_HAS_CARRIER; + *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL; if (sync & 0x04) *status |= FE_HAS_VITERBI; if (sync & 0x08) - *status |= FE_HAS_SYNC; + *status |= FE_HAS_CARRIER; if (sync & 0x80) - *status |= FE_HAS_LOCK; + *status |= FE_HAS_SYNC | FE_HAS_LOCK; return 0; } @@ -889,8 +681,6 @@ static int cx24123_read_ber(struct dvb_frontend* fe, u32* ber) else state->snr = 0; - dprintk("%s: BER = %d, S/N index = %d\n",__FUNCTION__,state->lastber, state->snr); - *ber = state->lastber; return 0; @@ -901,8 +691,6 @@ static int cx24123_read_signal_strength(struct dvb_frontend* fe, u16* signal_str struct cx24123_state *state = fe->demodulator_priv; *signal_strength = cx24123_readreg(state, 0x3b) << 8; /* larger = better */ - dprintk("%s: Signal strength = %d\n",__FUNCTION__,*signal_strength); - return 0; } @@ -911,8 +699,6 @@ static int cx24123_read_snr(struct dvb_frontend* fe, u16* snr) struct cx24123_state *state = fe->demodulator_priv; *snr = state->snr; - dprintk("%s: read S/N index = %d\n",__FUNCTION__,*snr); - return 0; } @@ -921,8 +707,6 @@ static int cx24123_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) struct cx24123_state *state = fe->demodulator_priv; *ucblocks = state->lastber; - dprintk("%s: ucblocks (ber) = %d\n",__FUNCTION__,*ucblocks); - return 0; } @@ -930,8 +714,6 @@ static int cx24123_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par { struct cx24123_state *state = fe->demodulator_priv; - dprintk("%s: set_frontend\n",__FUNCTION__); - if (state->config->set_ts_params) state->config->set_ts_params(fe, 0); @@ -955,8 +737,6 @@ static int cx24123_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par { struct cx24123_state *state = fe->demodulator_priv; - dprintk("%s: get_frontend\n",__FUNCTION__); - if (cx24123_get_inversion(state, &p->inversion) != 0) { printk("%s: Failed to get inversion status\n",__FUNCTION__); return -EREMOTEIO; @@ -983,10 +763,8 @@ static int cx24123_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) switch (tone) { case SEC_TONE_ON: - dprintk("%s: isl6421 sec tone on\n",__FUNCTION__); return cx24123_writelnbreg(state, 0x0, val | 0x10); case SEC_TONE_OFF: - dprintk("%s: isl6421 sec tone off\n",__FUNCTION__); return cx24123_writelnbreg(state, 0x0, val & 0x2f); default: printk("%s: CASE reached default with tone=%d\n", __FUNCTION__, tone); @@ -1077,13 +855,12 @@ static struct dvb_frontend_ops cx24123_ops = { .frequency_min = 950000, .frequency_max = 2150000, .frequency_stepsize = 1011, /* kHz for QPSK frontends */ - .frequency_tolerance = 5000, + .frequency_tolerance = 29500, .symbol_rate_min = 1000000, .symbol_rate_max = 45000000, .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | - FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | - FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | + FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | FE_CAN_QPSK | FE_CAN_RECOVER }, @@ -1098,16 +875,12 @@ static struct dvb_frontend_ops cx24123_ops = { .read_snr = cx24123_read_snr, .read_ucblocks = cx24123_read_ucblocks, .diseqc_send_master_cmd = cx24123_send_diseqc_msg, - .diseqc_send_burst = cx24123_diseqc_send_burst, .set_tone = cx24123_set_tone, .set_voltage = cx24123_set_voltage, }; module_param(debug, int, 0644); -MODULE_PARM_DESC(debug, "Activates frontend debugging (default:0)"); - -module_param(force_band, int, 0644); -MODULE_PARM_DESC(force_band, "Force a specific band select (1-9, default:off)."); +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24123/cx24109 hardware"); MODULE_AUTHOR("Steven Toth"); diff --git a/trunk/drivers/media/dvb/frontends/dvb-pll.c b/trunk/drivers/media/dvb/frontends/dvb-pll.c index 791706ec1da3..b6e2c387a04c 100644 --- a/trunk/drivers/media/dvb/frontends/dvb-pll.c +++ b/trunk/drivers/media/dvb/frontends/dvb-pll.c @@ -235,8 +235,8 @@ struct dvb_pll_desc dvb_pll_tdvs_tua6034 = { .max = 863000000, .count = 3, .entries = { - { 165000000, 44000000, 62500, 0xce, 0x01 }, - { 450000000, 44000000, 62500, 0xce, 0x02 }, + { 160000000, 44000000, 62500, 0xce, 0x01 }, + { 455000000, 44000000, 62500, 0xce, 0x02 }, { 999999999, 44000000, 62500, 0xce, 0x04 }, }, }; diff --git a/trunk/drivers/media/dvb/pluto2/Kconfig b/trunk/drivers/media/dvb/pluto2/Kconfig index 7d8e6e87bdbb..84f8f9f52869 100644 --- a/trunk/drivers/media/dvb/pluto2/Kconfig +++ b/trunk/drivers/media/dvb/pluto2/Kconfig @@ -1,6 +1,7 @@ config DVB_PLUTO2 tristate "Pluto2 cards" - depends on DVB_CORE && PCI && I2C + depends on DVB_CORE && PCI + select I2C select I2C_ALGOBIT select DVB_TDA1004X help diff --git a/trunk/drivers/media/dvb/pluto2/Makefile b/trunk/drivers/media/dvb/pluto2/Makefile index ce6a9aaf937e..86ca84b2be6e 100644 --- a/trunk/drivers/media/dvb/pluto2/Makefile +++ b/trunk/drivers/media/dvb/pluto2/Makefile @@ -1,3 +1,3 @@ -obj-$(CONFIG_DVB_PLUTO2) += pluto2.o +obj-$(CONFIG_DVB_PLUTO2) = pluto2.o EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ diff --git a/trunk/drivers/media/dvb/ttpci/Kconfig b/trunk/drivers/media/dvb/ttpci/Kconfig index b5ac7dfde52f..5b2aadb8385c 100644 --- a/trunk/drivers/media/dvb/ttpci/Kconfig +++ b/trunk/drivers/media/dvb/ttpci/Kconfig @@ -1,7 +1,8 @@ config DVB_AV7110 tristate "AV7110 cards" - depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 + depends on DVB_CORE && PCI select FW_LOADER + select VIDEO_DEV select VIDEO_SAA7146_VV select DVB_VES1820 select DVB_VES1X93 @@ -58,7 +59,7 @@ config DVB_AV7110_OSD config DVB_BUDGET tristate "Budget cards" - depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 + depends on DVB_CORE && PCI select VIDEO_SAA7146 select DVB_STV0299 select DVB_VES1X93 @@ -79,7 +80,7 @@ config DVB_BUDGET config DVB_BUDGET_CI tristate "Budget cards with onboard CI connector" - depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 + depends on DVB_CORE && PCI select VIDEO_SAA7146 select DVB_STV0297 select DVB_STV0299 @@ -99,7 +100,8 @@ config DVB_BUDGET_CI config DVB_BUDGET_AV tristate "Budget cards with analog video inputs" - depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 + depends on DVB_CORE && PCI + select VIDEO_DEV select VIDEO_SAA7146_VV select DVB_STV0299 select DVB_TDA1004X @@ -117,7 +119,7 @@ config DVB_BUDGET_AV config DVB_BUDGET_PATCH tristate "AV7110 cards with Budget Patch" - depends on DVB_CORE && DVB_BUDGET && VIDEO_V4L1 + depends on DVB_CORE && DVB_BUDGET select DVB_AV7110 select DVB_STV0299 select DVB_VES1X93 diff --git a/trunk/drivers/media/dvb/ttpci/budget-av.c b/trunk/drivers/media/dvb/ttpci/budget-av.c index 8a7cd7d505cf..8efe3ce5f66c 100644 --- a/trunk/drivers/media/dvb/ttpci/budget-av.c +++ b/trunk/drivers/media/dvb/ttpci/budget-av.c @@ -1190,6 +1190,8 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio SAA7146_HPS_SYNC_PORT_A); saa7113_setinput(budget_av, 0); + } else { + ciintf_init(budget_av); } /* fixme: find some sane values here... */ @@ -1209,10 +1211,6 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio budget_av->budget.dvb_adapter.priv = budget_av; frontend_init(budget_av); - if (!budget_av->has_saa7113) { - ciintf_init(budget_av); - } - return 0; } diff --git a/trunk/drivers/media/dvb/ttpci/budget-ci.c b/trunk/drivers/media/dvb/ttpci/budget-ci.c index e64a609cf4ff..5f91036f5b87 100644 --- a/trunk/drivers/media/dvb/ttpci/budget-ci.c +++ b/trunk/drivers/media/dvb/ttpci/budget-ci.c @@ -71,7 +71,6 @@ struct budget_ci { struct tasklet_struct msp430_irq_tasklet; struct tasklet_struct ciintf_irq_tasklet; int slot_status; - int ci_irq; struct dvb_ca_en50221 ca; char ir_dev_name[50]; u8 tuner_pll_address; /* used for philips_tdm1316l configs */ @@ -277,10 +276,8 @@ static int ciintf_slot_reset(struct dvb_ca_en50221 *ca, int slot) if (slot != 0) return -EINVAL; - if (budget_ci->ci_irq) { - // trigger on RISING edge during reset so we know when READY is re-asserted - saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); - } + // trigger on RISING edge during reset so we know when READY is re-asserted + saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); budget_ci->slot_status = SLOTSTATUS_RESET; ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); msleep(1); @@ -373,50 +370,11 @@ static void ciintf_interrupt(unsigned long data) } } -static int ciintf_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open) -{ - struct budget_ci *budget_ci = (struct budget_ci *) ca->data; - unsigned int flags; - - // ensure we don't get spurious IRQs during initialisation - if (!budget_ci->budget.ci_present) - return -EINVAL; - - // read the CAM status - flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0); - if (flags & CICONTROL_CAMDETECT) { - // mark it as present if it wasn't before - if (budget_ci->slot_status & SLOTSTATUS_NONE) { - budget_ci->slot_status = SLOTSTATUS_PRESENT; - } - - // during a RESET, we check if we can read from IO memory to see when CAM is ready - if (budget_ci->slot_status & SLOTSTATUS_RESET) { - if (ciintf_read_attribute_mem(ca, slot, 0) == 0x1d) { - budget_ci->slot_status = SLOTSTATUS_READY; - } - } - } else { - budget_ci->slot_status = SLOTSTATUS_NONE; - } - - if (budget_ci->slot_status != SLOTSTATUS_NONE) { - if (budget_ci->slot_status & SLOTSTATUS_READY) { - return DVB_CA_EN50221_POLL_CAM_PRESENT | DVB_CA_EN50221_POLL_CAM_READY; - } - return DVB_CA_EN50221_POLL_CAM_PRESENT; - } - - return 0; -} - static int ciintf_init(struct budget_ci *budget_ci) { struct saa7146_dev *saa = budget_ci->budget.dev; int flags; int result; - int ci_version; - int ca_flags; memset(&budget_ci->ca, 0, sizeof(struct dvb_ca_en50221)); @@ -424,29 +382,16 @@ static int ciintf_init(struct budget_ci *budget_ci) saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16) | 0x800); // test if it is there - ci_version = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CIVERSION, 1, 1, 0); - if ((ci_version & 0xa0) != 0xa0) { + if ((ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CIVERSION, 1, 1, 0) & 0xa0) != 0xa0) { result = -ENODEV; goto error; } - // determine whether a CAM is present or not flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0); budget_ci->slot_status = SLOTSTATUS_NONE; if (flags & CICONTROL_CAMDETECT) budget_ci->slot_status = SLOTSTATUS_PRESENT; - // version 0xa2 of the CI firmware doesn't generate interrupts - if (ci_version == 0xa2) { - ca_flags = 0; - budget_ci->ci_irq = 0; - } else { - ca_flags = DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | - DVB_CA_EN50221_FLAG_IRQ_FR | - DVB_CA_EN50221_FLAG_IRQ_DA; - budget_ci->ci_irq = 1; - } - // register CI interface budget_ci->ca.owner = THIS_MODULE; budget_ci->ca.read_attribute_mem = ciintf_read_attribute_mem; @@ -456,27 +401,23 @@ static int ciintf_init(struct budget_ci *budget_ci) budget_ci->ca.slot_reset = ciintf_slot_reset; budget_ci->ca.slot_shutdown = ciintf_slot_shutdown; budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable; - budget_ci->ca.poll_slot_status = ciintf_poll_slot_status; budget_ci->ca.data = budget_ci; if ((result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter, &budget_ci->ca, - ca_flags, 1)) != 0) { + DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | + DVB_CA_EN50221_FLAG_IRQ_FR | + DVB_CA_EN50221_FLAG_IRQ_DA, 1)) != 0) { printk("budget_ci: CI interface detected, but initialisation failed.\n"); goto error; } - // Setup CI slot IRQ - if (budget_ci->ci_irq) { - tasklet_init(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt, (unsigned long) budget_ci); - if (budget_ci->slot_status != SLOTSTATUS_NONE) { - saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO); - } else { - saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); - } - saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03); + tasklet_init(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt, (unsigned long) budget_ci); + if (budget_ci->slot_status != SLOTSTATUS_NONE) { + saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO); + } else { + saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); } - - // enable interface + saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03); ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, CICONTROL_RESET, 1, 0); @@ -485,12 +426,10 @@ static int ciintf_init(struct budget_ci *budget_ci) budget_ci->budget.ci_present = 1; // forge a fake CI IRQ so the CAM state is setup correctly - if (budget_ci->ci_irq) { - flags = DVB_CA_EN50221_CAMCHANGE_REMOVED; - if (budget_ci->slot_status != SLOTSTATUS_NONE) - flags = DVB_CA_EN50221_CAMCHANGE_INSERTED; - dvb_ca_en50221_camchange_irq(&budget_ci->ca, 0, flags); - } + flags = DVB_CA_EN50221_CAMCHANGE_REMOVED; + if (budget_ci->slot_status != SLOTSTATUS_NONE) + flags = DVB_CA_EN50221_CAMCHANGE_INSERTED; + dvb_ca_en50221_camchange_irq(&budget_ci->ca, 0, flags); return 0; @@ -504,13 +443,9 @@ static void ciintf_deinit(struct budget_ci *budget_ci) struct saa7146_dev *saa = budget_ci->budget.dev; // disable CI interrupts - if (budget_ci->ci_irq) { - saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_03); - saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT); - tasklet_kill(&budget_ci->ciintf_irq_tasklet); - } - - // reset interface + saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_03); + saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT); + tasklet_kill(&budget_ci->ciintf_irq_tasklet); ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); msleep(1); ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, @@ -538,7 +473,7 @@ static void budget_ci_irq(struct saa7146_dev *dev, u32 * isr) if (*isr & MASK_10) ttpci_budget_irq10_handler(dev, isr); - if ((*isr & MASK_03) && (budget_ci->budget.ci_present) && (budget_ci->ci_irq)) + if ((*isr & MASK_03) && (budget_ci->budget.ci_present)) tasklet_schedule(&budget_ci->ciintf_irq_tasklet); } diff --git a/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 6ceae38125c7..248fdc7accfb 100644 --- a/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/trunk/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c @@ -1507,11 +1507,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i mutex_unlock(&ttusb->semi2c); - if ((result = dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE)) < 0) { - ttusb_free_iso_urbs(ttusb); - kfree(ttusb); - return result; - } + dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE); ttusb->adapter.priv = ttusb; /* i2c */ diff --git a/trunk/drivers/media/radio/Kconfig b/trunk/drivers/media/radio/Kconfig index 3fff75763693..d318be383de6 100644 --- a/trunk/drivers/media/radio/Kconfig +++ b/trunk/drivers/media/radio/Kconfig @@ -7,7 +7,7 @@ menu "Radio Adapters" config RADIO_CADET tristate "ADS Cadet AM/FM Tuner" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV ---help--- Choose Y here if you have one of these AM/FM radio cards, and then fill in the port address below. @@ -25,7 +25,7 @@ config RADIO_CADET config RADIO_RTRACK tristate "AIMSlab RadioTrack (aka RadioReveal) support" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV ---help--- Choose Y here if you have one of these FM radio cards, and then fill in the port address below. @@ -59,7 +59,7 @@ config RADIO_RTRACK_PORT config RADIO_RTRACK2 tristate "AIMSlab RadioTrack II support" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV ---help--- Choose Y here if you have this FM radio card, and then fill in the port address below. @@ -82,7 +82,7 @@ config RADIO_RTRACK2_PORT config RADIO_AZTECH tristate "Aztech/Packard Bell Radio" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV ---help--- Choose Y here if you have one of these FM radio cards, and then fill in the port address below. @@ -106,7 +106,7 @@ config RADIO_AZTECH_PORT config RADIO_GEMTEK tristate "GemTek Radio Card support" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV ---help--- Choose Y here if you have this FM radio card, and then fill in the port address below. @@ -131,7 +131,7 @@ config RADIO_GEMTEK_PORT config RADIO_GEMTEK_PCI tristate "GemTek PCI Radio Card support" - depends on VIDEO_V4L1 && PCI + depends on VIDEO_DEV && PCI ---help--- Choose Y here if you have this PCI FM radio card. @@ -145,7 +145,7 @@ config RADIO_GEMTEK_PCI config RADIO_MAXIRADIO tristate "Guillemot MAXI Radio FM 2000 radio" - depends on VIDEO_V4L1 && PCI + depends on VIDEO_DEV && PCI ---help--- Choose Y here if you have this radio card. This card may also be found as Gemtek PCI FM. @@ -160,7 +160,7 @@ config RADIO_MAXIRADIO config RADIO_MAESTRO tristate "Maestro on board radio" - depends on VIDEO_V4L1 + depends on VIDEO_DEV ---help--- Say Y here to directly support the on-board radio tuner on the Maestro 2 or 2E sound card. @@ -175,7 +175,7 @@ config RADIO_MAESTRO config RADIO_MIROPCM20 tristate "miroSOUND PCM20 radio" - depends on ISA && VIDEO_V4L1 && SOUND_ACI_MIXER + depends on ISA && VIDEO_DEV && SOUND_ACI_MIXER ---help--- Choose Y here if you have this FM radio card. You also need to say Y to "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20 radio)" (in "Sound") @@ -208,7 +208,7 @@ config RADIO_MIROPCM20_RDS config RADIO_SF16FMI tristate "SF16FMI Radio" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV ---help--- Choose Y here if you have one of these FM radio cards. If you compile the driver into the kernel and your card is not PnP one, you @@ -225,7 +225,7 @@ config RADIO_SF16FMI config RADIO_SF16FMR2 tristate "SF16FMR2 Radio" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV ---help--- Choose Y here if you have one of these FM radio cards. @@ -239,7 +239,7 @@ config RADIO_SF16FMR2 config RADIO_TERRATEC tristate "TerraTec ActiveRadio ISA Standalone" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV ---help--- Choose Y here if you have this FM radio card, and then fill in the port address below. (TODO) @@ -268,7 +268,7 @@ config RADIO_TERRATEC_PORT config RADIO_TRUST tristate "Trust FM radio card" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV help This is a driver for the Trust FM radio cards. Say Y if you have such a card and want to use it under Linux. @@ -286,7 +286,7 @@ config RADIO_TRUST_PORT config RADIO_TYPHOON tristate "Typhoon Radio (a.k.a. EcoRadio)" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV ---help--- Choose Y here if you have one of these FM radio cards, and then fill in the port address and the frequency used for muting below. @@ -330,7 +330,7 @@ config RADIO_TYPHOON_MUTEFREQ config RADIO_ZOLTRIX tristate "Zoltrix Radio" - depends on ISA && VIDEO_V4L1 + depends on ISA && VIDEO_DEV ---help--- Choose Y here if you have one of these FM radio cards, and then fill in the port address below. diff --git a/trunk/drivers/media/video/Kconfig b/trunk/drivers/media/video/Kconfig index 6b4197018561..85888a8a93c9 100644 --- a/trunk/drivers/media/video/Kconfig +++ b/trunk/drivers/media/video/Kconfig @@ -2,10 +2,10 @@ # Multimedia Video device configuration # -menu "Video Capture Adapters" +menu "Video For Linux" depends on VIDEO_DEV -comment "Video Capture Adapters" +comment "Video Adapters" config VIDEO_ADV_DEBUG bool "Enable advanced debug functionality" @@ -16,23 +16,11 @@ config VIDEO_ADV_DEBUG V4L devices. In doubt, say N. -config VIDEO_VIVI - tristate "Virtual Video Driver" - depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 - select VIDEO_BUF - default n - ---help--- - Enables a virtual video driver. This device shows a color bar - and a timestamp, as a real device would generate by using V4L2 - api. - Say Y here if you want to test video apps or debug V4L devices. - In doubt, say N. - source "drivers/media/video/bt8xx/Kconfig" config VIDEO_SAA6588 tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards" - depends on I2C && VIDEO_BT848 + depends on VIDEO_DEV && I2C && VIDEO_BT848 help Support for Radio Data System (RDS) decoder. This allows seeing @@ -44,7 +32,7 @@ config VIDEO_SAA6588 config VIDEO_PMS tristate "Mediavision Pro Movie Studio Video For Linux" - depends on ISA && VIDEO_V4L1 + depends on VIDEO_DEV && ISA help Say Y if you have such a thing. @@ -53,7 +41,7 @@ config VIDEO_PMS config VIDEO_PLANB tristate "PlanB Video-In on PowerMac" - depends on PPC_PMAC && VIDEO_V4L1 && BROKEN + depends on PPC_PMAC && VIDEO_DEV && BROKEN help PlanB is the V4L driver for the PowerMac 7x00/8x00 series video input hardware. If you want to experiment with this, say Y. @@ -64,7 +52,7 @@ config VIDEO_PLANB config VIDEO_BWQCAM tristate "Quickcam BW Video For Linux" - depends on PARPORT && VIDEO_V4L1 + depends on VIDEO_DEV && PARPORT help Say Y have if you the black and white version of the QuickCam camera. See the next option for the color version. @@ -74,7 +62,7 @@ config VIDEO_BWQCAM config VIDEO_CQCAM tristate "QuickCam Colour Video For Linux (EXPERIMENTAL)" - depends on EXPERIMENTAL && PARPORT && VIDEO_V4L1 + depends on EXPERIMENTAL && VIDEO_DEV && PARPORT help This is the video4linux driver for the colour version of the Connectix QuickCam. If you have one of these cameras, say Y here, @@ -85,7 +73,7 @@ config VIDEO_CQCAM config VIDEO_W9966 tristate "W9966CF Webcam (FlyCam Supra and others) Video For Linux" - depends on PARPORT_1284 && PARPORT && VIDEO_V4L1 + depends on PARPORT_1284 && VIDEO_DEV && PARPORT help Video4linux driver for Winbond's w9966 based Webcams. Currently tested with the LifeView FlyCam Supra. @@ -98,7 +86,7 @@ config VIDEO_W9966 config VIDEO_CPIA tristate "CPiA Video For Linux" - depends on VIDEO_V4L1 + depends on VIDEO_DEV ---help--- This is the video4linux driver for cameras based on Vision's CPiA (Colour Processor Interface ASIC), such as the Creative Labs Video @@ -135,7 +123,7 @@ source "drivers/media/video/cpia2/Kconfig" config VIDEO_SAA5246A tristate "SAA5246A, SAA5281 Teletext processor" - depends on I2C && VIDEO_V4L1 + depends on VIDEO_DEV && I2C help Support for I2C bus based teletext using the SAA5246A or SAA5281 chip. Useful only if you live in Europe. @@ -162,7 +150,7 @@ config TUNER_3036 config VIDEO_VINO tristate "SGI Vino Video For Linux (EXPERIMENTAL)" - depends on I2C && SGI_IP22 && EXPERIMENTAL && VIDEO_V4L1 + depends on VIDEO_DEV && I2C && SGI_IP22 && EXPERIMENTAL select I2C_ALGO_SGI help Say Y here to build in support for the Vino video input system found @@ -170,7 +158,7 @@ config VIDEO_VINO config VIDEO_STRADIS tristate "Stradis 4:2:2 MPEG-2 video driver (EXPERIMENTAL)" - depends on EXPERIMENTAL && PCI && VIDEO_V4L1 && !PPC64 + depends on EXPERIMENTAL && VIDEO_DEV && PCI help Say Y here to enable support for the Stradis 4:2:2 MPEG-2 video driver for PCI. There is a product page at @@ -178,7 +166,7 @@ config VIDEO_STRADIS config VIDEO_ZORAN tristate "Zoran ZR36057/36067 Video For Linux" - depends on PCI && I2C_ALGOBIT && VIDEO_V4L1 && !PPC64 + depends on VIDEO_DEV && PCI && I2C_ALGOBIT help Say Y for support for MJPEG capture cards based on the Zoran 36057/36067 PCI controller chipset. This includes the Iomega @@ -226,7 +214,7 @@ config VIDEO_ZORAN_LML33R10 config VIDEO_ZR36120 tristate "Zoran ZR36120/36125 Video For Linux" - depends on PCI && I2C && VIDEO_V4L1 && BROKEN + depends on VIDEO_DEV && PCI && I2C && BROKEN help Support for ZR36120/ZR36125 based frame grabber/overlay boards. This includes the Victor II, WaveWatcher, Video Wonder, Maxi-TV, @@ -238,7 +226,7 @@ config VIDEO_ZR36120 config VIDEO_MEYE tristate "Sony Vaio Picturebook Motion Eye Video For Linux" - depends on PCI && SONYPI && VIDEO_V4L1 + depends on VIDEO_DEV && PCI && SONYPI ---help--- This is the video4linux driver for the Motion Eye camera found in the Vaio Picturebook laptops. Please read the material in @@ -254,7 +242,7 @@ source "drivers/media/video/saa7134/Kconfig" config VIDEO_MXB tristate "Siemens-Nixdorf 'Multimedia eXtension Board'" - depends on PCI && VIDEO_V4L1 + depends on VIDEO_DEV && PCI select VIDEO_SAA7146_VV select VIDEO_TUNER ---help--- @@ -266,9 +254,8 @@ config VIDEO_MXB config VIDEO_DPC tristate "Philips-Semiconductors 'dpc7146 demonstration board'" - depends on PCI && VIDEO_V4L1 + depends on VIDEO_DEV && PCI select VIDEO_SAA7146_VV - select VIDEO_V4L2 ---help--- This is a video4linux driver for the 'dpc7146 demonstration board' by Philips-Semiconductors. It's the reference design @@ -281,9 +268,8 @@ config VIDEO_DPC config VIDEO_HEXIUM_ORION tristate "Hexium HV-PCI6 and Orion frame grabber" - depends on PCI && VIDEO_V4L1 + depends on VIDEO_DEV && PCI select VIDEO_SAA7146_VV - select VIDEO_V4L2 ---help--- This is a video4linux driver for the Hexium HV-PCI6 and Orion frame grabber cards by Hexium. @@ -293,9 +279,8 @@ config VIDEO_HEXIUM_ORION config VIDEO_HEXIUM_GEMINI tristate "Hexium Gemini frame grabber" - depends on PCI && VIDEO_V4L1 + depends on VIDEO_DEV && PCI select VIDEO_SAA7146_VV - select VIDEO_V4L2 ---help--- This is a video4linux driver for the Hexium Gemini frame grabber card by Hexium. Please note that the Gemini Dual @@ -308,7 +293,7 @@ source "drivers/media/video/cx88/Kconfig" config VIDEO_OVCAMCHIP tristate "OmniVision Camera Chip support" - depends on I2C && VIDEO_V4L1 + depends on VIDEO_DEV && I2C ---help--- Support for the OmniVision OV6xxx and OV7xxx series of camera chips. This driver is intended to be used with the ov511 and w9968cf USB @@ -319,7 +304,7 @@ config VIDEO_OVCAMCHIP config VIDEO_M32R_AR tristate "AR devices" - depends on M32R && VIDEO_V4L1 + depends on M32R ---help--- This is a video4linux driver for the Renesas AR (Artificial Retina) camera module. @@ -380,17 +365,17 @@ config VIDEO_WM8739 source "drivers/media/video/cx25840/Kconfig" config VIDEO_SAA711X - tristate "Philips SAA7113/4/5 video decoders (OBSOLETED)" - depends on VIDEO_V4L1 && I2C && EXPERIMENTAL + tristate "Philips SAA7113/4/5 video decoders" + depends on VIDEO_DEV && I2C && EXPERIMENTAL ---help--- - Old support for the Philips SAA7113/4 video decoders. + Support for the Philips SAA7113/4/5 video decoders. To compile this driver as a module, choose M here: the module will be called saa7115. config VIDEO_SAA7127 tristate "Philips SAA7127/9 digital video encoders" - depends on VIDEO_V4L2 && I2C && EXPERIMENTAL + depends on VIDEO_DEV && I2C && EXPERIMENTAL ---help--- Support for the Philips SAA7127/9 digital video encoders. @@ -399,7 +384,7 @@ config VIDEO_SAA7127 config VIDEO_UPD64031A tristate "NEC Electronics uPD64031A Ghost Reduction" - depends on VIDEO_V4L2 && I2C && EXPERIMENTAL + depends on VIDEO_DEV && I2C && EXPERIMENTAL ---help--- Support for the NEC Electronics uPD64031A Ghost Reduction video chip. It is most often found in NTSC TV cards made for @@ -411,7 +396,7 @@ config VIDEO_UPD64031A config VIDEO_UPD64083 tristate "NEC Electronics uPD64083 3-Dimensional Y/C separation" - depends on VIDEO_V4L2 && I2C && EXPERIMENTAL + depends on VIDEO_DEV && I2C && EXPERIMENTAL ---help--- Support for the NEC Electronics uPD64083 3-Dimensional Y/C separation video chip. It is used to improve the quality of @@ -433,7 +418,7 @@ source "drivers/media/video/em28xx/Kconfig" config USB_DSBR tristate "D-Link USB FM radio support (EXPERIMENTAL)" - depends on USB && VIDEO_V4L1 && EXPERIMENTAL + depends on USB && VIDEO_DEV && EXPERIMENTAL ---help--- Say Y here if you want to connect this type of radio to your computer's USB port. Note that the audio is not digital, and @@ -449,7 +434,7 @@ source "drivers/media/video/et61x251/Kconfig" config USB_OV511 tristate "USB OV511 Camera support" - depends on USB && VIDEO_V4L1 + depends on USB && VIDEO_DEV ---help--- Say Y here if you want to connect this type of camera to your computer's USB port. See @@ -460,7 +445,7 @@ config USB_OV511 config USB_SE401 tristate "USB SE401 Camera support" - depends on USB && VIDEO_V4L1 + depends on USB && VIDEO_DEV ---help--- Say Y here if you want to connect this type of camera to your computer's USB port. See @@ -473,7 +458,7 @@ source "drivers/media/video/sn9c102/Kconfig" config USB_STV680 tristate "USB STV680 (Pencam) Camera support" - depends on USB && VIDEO_V4L1 + depends on USB && VIDEO_DEV ---help--- Say Y here if you want to connect this type of camera to your computer's USB port. This includes the Pencam line of cameras. @@ -485,7 +470,7 @@ config USB_STV680 config USB_W9968CF tristate "USB W996[87]CF JPEG Dual Mode Camera support" - depends on USB && VIDEO_V4L1 && I2C + depends on USB && VIDEO_DEV && I2C select VIDEO_OVCAMCHIP ---help--- Say Y here if you want support for cameras based on OV681 or diff --git a/trunk/drivers/media/video/Makefile b/trunk/drivers/media/video/Makefile index e5bf2687b76d..b3ea2d63db9b 100644 --- a/trunk/drivers/media/video/Makefile +++ b/trunk/drivers/media/video/Makefile @@ -10,11 +10,7 @@ tuner-objs := tuner-core.o tuner-types.o tuner-simple.o \ msp3400-objs := msp3400-driver.o msp3400-kthreads.o -obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o compat_ioctl32.o - -ifeq ($(CONFIG_VIDEO_V4L1_COMPAT),y) - obj-$(CONFIG_VIDEO_DEV) += v4l1-compat.o -endif +obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o compat_ioctl32.o obj-$(CONFIG_VIDEO_BT848) += bt8xx/ obj-$(CONFIG_VIDEO_BT848) += tvaudio.o tda7432.o tda9875.o ir-kbd-i2c.o @@ -88,8 +84,4 @@ obj-$(CONFIG_USB_IBMCAM) += usbvideo/ obj-$(CONFIG_USB_KONICAWC) += usbvideo/ obj-$(CONFIG_USB_VICAM) += usbvideo/ -obj-$(CONFIG_VIDEO_VIVI) += vivi.o - EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core -extra-cflags-$(CONFIG_VIDEO_V4L1_COMPAT) += -DCONFIG_VIDEO_V4L1_COMPAT - diff --git a/trunk/drivers/media/video/bt8xx/Kconfig b/trunk/drivers/media/video/bt8xx/Kconfig index 153f6a4a96c9..085477c12612 100644 --- a/trunk/drivers/media/video/bt8xx/Kconfig +++ b/trunk/drivers/media/video/bt8xx/Kconfig @@ -1,6 +1,6 @@ config VIDEO_BT848 tristate "BT848 Video For Linux" - depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2 + depends on VIDEO_DEV && PCI && I2C select I2C_ALGOBIT select FW_LOADER select VIDEO_BTCX diff --git a/trunk/drivers/media/video/bt8xx/Makefile b/trunk/drivers/media/video/bt8xx/Makefile index a096a03418aa..db641a36b197 100644 --- a/trunk/drivers/media/video/bt8xx/Makefile +++ b/trunk/drivers/media/video/bt8xx/Makefile @@ -8,5 +8,5 @@ bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \ obj-$(CONFIG_VIDEO_BT848) += bttv.o -EXTRA_CFLAGS += -Idrivers/media/video +EXTRA_CFLAGS += -I$(src)/.. EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core diff --git a/trunk/drivers/media/video/bt8xx/bttv-cards.c b/trunk/drivers/media/video/bt8xx/bttv-cards.c index 2b64aa835b42..f209a7492051 100644 --- a/trunk/drivers/media/video/bt8xx/bttv-cards.c +++ b/trunk/drivers/media/video/bt8xx/bttv-cards.c @@ -2991,13 +2991,13 @@ void __devinit bttv_idcard(struct bttv *btv) if (UNSET != audiomux[0]) { gpiobits = 0; - for (i = 0; i < 4; i++) { + for (i = 0; i < 5; i++) { bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i]; gpiobits |= audiomux[i]; } } else { gpiobits = audioall; - for (i = 0; i < 4; i++) { + for (i = 0; i < 5; i++) { bttv_tvcards[btv->c.type].gpiomux[i] = audioall; } } diff --git a/trunk/drivers/media/video/bt8xx/bttv-risc.c b/trunk/drivers/media/video/bt8xx/bttv-risc.c index afcfe71e3792..16323a5d68ac 100644 --- a/trunk/drivers/media/video/bt8xx/bttv-risc.c +++ b/trunk/drivers/media/video/bt8xx/bttv-risc.c @@ -233,7 +233,7 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, const struct bttv_format *fmt, struct bttv_overlay *ov, int skip_even, int skip_odd) { - int dwords,rc,line,maxy,start,end,skip,nskips; + int instructions,rc,line,maxy,start,end,skip,nskips; struct btcx_skiplist *skips; u32 *rp,ri,ra; u32 addr; @@ -242,12 +242,12 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, if (NULL == (skips = kmalloc(sizeof(*skips) * ov->nclips,GFP_KERNEL))) return -ENOMEM; - /* estimate risc mem: worst case is (1.5*clip+1) * lines instructions + /* estimate risc mem: worst case is (clip+1) * lines instructions + sync + jump (all 2 dwords) */ - dwords = (3 * ov->nclips + 2) * - ((skip_even || skip_odd) ? (ov->w.height+1)>>1 : ov->w.height); - dwords += 4; - if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,dwords*4)) < 0) { + instructions = (ov->nclips + 1) * + ((skip_even || skip_odd) ? ov->w.height>>1 : ov->w.height); + instructions += 2; + if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*8)) < 0) { kfree(skips); return rc; } @@ -276,6 +276,8 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, if (line > maxy) btcx_calc_skips(line, ov->w.width, &maxy, skips, &nskips, ov->clips, ov->nclips); + else + nskips = 0; /* write out risc code */ for (start = 0, skip = 0; start < ov->w.width; start = end) { diff --git a/trunk/drivers/media/video/cx25840/cx25840-firmware.c b/trunk/drivers/media/video/cx25840/cx25840-firmware.c index 1958d4016ea1..f59ced181c55 100644 --- a/trunk/drivers/media/video/cx25840/cx25840-firmware.c +++ b/trunk/drivers/media/video/cx25840/cx25840-firmware.c @@ -39,12 +39,29 @@ #define FWDEV(x) &((x)->adapter->dev) +static int fastfw = 1; static char *firmware = FWFILE; +module_param(fastfw, bool, 0444); module_param(firmware, charp, 0444); +MODULE_PARM_DESC(fastfw, "Load firmware fast [0=100MHz 1=333MHz (default)]"); MODULE_PARM_DESC(firmware, "Firmware image [default: " FWFILE "]"); +static void set_i2c_delay(struct i2c_client *client, int delay) +{ + struct i2c_algo_bit_data *algod = client->adapter->algo_data; + + /* We aren't guaranteed to be using algo_bit, + * so avoid the null pointer dereference + * and disable the 'fast firmware load' */ + if (algod) { + algod->udelay = delay; + } else { + fastfw = 0; + } +} + static void start_fw_load(struct i2c_client *client) { /* DL_ADDR_LB=0 DL_ADDR_HB=0 */ @@ -54,10 +71,16 @@ static void start_fw_load(struct i2c_client *client) cx25840_write(client, 0x803, 0x0b); /* AUTO_INC_DIS=1 */ cx25840_write(client, 0x000, 0x20); + + if (fastfw) + set_i2c_delay(client, 3); } static void end_fw_load(struct i2c_client *client) { + if (fastfw) + set_i2c_delay(client, 10); + /* AUTO_INC_DIS=0 */ cx25840_write(client, 0x000, 0x00); /* DL_ENABLE=0 */ @@ -84,8 +107,30 @@ static int fw_write(struct i2c_client *client, u8 * data, int size) int sent; if ((sent = i2c_master_send(client, data, size)) < size) { - v4l_err(client, "firmware load i2c failure\n"); - return -ENOSYS; + + if (fastfw) { + v4l_err(client, "333MHz i2c firmware load failed\n"); + fastfw = 0; + set_i2c_delay(client, 10); + + if (sent > 2) { + u16 dl_addr = cx25840_read(client, 0x801) << 8; + dl_addr |= cx25840_read(client, 0x800); + dl_addr -= sent - 2; + cx25840_write(client, 0x801, dl_addr >> 8); + cx25840_write(client, 0x800, dl_addr & 0xff); + } + + if (i2c_master_send(client, data, size) < size) { + v4l_err(client, "100MHz i2c firmware load failed\n"); + return -ENOSYS; + } + + } else { + v4l_err(client, "firmware load i2c failure\n"); + return -ENOSYS; + } + } return 0; diff --git a/trunk/drivers/media/video/cx88/cx88-cards.c b/trunk/drivers/media/video/cx88/cx88-cards.c index f80154b87d22..c7042cf41231 100644 --- a/trunk/drivers/media/video/cx88/cx88-cards.c +++ b/trunk/drivers/media/video/cx88/cx88-cards.c @@ -564,7 +564,7 @@ struct cx88_board cx88_boards[] = { }, [CX88_BOARD_PCHDTV_HD3000] = { .name = "pcHDTV HD3000 HDTV", - .tuner_type = TUNER_THOMSON_DTT761X, + .tuner_type = TUNER_THOMSON_DTT7610, .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, diff --git a/trunk/drivers/media/video/cx88/cx88-core.c b/trunk/drivers/media/video/cx88/cx88-core.c index e1092d5d4628..2c3d9f1999be 100644 --- a/trunk/drivers/media/video/cx88/cx88-core.c +++ b/trunk/drivers/media/video/cx88/cx88-core.c @@ -146,11 +146,9 @@ int cx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, fields++; /* estimate risc mem: worst case is one write per page border + - one write per scan line + syncs + jump (all 2 dwords). Padding - can cause next bpl to start close to a page border. First DMA - region may be smaller than PAGE_SIZE */ - instructions = fields * (1 + ((bpl + padding) * lines) / PAGE_SIZE + lines); - instructions += 2; + one write per scan line + syncs + jump (all 2 dwords) */ + instructions = (bpl * lines * fields) / PAGE_SIZE + lines * fields; + instructions += 3 + 4; if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) return rc; @@ -178,11 +176,9 @@ int cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc, int rc; /* estimate risc mem: worst case is one write per page border + - one write per scan line + syncs + jump (all 2 dwords). Here - there is no padding and no sync. First DMA region may be smaller - than PAGE_SIZE */ - instructions = 1 + (bpl * lines) / PAGE_SIZE + lines; - instructions += 1; + one write per scan line + syncs + jump (all 2 dwords) */ + instructions = (bpl * lines) / PAGE_SIZE + lines; + instructions += 3 + 4; if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) return rc; diff --git a/trunk/drivers/media/video/cx88/cx88-dvb.c b/trunk/drivers/media/video/cx88/cx88-dvb.c index 3619a449aefd..f0ea9b5cdbc2 100644 --- a/trunk/drivers/media/video/cx88/cx88-dvb.c +++ b/trunk/drivers/media/video/cx88/cx88-dvb.c @@ -372,7 +372,7 @@ static int or51132_set_ts_param(struct dvb_frontend* fe, static struct or51132_config pchdtv_hd3000 = { .demod_address = 0x15, .pll_address = 0x61, - .pll_desc = &dvb_pll_thomson_dtt761x, + .pll_desc = &dvb_pll_thomson_dtt7610, .set_ts_params = or51132_set_ts_param, }; #endif diff --git a/trunk/drivers/media/video/cx88/cx88-video.c b/trunk/drivers/media/video/cx88/cx88-video.c index 694d1d80ff3f..72a417b31745 100644 --- a/trunk/drivers/media/video/cx88/cx88-video.c +++ b/trunk/drivers/media/video/cx88/cx88-video.c @@ -35,10 +35,8 @@ #include "cx88.h" #include -#ifdef CONFIG_VIDEO_V4L1_COMPAT /* Include V4L1 specific functions. Should be removed soon */ #include -#endif MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); MODULE_AUTHOR("Gerd Knorr [SuSE Labs]"); diff --git a/trunk/drivers/media/video/em28xx/Kconfig b/trunk/drivers/media/video/em28xx/Kconfig index dfb15bfb83dc..5a793ae7cc23 100644 --- a/trunk/drivers/media/video/em28xx/Kconfig +++ b/trunk/drivers/media/video/em28xx/Kconfig @@ -1,6 +1,6 @@ config VIDEO_EM28XX tristate "Empia EM2800/2820/2840 USB video capture support" - depends on VIDEO_V4L1 && USB && I2C + depends on VIDEO_DEV && USB && I2C select VIDEO_BUF select VIDEO_TUNER select VIDEO_TVEEPROM diff --git a/trunk/drivers/media/video/em28xx/em28xx-video.c b/trunk/drivers/media/video/em28xx/em28xx-video.c index cf7cdf9ef617..ddc92cbb5276 100644 --- a/trunk/drivers/media/video/em28xx/em28xx-video.c +++ b/trunk/drivers/media/video/em28xx/em28xx-video.c @@ -1576,8 +1576,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, errCode = em28xx_config(dev); if (errCode) { em28xx_errdev("error configuring device\n"); - em28xx_devused&=~(1<devno); kfree(dev); + em28xx_devused&=~(1<devno); return -ENOMEM; } @@ -1603,8 +1603,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, dev->vdev = video_device_alloc(); if (NULL == dev->vdev) { em28xx_errdev("cannot allocate video_device.\n"); - em28xx_devused&=~(1<devno); kfree(dev); + em28xx_devused&=~(1<devno); return -ENOMEM; } @@ -1612,8 +1612,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, if (NULL == dev->vbi_dev) { em28xx_errdev("cannot allocate video_device.\n"); kfree(dev->vdev); - em28xx_devused&=~(1<devno); kfree(dev); + em28xx_devused&=~(1<devno); return -ENOMEM; } @@ -1650,8 +1650,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, mutex_unlock(&dev->lock); list_del(&dev->devlist); video_device_release(dev->vdev); - em28xx_devused&=~(1<devno); kfree(dev); + em28xx_devused&=~(1<devno); return -ENODEV; } @@ -1662,8 +1662,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, list_del(&dev->devlist); video_device_release(dev->vbi_dev); video_device_release(dev->vdev); - em28xx_devused&=~(1<devno); kfree(dev); + em28xx_devused&=~(1<devno); return -ENODEV; } else { printk("registered VBI\n"); diff --git a/trunk/drivers/media/video/et61x251/Kconfig b/trunk/drivers/media/video/et61x251/Kconfig index c6bff705688d..6c43a90c6569 100644 --- a/trunk/drivers/media/video/et61x251/Kconfig +++ b/trunk/drivers/media/video/et61x251/Kconfig @@ -1,6 +1,6 @@ config USB_ET61X251 tristate "USB ET61X[12]51 PC Camera Controller support" - depends on USB && VIDEO_V4L1 + depends on USB && VIDEO_DEV ---help--- Say Y here if you want support for cameras based on Etoms ET61X151 or ET61X251 PC Camera Controllers. diff --git a/trunk/drivers/media/video/pwc/Kconfig b/trunk/drivers/media/video/pwc/Kconfig index 53cbc950f95c..86376556f108 100644 --- a/trunk/drivers/media/video/pwc/Kconfig +++ b/trunk/drivers/media/video/pwc/Kconfig @@ -1,6 +1,6 @@ config USB_PWC tristate "USB Philips Cameras" - depends on USB && VIDEO_V4L1 + depends on USB && VIDEO_DEV ---help--- Say Y or M here if you want to use one of these Philips & OEM webcams: diff --git a/trunk/drivers/media/video/pwc/Makefile b/trunk/drivers/media/video/pwc/Makefile index 33d60126c024..8326684f49f3 100644 --- a/trunk/drivers/media/video/pwc/Makefile +++ b/trunk/drivers/media/video/pwc/Makefile @@ -1,3 +1,20 @@ +ifneq ($(KERNELRELEASE),) + pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-timon.o pwc-kiara.o obj-$(CONFIG_USB_PWC) += pwc.o + +else + +KDIR := /lib/modules/$(shell uname -r)/build +PWD := $(shell pwd) + +default: + $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules + +endif + +clean: + rm -f *.[oas] .*.flags *.ko .*.cmd .*.d .*.tmp *.mod.c + rm -rf .tmp_versions + diff --git a/trunk/drivers/media/video/saa7127.c b/trunk/drivers/media/video/saa7127.c index c271e2e14105..133f9e5252fe 100644 --- a/trunk/drivers/media/video/saa7127.c +++ b/trunk/drivers/media/video/saa7127.c @@ -142,7 +142,6 @@ struct i2c_reg_value { static const struct i2c_reg_value saa7129_init_config_extra[] = { { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x38 }, { SAA7127_REG_VTRIG, 0xfa }, - { 0, 0 } }; static const struct i2c_reg_value saa7127_init_config_common[] = { diff --git a/trunk/drivers/media/video/saa7134/saa7134-cards.c b/trunk/drivers/media/video/saa7134/saa7134-cards.c index 86eae3528330..e666a4465ca4 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-cards.c +++ b/trunk/drivers/media/video/saa7134/saa7134-cards.c @@ -3504,7 +3504,6 @@ int saa7134_board_init1(struct saa7134_dev *dev) /* power-up tuner chip */ saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); - break; case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: /* this turns the remote control chip off to work around a bug in it */ saa_writeb(SAA7134_GPIO_GPMODE1, 0x80); diff --git a/trunk/drivers/media/video/saa7134/saa7134-core.c b/trunk/drivers/media/video/saa7134/saa7134-core.c index f0c2111f14ad..13de05532e0a 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-core.c +++ b/trunk/drivers/media/video/saa7134/saa7134-core.c @@ -548,8 +548,6 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) if (report & SAA7134_IRQ_REPORT_GPIO16) { switch (dev->has_remote) { case SAA7134_REMOTE_GPIO: - if (!dev->remote) - break; if (dev->remote->mask_keydown & 0x10000) { saa7134_input_irq(dev); } @@ -566,8 +564,6 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) if (report & SAA7134_IRQ_REPORT_GPIO18) { switch (dev->has_remote) { case SAA7134_REMOTE_GPIO: - if (!dev->remote) - break; if ((dev->remote->mask_keydown & 0x40000) || (dev->remote->mask_keyup & 0x40000)) { saa7134_input_irq(dev); @@ -680,7 +676,7 @@ static int saa7134_hwinit2(struct saa7134_dev *dev) SAA7134_IRQ2_INTE_PE | SAA7134_IRQ2_INTE_AR; - if (dev->has_remote == SAA7134_REMOTE_GPIO && dev->remote) { + if (dev->has_remote == SAA7134_REMOTE_GPIO) { if (dev->remote->mask_keydown & 0x10000) irq2_mask |= SAA7134_IRQ2_INTE_GPIO16; else if (dev->remote->mask_keydown & 0x40000) diff --git a/trunk/drivers/media/video/saa7134/saa7134-video.c b/trunk/drivers/media/video/saa7134/saa7134-video.c index e4156ec9c6d7..aeef80f88a6b 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-video.c +++ b/trunk/drivers/media/video/saa7134/saa7134-video.c @@ -31,10 +31,8 @@ #include "saa7134.h" #include -#ifdef CONFIG_VIDEO_V4L1_COMPAT /* Include V4L1 specific functions. Should be removed soon */ #include -#endif /* ------------------------------------------------------------------ */ diff --git a/trunk/drivers/media/video/sn9c102/Kconfig b/trunk/drivers/media/video/sn9c102/Kconfig index cf552e6b8ecf..55f2bc11964b 100644 --- a/trunk/drivers/media/video/sn9c102/Kconfig +++ b/trunk/drivers/media/video/sn9c102/Kconfig @@ -1,6 +1,6 @@ config USB_SN9C102 tristate "USB SN9C10x PC Camera Controller support" - depends on USB && VIDEO_V4L1 + depends on USB && VIDEO_DEV ---help--- Say Y here if you want support for cameras based on SONiX SN9C101, SN9C102 or SN9C103 PC Camera Controllers. diff --git a/trunk/drivers/media/video/tuner-types.c b/trunk/drivers/media/video/tuner-types.c index a1ae036b44ec..72e0f01db563 100644 --- a/trunk/drivers/media/video/tuner-types.c +++ b/trunk/drivers/media/video/tuner-types.c @@ -877,8 +877,8 @@ static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = { /* ------------ TUNER_LG_TDVS_H062F - INFINEON ATSC ------------ */ static struct tuner_range tuner_tua6034_ntsc_ranges[] = { - { 16 * 165.00 /*MHz*/, 0x8e, 0x01 }, - { 16 * 450.00 /*MHz*/, 0x8e, 0x02 }, + { 16 * 160.00 /*MHz*/, 0x8e, 0x01 }, + { 16 * 455.00 /*MHz*/, 0x8e, 0x02 }, { 16 * 999.99 , 0x8e, 0x04 }, }; diff --git a/trunk/drivers/media/video/tveeprom.c b/trunk/drivers/media/video/tveeprom.c index b463e996961a..431c3e2f6c42 100644 --- a/trunk/drivers/media/video/tveeprom.c +++ b/trunk/drivers/media/video/tveeprom.c @@ -218,7 +218,7 @@ hauppauge_tuner[] = /* 110-119 */ { TUNER_ABSENT, "Thompson DTT75105"}, { TUNER_ABSENT, "Conexant_CX24109"}, - { TUNER_TCL_2002N, "TCL M2523_5N_E"}, + { TUNER_ABSENT, "TCL M2523_5N_E"}, { TUNER_ABSENT, "TCL M2523_3DB_E"}, { TUNER_ABSENT, "Philips 8275A"}, { TUNER_ABSENT, "Microtune MT2060"}, diff --git a/trunk/drivers/media/video/usbvideo/Kconfig b/trunk/drivers/media/video/usbvideo/Kconfig index 39269a2c5635..08a5d20bb2c0 100644 --- a/trunk/drivers/media/video/usbvideo/Kconfig +++ b/trunk/drivers/media/video/usbvideo/Kconfig @@ -3,7 +3,7 @@ config VIDEO_USBVIDEO config USB_VICAM tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)" - depends on USB && VIDEO_V4L1 && EXPERIMENTAL + depends on USB && VIDEO_DEV && EXPERIMENTAL select VIDEO_USBVIDEO ---help--- Say Y here if you have 3com homeconnect camera (vicam). @@ -13,7 +13,7 @@ config USB_VICAM config USB_IBMCAM tristate "USB IBM (Xirlink) C-it Camera support" - depends on USB && VIDEO_V4L1 + depends on USB && VIDEO_DEV select VIDEO_USBVIDEO ---help--- Say Y here if you want to connect a IBM "C-It" camera, also known as @@ -28,7 +28,7 @@ config USB_IBMCAM config USB_KONICAWC tristate "USB Konica Webcam support" - depends on USB && VIDEO_V4L1 + depends on USB && VIDEO_DEV select VIDEO_USBVIDEO ---help--- Say Y here if you want support for webcams based on a Konica diff --git a/trunk/drivers/media/video/vivi.c b/trunk/drivers/media/video/vivi.c index 779db26771c0..5e813404d068 100644 --- a/trunk/drivers/media/video/vivi.c +++ b/trunk/drivers/media/video/vivi.c @@ -26,11 +26,6 @@ #include #include #include -#include -#ifdef CONFIG_VIDEO_V4L1_COMPAT -/* Include V4L1 specific functions. Should be removed soon */ -#include -#endif #include #include #include diff --git a/trunk/drivers/media/video/zc0301/Kconfig b/trunk/drivers/media/video/zc0301/Kconfig index 115833e4f4dd..c3bf886b80cd 100644 --- a/trunk/drivers/media/video/zc0301/Kconfig +++ b/trunk/drivers/media/video/zc0301/Kconfig @@ -1,6 +1,6 @@ config USB_ZC0301 tristate "USB ZC0301 Image Processor and Control Chip support" - depends on USB && VIDEO_V4L1 + depends on USB && VIDEO_DEV ---help--- Say Y here if you want support for cameras based on the ZC0301 Image Processor and Control Chip. diff --git a/trunk/drivers/mmc/mmc_block.c b/trunk/drivers/mmc/mmc_block.c index 587458b370b9..e39cc05c64c2 100644 --- a/trunk/drivers/mmc/mmc_block.c +++ b/trunk/drivers/mmc/mmc_block.c @@ -353,7 +353,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) */ printk(KERN_ERR "%s: unable to select block size for " "writing (rb%u wb%u rp%u wp%u)\n", - mmc_card_id(card), + md->disk->disk_name, 1 << card->csd.read_blkbits, 1 << card->csd.write_blkbits, card->csd.read_partial, diff --git a/trunk/drivers/net/bnx2.c b/trunk/drivers/net/bnx2.c index 54161aef3cac..5ca99e26660a 100644 --- a/trunk/drivers/net/bnx2.c +++ b/trunk/drivers/net/bnx2.c @@ -55,8 +55,8 @@ #define DRV_MODULE_NAME "bnx2" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "1.4.40" -#define DRV_MODULE_RELDATE "May 22, 2006" +#define DRV_MODULE_VERSION "1.4.39" +#define DRV_MODULE_RELDATE "March 22, 2006" #define RUN_AT(x) (jiffies + (x)) @@ -2945,7 +2945,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, int buf_size) { u32 written, offset32, len32; - u8 *buf, start[4], end[4], *flash_buffer = NULL; + u8 *buf, start[4], end[4]; int rc = 0; int align_start, align_end; @@ -2985,19 +2985,12 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, memcpy(buf + align_start, data_buf, buf_size); } - if (bp->flash_info->buffered == 0) { - flash_buffer = kmalloc(264, GFP_KERNEL); - if (flash_buffer == NULL) { - rc = -ENOMEM; - goto nvram_write_end; - } - } - written = 0; while ((written < len32) && (rc == 0)) { u32 page_start, page_end, data_start, data_end; u32 addr, cmd_flags; int i; + u8 flash_buffer[264]; /* Find the page_start addr */ page_start = offset32 + written; @@ -3068,7 +3061,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, } /* Loop to write the new data from data_start to data_end */ - for (addr = data_start; addr < data_end; addr += 4, i += 4) { + for (addr = data_start; addr < data_end; addr += 4, i++) { if ((addr == page_end - 4) || ((bp->flash_info->buffered) && (addr == data_end - 4))) { @@ -3116,9 +3109,6 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, } nvram_write_end: - if (bp->flash_info->buffered == 0) - kfree(flash_buffer); - if (align_start || align_end) kfree(buf); return rc; diff --git a/trunk/drivers/net/e1000/e1000_main.c b/trunk/drivers/net/e1000/e1000_main.c index ed15fcaedaf9..c99e87838f92 100644 --- a/trunk/drivers/net/e1000/e1000_main.c +++ b/trunk/drivers/net/e1000/e1000_main.c @@ -220,7 +220,6 @@ static void e1000_restore_vlan(struct e1000_adapter *adapter); static int e1000_suspend(struct pci_dev *pdev, pm_message_t state); static int e1000_resume(struct pci_dev *pdev); #endif -static void e1000_shutdown(struct pci_dev *pdev); #ifdef CONFIG_NET_POLL_CONTROLLER /* for netdump / net console */ @@ -236,9 +235,8 @@ static struct pci_driver e1000_driver = { /* Power Managment Hooks */ #ifdef CONFIG_PM .suspend = e1000_suspend, - .resume = e1000_resume, + .resume = e1000_resume #endif - .shutdown = e1000_shutdown }; MODULE_AUTHOR("Intel Corporation, "); @@ -4613,12 +4611,6 @@ e1000_resume(struct pci_dev *pdev) return 0; } #endif - -static void e1000_shutdown(struct pci_dev *pdev) -{ - e1000_suspend(pdev, PMSG_SUSPEND); -} - #ifdef CONFIG_NET_POLL_CONTROLLER /* * Polling 'interrupt' - used by things like netconsole to send skbs diff --git a/trunk/drivers/net/irda/Kconfig b/trunk/drivers/net/irda/Kconfig index cff8598aa800..5e6d00752990 100644 --- a/trunk/drivers/net/irda/Kconfig +++ b/trunk/drivers/net/irda/Kconfig @@ -33,7 +33,7 @@ config DONGLE config ESI_DONGLE tristate "ESI JetEye PC dongle" - depends on IRTTY_SIR && DONGLE && IRDA + depends on DONGLE && IRDA help Say Y here if you want to build support for the Extended Systems JetEye PC dongle. To compile it as a module, choose M here. The ESI @@ -44,7 +44,7 @@ config ESI_DONGLE config ACTISYS_DONGLE tristate "ACTiSYS IR-220L and IR220L+ dongle" - depends on IRTTY_SIR && DONGLE && IRDA + depends on DONGLE && IRDA help Say Y here if you want to build support for the ACTiSYS IR-220L and IR220L+ dongles. To compile it as a module, choose M here. The @@ -55,7 +55,7 @@ config ACTISYS_DONGLE config TEKRAM_DONGLE tristate "Tekram IrMate 210B dongle" - depends on IRTTY_SIR && DONGLE && IRDA + depends on DONGLE && IRDA help Say Y here if you want to build support for the Tekram IrMate 210B dongle. To compile it as a module, choose M here. The Tekram dongle @@ -66,7 +66,7 @@ config TEKRAM_DONGLE config TOIM3232_DONGLE tristate "TOIM3232 IrDa dongle" - depends on IRTTY_SIR && DONGLE && IRDA + depends on DONGLE && IRDA help Say Y here if you want to build support for the Vishay/Temic TOIM3232 and TOIM4232 based dongles. @@ -74,7 +74,7 @@ config TOIM3232_DONGLE config LITELINK_DONGLE tristate "Parallax LiteLink dongle" - depends on IRTTY_SIR && DONGLE && IRDA + depends on DONGLE && IRDA help Say Y here if you want to build support for the Parallax Litelink dongle. To compile it as a module, choose M here. The Parallax @@ -85,7 +85,7 @@ config LITELINK_DONGLE config MA600_DONGLE tristate "Mobile Action MA600 dongle" - depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL + depends on DONGLE && IRDA && EXPERIMENTAL help Say Y here if you want to build support for the Mobile Action MA600 dongle. To compile it as a module, choose M here. The MA600 dongle @@ -98,7 +98,7 @@ config MA600_DONGLE config GIRBIL_DONGLE tristate "Greenwich GIrBIL dongle" - depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL + depends on DONGLE && IRDA && EXPERIMENTAL help Say Y here if you want to build support for the Greenwich GIrBIL dongle. If you want to compile it as a module, choose M here. @@ -109,7 +109,7 @@ config GIRBIL_DONGLE config MCP2120_DONGLE tristate "Microchip MCP2120" - depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL + depends on DONGLE && IRDA && EXPERIMENTAL help Say Y here if you want to build support for the Microchip MCP2120 dongle. If you want to compile it as a module, choose M here. @@ -123,7 +123,7 @@ config MCP2120_DONGLE config OLD_BELKIN_DONGLE tristate "Old Belkin dongle" - depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL + depends on DONGLE && IRDA && EXPERIMENTAL help Say Y here if you want to build support for the Adaptec Airport 1000 and 2000 dongles. If you want to compile it as a module, choose @@ -132,7 +132,7 @@ config OLD_BELKIN_DONGLE config ACT200L_DONGLE tristate "ACTiSYS IR-200L dongle" - depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL + depends on DONGLE && IRDA && EXPERIMENTAL help Say Y here if you want to build support for the ACTiSYS IR-200L dongle. If you want to compile it as a module, choose M here. diff --git a/trunk/drivers/net/pcnet32.c b/trunk/drivers/net/pcnet32.c index fc08c4af506c..07c31f19c6ba 100644 --- a/trunk/drivers/net/pcnet32.c +++ b/trunk/drivers/net/pcnet32.c @@ -1774,6 +1774,8 @@ static int pcnet32_open(struct net_device *dev) lp->rx_dma_addr[i] = 0; } + pcnet32_free_ring(dev); + /* * Switch back to 16bit mode to avoid problems with dumb * DOS packet driver after a warm reboot diff --git a/trunk/drivers/net/sky2.c b/trunk/drivers/net/sky2.c index 959109609d85..60779ebf2ff6 100644 --- a/trunk/drivers/net/sky2.c +++ b/trunk/drivers/net/sky2.c @@ -979,7 +979,6 @@ static int sky2_rx_start(struct sky2_port *sky2) struct sky2_hw *hw = sky2->hw; unsigned rxq = rxqaddr[sky2->port]; int i; - unsigned thresh; sky2->rx_put = sky2->rx_next = 0; sky2_qset(hw, rxq); @@ -1004,21 +1003,9 @@ static int sky2_rx_start(struct sky2_port *sky2) sky2_rx_add(sky2, re->mapaddr); } - - /* - * The receiver hangs if it receives frames larger than the - * packet buffer. As a workaround, truncate oversize frames, but - * the register is limited to 9 bits, so if you do frames > 2052 - * you better get the MTU right! - */ - thresh = (sky2->rx_bufsize - 8) / sizeof(u32); - if (thresh > 0x1ff) - sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_OFF); - else { - sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), thresh); - sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON); - } - + /* Truncate oversize frames */ + sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 8); + sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON); /* Tell chip about available buffers */ sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c index 49ad60b72657..e1b33a25a25f 100644 --- a/trunk/drivers/net/tg3.c +++ b/trunk/drivers/net/tg3.c @@ -69,8 +69,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "3.58" -#define DRV_MODULE_RELDATE "May 22, 2006" +#define DRV_MODULE_VERSION "3.57" +#define DRV_MODULE_RELDATE "Apr 28, 2006" #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE 0 @@ -6488,10 +6488,6 @@ static void tg3_periodic_fetch_stats(struct tg3 *tp) TG3_STAT_ADD32(&sp->rx_frame_too_long_errors, MAC_RX_STATS_FRAME_TOO_LONG); TG3_STAT_ADD32(&sp->rx_jabbers, MAC_RX_STATS_JABBERS); TG3_STAT_ADD32(&sp->rx_undersize_packets, MAC_RX_STATS_UNDERSIZE); - - TG3_STAT_ADD32(&sp->rxbds_empty, RCVLPC_NO_RCV_BD_CNT); - TG3_STAT_ADD32(&sp->rx_discards, RCVLPC_IN_DISCARDS_CNT); - TG3_STAT_ADD32(&sp->rx_errors, RCVLPC_IN_ERRORS_CNT); } static void tg3_timer(unsigned long __opaque) diff --git a/trunk/drivers/net/wireless/arlan-main.c b/trunk/drivers/net/wireless/arlan-main.c index bed6823d9809..0e1ac338cac1 100644 --- a/trunk/drivers/net/wireless/arlan-main.c +++ b/trunk/drivers/net/wireless/arlan-main.c @@ -1838,7 +1838,7 @@ struct net_device * __init arlan_probe(int unit) } #ifdef MODULE -int __init init_module(void) +int init_module(void) { int i = 0; @@ -1860,7 +1860,7 @@ int __init init_module(void) } -void __exit cleanup_module(void) +void cleanup_module(void) { int i = 0; struct net_device *dev; diff --git a/trunk/drivers/net/wireless/orinoco.c b/trunk/drivers/net/wireless/orinoco.c index c2d0b09e0418..06523e2a8471 100644 --- a/trunk/drivers/net/wireless/orinoco.c +++ b/trunk/drivers/net/wireless/orinoco.c @@ -812,6 +812,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid, if (datalen > IEEE80211_DATA_LEN + 12) { printk(KERN_DEBUG "%s: oversized monitor frame, " "data length = %d\n", dev->name, datalen); + err = -EIO; stats->rx_length_errors++; goto update_stats; } @@ -820,7 +821,8 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid, if (!skb) { printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n", dev->name); - goto update_stats; + err = -ENOMEM; + goto drop; } /* Copy the 802.11 header to the skb */ diff --git a/trunk/drivers/net/wireless/wavelan.c b/trunk/drivers/net/wireless/wavelan.c index dade4b903579..ff192e96268a 100644 --- a/trunk/drivers/net/wireless/wavelan.c +++ b/trunk/drivers/net/wireless/wavelan.c @@ -4306,7 +4306,7 @@ struct net_device * __init wavelan_probe(int unit) * Insertion of the module * I'm now quite proud of the multi-device support. */ -int __init init_module(void) +int init_module(void) { int ret = -EIO; /* Return error if no cards found */ int i; diff --git a/trunk/drivers/s390/net/ctcmain.c b/trunk/drivers/s390/net/ctcmain.c index fe986af884f8..af9f212314b3 100644 --- a/trunk/drivers/s390/net/ctcmain.c +++ b/trunk/drivers/s390/net/ctcmain.c @@ -1486,13 +1486,13 @@ ch_action_iofatal(fsm_instance * fi, int event, void *arg) } } -static void +static void ch_action_reinit(fsm_instance *fi, int event, void *arg) { struct channel *ch = (struct channel *)arg; struct net_device *dev = ch->netdev; struct ctc_priv *privptr = dev->priv; - + DBF_TEXT(trace, 4, __FUNCTION__); ch_action_iofatal(fi, event, arg); fsm_addtimer(&privptr->restart_timer, 1000, DEV_EVENT_RESTART, dev); @@ -1624,7 +1624,7 @@ less_than(char *id1, char *id2) } dev1 = simple_strtoul(id1, &id1, 16); dev2 = simple_strtoul(id2, &id2, 16); - + return (dev1 < dev2); } @@ -1895,7 +1895,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) irb->scsw.dstat); return; } - + priv = ((struct ccwgroup_device *)cdev->dev.driver_data) ->dev.driver_data; @@ -1909,7 +1909,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) "device %s\n", cdev->dev.bus_id); return; } - + dev = (struct net_device *) (ch->netdev); if (dev == NULL) { ctc_pr_crit("ctc: ctc_irq_handler dev=NULL bus_id=%s, ch=0x%p\n", @@ -2008,12 +2008,12 @@ dev_action_stop(fsm_instance * fi, int event, void *arg) fsm_event(ch->fsm, CH_EVENT_STOP, ch); } } -static void +static void dev_action_restart(fsm_instance *fi, int event, void *arg) { struct net_device *dev = (struct net_device *)arg; struct ctc_priv *privptr = dev->priv; - + DBF_TEXT(trace, 3, __FUNCTION__); ctc_pr_debug("%s: Restarting\n", dev->name); dev_action_stop(fi, event, arg); @@ -2193,7 +2193,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb) DBF_TEXT(trace, 5, __FUNCTION__); /* we need to acquire the lock for testing the state - * otherwise we can have an IRQ changing the state to + * otherwise we can have an IRQ changing the state to * TXIDLE after the test but before acquiring the lock. */ spin_lock_irqsave(&ch->collect_lock, saveflags); @@ -2393,7 +2393,7 @@ ctc_tx(struct sk_buff *skb, struct net_device * dev) /** * If channels are not running, try to restart them - * and throw away packet. + * and throw away packet. */ if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { fsm_event(privptr->fsm, DEV_EVENT_START, dev); @@ -2738,7 +2738,7 @@ ctc_remove_files(struct device *dev) /** * Add ctc specific attributes. * Add ctc private data. - * + * * @param cgdev pointer to ccwgroup_device just added * * @returns 0 on success, !0 on failure. @@ -2869,7 +2869,7 @@ ctc_new_device(struct ccwgroup_device *cgdev) DBF_TEXT(setup, 3, buffer); type = get_channel_type(&cgdev->cdev[0]->id); - + snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id); snprintf(write_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id); @@ -2907,7 +2907,7 @@ ctc_new_device(struct ccwgroup_device *cgdev) channel_get(type, direction == READ ? read_id : write_id, direction); if (privptr->channel[direction] == NULL) { - if (direction == WRITE) + if (direction == WRITE) channel_free(privptr->channel[READ]); ctc_free_netdevice(dev, 1); @@ -2955,7 +2955,7 @@ ctc_shutdown_device(struct ccwgroup_device *cgdev) { struct ctc_priv *priv; struct net_device *ndev; - + DBF_TEXT(setup, 3, __FUNCTION__); pr_debug("%s() called\n", __FUNCTION__); diff --git a/trunk/drivers/s390/net/ctctty.c b/trunk/drivers/s390/net/ctctty.c index af54d1de07bf..5cdcdbf92962 100644 --- a/trunk/drivers/s390/net/ctctty.c +++ b/trunk/drivers/s390/net/ctctty.c @@ -130,7 +130,7 @@ ctc_tty_readmodem(ctc_tty_info *info) if ((tty = info->tty)) { if (info->mcr & UART_MCR_RTS) { struct sk_buff *skb; - + if ((skb = skb_dequeue(&info->rx_queue))) { int len = skb->len; tty_insert_flip_string(tty, skb->data, len); @@ -328,7 +328,7 @@ ctc_tty_inject(ctc_tty_info *info, char c) { int skb_res; struct sk_buff *skb; - + DBF_TEXT(trace, 4, __FUNCTION__); if (ctc_tty_shuttingdown) return; @@ -497,7 +497,7 @@ ctc_tty_write(struct tty_struct *tty, const u_char * buf, int count) c = (count < CTC_TTY_XMIT_SIZE) ? count : CTC_TTY_XMIT_SIZE; if (c <= 0) break; - + skb_res = info->netdev->hard_header_len + sizeof(info->mcr) + + sizeof(__u32); skb = dev_alloc_skb(skb_res + c); @@ -828,7 +828,7 @@ ctc_tty_block_til_ready(struct tty_struct *tty, struct file *filp, ctc_tty_info if (tty_hung_up_p(filp) || (info->flags & CTC_ASYNC_CLOSING)) { if (info->flags & CTC_ASYNC_CLOSING) - wait_event(info->close_wait, + wait_event(info->close_wait, !(info->flags & CTC_ASYNC_CLOSING)); #ifdef MODEM_DO_RESTART if (info->flags & CTC_ASYNC_HUP_NOTIFY) @@ -1247,7 +1247,7 @@ ctc_tty_unregister_netdev(struct net_device *dev) { void ctc_tty_cleanup(void) { unsigned long saveflags; - + DBF_TEXT(trace, 2, __FUNCTION__); spin_lock_irqsave(&ctc_tty_lock, saveflags); ctc_tty_shuttingdown = 1; diff --git a/trunk/drivers/s390/net/cu3088.c b/trunk/drivers/s390/net/cu3088.c index e965f03a7291..b12533104c1f 100644 --- a/trunk/drivers/s390/net/cu3088.c +++ b/trunk/drivers/s390/net/cu3088.c @@ -20,7 +20,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ - + #include #include #include @@ -77,7 +77,7 @@ group_write(struct device_driver *drv, const char *buf, size_t count) int len; if (!(end = strchr(start, delim[i]))) - return -EINVAL; + return count; len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1); strlcpy (bus_ids[i], start, len); argv[i] = bus_ids[i]; @@ -94,7 +94,7 @@ static DRIVER_ATTR(group, 0200, NULL, group_write); /* Register-unregister for ctc&lcs */ int -register_cu3088_discipline(struct ccwgroup_driver *dcp) +register_cu3088_discipline(struct ccwgroup_driver *dcp) { int rc; @@ -109,7 +109,7 @@ register_cu3088_discipline(struct ccwgroup_driver *dcp) rc = driver_create_file(&dcp->driver, &driver_attr_group); if (rc) ccwgroup_driver_unregister(dcp); - + return rc; } @@ -137,7 +137,7 @@ static int __init cu3088_init (void) { int rc; - + cu3088_root_dev = s390_root_dev_register("cu3088"); if (IS_ERR(cu3088_root_dev)) return PTR_ERR(cu3088_root_dev); diff --git a/trunk/drivers/s390/net/iucv.c b/trunk/drivers/s390/net/iucv.c index e0c7deb98831..6190be9dca99 100644 --- a/trunk/drivers/s390/net/iucv.c +++ b/trunk/drivers/s390/net/iucv.c @@ -1,4 +1,4 @@ -/* +/* * IUCV network driver * * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation @@ -28,7 +28,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ - + /* #define DEBUG */ #include @@ -81,7 +81,7 @@ iucv_bus_match (struct device *dev, struct device_driver *drv) struct bus_type iucv_bus = { .name = "iucv", .match = iucv_bus_match, -}; +}; struct device *iucv_root; @@ -297,7 +297,7 @@ MODULE_LICENSE("GPL"); /* * Debugging stuff *******************************************************************************/ - + #ifdef DEBUG static int debuglevel = 0; @@ -344,7 +344,7 @@ do { \ /* * Internal functions *******************************************************************************/ - + /** * print start banner */ @@ -810,7 +810,7 @@ iucv_register_program (__u8 pgmname[16], sizeof (new_handler->id.userid)); EBC_TOUPPER (new_handler->id.userid, sizeof (new_handler->id.userid)); - + if (pgmmask) { memcpy (new_handler->id.mask, pgmmask, sizeof (new_handler->id.mask)); @@ -1229,7 +1229,7 @@ iucv_purge (__u16 pathid, __u32 msgid, __u32 srccls, __u32 *audit) /* parm->ipaudit has only 3 bytes */ *audit >>= 8; } - + release_param(parm); iucv_debug(1, "b2f0_result = %ld", b2f0_result); @@ -2330,14 +2330,14 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) temp_buff1[j] &= (h->id.mask)[j]; temp_buff2[j] &= (h->id.mask)[j]; } - + iucv_dumpit("temp_buff1:", temp_buff1, sizeof(temp_buff1)); iucv_dumpit("temp_buff2", temp_buff2, sizeof(temp_buff2)); - + if (!memcmp (temp_buff1, temp_buff2, 24)) { - + iucv_debug(2, "found a matching handler"); break; @@ -2368,7 +2368,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) } else iucv_sever(int_buf->ippathid, no_listener); break; - + case 0x02: /*connection complete */ if (messagesDisabled) { iucv_setmask(~0); @@ -2387,7 +2387,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) } else iucv_sever(int_buf->ippathid, no_listener); break; - + case 0x03: /* connection severed */ if (messagesDisabled) { iucv_setmask(~0); @@ -2398,13 +2398,13 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) interrupt->ConnectionSevered( (iucv_ConnectionSevered *)int_buf, h->pgm_data); - + else iucv_sever (int_buf->ippathid, no_listener); } else iucv_sever(int_buf->ippathid, no_listener); break; - + case 0x04: /* connection quiesced */ if (messagesDisabled) { iucv_setmask(~0); @@ -2420,7 +2420,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) "ConnectionQuiesced not called"); } break; - + case 0x05: /* connection resumed */ if (messagesDisabled) { iucv_setmask(~0); @@ -2436,7 +2436,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) "ConnectionResumed not called"); } break; - + case 0x06: /* priority message complete */ case 0x07: /* nonpriority message complete */ if (h) { @@ -2449,7 +2449,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) "MessageComplete not called"); } break; - + case 0x08: /* priority message pending */ case 0x09: /* nonpriority message pending */ if (h) { @@ -2467,7 +2467,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) __FUNCTION__); break; } /* end switch */ - + iucv_debug(2, "exiting pathid %d, type %02X", int_buf->ippathid, int_buf->iptype); diff --git a/trunk/drivers/s390/net/iucv.h b/trunk/drivers/s390/net/iucv.h index 5b6b1b7241c9..0c4644d3d2f3 100644 --- a/trunk/drivers/s390/net/iucv.h +++ b/trunk/drivers/s390/net/iucv.h @@ -4,7 +4,7 @@ * * S390 version * Copyright (C) 2000 IBM Corporation - * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) + * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) * Xenia Tkatschow (xenia@us.ibm.com) * * @@ -16,17 +16,17 @@ * CP Programming Services book, also available on the web * thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 * - * Definition of Return Codes - * -All positive return codes including zero are reflected back - * from CP except for iucv_register_program. The definition of each - * return code can be found in CP Programming Services book. - * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 - * - Return Code of: - * (-EINVAL) Invalid value - * (-ENOMEM) storage allocation failed + * Definition of Return Codes + * -All positive return codes including zero are reflected back + * from CP except for iucv_register_program. The definition of each + * return code can be found in CP Programming Services book. + * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 + * - Return Code of: + * (-EINVAL) Invalid value + * (-ENOMEM) storage allocation failed * pgmask defined in iucv_register_program will be set depending on input - * paramters. - * + * paramters. + * */ #include @@ -124,13 +124,13 @@ iucv_hex_dump(unsigned char *buf, size_t len) #define iucv_handle_t void * /* flags1: - * All flags are defined in the field IPFLAGS1 of each function - * and can be found in CP Programming Services. - * IPLOCAL - Indicates the connect can only be satisfied on the - * local system - * IPPRTY - Indicates a priority message - * IPQUSCE - Indicates you do not want to receive messages on a - * path until an iucv_resume is issued + * All flags are defined in the field IPFLAGS1 of each function + * and can be found in CP Programming Services. + * IPLOCAL - Indicates the connect can only be satisfied on the + * local system + * IPPRTY - Indicates a priority message + * IPQUSCE - Indicates you do not want to receive messages on a + * path until an iucv_resume is issued * IPRMDATA - Indicates that the message is in the parameter list */ #define IPLOCAL 0x01 @@ -154,14 +154,14 @@ iucv_hex_dump(unsigned char *buf, size_t len) #define AllInterrupts 0xf8 /* * Mapping of external interrupt buffers should be used with the corresponding - * interrupt types. - * Names: iucv_ConnectionPending -> connection pending + * interrupt types. + * Names: iucv_ConnectionPending -> connection pending * iucv_ConnectionComplete -> connection complete - * iucv_ConnectionSevered -> connection severed - * iucv_ConnectionQuiesced -> connection quiesced - * iucv_ConnectionResumed -> connection resumed - * iucv_MessagePending -> message pending - * iucv_MessageComplete -> message complete + * iucv_ConnectionSevered -> connection severed + * iucv_ConnectionQuiesced -> connection quiesced + * iucv_ConnectionResumed -> connection resumed + * iucv_MessagePending -> message pending + * iucv_MessageComplete -> message complete */ typedef struct { u16 ippathid; @@ -260,16 +260,16 @@ typedef struct { uchar res2[3]; } iucv_MessageComplete; -/* - * iucv_interrupt_ops_t: Is a vector of functions that handle - * IUCV interrupts. - * Parameter list: - * eib - is a pointer to a 40-byte area described - * with one of the structures above. - * pgm_data - this data is strictly for the - * interrupt handler that is passed by - * the application. This may be an address - * or token. +/* + * iucv_interrupt_ops_t: Is a vector of functions that handle + * IUCV interrupts. + * Parameter list: + * eib - is a pointer to a 40-byte area described + * with one of the structures above. + * pgm_data - this data is strictly for the + * interrupt handler that is passed by + * the application. This may be an address + * or token. */ typedef struct { void (*ConnectionPending) (iucv_ConnectionPending * eib, @@ -287,8 +287,8 @@ typedef struct { } iucv_interrupt_ops_t; /* - *iucv_array_t : Defines buffer array. - * Inside the array may be 31- bit addresses and 31-bit lengths. + *iucv_array_t : Defines buffer array. + * Inside the array may be 31- bit addresses and 31-bit lengths. */ typedef struct { u32 address; @@ -299,19 +299,19 @@ extern struct bus_type iucv_bus; extern struct device *iucv_root; /* -prototypes- */ -/* - * Name: iucv_register_program - * Purpose: Registers an application with IUCV - * Input: prmname - user identification +/* + * Name: iucv_register_program + * Purpose: Registers an application with IUCV + * Input: prmname - user identification * userid - machine identification * pgmmask - indicates which bits in the prmname and userid combined will be * used to determine who is given control - * ops - address of vector of interrupt handlers - * pgm_data- application data passed to interrupt handlers - * Output: NA - * Return: address of handler + * ops - address of vector of interrupt handlers + * pgm_data- application data passed to interrupt handlers + * Output: NA + * Return: address of handler * (0) - Error occurred, registration not completed. - * NOTE: Exact cause of failure will be recorded in syslog. + * NOTE: Exact cause of failure will be recorded in syslog. */ iucv_handle_t iucv_register_program (uchar pgmname[16], uchar userid[8], @@ -319,13 +319,13 @@ iucv_handle_t iucv_register_program (uchar pgmname[16], iucv_interrupt_ops_t * ops, void *pgm_data); -/* - * Name: iucv_unregister_program - * Purpose: Unregister application with IUCV - * Input: address of handler - * Output: NA - * Return: (0) - Normal return - * (-EINVAL) - Internal error, wild pointer +/* + * Name: iucv_unregister_program + * Purpose: Unregister application with IUCV + * Input: address of handler + * Output: NA + * Return: (0) - Normal return + * (-EINVAL) - Internal error, wild pointer */ int iucv_unregister_program (iucv_handle_t handle); @@ -333,7 +333,7 @@ int iucv_unregister_program (iucv_handle_t handle); * Name: iucv_accept * Purpose: This function is issued after the user receives a Connection Pending external * interrupt and now wishes to complete the IUCV communication path. - * Input: pathid - u16 , Path identification number + * Input: pathid - u16 , Path identification number * msglim_reqstd - u16, The number of outstanding messages requested. * user_data - uchar[16], Data specified by the iucv_connect function. * flags1 - int, Contains options for this path. @@ -358,34 +358,34 @@ int iucv_accept (u16 pathid, void *pgm_data, int *flags1_out, u16 * msglim); /* - * Name: iucv_connect + * Name: iucv_connect * Purpose: This function establishes an IUCV path. Although the connect may complete - * successfully, you are not able to use the path until you receive an IUCV - * Connection Complete external interrupt. - * Input: pathid - u16 *, Path identification number - * msglim_reqstd - u16, Number of outstanding messages requested - * user_data - uchar[16], 16-byte user data + * successfully, you are not able to use the path until you receive an IUCV + * Connection Complete external interrupt. + * Input: pathid - u16 *, Path identification number + * msglim_reqstd - u16, Number of outstanding messages requested + * user_data - uchar[16], 16-byte user data * userid - uchar[8], User identification - * system_name - uchar[8], 8-byte identifying the system name + * system_name - uchar[8], 8-byte identifying the system name * flags1 - int, Contains options for this path. * -IPPRTY - 0x20, Specifies if you want to send priority message. * -IPRMDATA - 0x80, Specifies whether your program can handle a message * in the parameter list. - * -IPQUSCE - 0x40, Specifies whether you want to quiesce the path being + * -IPQUSCE - 0x40, Specifies whether you want to quiesce the path being * established. - * -IPLOCAL - 0X01, Allows an application to force the partner to be on + * -IPLOCAL - 0X01, Allows an application to force the partner to be on * the local system. If local is specified then target class cannot be - * specified. + * specified. * flags1_out - int * Contains information about the path * - IPPRTY - 0x20, Indicates you may send priority messages. * msglim - * u16, Number of outstanding messages - * handle - iucv_handle_t, Address of handler - * pgm_data - void *, Application data passed to interrupt handlers + * handle - iucv_handle_t, Address of handler + * pgm_data - void *, Application data passed to interrupt handlers * Output: return code from CP IUCV call * rc - return code from iucv_declare_buffer - * -EINVAL - Invalid handle passed by application - * -EINVAL - Pathid address is NULL - * add_pathid_result - Return code from internal function add_pathid + * -EINVAL - Invalid handle passed by application + * -EINVAL - Pathid address is NULL + * add_pathid_result - Return code from internal function add_pathid */ int iucv_connect (u16 * pathid, @@ -397,16 +397,16 @@ int int *flags1_out, u16 * msglim, iucv_handle_t handle, void *pgm_data); -/* - * Name: iucv_purge - * Purpose: This function cancels a message that you have sent. - * Input: pathid - Path identification number. +/* + * Name: iucv_purge + * Purpose: This function cancels a message that you have sent. + * Input: pathid - Path identification number. * msgid - Specifies the message ID of the message to be purged. - * srccls - Specifies the source message class. - * Output: audit - Contains information about asynchronous error - * that may have affected the normal completion - * of this message. - * Return: Return code from CP IUCV call. + * srccls - Specifies the source message class. + * Output: audit - Contains information about asynchronous error + * that may have affected the normal completion + * of this message. + * Return: Return code from CP IUCV call. */ int iucv_purge (u16 pathid, u32 msgid, u32 srccls, __u32 *audit); /* @@ -426,38 +426,38 @@ ulong iucv_query_maxconn (void); */ ulong iucv_query_bufsize (void); -/* - * Name: iucv_quiesce - * Purpose: This function temporarily suspends incoming messages on an - * IUCV path. You can later reactivate the path by invoking - * the iucv_resume function. - * Input: pathid - Path identification number - * user_data - 16-bytes of user data - * Output: NA - * Return: Return code from CP IUCV call. +/* + * Name: iucv_quiesce + * Purpose: This function temporarily suspends incoming messages on an + * IUCV path. You can later reactivate the path by invoking + * the iucv_resume function. + * Input: pathid - Path identification number + * user_data - 16-bytes of user data + * Output: NA + * Return: Return code from CP IUCV call. */ int iucv_quiesce (u16 pathid, uchar user_data[16]); -/* - * Name: iucv_receive - * Purpose: This function receives messages that are being sent to you +/* + * Name: iucv_receive + * Purpose: This function receives messages that are being sent to you * over established paths. Data will be returned in buffer for length of * buflen. - * Input: - * pathid - Path identification number. - * buffer - Address of buffer to receive. - * buflen - Length of buffer to receive. - * msgid - Specifies the message ID. - * trgcls - Specifies target class. - * Output: + * Input: + * pathid - Path identification number. + * buffer - Address of buffer to receive. + * buflen - Length of buffer to receive. + * msgid - Specifies the message ID. + * trgcls - Specifies target class. + * Output: * flags1_out: int *, Contains information about this path. * IPNORPY - 0x10 Specifies this is a one-way message and no reply is - * expected. - * IPPRTY - 0x20 Specifies if you want to send priority message. + * expected. + * IPPRTY - 0x20 Specifies if you want to send priority message. * IPRMDATA - 0x80 specifies the data is contained in the parameter list * residual_buffer - address of buffer updated by the number * of bytes you have received. - * residual_length - + * residual_length - * Contains one of the following values, if the receive buffer is: * The same length as the message, this field is zero. * Longer than the message, this field contains the number of @@ -466,8 +466,8 @@ int iucv_quiesce (u16 pathid, uchar user_data[16]); * count (that is, the number of bytes remaining in the * message that does not fit into the buffer. In this * case b2f0_result = 5. - * Return: Return code from CP IUCV call. - * (-EINVAL) - buffer address is pointing to NULL + * Return: Return code from CP IUCV call. + * (-EINVAL) - buffer address is pointing to NULL */ int iucv_receive (u16 pathid, u32 msgid, @@ -477,16 +477,16 @@ int iucv_receive (u16 pathid, int *flags1_out, ulong * residual_buffer, ulong * residual_length); - /* - * Name: iucv_receive_array - * Purpose: This function receives messages that are being sent to you + /* + * Name: iucv_receive_array + * Purpose: This function receives messages that are being sent to you * over established paths. Data will be returned in first buffer for * length of first buffer. - * Input: pathid - Path identification number. + * Input: pathid - Path identification number. * msgid - specifies the message ID. * trgcls - Specifies target class. - * buffer - Address of array of buffers. - * buflen - Total length of buffers. + * buffer - Address of array of buffers. + * buflen - Total length of buffers. * Output: * flags1_out: int *, Contains information about this path. * IPNORPY - 0x10 Specifies this is a one-way message and no reply is @@ -504,8 +504,8 @@ int iucv_receive (u16 pathid, * count (that is, the number of bytes remaining in the * message that does not fit into the buffer. In this * case b2f0_result = 5. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_receive_array (u16 pathid, u32 msgid, @@ -515,44 +515,44 @@ int iucv_receive_array (u16 pathid, int *flags1_out, ulong * residual_buffer, ulong * residual_length); -/* - * Name: iucv_reject - * Purpose: The reject function refuses a specified message. Between the - * time you are notified of a message and the time that you - * complete the message, the message may be rejected. - * Input: pathid - Path identification number. - * msgid - Specifies the message ID. - * trgcls - Specifies target class. - * Output: NA - * Return: Return code from CP IUCV call. +/* + * Name: iucv_reject + * Purpose: The reject function refuses a specified message. Between the + * time you are notified of a message and the time that you + * complete the message, the message may be rejected. + * Input: pathid - Path identification number. + * msgid - Specifies the message ID. + * trgcls - Specifies target class. + * Output: NA + * Return: Return code from CP IUCV call. */ int iucv_reject (u16 pathid, u32 msgid, u32 trgcls); -/* - * Name: iucv_reply - * Purpose: This function responds to the two-way messages that you - * receive. You must identify completely the message to - * which you wish to reply. ie, pathid, msgid, and trgcls. - * Input: pathid - Path identification number. - * msgid - Specifies the message ID. - * trgcls - Specifies target class. +/* + * Name: iucv_reply + * Purpose: This function responds to the two-way messages that you + * receive. You must identify completely the message to + * which you wish to reply. ie, pathid, msgid, and trgcls. + * Input: pathid - Path identification number. + * msgid - Specifies the message ID. + * trgcls - Specifies target class. * flags1 - Option for path. - * IPPRTY- 0x20, Specifies if you want to send priority message. - * buffer - Address of reply buffer. - * buflen - Length of reply buffer. - * Output: residual_buffer - Address of buffer updated by the number - * of bytes you have moved. + * IPPRTY- 0x20, Specifies if you want to send priority message. + * buffer - Address of reply buffer. + * buflen - Length of reply buffer. + * Output: residual_buffer - Address of buffer updated by the number + * of bytes you have moved. * residual_length - Contains one of the following values: * If the answer buffer is the same length as the reply, this field * contains zero. * If the answer buffer is longer than the reply, this field contains - * the number of bytes remaining in the buffer. + * the number of bytes remaining in the buffer. * If the answer buffer is shorter than the reply, this field contains * a residual count (that is, the number of bytes remianing in the * reply that does not fit into the buffer. In this * case b2f0_result = 5. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_reply (u16 pathid, u32 msgid, @@ -561,20 +561,20 @@ int iucv_reply (u16 pathid, void *buffer, ulong buflen, ulong * residual_buffer, ulong * residual_length); -/* - * Name: iucv_reply_array - * Purpose: This function responds to the two-way messages that you - * receive. You must identify completely the message to - * which you wish to reply. ie, pathid, msgid, and trgcls. - * The array identifies a list of addresses and lengths of - * discontiguous buffers that contains the reply data. - * Input: pathid - Path identification number - * msgid - Specifies the message ID. - * trgcls - Specifies target class. +/* + * Name: iucv_reply_array + * Purpose: This function responds to the two-way messages that you + * receive. You must identify completely the message to + * which you wish to reply. ie, pathid, msgid, and trgcls. + * The array identifies a list of addresses and lengths of + * discontiguous buffers that contains the reply data. + * Input: pathid - Path identification number + * msgid - Specifies the message ID. + * trgcls - Specifies target class. * flags1 - Option for path. * IPPRTY- 0x20, Specifies if you want to send priority message. - * buffer - Address of array of reply buffers. - * buflen - Total length of reply buffers. + * buffer - Address of array of reply buffers. + * buflen - Total length of reply buffers. * Output: residual_buffer - Address of buffer which IUCV is currently working on. * residual_length - Contains one of the following values: * If the answer buffer is the same length as the reply, this field @@ -585,8 +585,8 @@ int iucv_reply (u16 pathid, * a residual count (that is, the number of bytes remianing in the * reply that does not fit into the buffer. In this * case b2f0_result = 5. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_reply_array (u16 pathid, u32 msgid, @@ -596,77 +596,77 @@ int iucv_reply_array (u16 pathid, ulong buflen, ulong * residual_address, ulong * residual_length); -/* - * Name: iucv_reply_prmmsg - * Purpose: This function responds to the two-way messages that you - * receive. You must identify completely the message to - * which you wish to reply. ie, pathid, msgid, and trgcls. - * Prmmsg signifies the data is moved into the - * parameter list. - * Input: pathid - Path identification number. - * msgid - Specifies the message ID. - * trgcls - Specifies target class. +/* + * Name: iucv_reply_prmmsg + * Purpose: This function responds to the two-way messages that you + * receive. You must identify completely the message to + * which you wish to reply. ie, pathid, msgid, and trgcls. + * Prmmsg signifies the data is moved into the + * parameter list. + * Input: pathid - Path identification number. + * msgid - Specifies the message ID. + * trgcls - Specifies target class. * flags1 - Option for path. * IPPRTY- 0x20 Specifies if you want to send priority message. - * prmmsg - 8-bytes of data to be placed into the parameter. - * list. - * Output: NA - * Return: Return code from CP IUCV call. + * prmmsg - 8-bytes of data to be placed into the parameter. + * list. + * Output: NA + * Return: Return code from CP IUCV call. */ int iucv_reply_prmmsg (u16 pathid, u32 msgid, u32 trgcls, int flags1, uchar prmmsg[8]); -/* - * Name: iucv_resume - * Purpose: This function restores communications over a quiesced path - * Input: pathid - Path identification number. - * user_data - 16-bytes of user data. - * Output: NA - * Return: Return code from CP IUCV call. +/* + * Name: iucv_resume + * Purpose: This function restores communications over a quiesced path + * Input: pathid - Path identification number. + * user_data - 16-bytes of user data. + * Output: NA + * Return: Return code from CP IUCV call. */ int iucv_resume (u16 pathid, uchar user_data[16]); -/* - * Name: iucv_send - * Purpose: This function transmits data to another application. - * Data to be transmitted is in a buffer and this is a - * one-way message and the receiver will not reply to the - * message. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag to be associated with the message. +/* + * Name: iucv_send + * Purpose: This function transmits data to another application. + * Data to be transmitted is in a buffer and this is a + * one-way message and the receiver will not reply to the + * message. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag to be associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 Specifies if you want to send priority message. - * buffer - Address of send buffer. - * buflen - Length of send buffer. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * buffer - Address of send buffer. + * buflen - Length of send buffer. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_send (u16 pathid, u32 * msgid, u32 trgcls, u32 srccls, u32 msgtag, int flags1, void *buffer, ulong buflen); -/* - * Name: iucv_send_array - * Purpose: This function transmits data to another application. - * The contents of buffer is the address of the array of - * addresses and lengths of discontiguous buffers that hold - * the message text. This is a one-way message and the - * receiver will not reply to the message. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. +/* + * Name: iucv_send_array + * Purpose: This function transmits data to another application. + * The contents of buffer is the address of the array of + * addresses and lengths of discontiguous buffers that hold + * the message text. This is a one-way message and the + * receiver will not reply to the message. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. * msgtag - Specifies a tag to be associated witht the message. * flags1 - Option for path. - * IPPRTY- specifies if you want to send priority message. - * buffer - Address of array of send buffers. - * buflen - Total length of send buffers. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * IPPRTY- specifies if you want to send priority message. + * buffer - Address of array of send buffers. + * buflen - Total length of send buffers. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_send_array (u16 pathid, u32 * msgid, @@ -675,48 +675,48 @@ int iucv_send_array (u16 pathid, u32 msgtag, int flags1, iucv_array_t * buffer, ulong buflen); -/* - * Name: iucv_send_prmmsg - * Purpose: This function transmits data to another application. - * Prmmsg specifies that the 8-bytes of data are to be moved - * into the parameter list. This is a one-way message and the - * receiver will not reply to the message. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag to be associated with the message. +/* + * Name: iucv_send_prmmsg + * Purpose: This function transmits data to another application. + * Prmmsg specifies that the 8-bytes of data are to be moved + * into the parameter list. This is a one-way message and the + * receiver will not reply to the message. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag to be associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 specifies if you want to send priority message. - * prmmsg - 8-bytes of data to be placed into parameter list. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. + * prmmsg - 8-bytes of data to be placed into parameter list. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. */ int iucv_send_prmmsg (u16 pathid, u32 * msgid, u32 trgcls, u32 srccls, u32 msgtag, int flags1, uchar prmmsg[8]); -/* - * Name: iucv_send2way - * Purpose: This function transmits data to another application. - * Data to be transmitted is in a buffer. The receiver - * of the send is expected to reply to the message and - * a buffer is provided into which IUCV moves the reply - * to this message. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag associated with the message. +/* + * Name: iucv_send2way + * Purpose: This function transmits data to another application. + * Data to be transmitted is in a buffer. The receiver + * of the send is expected to reply to the message and + * a buffer is provided into which IUCV moves the reply + * to this message. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 Specifies if you want to send priority message. - * buffer - Address of send buffer. - * buflen - Length of send buffer. - * ansbuf - Address of buffer into which IUCV moves the reply of - * this message. - * anslen - Address of length of buffer. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer or ansbuf address is NULL. + * buffer - Address of send buffer. + * buflen - Length of send buffer. + * ansbuf - Address of buffer into which IUCV moves the reply of + * this message. + * anslen - Address of length of buffer. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer or ansbuf address is NULL. */ int iucv_send2way (u16 pathid, u32 * msgid, @@ -726,28 +726,28 @@ int iucv_send2way (u16 pathid, int flags1, void *buffer, ulong buflen, void *ansbuf, ulong anslen); -/* - * Name: iucv_send2way_array - * Purpose: This function transmits data to another application. - * The contents of buffer is the address of the array of - * addresses and lengths of discontiguous buffers that hold - * the message text. The receiver of the send is expected to - * reply to the message and a buffer is provided into which - * IUCV moves the reply to this message. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag to be associated with the message. +/* + * Name: iucv_send2way_array + * Purpose: This function transmits data to another application. + * The contents of buffer is the address of the array of + * addresses and lengths of discontiguous buffers that hold + * the message text. The receiver of the send is expected to + * reply to the message and a buffer is provided into which + * IUCV moves the reply to this message. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag to be associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 Specifies if you want to send priority message. - * buffer - Sddress of array of send buffers. - * buflen - Total length of send buffers. - * ansbuf - Address of array of buffer into which IUCV moves the reply - * of this message. - * anslen - Address of length reply buffers. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * buffer - Sddress of array of send buffers. + * buflen - Total length of send buffers. + * ansbuf - Address of array of buffer into which IUCV moves the reply + * of this message. + * anslen - Address of length reply buffers. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_send2way_array (u16 pathid, u32 * msgid, @@ -758,27 +758,27 @@ int iucv_send2way_array (u16 pathid, iucv_array_t * buffer, ulong buflen, iucv_array_t * ansbuf, ulong anslen); -/* - * Name: iucv_send2way_prmmsg - * Purpose: This function transmits data to another application. - * Prmmsg specifies that the 8-bytes of data are to be moved - * into the parameter list. This is a two-way message and the - * receiver of the message is expected to reply. A buffer - * is provided into which IUCV moves the reply to this - * message. - * Input: pathid - Rath identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag to be associated with the message. +/* + * Name: iucv_send2way_prmmsg + * Purpose: This function transmits data to another application. + * Prmmsg specifies that the 8-bytes of data are to be moved + * into the parameter list. This is a two-way message and the + * receiver of the message is expected to reply. A buffer + * is provided into which IUCV moves the reply to this + * message. + * Input: pathid - Rath identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag to be associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 Specifies if you want to send priority message. - * prmmsg - 8-bytes of data to be placed in parameter list. - * ansbuf - Address of buffer into which IUCV moves the reply of + * prmmsg - 8-bytes of data to be placed in parameter list. + * ansbuf - Address of buffer into which IUCV moves the reply of * this message. - * anslen - Address of length of buffer. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Buffer address is NULL. + * anslen - Address of length of buffer. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Buffer address is NULL. */ int iucv_send2way_prmmsg (u16 pathid, u32 * msgid, @@ -788,29 +788,29 @@ int iucv_send2way_prmmsg (u16 pathid, ulong flags1, uchar prmmsg[8], void *ansbuf, ulong anslen); -/* - * Name: iucv_send2way_prmmsg_array - * Purpose: This function transmits data to another application. - * Prmmsg specifies that the 8-bytes of data are to be moved - * into the parameter list. This is a two-way message and the - * receiver of the message is expected to reply. A buffer - * is provided into which IUCV moves the reply to this - * message. The contents of ansbuf is the address of the - * array of addresses and lengths of discontiguous buffers - * that contain the reply. - * Input: pathid - Path identification number. - * trgcls - Specifies target class. - * srccls - Specifies the source message class. - * msgtag - Specifies a tag to be associated with the message. +/* + * Name: iucv_send2way_prmmsg_array + * Purpose: This function transmits data to another application. + * Prmmsg specifies that the 8-bytes of data are to be moved + * into the parameter list. This is a two-way message and the + * receiver of the message is expected to reply. A buffer + * is provided into which IUCV moves the reply to this + * message. The contents of ansbuf is the address of the + * array of addresses and lengths of discontiguous buffers + * that contain the reply. + * Input: pathid - Path identification number. + * trgcls - Specifies target class. + * srccls - Specifies the source message class. + * msgtag - Specifies a tag to be associated with the message. * flags1 - Option for path. * IPPRTY- 0x20 specifies if you want to send priority message. - * prmmsg - 8-bytes of data to be placed into the parameter list. + * prmmsg - 8-bytes of data to be placed into the parameter list. * ansbuf - Address of array of buffer into which IUCV moves the reply - * of this message. - * anslen - Address of length of reply buffers. - * Output: msgid - Specifies the message ID. - * Return: Return code from CP IUCV call. - * (-EINVAL) - Ansbuf address is NULL. + * of this message. + * anslen - Address of length of reply buffers. + * Output: msgid - Specifies the message ID. + * Return: Return code from CP IUCV call. + * (-EINVAL) - Ansbuf address is NULL. */ int iucv_send2way_prmmsg_array (u16 pathid, u32 * msgid, @@ -821,29 +821,29 @@ int iucv_send2way_prmmsg_array (u16 pathid, uchar prmmsg[8], iucv_array_t * ansbuf, ulong anslen); -/* - * Name: iucv_setmask - * Purpose: This function enables or disables the following IUCV - * external interruptions: Nonpriority and priority message - * interrupts, nonpriority and priority reply interrupts. +/* + * Name: iucv_setmask + * Purpose: This function enables or disables the following IUCV + * external interruptions: Nonpriority and priority message + * interrupts, nonpriority and priority reply interrupts. * Input: SetMaskFlag - options for interrupts - * 0x80 - Nonpriority_MessagePendingInterruptsFlag - * 0x40 - Priority_MessagePendingInterruptsFlag - * 0x20 - Nonpriority_MessageCompletionInterruptsFlag - * 0x10 - Priority_MessageCompletionInterruptsFlag + * 0x80 - Nonpriority_MessagePendingInterruptsFlag + * 0x40 - Priority_MessagePendingInterruptsFlag + * 0x20 - Nonpriority_MessageCompletionInterruptsFlag + * 0x10 - Priority_MessageCompletionInterruptsFlag * 0x08 - IUCVControlInterruptsFlag - * Output: NA - * Return: Return code from CP IUCV call. + * Output: NA + * Return: Return code from CP IUCV call. */ int iucv_setmask (int SetMaskFlag); -/* - * Name: iucv_sever - * Purpose: This function terminates an IUCV path. - * Input: pathid - Path identification number. - * user_data - 16-bytes of user data. - * Output: NA - * Return: Return code from CP IUCV call. - * (-EINVAL) - Interal error, wild pointer. +/* + * Name: iucv_sever + * Purpose: This function terminates an IUCV path. + * Input: pathid - Path identification number. + * user_data - 16-bytes of user data. + * Output: NA + * Return: Return code from CP IUCV call. + * (-EINVAL) - Interal error, wild pointer. */ int iucv_sever (u16 pathid, uchar user_data[16]); diff --git a/trunk/drivers/s390/net/lcs.c b/trunk/drivers/s390/net/lcs.c index f94419b334f7..e65da921a827 100644 --- a/trunk/drivers/s390/net/lcs.c +++ b/trunk/drivers/s390/net/lcs.c @@ -68,7 +68,6 @@ static void lcs_tasklet(unsigned long); static void lcs_start_kernel_thread(struct lcs_card *card); static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *); static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *); -static int lcs_recovery(void *ptr); /** * Debug Facility Stuff @@ -430,6 +429,12 @@ lcs_setup_card(struct lcs_card *card) card->tx_buffer = NULL; card->tx_emitted = 0; + /* Initialize kernel thread task used for LGW commands. */ + INIT_WORK(&card->kernel_thread_starter, + (void *)lcs_start_kernel_thread,card); + card->thread_start_mask = 0; + card->thread_allowed_mask = 0; + card->thread_running_mask = 0; init_waitqueue_head(&card->wait_q); spin_lock_init(&card->lock); spin_lock_init(&card->ipm_lock); @@ -670,9 +675,8 @@ lcs_ready_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer) int index, rc; LCS_DBF_TEXT(5, trace, "rdybuff"); - if (buffer->state != BUF_STATE_LOCKED && - buffer->state != BUF_STATE_PROCESSED) - BUG(); + BUG_ON(buffer->state != BUF_STATE_LOCKED && + buffer->state != BUF_STATE_PROCESSED); spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); buffer->state = BUF_STATE_READY; index = buffer - channel->iob; @@ -696,8 +700,7 @@ __lcs_processed_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer) int index, prev, next; LCS_DBF_TEXT(5, trace, "prcsbuff"); - if (buffer->state != BUF_STATE_READY) - BUG(); + BUG_ON(buffer->state != BUF_STATE_READY); buffer->state = BUF_STATE_PROCESSED; index = buffer - channel->iob; prev = (index - 1) & (LCS_NUM_BUFFS - 1); @@ -729,9 +732,8 @@ lcs_release_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer) unsigned long flags; LCS_DBF_TEXT(5, trace, "relbuff"); - if (buffer->state != BUF_STATE_LOCKED && - buffer->state != BUF_STATE_PROCESSED) - BUG(); + BUG_ON(buffer->state != BUF_STATE_LOCKED && + buffer->state != BUF_STATE_PROCESSED); spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); buffer->state = BUF_STATE_EMPTY; spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); @@ -1145,6 +1147,8 @@ lcs_fix_multicast_list(struct lcs_card *card) list_add_tail(&ipm->list, &card->ipm_list); } spin_unlock_irqrestore(&card->ipm_lock, flags); + if (card->state == DEV_STATE_UP) + netif_wake_queue(card->dev); } /** @@ -1227,17 +1231,17 @@ lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev) if (ipm != NULL) continue; /* Address already in list. */ ipm = (struct lcs_ipm_list *) - kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); + kmalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); if (ipm == NULL) { PRINT_INFO("Not enough memory to add " "new multicast entry!\n"); break; } + memset(ipm, 0, sizeof(struct lcs_ipm_list)); memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH); ipm->ipm.ip_addr = im4->multiaddr; ipm->ipm_state = LCS_IPM_STATE_SET_REQUIRED; spin_lock_irqsave(&card->ipm_lock, flags); - LCS_DBF_HEX(2,trace,&ipm->ipm.ip_addr,4); list_add(&ipm->list, &card->ipm_list); spin_unlock_irqrestore(&card->ipm_lock, flags); } @@ -1265,15 +1269,7 @@ lcs_register_mc_addresses(void *data) read_unlock(&in4_dev->mc_list_lock); in_dev_put(in4_dev); - netif_carrier_off(card->dev); - netif_tx_disable(card->dev); - wait_event(card->write.wait_q, - (card->write.state != CH_STATE_RUNNING)); lcs_fix_multicast_list(card); - if (card->state == DEV_STATE_UP) { - netif_carrier_on(card->dev); - netif_wake_queue(card->dev); - } out: lcs_clear_thread_running_bit(card, LCS_SET_MC_THREAD); return 0; @@ -1290,7 +1286,7 @@ lcs_set_multicast_list(struct net_device *dev) LCS_DBF_TEXT(4, trace, "setmulti"); card = (struct lcs_card *) dev->priv; - if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) + if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) schedule_work(&card->kernel_thread_starter); } @@ -1322,53 +1318,6 @@ lcs_check_irb_error(struct ccw_device *cdev, struct irb *irb) return PTR_ERR(irb); } -static int -lcs_get_problem(struct ccw_device *cdev, struct irb *irb) -{ - int dstat, cstat; - char *sense; - - sense = (char *) irb->ecw; - cstat = irb->scsw.cstat; - dstat = irb->scsw.dstat; - - if (cstat & (SCHN_STAT_CHN_CTRL_CHK | SCHN_STAT_INTF_CTRL_CHK | - SCHN_STAT_CHN_DATA_CHK | SCHN_STAT_CHAIN_CHECK | - SCHN_STAT_PROT_CHECK | SCHN_STAT_PROG_CHECK)) { - LCS_DBF_TEXT(2, trace, "CGENCHK"); - return 1; - } - if (dstat & DEV_STAT_UNIT_CHECK) { - if (sense[LCS_SENSE_BYTE_1] & - LCS_SENSE_RESETTING_EVENT) { - LCS_DBF_TEXT(2, trace, "REVIND"); - return 1; - } - if (sense[LCS_SENSE_BYTE_0] & - LCS_SENSE_CMD_REJECT) { - LCS_DBF_TEXT(2, trace, "CMDREJ"); - return 0; - } - if ((!sense[LCS_SENSE_BYTE_0]) && - (!sense[LCS_SENSE_BYTE_1]) && - (!sense[LCS_SENSE_BYTE_2]) && - (!sense[LCS_SENSE_BYTE_3])) { - LCS_DBF_TEXT(2, trace, "ZEROSEN"); - return 0; - } - LCS_DBF_TEXT(2, trace, "DGENCHK"); - return 1; - } - return 0; -} - -void -lcs_schedule_recovery(struct lcs_card *card) -{ - LCS_DBF_TEXT(2, trace, "startrec"); - if (!lcs_set_thread_start_bit(card, LCS_RECOVERY_THREAD)) - schedule_work(&card->kernel_thread_starter); -} /** * IRQ Handler for LCS channels @@ -1378,8 +1327,7 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) { struct lcs_card *card; struct lcs_channel *channel; - int rc, index; - int cstat, dstat; + int index; if (lcs_check_irb_error(cdev, irb)) return; @@ -1390,27 +1338,14 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) else channel = &card->write; - cstat = irb->scsw.cstat; - dstat = irb->scsw.dstat; LCS_DBF_TEXT_(5, trace, "Rint%s",cdev->dev.bus_id); LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.cstat, irb->scsw.dstat); LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.fctl, irb->scsw.actl); - /* Check for channel and device errors presented */ - rc = lcs_get_problem(cdev, irb); - if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) { - PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n", - cdev->dev.bus_id, dstat, cstat); - if (rc) { - lcs_schedule_recovery(card); - wake_up(&card->wait_q); - return; - } - } /* How far in the ccw chain have we processed? */ if ((channel->state != CH_STATE_INIT) && (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) { - index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) + index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) - channel->ccws; if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) || (irb->scsw.cstat & SCHN_STAT_PCI)) @@ -1432,6 +1367,7 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) else if (irb->scsw.actl & SCSW_ACTL_SUSPENDED) /* CCW execution stopped on a suspend bit. */ channel->state = CH_STATE_SUSPENDED; + if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) { if (irb->scsw.cc != 0) { ccw_device_halt(channel->ccwdev, (addr_t) channel); @@ -1440,6 +1376,7 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) /* The channel has been stopped by halt_IO. */ channel->state = CH_STATE_HALTED; } + if (irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) { channel->state = CH_STATE_CLEARED; } @@ -1515,7 +1452,7 @@ lcs_txbuffer_cb(struct lcs_channel *channel, struct lcs_buffer *buffer) lcs_release_buffer(channel, buffer); card = (struct lcs_card *) ((char *) channel - offsetof(struct lcs_card, write)); - if (netif_queue_stopped(card->dev) && netif_carrier_ok(card->dev)) + if (netif_queue_stopped(card->dev)) netif_wake_queue(card->dev); spin_lock(&card->lock); card->tx_emitted--; @@ -1551,10 +1488,6 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb, card->stats.tx_carrier_errors++; return 0; } - if (skb->protocol == htons(ETH_P_IPV6)) { - dev_kfree_skb(skb); - return 0; - } netif_stop_queue(card->dev); spin_lock(&card->lock); if (card->tx_buffer != NULL && @@ -1699,6 +1632,30 @@ lcs_detect(struct lcs_card *card) return rc; } +/** + * reset card + */ +static int +lcs_resetcard(struct lcs_card *card) +{ + int retries; + + LCS_DBF_TEXT(2, trace, "rescard"); + for (retries = 0; retries < 10; retries++) { + if (lcs_detect(card) == 0) { + netif_wake_queue(card->dev); + card->state = DEV_STATE_UP; + PRINT_INFO("LCS device %s successfully restarted!\n", + card->dev->name); + return 0; + } + msleep(3000); + } + PRINT_ERR("Error in Reseting LCS card!\n"); + return -EIO; +} + + /** * LCS Stop card */ @@ -1722,6 +1679,111 @@ lcs_stopcard(struct lcs_card *card) return rc; } +/** + * LGW initiated commands + */ +static int +lcs_lgw_startlan_thread(void *data) +{ + struct lcs_card *card; + + card = (struct lcs_card *) data; + daemonize("lgwstpln"); + + if (!lcs_do_run_thread(card, LCS_STARTLAN_THREAD)) + return 0; + LCS_DBF_TEXT(4, trace, "lgwstpln"); + if (card->dev) + netif_stop_queue(card->dev); + if (lcs_startlan(card) == 0) { + netif_wake_queue(card->dev); + card->state = DEV_STATE_UP; + PRINT_INFO("LCS Startlan for device %s succeeded!\n", + card->dev->name); + + } else + PRINT_ERR("LCS Startlan for device %s failed!\n", + card->dev->name); + lcs_clear_thread_running_bit(card, LCS_STARTLAN_THREAD); + return 0; +} + +/** + * Send startup command initiated by Lan Gateway + */ +static int +lcs_lgw_startup_thread(void *data) +{ + int rc; + + struct lcs_card *card; + + card = (struct lcs_card *) data; + daemonize("lgwstaln"); + + if (!lcs_do_run_thread(card, LCS_STARTUP_THREAD)) + return 0; + LCS_DBF_TEXT(4, trace, "lgwstaln"); + if (card->dev) + netif_stop_queue(card->dev); + rc = lcs_send_startup(card, LCS_INITIATOR_LGW); + if (rc != 0) { + PRINT_ERR("Startup for LCS device %s initiated " \ + "by LGW failed!\nReseting card ...\n", + card->dev->name); + /* do a card reset */ + rc = lcs_resetcard(card); + if (rc == 0) + goto Done; + } + rc = lcs_startlan(card); + if (rc == 0) { + netif_wake_queue(card->dev); + card->state = DEV_STATE_UP; + } +Done: + if (rc == 0) + PRINT_INFO("LCS Startup for device %s succeeded!\n", + card->dev->name); + else + PRINT_ERR("LCS Startup for device %s failed!\n", + card->dev->name); + lcs_clear_thread_running_bit(card, LCS_STARTUP_THREAD); + return 0; +} + + +/** + * send stoplan command initiated by Lan Gateway + */ +static int +lcs_lgw_stoplan_thread(void *data) +{ + struct lcs_card *card; + int rc; + + card = (struct lcs_card *) data; + daemonize("lgwstop"); + + if (!lcs_do_run_thread(card, LCS_STOPLAN_THREAD)) + return 0; + LCS_DBF_TEXT(4, trace, "lgwstop"); + if (card->dev) + netif_stop_queue(card->dev); + if (lcs_send_stoplan(card, LCS_INITIATOR_LGW) == 0) + PRINT_INFO("Stoplan for %s initiated by LGW succeeded!\n", + card->dev->name); + else + PRINT_ERR("Stoplan %s initiated by LGW failed!\n", + card->dev->name); + /*Try to reset the card, stop it on failure */ + rc = lcs_resetcard(card); + if (rc != 0) + rc = lcs_stopcard(card); + lcs_clear_thread_running_bit(card, LCS_STOPLAN_THREAD); + return rc; +} + /** * Kernel Thread helper functions for LGW initiated commands */ @@ -1729,12 +1791,15 @@ static void lcs_start_kernel_thread(struct lcs_card *card) { LCS_DBF_TEXT(5, trace, "krnthrd"); - if (lcs_do_start_thread(card, LCS_RECOVERY_THREAD)) - kernel_thread(lcs_recovery, (void *) card, SIGCHLD); + if (lcs_do_start_thread(card, LCS_STARTUP_THREAD)) + kernel_thread(lcs_lgw_startup_thread, (void *) card, SIGCHLD); + if (lcs_do_start_thread(card, LCS_STARTLAN_THREAD)) + kernel_thread(lcs_lgw_startlan_thread, (void *) card, SIGCHLD); + if (lcs_do_start_thread(card, LCS_STOPLAN_THREAD)) + kernel_thread(lcs_lgw_stoplan_thread, (void *) card, SIGCHLD); #ifdef CONFIG_IP_MULTICAST if (lcs_do_start_thread(card, LCS_SET_MC_THREAD)) - kernel_thread(lcs_register_mc_addresses, - (void *) card, SIGCHLD); + kernel_thread(lcs_register_mc_addresses, (void *) card, SIGCHLD); #endif } @@ -1748,14 +1813,19 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd) if (cmd->initiator == LCS_INITIATOR_LGW) { switch(cmd->cmd_code) { case LCS_CMD_STARTUP: + if (!lcs_set_thread_start_bit(card, + LCS_STARTUP_THREAD)) + schedule_work(&card->kernel_thread_starter); + break; case LCS_CMD_STARTLAN: - lcs_schedule_recovery(card); + if (!lcs_set_thread_start_bit(card, + LCS_STARTLAN_THREAD)) + schedule_work(&card->kernel_thread_starter); break; case LCS_CMD_STOPLAN: - PRINT_WARN("Stoplan for %s initiated by LGW.\n", - card->dev->name); - if (card->dev) - netif_carrier_off(card->dev); + if (!lcs_set_thread_start_bit(card, + LCS_STOPLAN_THREAD)) + schedule_work(&card->kernel_thread_starter); break; default: PRINT_INFO("UNRECOGNIZED LGW COMMAND\n"); @@ -1871,11 +1941,8 @@ lcs_stop_device(struct net_device *dev) LCS_DBF_TEXT(2, trace, "stopdev"); card = (struct lcs_card *) dev->priv; - netif_carrier_off(dev); - netif_tx_disable(dev); + netif_stop_queue(dev); dev->flags &= ~IFF_UP; - wait_event(card->write.wait_q, - (card->write.state != CH_STATE_RUNNING)); rc = lcs_stopcard(card); if (rc) PRINT_ERR("Try it again!\n "); @@ -1901,7 +1968,6 @@ lcs_open_device(struct net_device *dev) } else { dev->flags |= IFF_UP; - netif_carrier_on(dev); netif_wake_queue(dev); card->state = DEV_STATE_UP; } @@ -1993,31 +2059,10 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char DEVICE_ATTR(lancmd_timeout, 0644, lcs_timeout_show, lcs_timeout_store); -static ssize_t -lcs_dev_recover_store(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) -{ - struct lcs_card *card = dev->driver_data; - char *tmp; - int i; - - if (!card) - return -EINVAL; - if (card->state != DEV_STATE_UP) - return -EPERM; - i = simple_strtoul(buf, &tmp, 16); - if (i == 1) - lcs_schedule_recovery(card); - return count; -} - -static DEVICE_ATTR(recover, 0200, NULL, lcs_dev_recover_store); - static struct attribute * lcs_attrs[] = { &dev_attr_portno.attr, &dev_attr_type.attr, &dev_attr_lancmd_timeout.attr, - &dev_attr_recover.attr, NULL, }; @@ -2054,12 +2099,6 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev) ccwgdev->dev.driver_data = card; ccwgdev->cdev[0]->handler = lcs_irq; ccwgdev->cdev[1]->handler = lcs_irq; - card->gdev = ccwgdev; - INIT_WORK(&card->kernel_thread_starter, - (void *) lcs_start_kernel_thread, card); - card->thread_start_mask = 0; - card->thread_allowed_mask = 0; - card->thread_running_mask = 0; return 0; } @@ -2161,7 +2200,6 @@ lcs_new_device(struct ccwgroup_device *ccwgdev) if (recover_state == DEV_STATE_RECOVER) { lcs_set_multicast_list(card->dev); card->dev->flags |= IFF_UP; - netif_carrier_on(card->dev); netif_wake_queue(card->dev); card->state = DEV_STATE_UP; } else { @@ -2191,7 +2229,7 @@ lcs_new_device(struct ccwgroup_device *ccwgdev) * lcs_shutdown_device, called when setting the group device offline. */ static int -__lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode) +lcs_shutdown_device(struct ccwgroup_device *ccwgdev) { struct lcs_card *card; enum lcs_dev_states recover_state; @@ -2201,11 +2239,9 @@ __lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode) card = (struct lcs_card *)ccwgdev->dev.driver_data; if (!card) return -ENODEV; - if (recovery_mode == 0) { - lcs_set_allowed_threads(card, 0); - if (lcs_wait_for_threads(card, LCS_SET_MC_THREAD)) - return -ERESTARTSYS; - } + lcs_set_allowed_threads(card, 0); + if (lcs_wait_for_threads(card, LCS_SET_MC_THREAD)) + return -ERESTARTSYS; LCS_DBF_HEX(3, setup, &card, sizeof(void*)); recover_state = card->state; @@ -2220,43 +2256,6 @@ __lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode) return 0; } -static int -lcs_shutdown_device(struct ccwgroup_device *ccwgdev) -{ - return __lcs_shutdown_device(ccwgdev, 0); -} - -/** - * drive lcs recovery after startup and startlan initiated by Lan Gateway - */ -static int -lcs_recovery(void *ptr) -{ - struct lcs_card *card; - struct ccwgroup_device *gdev; - int rc; - - card = (struct lcs_card *) ptr; - daemonize("lcs_recover"); - - LCS_DBF_TEXT(4, trace, "recover1"); - if (!lcs_do_run_thread(card, LCS_RECOVERY_THREAD)) - return 0; - LCS_DBF_TEXT(4, trace, "recover2"); - gdev = card->gdev; - PRINT_WARN("Recovery of device %s started...\n", gdev->dev.bus_id); - rc = __lcs_shutdown_device(gdev, 1); - rc = lcs_new_device(gdev); - if (!rc) - PRINT_INFO("Device %s successfully recovered!\n", - card->dev->name); - else - PRINT_INFO("Device %s could not be recovered!\n", - card->dev->name); - lcs_clear_thread_running_bit(card, LCS_RECOVERY_THREAD); - return 0; -} - /** * lcs_remove_device, free buffers and card */ diff --git a/trunk/drivers/s390/net/lcs.h b/trunk/drivers/s390/net/lcs.h index 93143932983b..2fad5e40c2e4 100644 --- a/trunk/drivers/s390/net/lcs.h +++ b/trunk/drivers/s390/net/lcs.h @@ -73,17 +73,13 @@ do { \ /** * LCS sense byte definitions */ -#define LCS_SENSE_BYTE_0 0 -#define LCS_SENSE_BYTE_1 1 -#define LCS_SENSE_BYTE_2 2 -#define LCS_SENSE_BYTE_3 3 #define LCS_SENSE_INTERFACE_DISCONNECT 0x01 #define LCS_SENSE_EQUIPMENT_CHECK 0x10 #define LCS_SENSE_BUS_OUT_CHECK 0x20 #define LCS_SENSE_INTERVENTION_REQUIRED 0x40 #define LCS_SENSE_CMD_REJECT 0x80 -#define LCS_SENSE_RESETTING_EVENT 0x80 -#define LCS_SENSE_DEVICE_ONLINE 0x20 +#define LCS_SENSE_RESETTING_EVENT 0x0080 +#define LCS_SENSE_DEVICE_ONLINE 0x0020 /** * LCS packet type definitions @@ -156,9 +152,10 @@ enum lcs_dev_states { enum lcs_threads { LCS_SET_MC_THREAD = 1, - LCS_RECOVERY_THREAD = 2, + LCS_STARTLAN_THREAD = 2, + LCS_STOPLAN_THREAD = 4, + LCS_STARTUP_THREAD = 8, }; - /** * LCS struct declarations */ @@ -289,7 +286,6 @@ struct lcs_card { struct net_device_stats stats; unsigned short (*lan_type_trans)(struct sk_buff *skb, struct net_device *dev); - struct ccwgroup_device *gdev; struct lcs_channel read; struct lcs_channel write; struct lcs_buffer *tx_buffer; diff --git a/trunk/drivers/s390/net/netiucv.c b/trunk/drivers/s390/net/netiucv.c index b452cc1afd55..260a93c8c442 100644 --- a/trunk/drivers/s390/net/netiucv.c +++ b/trunk/drivers/s390/net/netiucv.c @@ -30,7 +30,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ - + #undef DEBUG #include @@ -65,7 +65,7 @@ MODULE_AUTHOR ("(C) 2001 IBM Corporation by Fritz Elfert (felfert@millenux.com)"); MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver"); - + #define PRINTK_HEADER " iucv: " /* for debugging */ static struct device_driver netiucv_driver = { @@ -202,7 +202,7 @@ netiucv_printname(char *name) *p = '\0'; return tmp; } - + /** * States of the interface statemachine. */ @@ -244,7 +244,7 @@ static const char *dev_event_names[] = { "Connection up", "Connection down", }; - + /** * Events of the connection statemachine */ @@ -364,7 +364,7 @@ static const char *conn_state_names[] = { "Connect error", }; - + /** * Debug Facility Stuff */ @@ -516,7 +516,7 @@ static void fsm_action_nop(fsm_instance *fi, int event, void *arg) { } - + /** * Actions of the connection statemachine *****************************************************************************/ @@ -993,7 +993,7 @@ static const fsm_node conn_fsm[] = { static const int CONN_FSM_LEN = sizeof(conn_fsm) / sizeof(fsm_node); - + /** * Actions for interface - statemachine. *****************************************************************************/ @@ -1182,7 +1182,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) { fsm_newstate(conn->fsm, CONN_STATE_TX); conn->prof.send_stamp = xtime; - + rc = iucv_send(conn->pathid, NULL, 0, 0, 1 /* single_flag */, 0, nskb->data, nskb->len); /* Shut up, gcc! nskb is always below 2G. */ @@ -1220,7 +1220,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) { return rc; } - + /** * Interface API for upper network layers *****************************************************************************/ @@ -1291,7 +1291,7 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev) /** * If connection is not running, try to restart it - * and throw away packet. + * and throw away packet. */ if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { fsm_event(privptr->fsm, DEV_EVENT_START, dev); @@ -1538,7 +1538,7 @@ static ssize_t maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - + IUCV_DBF_TEXT(trace, 4, __FUNCTION__); priv->conn->prof.maxcqueue = 0; return count; @@ -1559,7 +1559,7 @@ static ssize_t sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - + IUCV_DBF_TEXT(trace, 4, __FUNCTION__); priv->conn->prof.doios_single = 0; return count; @@ -1580,7 +1580,7 @@ static ssize_t mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - + IUCV_DBF_TEXT(trace, 5, __FUNCTION__); priv->conn->prof.doios_multi = 0; return count; @@ -1601,7 +1601,7 @@ static ssize_t txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - + IUCV_DBF_TEXT(trace, 4, __FUNCTION__); priv->conn->prof.txlen = 0; return count; @@ -1622,7 +1622,7 @@ static ssize_t txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct netiucv_priv *priv = dev->driver_data; - + IUCV_DBF_TEXT(trace, 4, __FUNCTION__); priv->conn->prof.tx_time = 0; return count; @@ -2000,7 +2000,7 @@ conn_write(struct device_driver *drv, const char *buf, size_t count) } PRINT_INFO("%s: '%s'\n", dev->name, netiucv_printname(username)); - + return count; out_free_ndev: @@ -2099,7 +2099,7 @@ static int __init netiucv_init(void) { int ret; - + ret = iucv_register_dbf_views(); if (ret) { PRINT_WARN("netiucv_init failed, " @@ -2128,7 +2128,7 @@ netiucv_init(void) } return ret; } - + module_init(netiucv_init); module_exit(netiucv_exit); MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/s390/net/qeth.h b/trunk/drivers/s390/net/qeth.h index 619f4a0c7160..4df0fcd7b10b 100644 --- a/trunk/drivers/s390/net/qeth.h +++ b/trunk/drivers/s390/net/qeth.h @@ -376,7 +376,7 @@ struct qeth_hdr_osn { __u8 reserved3[18]; __u32 ccid; } __attribute__ ((packed)); - + struct qeth_hdr { union { struct qeth_hdr_layer2 l2; @@ -825,7 +825,7 @@ struct qeth_card { int use_hard_stop; int (*orig_hard_header)(struct sk_buff *,struct net_device *, unsigned short,void *,void *,unsigned); - struct qeth_osn_info osn_info; + struct qeth_osn_info osn_info; }; struct qeth_card_list_struct { @@ -944,7 +944,7 @@ qeth_get_netdev_flags(struct qeth_card *card) return 0; switch (card->info.type) { case QETH_CARD_TYPE_IQD: - case QETH_CARD_TYPE_OSN: + case QETH_CARD_TYPE_OSN: return IFF_NOARP; #ifdef CONFIG_QETH_IPV6 default: @@ -981,7 +981,7 @@ static inline int qeth_get_max_mtu_for_card(int cardtype) { switch (cardtype) { - + case QETH_CARD_TYPE_UNKNOWN: case QETH_CARD_TYPE_OSAE: case QETH_CARD_TYPE_OSN: @@ -1097,9 +1097,9 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr) int count = 0, rc = 0; int in[4]; - rc = sscanf(buf, "%d.%d.%d.%d%n", + rc = sscanf(buf, "%d.%d.%d.%d%n", &in[0], &in[1], &in[2], &in[3], &count); - if (rc != 4 || count<=0) + if (rc != 4 || count) return -EINVAL; for (count = 0; count < 4; count++) { if (in[count] > 255) @@ -1131,7 +1131,7 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr) cnt = out = found = save_cnt = num2 = 0; end = start = (char *) buf; - in = (__u16 *) addr; + in = (__u16 *) addr; memset(in, 0, 16); while (end) { end = strchr(end,':'); @@ -1139,7 +1139,7 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr) end = (char *)buf + (strlen(buf)); out = 1; } - if ((end - start)) { + if ((end - start)) { memset(num, 0, 5); memcpy(num, start, end - start); if (!qeth_isxdigit(num)) @@ -1241,5 +1241,5 @@ qeth_osn_register(unsigned char *read_dev_no, extern void qeth_osn_deregister(struct net_device *); - + #endif /* __QETH_H__ */ diff --git a/trunk/drivers/s390/net/qeth_eddp.c b/trunk/drivers/s390/net/qeth_eddp.c index 0bab60a20309..44e226f211e7 100644 --- a/trunk/drivers/s390/net/qeth_eddp.c +++ b/trunk/drivers/s390/net/qeth_eddp.c @@ -81,7 +81,7 @@ void qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *buf) { struct qeth_eddp_context_reference *ref; - + QETH_DBF_TEXT(trace, 6, "eddprctx"); while (!list_empty(&buf->ctx_list)){ ref = list_entry(buf->ctx_list.next, @@ -135,7 +135,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue, "buffer!\n"); goto out; } - } + } /* check if the whole next skb fits into current buffer */ if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) - buf->next_element_to_fill) @@ -148,7 +148,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue, * and increment ctx's refcnt */ must_refcnt = 1; continue; - } + } if (must_refcnt){ must_refcnt = 0; if (qeth_eddp_buf_ref_context(buf, ctx)){ @@ -266,7 +266,7 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len, int left_in_frag; int copy_len; u8 *src; - + QETH_DBF_TEXT(trace, 5, "eddpcdtc"); if (skb_shinfo(eddp->skb)->nr_frags == 0) { memcpy(dst, eddp->skb->data + eddp->skb_offset, len); @@ -408,7 +408,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, struct tcphdr *tcph; int data_len; u32 hcsum; - + QETH_DBF_TEXT(trace, 5, "eddpftcp"); eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl; if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) { @@ -465,13 +465,13 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, eddp->th.tcp.h.seq += data_len; } } - + static inline int qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, struct sk_buff *skb, struct qeth_hdr *qhdr) { struct qeth_eddp_data *eddp = NULL; - + QETH_DBF_TEXT(trace, 5, "eddpficx"); /* create our segmentation headers and copy original headers */ if (skb->protocol == ETH_P_IP) @@ -512,7 +512,7 @@ qeth_eddp_calc_num_pages(struct qeth_eddp_context *ctx, struct sk_buff *skb, int hdr_len) { int skbs_per_page; - + QETH_DBF_TEXT(trace, 5, "eddpcanp"); /* can we put multiple skbs in one page? */ skbs_per_page = PAGE_SIZE / (skb_shinfo(skb)->tso_size + hdr_len); @@ -588,7 +588,7 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb, struct qeth_hdr *qhdr) { struct qeth_eddp_context *ctx = NULL; - + QETH_DBF_TEXT(trace, 5, "creddpct"); if (skb->protocol == ETH_P_IP) ctx = qeth_eddp_create_context_generic(card, skb, diff --git a/trunk/drivers/s390/net/qeth_fs.h b/trunk/drivers/s390/net/qeth_fs.h index 61faf05517d6..e422b41c656e 100644 --- a/trunk/drivers/s390/net/qeth_fs.h +++ b/trunk/drivers/s390/net/qeth_fs.h @@ -42,7 +42,7 @@ qeth_create_device_attributes_osn(struct device *dev); extern void qeth_remove_device_attributes_osn(struct device *dev); - + extern int qeth_create_driver_attributes(void); diff --git a/trunk/drivers/s390/net/qeth_main.c b/trunk/drivers/s390/net/qeth_main.c index 9e671a48cd2f..cb14642d97aa 100644 --- a/trunk/drivers/s390/net/qeth_main.c +++ b/trunk/drivers/s390/net/qeth_main.c @@ -513,7 +513,7 @@ __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode) QETH_DBF_TEXT(setup, 3, "setoffl"); QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); - + if (card->dev && netif_carrier_ok(card->dev)) netif_carrier_off(card->dev); recover_flag = card->state; @@ -604,13 +604,13 @@ __qeth_ref_ip_on_card(struct qeth_card *card, struct qeth_ipaddr *todo, list_for_each_entry(addr, &card->ip_list, entry) { if (card->options.layer2) { if ((addr->type == todo->type) && - (memcmp(&addr->mac, &todo->mac, + (memcmp(&addr->mac, &todo->mac, OSA_ADDR_LEN) == 0)) { found = 1; break; } continue; - } + } if ((addr->proto == QETH_PROT_IPV4) && (todo->proto == QETH_PROT_IPV4) && (addr->type == todo->type) && @@ -694,13 +694,13 @@ __qeth_insert_ip_todo(struct qeth_card *card, struct qeth_ipaddr *addr, int add) if (card->options.layer2) { if ((tmp->type == addr->type) && (tmp->is_multicast == addr->is_multicast) && - (memcmp(&tmp->mac, &addr->mac, + (memcmp(&tmp->mac, &addr->mac, OSA_ADDR_LEN) == 0)) { found = 1; break; } continue; - } + } if ((tmp->proto == QETH_PROT_IPV4) && (addr->proto == QETH_PROT_IPV4) && (tmp->type == addr->type) && @@ -1173,7 +1173,7 @@ qeth_determine_card_type(struct qeth_card *card) "due to hardware limitations!\n"); card->qdio.no_out_queues = 1; card->qdio.default_out_queue = 0; - } + } return 0; } i++; @@ -1198,7 +1198,7 @@ qeth_probe_device(struct ccwgroup_device *gdev) return -ENODEV; QETH_DBF_TEXT_(setup, 2, "%s", gdev->dev.bus_id); - + card = qeth_alloc_card(); if (!card) { put_device(dev); @@ -1220,7 +1220,7 @@ qeth_probe_device(struct ccwgroup_device *gdev) put_device(dev); qeth_free_card(card); return rc; - } + } if ((rc = qeth_setup_card(card))){ QETH_DBF_TEXT_(setup, 2, "2err%d", rc); put_device(dev); @@ -1843,7 +1843,7 @@ struct qeth_cmd_buffer *iob) &card->seqno.pdu_hdr_ack, QETH_SEQ_NO_LENGTH); QETH_DBF_HEX(control, 2, iob->data, QETH_DBF_CONTROL_LEN); } - + static int qeth_send_control_data(struct qeth_card *card, int len, struct qeth_cmd_buffer *iob, @@ -1937,7 +1937,7 @@ qeth_osn_send_control_data(struct qeth_card *card, int len, wake_up(&card->wait_q); } return rc; -} +} static inline void qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, @@ -1966,7 +1966,7 @@ qeth_osn_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, memcpy(QETH_IPA_PDU_LEN_PDU3(iob->data), &s2, 2); return qeth_osn_send_control_data(card, s1, iob); } - + static int qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, int (*reply_cb) @@ -2579,7 +2579,7 @@ qeth_process_inbound_buffer(struct qeth_card *card, skb->dev = card->dev; if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr); - else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) + else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) qeth_rebuild_skb(card, skb, hdr); else { /*in case of OSN*/ skb_push(skb, sizeof(struct qeth_hdr)); @@ -2763,7 +2763,7 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, index = i % QDIO_MAX_BUFFERS_PER_Q; buffer = &card->qdio.in_q->bufs[index]; if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && - qeth_check_qdio_errors(buffer->buffer, + qeth_check_qdio_errors(buffer->buffer, qdio_err, siga_err,"qinerr"))) qeth_process_inbound_buffer(card, buffer, index); /* clear buffer and give back to hardware */ @@ -3187,7 +3187,7 @@ qeth_alloc_qdio_buffers(struct qeth_card *card) if (card->qdio.state == QETH_QDIO_ALLOCATED) return 0; - card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), + card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), GFP_KERNEL|GFP_DMA); if (!card->qdio.in_q) return - ENOMEM; @@ -3476,7 +3476,7 @@ qeth_halt_channels(struct qeth_card *card) rc3 = qeth_halt_channel(&card->data); if (rc1) return rc1; - if (rc2) + if (rc2) return rc2; return rc3; } @@ -3491,7 +3491,7 @@ qeth_clear_channels(struct qeth_card *card) rc3 = qeth_clear_channel(&card->data); if (rc1) return rc1; - if (rc2) + if (rc2) return rc2; return rc3; } @@ -3798,10 +3798,10 @@ qeth_open(struct net_device *dev) QETH_DBF_TEXT(trace,4,"nomacadr"); return -EPERM; } - card->data.state = CH_STATE_UP; - card->state = CARD_STATE_UP; card->dev->flags |= IFF_UP; netif_start_queue(dev); + card->data.state = CH_STATE_UP; + card->state = CARD_STATE_UP; if (!card->lan_online && netif_carrier_ok(dev)) netif_carrier_off(dev); @@ -3817,7 +3817,7 @@ qeth_stop(struct net_device *dev) card = (struct qeth_card *) dev->priv; - netif_tx_disable(dev); + netif_stop_queue(dev); card->dev->flags &= ~IFF_UP; if (card->state == CARD_STATE_UP) card->state = CARD_STATE_SOFTSETUP; @@ -3958,7 +3958,7 @@ qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb, #endif *hdr = (struct qeth_hdr *) qeth_push_skb(card, skb, sizeof(struct qeth_hdr)); - if (*hdr == NULL) + if (hdr == NULL) return -EINVAL; return 0; } @@ -4098,7 +4098,7 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, } } else { /* passthrough */ if((skb->dev->type == ARPHRD_IEEE802_TR) && - !memcmp(skb->data + sizeof(struct qeth_hdr) + + !memcmp(skb->data + sizeof(struct qeth_hdr) + sizeof(__u16), skb->dev->broadcast, 6)) { hdr->hdr.l3.flags = QETH_CAST_BROADCAST | QETH_HDR_PASSTHRU; @@ -4385,7 +4385,7 @@ qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue, } static inline int -qeth_get_elements_no(struct qeth_card *card, void *hdr, +qeth_get_elements_no(struct qeth_card *card, void *hdr, struct sk_buff *skb, int elems) { int elements_needed = 0; @@ -4416,8 +4416,6 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; struct qeth_eddp_context *ctx = NULL; int tx_bytes = skb->len; - unsigned short nr_frags = skb_shinfo(skb)->nr_frags; - unsigned short tso_size = skb_shinfo(skb)->tso_size; int rc; QETH_DBF_TEXT(trace, 6, "sendpkt"); @@ -4443,7 +4441,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) return 0; } cast_type = qeth_get_cast_type(card, skb); - if ((cast_type == RTN_BROADCAST) && + if ((cast_type == RTN_BROADCAST) && (card->info.broadcast_capable == 0)){ card->stats.tx_dropped++; card->stats.tx_errors++; @@ -4465,7 +4463,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) card->stats.tx_errors++; dev_kfree_skb_any(skb); return NETDEV_TX_OK; - } + } elements_needed++; } else { if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))) { @@ -4500,16 +4498,16 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) card->stats.tx_packets++; card->stats.tx_bytes += tx_bytes; #ifdef CONFIG_QETH_PERF_STATS - if (tso_size && + if (skb_shinfo(skb)->tso_size && !(large_send == QETH_LARGE_SEND_NO)) { - card->perf_stats.large_send_bytes += tx_bytes; + card->perf_stats.large_send_bytes += skb->len; card->perf_stats.large_send_cnt++; } - if (nr_frags > 0){ + if (skb_shinfo(skb)->nr_frags > 0){ card->perf_stats.sg_skbs_sent++; /* nr_frags + skb->data */ card->perf_stats.sg_frags_sent += - nr_frags + 1; + skb_shinfo(skb)->nr_frags + 1; } #endif /* CONFIG_QETH_PERF_STATS */ } @@ -5375,7 +5373,7 @@ qeth_layer2_send_setdelvlan_cb(struct qeth_card *card, cmd = (struct qeth_ipa_cmd *) data; if (cmd->hdr.return_code) { PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. " - "Continuing\n",cmd->data.setdelvlan.vlan_id, + "Continuing\n",cmd->data.setdelvlan.vlan_id, QETH_CARD_IFNAME(card), cmd->hdr.return_code); QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command); QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card)); @@ -5395,7 +5393,7 @@ qeth_layer2_send_setdelvlan(struct qeth_card *card, __u16 i, iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); cmd->data.setdelvlan.vlan_id = i; - return qeth_send_ipa_cmd(card, iob, + return qeth_send_ipa_cmd(card, iob, qeth_layer2_send_setdelvlan_cb, NULL); } @@ -5459,7 +5457,7 @@ qeth_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) * Examine hardware response to SET_PROMISC_MODE */ static int -qeth_setadp_promisc_mode_cb(struct qeth_card *card, +qeth_setadp_promisc_mode_cb(struct qeth_card *card, struct qeth_reply *reply, unsigned long data) { @@ -5470,10 +5468,10 @@ qeth_setadp_promisc_mode_cb(struct qeth_card *card, cmd = (struct qeth_ipa_cmd *) data; setparms = &(cmd->data.setadapterparms); - + qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd); - if (cmd->hdr.return_code) { - QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code); + if (cmd->hdr.return_code) { + QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code); setparms->data.mode = SET_PROMISC_MODE_OFF; } card->info.promisc_mode = setparms->data.mode; @@ -5519,7 +5517,7 @@ qeth_set_multicast_list(struct net_device *dev) if (card->info.type == QETH_CARD_TYPE_OSN) return ; - + QETH_DBF_TEXT(trace, 3, "setmulti"); qeth_delete_mc_addresses(card); if (card->options.layer2) { @@ -5577,7 +5575,7 @@ qeth_osn_assist(struct net_device *dev, struct qeth_cmd_buffer *iob; struct qeth_card *card; int rc; - + QETH_DBF_TEXT(trace, 2, "osnsdmc"); if (!dev) return -ENODEV; @@ -5656,7 +5654,7 @@ qeth_osn_deregister(struct net_device * dev) card->osn_info.data_cb = NULL; return; } - + static void qeth_delete_mc_addresses(struct qeth_card *card) { @@ -5820,7 +5818,7 @@ qeth_add_multicast_ipv6(struct qeth_card *card) struct inet6_dev *in6_dev; QETH_DBF_TEXT(trace,4,"chkmcv6"); - if (!qeth_is_supported(card, IPA_IPV6)) + if (!qeth_is_supported(card, IPA_IPV6)) return ; in6_dev = in6_dev_get(card->dev); if (in6_dev == NULL) @@ -6361,9 +6359,12 @@ qeth_netdev_init(struct net_device *dev) dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid; dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid; #endif + dev->hard_header = card->orig_hard_header; if (qeth_get_netdev_flags(card) & IFF_NOARP) { dev->rebuild_header = NULL; dev->hard_header = NULL; + if (card->options.fake_ll) + dev->hard_header = qeth_fake_header; dev->header_cache_update = NULL; dev->hard_header_cache = NULL; } @@ -6372,9 +6373,6 @@ qeth_netdev_init(struct net_device *dev) if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) card->dev->dev_id = card->info.unique_id & 0xffff; #endif - if (card->options.fake_ll && - (qeth_get_netdev_flags(card) & IFF_NOARP)) - dev->hard_header = qeth_fake_header; dev->hard_header_parse = NULL; dev->set_mac_address = qeth_layer2_set_mac_address; dev->flags |= qeth_get_netdev_flags(card); @@ -6479,9 +6477,6 @@ qeth_hardsetup_card(struct qeth_card *card) /*network device will be recovered*/ if (card->dev) { card->dev->hard_header = card->orig_hard_header; - if (card->options.fake_ll && - (qeth_get_netdev_flags(card) & IFF_NOARP)) - card->dev->hard_header = qeth_fake_header; return 0; } /* at first set_online allocate netdev */ @@ -6589,7 +6584,7 @@ qeth_setadpparms_change_macaddr_cb(struct qeth_card *card, cmd = (struct qeth_ipa_cmd *) data; if (!card->options.layer2 || card->info.guestlan || - !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { + !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { memcpy(card->dev->dev_addr, &cmd->data.setadapterparms.data.change_addr.addr, OSA_ADDR_LEN); @@ -7036,12 +7031,14 @@ qeth_softsetup_ipv6(struct qeth_card *card) QETH_DBF_TEXT(trace,3,"softipv6"); + netif_stop_queue(card->dev); rc = qeth_send_startlan(card, QETH_PROT_IPV6); if (rc) { PRINT_ERR("IPv6 startlan failed on %s\n", QETH_CARD_IFNAME(card)); return rc; } + netif_wake_queue(card->dev); rc = qeth_query_ipassists(card,QETH_PROT_IPV6); if (rc) { PRINT_ERR("IPv6 query ipassist failed on %s\n", @@ -7355,8 +7352,7 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type) card->options.large_send = type; return 0; } - if (card->state == CARD_STATE_UP) - netif_tx_disable(card->dev); + netif_stop_queue(card->dev); card->options.large_send = type; switch (card->options.large_send) { case QETH_LARGE_SEND_EDDP: @@ -7378,8 +7374,7 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type) card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); break; } - if (card->state == CARD_STATE_UP) - netif_wake_queue(card->dev); + netif_wake_queue(card->dev); return rc; } @@ -7432,7 +7427,7 @@ qeth_softsetup_card(struct qeth_card *card) if ((rc = qeth_setrouting_v6(card))) QETH_DBF_TEXT_(setup, 2, "5err%d", rc); out: - netif_tx_disable(card->dev); + netif_stop_queue(card->dev); return 0; } @@ -7572,7 +7567,7 @@ qeth_stop_card(struct qeth_card *card, int recovery_mode) if (card->read.state == CH_STATE_UP && card->write.state == CH_STATE_UP && (card->state == CARD_STATE_UP)) { - if (recovery_mode && + if (recovery_mode && card->info.type != QETH_CARD_TYPE_OSN) { qeth_stop(card->dev); } else { @@ -7741,8 +7736,10 @@ static int qeth_register_netdev(struct qeth_card *card) { QETH_DBF_TEXT(setup, 3, "regnetd"); - if (card->dev->reg_state != NETREG_UNINITIALIZED) + if (card->dev->reg_state != NETREG_UNINITIALIZED) { + qeth_netdev_init(card->dev); return 0; + } /* sysfs magic */ SET_NETDEV_DEV(card->dev, &card->gdev->dev); return register_netdev(card->dev); @@ -7753,7 +7750,7 @@ qeth_start_again(struct qeth_card *card, int recovery_mode) { QETH_DBF_TEXT(setup ,2, "startag"); - if (recovery_mode && + if (recovery_mode && card->info.type != QETH_CARD_TYPE_OSN) { qeth_open(card->dev); } else { diff --git a/trunk/drivers/s390/net/qeth_mpc.h b/trunk/drivers/s390/net/qeth_mpc.h index 0477c47471c5..011c41041029 100644 --- a/trunk/drivers/s390/net/qeth_mpc.h +++ b/trunk/drivers/s390/net/qeth_mpc.h @@ -445,7 +445,7 @@ enum qeth_ipa_arp_return_codes { /* Helper functions */ #define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \ (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY)) - + /*****************************************************************************/ /* END OF IP Assist related definitions */ /*****************************************************************************/ @@ -490,7 +490,7 @@ extern unsigned char ULP_ENABLE[]; /* Layer 2 defintions */ #define QETH_PROT_LAYER2 0x08 #define QETH_PROT_TCPIP 0x03 -#define QETH_PROT_OSN2 0x0a +#define QETH_PROT_OSN2 0x0a #define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer+0x50) #define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer+0x19) diff --git a/trunk/drivers/s390/net/qeth_proc.c b/trunk/drivers/s390/net/qeth_proc.c index 66f2da14e6e3..360d782c7ada 100644 --- a/trunk/drivers/s390/net/qeth_proc.c +++ b/trunk/drivers/s390/net/qeth_proc.c @@ -36,7 +36,7 @@ qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) { struct device *dev = NULL; loff_t nr = 0; - + down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); if (*offset == 0) return SEQ_START_TOKEN; @@ -60,8 +60,8 @@ static void * qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) { struct device *prev, *next; - - if (it == SEQ_START_TOKEN) + + if (it == SEQ_START_TOKEN) prev = NULL; else prev = (struct device *) it; @@ -180,7 +180,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) struct device *device; struct qeth_card *card; - + if (it == SEQ_START_TOKEN) return 0; diff --git a/trunk/drivers/s390/net/qeth_sys.c b/trunk/drivers/s390/net/qeth_sys.c index 185a9cfbcbdc..882d419e4160 100644 --- a/trunk/drivers/s390/net/qeth_sys.c +++ b/trunk/drivers/s390/net/qeth_sys.c @@ -785,7 +785,7 @@ qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, con } if (card->options.large_send == type) return count; - if ((rc = qeth_set_large_send(card, type))) + if ((rc = qeth_set_large_send(card, type))) return rc; return count; } @@ -1682,7 +1682,7 @@ qeth_create_device_attributes(struct device *dev) if (card->info.type == QETH_CARD_TYPE_OSN) return sysfs_create_group(&dev->kobj, &qeth_osn_device_attr_group); - + if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group))) return ret; if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_ipato_group))){ @@ -1713,7 +1713,7 @@ qeth_remove_device_attributes(struct device *dev) if (card->info.type == QETH_CARD_TYPE_OSN) return sysfs_remove_group(&dev->kobj, &qeth_osn_device_attr_group); - + sysfs_remove_group(&dev->kobj, &qeth_device_attr_group); sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group); sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group); diff --git a/trunk/drivers/s390/net/qeth_tso.h b/trunk/drivers/s390/net/qeth_tso.h index 24ef40ca9562..1286ddea450b 100644 --- a/trunk/drivers/s390/net/qeth_tso.h +++ b/trunk/drivers/s390/net/qeth_tso.h @@ -117,11 +117,11 @@ __qeth_fill_buffer_frag(struct sk_buff *skb, struct qdio_buffer *buffer, int fragno; unsigned long addr; int element, cnt, dlen; - + fragno = skb_shinfo(skb)->nr_frags; element = *next_element_to_fill; dlen = 0; - + if (is_tso) buffer->element[element].flags = SBAL_FLAGS_MIDDLE_FRAG; diff --git a/trunk/drivers/scsi/libata-core.c b/trunk/drivers/scsi/libata-core.c index b046ffa22101..823dfa78c0ba 100644 --- a/trunk/drivers/scsi/libata-core.c +++ b/trunk/drivers/scsi/libata-core.c @@ -3643,8 +3643,6 @@ static void ata_pio_block(struct ata_port *ap) ata_pio_sector(qc); } - - ata_altstatus(ap); /* flush */ } static void ata_pio_error(struct ata_port *ap) @@ -3761,14 +3759,11 @@ static void atapi_packet_task(void *_data) spin_lock_irqsave(&ap->host_set->lock, flags); ap->flags &= ~ATA_FLAG_NOINTR; ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1); - ata_altstatus(ap); /* flush */ - if (qc->tf.protocol == ATA_PROT_ATAPI_DMA) ap->ops->bmdma_start(qc); /* initiate bmdma */ spin_unlock_irqrestore(&ap->host_set->lock, flags); } else { ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1); - ata_altstatus(ap); /* flush */ /* PIO commands are handled by polling */ ap->hsm_task_state = HSM_ST; @@ -4297,7 +4292,6 @@ static int ata_start_drive(struct ata_port *ap, struct ata_device *dev) int ata_device_resume(struct ata_port *ap, struct ata_device *dev) { if (ap->flags & ATA_FLAG_SUSPENDED) { - ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000); ap->flags &= ~ATA_FLAG_SUSPENDED; ata_set_mode(ap); } diff --git a/trunk/drivers/serial/cpm_uart/cpm_uart_core.c b/trunk/drivers/serial/cpm_uart/cpm_uart_core.c index 5cba59ad7dc5..969f94900431 100644 --- a/trunk/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/trunk/drivers/serial/cpm_uart/cpm_uart_core.c @@ -1164,16 +1164,14 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) struct fs_uart_platform_info *pdata; struct platform_device* pdev = early_uart_get_pdev(co->index); + port = + (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; + pinfo = (struct uart_cpm_port *)port; if (!pdev) { pr_info("cpm_uart: console: compat mode\n"); /* compatibility - will be cleaned up */ cpm_uart_init_portdesc(); - } - port = - (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; - pinfo = (struct uart_cpm_port *)port; - if (!pdev) { if (pinfo->set_lineif) pinfo->set_lineif(pinfo); } else { diff --git a/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c index cdba128250a9..4b2de08f46d0 100644 --- a/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c +++ b/trunk/drivers/serial/cpm_uart/cpm_uart_cpm2.c @@ -213,7 +213,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); if (is_con) { mem_addr = alloc_bootmem(memsz); - dma_addr = virt_to_bus(mem_addr); + dma_addr = mem_addr; } else mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, diff --git a/trunk/drivers/serial/sunsu.c b/trunk/drivers/serial/sunsu.c index 2b4f96541b8e..1c4396c2962d 100644 --- a/trunk/drivers/serial/sunsu.c +++ b/trunk/drivers/serial/sunsu.c @@ -1730,4 +1730,3 @@ static void __exit sunsu_exit(void) module_init(sunsu_probe); module_exit(sunsu_exit); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/spi/spi_s3c24xx.c b/trunk/drivers/spi/spi_s3c24xx.c index 5fc14563ee3a..9de4b5a04d70 100644 --- a/trunk/drivers/spi/spi_s3c24xx.c +++ b/trunk/drivers/spi/spi_s3c24xx.c @@ -405,7 +405,7 @@ static int s3c24xx_spi_remove(struct platform_device *dev) static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg) { - struct s3c24xx_spi *hw = platform_get_drvdata(pdev); + struct s3c24xx_spi *hw = platform_get_drvdata(dev); clk_disable(hw->clk); return 0; @@ -413,7 +413,7 @@ static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg) static int s3c24xx_spi_resume(struct platform_device *pdev) { - struct s3c24xx_spi *hw = platform_get_drvdata(pdev); + struct s3c24xx_spi *hw = platform_get_drvdata(dev); clk_enable(hw->clk); return 0; diff --git a/trunk/fs/affs/namei.c b/trunk/fs/affs/namei.c index a42143ca0169..d4c2d636c479 100644 --- a/trunk/fs/affs/namei.c +++ b/trunk/fs/affs/namei.c @@ -416,9 +416,10 @@ affs_rename(struct inode *old_dir, struct dentry *old_dentry, return retval; } + retval = -EIO; bh = affs_bread(sb, old_dentry->d_inode->i_ino); if (!bh) - return -EIO; + goto done; /* Remove header from its parent directory. */ affs_lock_dir(old_dir); diff --git a/trunk/fs/bio.c b/trunk/fs/bio.c index 098c12b2d60a..eb8fbc53f2cd 100644 --- a/trunk/fs/bio.c +++ b/trunk/fs/bio.c @@ -1116,9 +1116,6 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) bp->bio1.bi_io_vec = &bp->bv1; bp->bio2.bi_io_vec = &bp->bv2; - bp->bio1.bi_max_vecs = 1; - bp->bio2.bi_max_vecs = 1; - bp->bio1.bi_end_io = bio_pair_end_1; bp->bio2.bi_end_io = bio_pair_end_2; diff --git a/trunk/fs/cifs/CHANGES b/trunk/fs/cifs/CHANGES index 7271bb0257f6..1a27ecb46c9a 100644 --- a/trunk/fs/cifs/CHANGES +++ b/trunk/fs/cifs/CHANGES @@ -1,10 +1,3 @@ -Version 1.43 ------------- -POSIX locking to servers which support CIFS POSIX Extensions -(disabled by default controlled by proc/fs/cifs/Experimental). -Handle conversion of long share names (especially Asian languages) -to Unicode during mount. - Version 1.42 ------------ Fix slow oplock break when mounted to different servers at the same time and diff --git a/trunk/fs/cifs/cifsfs.h b/trunk/fs/cifs/cifsfs.h index c98755dca868..4e829dc672a6 100644 --- a/trunk/fs/cifs/cifsfs.h +++ b/trunk/fs/cifs/cifsfs.h @@ -99,5 +99,5 @@ extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t); extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); extern int cifs_ioctl (struct inode * inode, struct file * filep, unsigned int command, unsigned long arg); -#define CIFS_VERSION "1.43" +#define CIFS_VERSION "1.42" #endif /* _CIFSFS_H */ diff --git a/trunk/fs/cifs/cifsproto.h b/trunk/fs/cifs/cifsproto.h index 310ea2f0e0bf..2879ba343ca7 100644 --- a/trunk/fs/cifs/cifsproto.h +++ b/trunk/fs/cifs/cifsproto.h @@ -267,7 +267,7 @@ extern int CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, const int waitFlag); extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, const __u16 smb_file_id, const int get_flag, - const __u64 len, struct file_lock *, + const __u64 len, const __u64 offset, const __u16 lock_type, const int waitFlag); extern int CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon); extern int CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses); diff --git a/trunk/fs/cifs/cifssmb.c b/trunk/fs/cifs/cifssmb.c index 925881e00ff2..fd36892eda55 100644 --- a/trunk/fs/cifs/cifssmb.c +++ b/trunk/fs/cifs/cifssmb.c @@ -1355,8 +1355,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, const __u16 smb_file_id, const int get_flag, const __u64 len, - struct file_lock *pLockData, const __u16 lock_type, - const int waitFlag) + const __u64 lkoffset, const __u16 lock_type, const int waitFlag) { struct smb_com_transaction2_sfi_req *pSMB = NULL; struct smb_com_transaction2_sfi_rsp *pSMBr = NULL; @@ -1367,10 +1366,6 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, __u16 params, param_offset, offset, byte_count, count; cFYI(1, ("Posix Lock")); - - if(pLockData == NULL) - return EINVAL; - rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); if (rc) @@ -1409,10 +1404,10 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, parm_data->lock_type = cpu_to_le16(lock_type); if(waitFlag) - parm_data->lock_flags = cpu_to_le16(1); + parm_data->lock_flags = 1; parm_data->pid = cpu_to_le32(current->tgid); - parm_data->start = cpu_to_le64(pLockData->fl_start); - parm_data->length = cpu_to_le64(len); /* normalize negative numbers */ + parm_data->start = lkoffset; + parm_data->length = len; /* normalize negative numbers */ pSMB->DataOffset = cpu_to_le16(offset); pSMB->Fid = smb_file_id; @@ -1424,33 +1419,8 @@ CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, (struct smb_hdr *) pSMBr, &bytes_returned, 0); if (rc) { cFYI(1, ("Send error in Posix Lock = %d", rc)); - } else if (get_flag) { - /* lock structure can be returned on get */ - __u16 data_offset; - __u16 data_count; - rc = validate_t2((struct smb_t2_rsp *)pSMBr); - - if (rc || (pSMBr->ByteCount < sizeof(struct cifs_posix_lock))) { - rc = -EIO; /* bad smb */ - goto plk_err_exit; - } - if(pLockData == NULL) { - rc = -EINVAL; - goto plk_err_exit; - } - data_offset = le16_to_cpu(pSMBr->t2.DataOffset); - data_count = le16_to_cpu(pSMBr->t2.DataCount); - if(data_count < sizeof(struct cifs_posix_lock)) { - rc = -EIO; - goto plk_err_exit; - } - parm_data = (struct cifs_posix_lock *) - ((char *)&pSMBr->hdr.Protocol + data_offset); - if(parm_data->lock_type == cpu_to_le16(CIFS_UNLCK)) - pLockData->fl_type = F_UNLCK; } - -plk_err_exit: + if (pSMB) cifs_small_buf_release(pSMB); diff --git a/trunk/fs/cifs/connect.c b/trunk/fs/cifs/connect.c index bae1479318d1..d2ec806a4f32 100644 --- a/trunk/fs/cifs/connect.c +++ b/trunk/fs/cifs/connect.c @@ -2148,8 +2148,6 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, /* We look for obvious messed up bcc or strings in response so we do not go off the end since (at least) WIN2K and Windows XP have a major bug in not null terminating last Unicode string in response */ - if(ses->serverOS) - kfree(ses->serverOS); ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); if(ses->serverOS == NULL) goto sesssetup_nomem; @@ -2162,8 +2160,6 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, if (remaining_words > 0) { len = UniStrnlen((wchar_t *)bcc_ptr, remaining_words-1); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(2 * (len + 1),GFP_KERNEL); if(ses->serverNOS == NULL) goto sesssetup_nomem; @@ -2181,8 +2177,6 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, if (remaining_words > 0) { len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ - if(ses->serverDomain) - kfree(ses->serverDomain); ses->serverDomain = kzalloc(2*(len+1),GFP_KERNEL); if(ses->serverDomain == NULL) @@ -2193,22 +2187,15 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, ses->serverDomain[2*len] = 0; ses->serverDomain[1+(2*len)] = 0; } /* else no more room so create dummy domain string */ - else { - if(ses->serverDomain) - kfree(ses->serverDomain); + else ses->serverDomain = kzalloc(2, GFP_KERNEL); - } } else { /* no room so create dummy domain and NOS string */ /* if these kcallocs fail not much we can do, but better to not fail the sesssetup itself */ - if(ses->serverDomain) - kfree(ses->serverDomain); ses->serverDomain = kzalloc(2, GFP_KERNEL); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(2, GFP_KERNEL); } @@ -2217,8 +2204,6 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, if (((long) bcc_ptr + len) - (long) pByteArea(smb_buffer_response) <= BCC(smb_buffer_response)) { - if(ses->serverOS) - kfree(ses->serverOS); ses->serverOS = kzalloc(len + 1,GFP_KERNEL); if(ses->serverOS == NULL) goto sesssetup_nomem; @@ -2229,8 +2214,6 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, bcc_ptr++; len = strnlen(bcc_ptr, 1024); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(len + 1,GFP_KERNEL); if(ses->serverNOS == NULL) goto sesssetup_nomem; @@ -2240,8 +2223,6 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses, bcc_ptr++; len = strnlen(bcc_ptr, 1024); - if(ses->serverDomain) - kfree(ses->serverDomain); ses->serverDomain = kzalloc(len + 1,GFP_KERNEL); if(ses->serverDomain == NULL) goto sesssetup_nomem; @@ -2446,8 +2427,6 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, /* We look for obvious messed up bcc or strings in response so we do not go off the end since (at least) WIN2K and Windows XP have a major bug in not null terminating last Unicode string in response */ - if(ses->serverOS) - kfree(ses->serverOS); ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); cifs_strfromUCS_le(ses->serverOS, @@ -2462,8 +2441,6 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, len = UniStrnlen((wchar_t *)bcc_ptr, remaining_words - 1); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(2 * (len + 1), GFP_KERNEL); @@ -2477,9 +2454,7 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, remaining_words -= len + 1; if (remaining_words > 0) { len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); - /* last string not null terminated (e.g.Windows XP/2000) */ - if(ses->serverDomain) - kfree(ses->serverDomain); + /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ ses->serverDomain = kzalloc(2*(len+1),GFP_KERNEL); cifs_strfromUCS_le(ses->serverDomain, (__le16 *)bcc_ptr, @@ -2488,18 +2463,11 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, ses->serverDomain[2*len] = 0; ses->serverDomain[1+(2*len)] = 0; } /* else no more room so create dummy domain string */ - else { - if(ses->serverDomain) - kfree(ses->serverDomain); + else ses->serverDomain = kzalloc(2,GFP_KERNEL); - } - } else {/* no room use dummy domain&NOS */ - if(ses->serverDomain) - kfree(ses->serverDomain); + } else { /* no room so create dummy domain and NOS string */ ses->serverDomain = kzalloc(2, GFP_KERNEL); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(2, GFP_KERNEL); } } else { /* ASCII */ @@ -2508,8 +2476,6 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, if (((long) bcc_ptr + len) - (long) pByteArea(smb_buffer_response) <= BCC(smb_buffer_response)) { - if(ses->serverOS) - kfree(ses->serverOS); ses->serverOS = kzalloc(len + 1, GFP_KERNEL); strncpy(ses->serverOS, bcc_ptr, len); @@ -2518,8 +2484,6 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, bcc_ptr++; len = strnlen(bcc_ptr, 1024); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(len + 1,GFP_KERNEL); strncpy(ses->serverNOS, bcc_ptr, len); bcc_ptr += len; @@ -2527,8 +2491,6 @@ CIFSSpnegoSessSetup(unsigned int xid, struct cifsSesInfo *ses, bcc_ptr++; len = strnlen(bcc_ptr, 1024); - if(ses->serverDomain) - kfree(ses->serverDomain); ses->serverDomain = kzalloc(len + 1, GFP_KERNEL); strncpy(ses->serverDomain, bcc_ptr, len); bcc_ptr += len; @@ -2766,8 +2728,6 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, /* We look for obvious messed up bcc or strings in response so we do not go off the end since (at least) WIN2K and Windows XP have a major bug in not null terminating last Unicode string in response */ - if(ses->serverOS) - kfree(ses->serverOS); ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); cifs_strfromUCS_le(ses->serverOS, @@ -2783,8 +2743,6 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, bcc_ptr, remaining_words - 1); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(2 * (len + 1), GFP_KERNEL); @@ -2802,8 +2760,6 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, if (remaining_words > 0) { len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); /* last string is not always null terminated (for e.g. for Windows XP & 2000) */ - if(ses->serverDomain) - kfree(ses->serverDomain); ses->serverDomain = kzalloc(2 * (len + @@ -2821,20 +2777,13 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, [1 + (2 * len)] = 0; } /* else no more room so create dummy domain string */ - else { - if(ses->serverDomain) - kfree(ses->serverDomain); + else ses->serverDomain = kzalloc(2, GFP_KERNEL); - } } else { /* no room so create dummy domain and NOS string */ - if(ses->serverDomain); - kfree(ses->serverDomain); ses->serverDomain = kzalloc(2, GFP_KERNEL); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(2, GFP_KERNEL); } @@ -2843,8 +2792,6 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, if (((long) bcc_ptr + len) - (long) pByteArea(smb_buffer_response) <= BCC(smb_buffer_response)) { - if(ses->serverOS) - kfree(ses->serverOS); ses->serverOS = kzalloc(len + 1, GFP_KERNEL); @@ -2856,8 +2803,6 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, bcc_ptr++; len = strnlen(bcc_ptr, 1024); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(len + 1, GFP_KERNEL); @@ -2867,8 +2812,6 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, bcc_ptr++; len = strnlen(bcc_ptr, 1024); - if(ses->serverDomain) - kfree(ses->serverDomain); ses->serverDomain = kzalloc(len + 1, GFP_KERNEL); @@ -3173,8 +3116,6 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, /* We look for obvious messed up bcc or strings in response so we do not go off the end since (at least) WIN2K and Windows XP have a major bug in not null terminating last Unicode string in response */ - if(ses->serverOS) - kfree(ses->serverOS); ses->serverOS = kzalloc(2 * (len + 1), GFP_KERNEL); cifs_strfromUCS_le(ses->serverOS, @@ -3190,8 +3131,6 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, bcc_ptr, remaining_words - 1); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(2 * (len + 1), GFP_KERNEL); @@ -3208,8 +3147,6 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, if (remaining_words > 0) { len = UniStrnlen((wchar_t *) bcc_ptr, remaining_words); /* last string not always null terminated (e.g. for Windows XP & 2000) */ - if(ses->serverDomain) - kfree(ses->serverDomain); ses->serverDomain = kzalloc(2 * (len + @@ -3235,17 +3172,10 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, len)] = 0; } /* else no more room so create dummy domain string */ - else { - if(ses->serverDomain) - kfree(ses->serverDomain); + else ses->serverDomain = kzalloc(2,GFP_KERNEL); - } } else { /* no room so create dummy domain and NOS string */ - if(ses->serverDomain) - kfree(ses->serverDomain); ses->serverDomain = kzalloc(2, GFP_KERNEL); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(2, GFP_KERNEL); } } else { /* ASCII */ @@ -3253,8 +3183,6 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, if (((long) bcc_ptr + len) - (long) pByteArea(smb_buffer_response) <= BCC(smb_buffer_response)) { - if(ses->serverOS) - kfree(ses->serverOS); ses->serverOS = kzalloc(len + 1,GFP_KERNEL); strncpy(ses->serverOS,bcc_ptr, len); @@ -3263,8 +3191,6 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, bcc_ptr++; len = strnlen(bcc_ptr, 1024); - if(ses->serverNOS) - kfree(ses->serverNOS); ses->serverNOS = kzalloc(len+1,GFP_KERNEL); strncpy(ses->serverNOS, bcc_ptr, len); bcc_ptr += len; @@ -3272,8 +3198,6 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, bcc_ptr++; len = strnlen(bcc_ptr, 1024); - if(ses->serverDomain) - kfree(ses->serverDomain); ses->serverDomain = kzalloc(len+1,GFP_KERNEL); strncpy(ses->serverDomain, bcc_ptr, len); bcc_ptr += len; @@ -3358,8 +3282,7 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, bcc_ptr++; /* align */ } - if(ses->server->secMode & - (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) + if(ses->server->secMode & (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) smb_buffer->Flags2 |= SMBFLG2_SECURITY_SIGNATURE; if (ses->capabilities & CAP_STATUS32) { @@ -3371,10 +3294,8 @@ CIFSTCon(unsigned int xid, struct cifsSesInfo *ses, if (ses->capabilities & CAP_UNICODE) { smb_buffer->Flags2 |= SMBFLG2_UNICODE; length = - cifs_strtoUCS((__le16 *) bcc_ptr, tree, - 6 /* max utf8 char length in bytes */ * - (/* server len*/ + 256 /* share len */), nls_codepage); - bcc_ptr += 2 * length; /* convert num 16 bit words to bytes */ + cifs_strtoUCS((__le16 *) bcc_ptr, tree, 100, nls_codepage); + bcc_ptr += 2 * length; /* convert num of 16 bit words to bytes */ bcc_ptr += 2; /* skip trailing null */ } else { /* ASCII */ strcpy(bcc_ptr, tree); diff --git a/trunk/fs/cifs/file.c b/trunk/fs/cifs/file.c index e2b4ce1dad66..e152bf6afa60 100644 --- a/trunk/fs/cifs/file.c +++ b/trunk/fs/cifs/file.c @@ -84,8 +84,6 @@ static inline int cifs_get_disposition(unsigned int flags) return FILE_OVERWRITE_IF; else if ((flags & O_CREAT) == O_CREAT) return FILE_OPEN_IF; - else if ((flags & O_TRUNC) == O_TRUNC) - return FILE_OVERWRITE; else return FILE_OPEN; } @@ -658,7 +656,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock) else posix_lock_type = CIFS_WRLCK; rc = CIFSSMBPosixLock(xid, pTcon, netfid, 1 /* get */, - length, pfLock, + length, pfLock->fl_start, posix_lock_type, wait_flag); FreeXid(xid); return rc; @@ -706,7 +704,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock) return -EOPNOTSUPP; } rc = CIFSSMBPosixLock(xid, pTcon, netfid, 0 /* set */, - length, pfLock, + length, pfLock->fl_start, posix_lock_type, wait_flag); } else rc = CIFSSMBLock(xid, pTcon, netfid, length, pfLock->fl_start, @@ -906,10 +904,8 @@ static ssize_t cifs_write(struct file *file, const char *write_data, if (rc != 0) break; } - if(experimEnabled || (pTcon->ses->server && - ((pTcon->ses->server->secMode & - (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) - == 0))) { + if(experimEnabled || (pTcon->ses->server->secMode & + (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) { struct kvec iov[2]; unsigned int len; diff --git a/trunk/fs/jfs/jfs_metapage.c b/trunk/fs/jfs/jfs_metapage.c index 2b220dd6b4e7..f28696f235c4 100644 --- a/trunk/fs/jfs/jfs_metapage.c +++ b/trunk/fs/jfs/jfs_metapage.c @@ -542,7 +542,7 @@ static int metapage_readpage(struct file *fp, struct page *page) static int metapage_releasepage(struct page *page, gfp_t gfp_mask) { struct metapage *mp; - int ret = 1; + int busy = 0; unsigned int offset; for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) { @@ -552,20 +552,30 @@ static int metapage_releasepage(struct page *page, gfp_t gfp_mask) continue; jfs_info("metapage_releasepage: mp = 0x%p", mp); - if (mp->count || mp->nohomeok || - test_bit(META_dirty, &mp->flag)) { + if (mp->count || mp->nohomeok) { jfs_info("count = %ld, nohomeok = %d", mp->count, mp->nohomeok); - ret = 0; + busy = 1; continue; } + wait_on_page_writeback(page); + //WARN_ON(test_bit(META_dirty, &mp->flag)); + if (test_bit(META_dirty, &mp->flag)) { + dump_mem("dirty mp in metapage_releasepage", mp, + sizeof(struct metapage)); + dump_mem("page", page, sizeof(struct page)); + dump_stack(); + } if (mp->lsn) remove_from_logsync(mp); remove_metapage(page, mp); INCREMENT(mpStat.pagefree); free_metapage(mp); } - return ret; + if (busy) + return -1; + + return 0; } static void metapage_invalidatepage(struct page *page, unsigned long offset) diff --git a/trunk/fs/nfsd/export.c b/trunk/fs/nfsd/export.c index 3eec30000f3f..4e0578121d9a 100644 --- a/trunk/fs/nfsd/export.c +++ b/trunk/fs/nfsd/export.c @@ -1066,11 +1066,9 @@ exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp, rv = nfserr_perm; else if (IS_ERR(exp)) rv = nfserrno(PTR_ERR(exp)); - else { + else rv = fh_compose(fhp, exp, fsid_key->ek_dentry, NULL); - exp_put(exp); - } cache_put(&fsid_key->h, &svc_expkey_cache); return rv; } diff --git a/trunk/include/asm-alpha/termbits.h b/trunk/include/asm-alpha/termbits.h index 5541101b58ae..f4837fa29420 100644 --- a/trunk/include/asm-alpha/termbits.h +++ b/trunk/include/asm-alpha/termbits.h @@ -148,7 +148,6 @@ struct termios { #define HUPCL 00040000 #define CLOCAL 00100000 -#define CMSPAR 010000000000 /* mark or space (stick) parity */ #define CRTSCTS 020000000000 /* flow control */ /* c_lflag bits */ diff --git a/trunk/include/asm-powerpc/termbits.h b/trunk/include/asm-powerpc/termbits.h index 6d533b07aaf5..ebf6055481dc 100644 --- a/trunk/include/asm-powerpc/termbits.h +++ b/trunk/include/asm-powerpc/termbits.h @@ -153,7 +153,6 @@ struct termios { #define HUPCL 00040000 #define CLOCAL 00100000 -#define CMSPAR 010000000000 /* mark or space (stick) parity */ #define CRTSCTS 020000000000 /* flow control */ /* c_lflag bits */ diff --git a/trunk/include/asm-powerpc/unistd.h b/trunk/include/asm-powerpc/unistd.h index edde2462bf52..908acb44cb8a 100644 --- a/trunk/include/asm-powerpc/unistd.h +++ b/trunk/include/asm-powerpc/unistd.h @@ -321,10 +321,8 @@ #define __NR_readlinkat 296 #define __NR_fchmodat 297 #define __NR_faccessat 298 -#define __NR_get_robust_list 299 -#define __NR_set_robust_list 300 -#define __NR_syscalls 301 +#define __NR_syscalls 299 #ifdef __KERNEL__ #define __NR__exit __NR_exit diff --git a/trunk/include/asm-sparc/unistd.h b/trunk/include/asm-sparc/unistd.h index 45a576507785..f5611a721fbd 100644 --- a/trunk/include/asm-sparc/unistd.h +++ b/trunk/include/asm-sparc/unistd.h @@ -316,13 +316,11 @@ #define __NR_pselect6 297 #define __NR_ppoll 298 #define __NR_unshare 299 -#define __NR_set_robust_list 300 -#define __NR_get_robust_list 301 -/* WARNING: You MAY NOT add syscall numbers larger than 301, since +/* WARNING: You MAY NOT add syscall numbers larger than 299, since * all of the syscall tables in the Sparc kernel are - * sized to have 301 entries (starting at zero). Therefore - * find a free slot in the 0-301 range. + * sized to have 299 entries (starting at zero). Therefore + * find a free slot in the 0-299 range. */ #define _syscall0(type,name) \ diff --git a/trunk/include/asm-sparc64/dma-mapping.h b/trunk/include/asm-sparc64/dma-mapping.h index a8d39f23d43b..c7d5804ba76d 100644 --- a/trunk/include/asm-sparc64/dma-mapping.h +++ b/trunk/include/asm-sparc64/dma-mapping.h @@ -4,146 +4,7 @@ #include #ifdef CONFIG_PCI - -/* we implement the API below in terms of the existing PCI one, - * so include it */ -#include -/* need struct page definitions */ -#include - -static inline int -dma_supported(struct device *dev, u64 mask) -{ - BUG_ON(dev->bus != &pci_bus_type); - - return pci_dma_supported(to_pci_dev(dev), mask); -} - -static inline int -dma_set_mask(struct device *dev, u64 dma_mask) -{ - BUG_ON(dev->bus != &pci_bus_type); - - return pci_set_dma_mask(to_pci_dev(dev), dma_mask); -} - -static inline void * -dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, - gfp_t flag) -{ - BUG_ON(dev->bus != &pci_bus_type); - - return pci_iommu_ops->alloc_consistent(to_pci_dev(dev), size, dma_handle, flag); -} - -static inline void -dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, - dma_addr_t dma_handle) -{ - BUG_ON(dev->bus != &pci_bus_type); - - pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); -} - -static inline dma_addr_t -dma_map_single(struct device *dev, void *cpu_addr, size_t size, - enum dma_data_direction direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); -} - -static inline void -dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, - enum dma_data_direction direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); -} - -static inline dma_addr_t -dma_map_page(struct device *dev, struct page *page, - unsigned long offset, size_t size, - enum dma_data_direction direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); -} - -static inline void -dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, - enum dma_data_direction direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); -} - -static inline int -dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, - enum dma_data_direction direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); -} - -static inline void -dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, - enum dma_data_direction direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); -} - -static inline void -dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, - enum dma_data_direction direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle, - size, (int)direction); -} - -static inline void -dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, - enum dma_data_direction direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle, - size, (int)direction); -} - -static inline void -dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, - enum dma_data_direction direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction); -} - -static inline void -dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, - enum dma_data_direction direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction); -} - -static inline int -dma_mapping_error(dma_addr_t dma_addr) -{ - return pci_dma_mapping_error(dma_addr); -} - +#include #else struct device; diff --git a/trunk/include/asm-sparc64/pci.h b/trunk/include/asm-sparc64/pci.h index e1ea67bc32f2..7c5a589ea437 100644 --- a/trunk/include/asm-sparc64/pci.h +++ b/trunk/include/asm-sparc64/pci.h @@ -42,7 +42,7 @@ static inline void pcibios_penalize_isa_irq(int irq, int active) struct pci_dev; struct pci_iommu_ops { - void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *, gfp_t); + void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *); void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t); dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int); void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int); @@ -59,7 +59,7 @@ extern struct pci_iommu_ops *pci_iommu_ops; */ static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) { - return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle, GFP_ATOMIC); + return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle); } /* Free and unmap a consistent DMA buffer. diff --git a/trunk/include/asm-sparc64/unistd.h b/trunk/include/asm-sparc64/unistd.h index 998ef4ab0e06..68705748bec0 100644 --- a/trunk/include/asm-sparc64/unistd.h +++ b/trunk/include/asm-sparc64/unistd.h @@ -318,13 +318,11 @@ #define __NR_pselect6 297 #define __NR_ppoll 298 #define __NR_unshare 299 -#define __NR_set_robust_list 300 -#define __NR_get_robust_list 301 -/* WARNING: You MAY NOT add syscall numbers larger than 301, since +/* WARNING: You MAY NOT add syscall numbers larger than 299, since * all of the syscall tables in the Sparc kernel are - * sized to have 301 entries (starting at zero). Therefore - * find a free slot in the 0-301 range. + * sized to have 299 entries (starting at zero). Therefore + * find a free slot in the 0-299 range. */ #define _syscall0(type,name) \ diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index f813bc8266aa..3de2bfb2410f 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -213,10 +213,6 @@ extern int dir_notify_enable; #define FIBMAP _IO(0x00,1) /* bmap access */ #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ -#define SYNC_FILE_RANGE_WAIT_BEFORE 1 -#define SYNC_FILE_RANGE_WRITE 2 -#define SYNC_FILE_RANGE_WAIT_AFTER 4 - #ifdef __KERNEL__ #include @@ -762,6 +758,9 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); extern int fcntl_getlease(struct file *filp); /* fs/sync.c */ +#define SYNC_FILE_RANGE_WAIT_BEFORE 1 +#define SYNC_FILE_RANGE_WRITE 2 +#define SYNC_FILE_RANGE_WAIT_AFTER 4 extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte, unsigned int flags); diff --git a/trunk/include/linux/input.h b/trunk/include/linux/input.h index ce1a756c4c30..50e338d2ffda 100644 --- a/trunk/include/linux/input.h +++ b/trunk/include/linux/input.h @@ -345,8 +345,6 @@ struct input_absinfo { #define KEY_SAVE 234 #define KEY_DOCUMENTS 235 -#define KEY_BATTERY 236 - #define KEY_UNKNOWN 240 #define BTN_MISC 0x100 @@ -579,9 +577,14 @@ struct input_absinfo { * Switch events */ -#define SW_LID 0x00 /* set = lid shut */ -#define SW_TABLET_MODE 0x01 /* set = tablet mode */ -#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ +#define SW_0 0x00 +#define SW_1 0x01 +#define SW_2 0x02 +#define SW_3 0x03 +#define SW_4 0x04 +#define SW_5 0x05 +#define SW_6 0x06 +#define SW_7 0x07 #define SW_MAX 0x0f /* diff --git a/trunk/include/linux/syscalls.h b/trunk/include/linux/syscalls.h index 60d49e5456e7..3996960fc565 100644 --- a/trunk/include/linux/syscalls.h +++ b/trunk/include/linux/syscalls.h @@ -52,7 +52,6 @@ struct utimbuf; struct mq_attr; struct compat_stat; struct compat_timeval; -struct robust_list_head; #include #include @@ -582,10 +581,5 @@ asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, unsigned int flags); -asmlinkage long sys_get_robust_list(int pid, - struct robust_list_head __user **head_ptr, - size_t __user *len_ptr); -asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, - size_t len); #endif diff --git a/trunk/include/linux/videodev2.h b/trunk/include/linux/videodev2.h index ad7fa9c86c10..d7670ec1ec1e 100644 --- a/trunk/include/linux/videodev2.h +++ b/trunk/include/linux/videodev2.h @@ -1141,13 +1141,8 @@ extern char *v4l2_type_names[]; /* Compatibility layer interface -- v4l1-compat module */ typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, unsigned int cmd, void *arg); - -#ifdef CONFIG_VIDEO_V4L1_COMPAT int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, int cmd, void *arg, v4l2_kioctl driver_ioctl); -#else -#define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL -#endif /* 32 Bits compatibility layer for 64 bits processors */ extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, diff --git a/trunk/include/net/irda/irlmp.h b/trunk/include/net/irda/irlmp.h index c0c895d379ba..86aefb1fda5e 100644 --- a/trunk/include/net/irda/irlmp.h +++ b/trunk/include/net/irda/irlmp.h @@ -112,7 +112,7 @@ struct lsap_cb { struct timer_list watchdog_timer; - LSAP_STATE lsap_state; /* Connection state */ + IRLMP_STATE lsap_state; /* Connection state */ notify_t notify; /* Indication/Confirm entry points */ struct qos_info qos; /* QoS for this connection */ diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index c13f1bd2df7d..4c64f85698ae 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -664,6 +664,48 @@ static int effective_prio(task_t *p) return prio; } +/* + * We place interactive tasks back into the active array, if possible. + * + * To guarantee that this does not starve expired tasks we ignore the + * interactivity of a task if the first expired task had to wait more + * than a 'reasonable' amount of time. This deadline timeout is + * load-dependent, as the frequency of array switched decreases with + * increasing number of running tasks. We also ignore the interactivity + * if a better static_prio task has expired, and switch periodically + * regardless, to ensure that highly interactive tasks do not starve + * the less fortunate for unreasonably long periods. + */ +static inline int expired_starving(runqueue_t *rq) +{ + int limit; + + /* + * Arrays were recently switched, all is well + */ + if (!rq->expired_timestamp) + return 0; + + limit = STARVATION_LIMIT * rq->nr_running; + + /* + * It's time to switch arrays + */ + if (jiffies - rq->expired_timestamp >= limit) + return 1; + + /* + * There's a better selection in the expired array + */ + if (rq->curr->static_prio > rq->best_expired_prio) + return 1; + + /* + * All is well + */ + return 0; +} + /* * __activate_task - move a task to the runqueue. */ @@ -671,7 +713,7 @@ static void __activate_task(task_t *p, runqueue_t *rq) { prio_array_t *target = rq->active; - if (batch_task(p)) + if (unlikely(batch_task(p) || (expired_starving(rq) && !rt_task(p)))) target = rq->expired; enqueue_task(p, target); rq->nr_running++; @@ -2489,22 +2531,6 @@ unsigned long long current_sched_time(const task_t *tsk) return ns; } -/* - * We place interactive tasks back into the active array, if possible. - * - * To guarantee that this does not starve expired tasks we ignore the - * interactivity of a task if the first expired task had to wait more - * than a 'reasonable' amount of time. This deadline timeout is - * load-dependent, as the frequency of array switched decreases with - * increasing number of running tasks. We also ignore the interactivity - * if a better static_prio task has expired: - */ -#define EXPIRED_STARVING(rq) \ - ((STARVATION_LIMIT && ((rq)->expired_timestamp && \ - (jiffies - (rq)->expired_timestamp >= \ - STARVATION_LIMIT * ((rq)->nr_running) + 1))) || \ - ((rq)->curr->static_prio > (rq)->best_expired_prio)) - /* * Account user cpu time to a process. * @p: the process that the cpu time gets accounted to @@ -2640,7 +2666,7 @@ void scheduler_tick(void) if (!rq->expired_timestamp) rq->expired_timestamp = jiffies; - if (!TASK_INTERACTIVE(p) || EXPIRED_STARVING(rq)) { + if (!TASK_INTERACTIVE(p) || expired_starving(rq)) { enqueue_task(p, rq->expired); if (p->static_prio < rq->best_expired_prio) rq->best_expired_prio = p->static_prio; diff --git a/trunk/net/bridge/br.c b/trunk/net/bridge/br.c index 12da21afb9ca..22d806cf40ca 100644 --- a/trunk/net/bridge/br.c +++ b/trunk/net/bridge/br.c @@ -55,7 +55,7 @@ static int __init br_init(void) static void __exit br_deinit(void) { - rcu_assign_pointer(br_stp_sap->rcv_func, NULL); + llc_sap_close(br_stp_sap); #ifdef CONFIG_BRIDGE_NETFILTER br_netfilter_fini(); @@ -67,7 +67,6 @@ static void __exit br_deinit(void) synchronize_net(); - llc_sap_put(br_stp_sap); br_fdb_get_hook = NULL; br_fdb_put_hook = NULL; diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 4fba549caf29..2dce673a039b 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -127,7 +127,7 @@ * sure which should go first, but I bet it won't make much * difference if we are running VLANs. The good news is that * this protocol won't be in the list unless compiled in, so - * the average user (w/out VLANs) will not be adversely affected. + * the average user (w/out VLANs) will not be adversly affected. * --BLG * * 0800 IP @@ -149,7 +149,7 @@ static struct list_head ptype_base[16]; /* 16 way hashed list */ static struct list_head ptype_all; /* Taps */ /* - * The @dev_base list is protected by @dev_base_lock and the rtnl + * The @dev_base list is protected by @dev_base_lock and the rtln * semaphore. * * Pure readers hold dev_base_lock for reading. @@ -641,12 +641,10 @@ int dev_valid_name(const char *name) * @name: name format string * * Passed a format string - eg "lt%d" it will try and find a suitable - * id. It scans list of devices to build up a free map, then chooses - * the first empty slot. The caller must hold the dev_base or rtnl lock - * while allocating the name and adding the device in order to avoid - * duplicates. - * Limited to bits_per_byte * page size devices (ie 32K on most platforms). - * Returns the number of the unit assigned or a negative errno code. + * id. Not efficient for many devices, not called a lot. The caller + * must hold the dev_base or rtnl lock while allocating the name and + * adding the device in order to avoid duplicates. Returns the number + * of the unit assigned or a negative errno code. */ int dev_alloc_name(struct net_device *dev, const char *name) @@ -746,7 +744,7 @@ int dev_change_name(struct net_device *dev, char *newname) } /** - * netdev_features_change - device changes features + * netdev_features_change - device changes fatures * @dev: device to cause notification * * Called to indicate a device has changed features. @@ -2198,7 +2196,7 @@ int netdev_set_master(struct net_device *slave, struct net_device *master) * @dev: device * @inc: modifier * - * Add or remove promiscuity from a device. While the count in the device + * Add or remove promsicuity from a device. While the count in the device * remains above zero the interface remains promiscuous. Once it hits zero * the device reverts back to normal filtering operation. A negative inc * value is used to drop promiscuity on the device. @@ -3124,7 +3122,7 @@ EXPORT_SYMBOL(alloc_netdev); void free_netdev(struct net_device *dev) { #ifdef CONFIG_SYSFS - /* Compatibility with error handling in drivers */ + /* Compatiablity with error handling in drivers */ if (dev->reg_state == NETREG_UNINITIALIZED) { kfree((char *)dev - dev->padded); return; diff --git a/trunk/net/ipv4/ipcomp.c b/trunk/net/ipv4/ipcomp.c index 95278b22b669..cd810f41af1a 100644 --- a/trunk/net/ipv4/ipcomp.c +++ b/trunk/net/ipv4/ipcomp.c @@ -210,7 +210,7 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info) skb->h.icmph->code != ICMP_FRAG_NEEDED) return; - spi = htonl(ntohs(ipch->cpi)); + spi = ntohl(ntohs(ipch->cpi)); x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET); if (!x) diff --git a/trunk/net/ipv4/netfilter/Kconfig b/trunk/net/ipv4/netfilter/Kconfig index d4072533da21..3d560dec63ab 100644 --- a/trunk/net/ipv4/netfilter/Kconfig +++ b/trunk/net/ipv4/netfilter/Kconfig @@ -170,8 +170,8 @@ config IP_NF_PPTP Documentation/modules.txt. If unsure, say `N'. config IP_NF_H323 - tristate 'H.323 protocol support (EXPERIMENTAL)' - depends on IP_NF_CONNTRACK && EXPERIMENTAL + tristate 'H.323 protocol support' + depends on IP_NF_CONNTRACK help H.323 is a VoIP signalling protocol from ITU-T. As one of the most important VoIP protocols, it is widely used by voice hardware and diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_core.c b/trunk/net/ipv4/netfilter/ip_conntrack_core.c index a297da7bbef5..979a2eac6f00 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_core.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_core.c @@ -1318,7 +1318,6 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len) .tuple.dst.u.tcp.port; sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL] .tuple.dst.ip; - memset(sin.sin_zero, 0, sizeof(sin.sin_zero)); DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n", NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c b/trunk/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c index 26dfecadb335..355a53a5b6cd 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c @@ -528,15 +528,14 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level) /* Decode */ if ((err = (Decoders[son->type]) (bs, son, base, - level + 1)) < - H323_ERROR_NONE) + level + 1)) > + H323_ERROR_STOP) return err; bs->cur = beg + len; bs->bit = 0; } else if ((err = (Decoders[son->type]) (bs, son, base, - level + 1)) < - H323_ERROR_NONE) + level + 1))) return err; } @@ -555,7 +554,7 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level) /* Decode the extension components */ for (opt = 0; opt < bmp2_len; opt++, i++, son++) { - if (i < f->ub && son->attr & STOP) { + if (son->attr & STOP) { PRINT("%*.s%s\n", (level + 1) * TAB_SIZE, " ", son->name); return H323_ERROR_STOP; @@ -585,8 +584,8 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level) beg = bs->cur; if ((err = (Decoders[son->type]) (bs, son, base, - level + 1)) < - H323_ERROR_NONE) + level + 1)) > + H323_ERROR_STOP) return err; bs->cur = beg + len; @@ -661,20 +660,18 @@ int decode_seqof(bitstr_t * bs, field_t * f, char *base, int level) i < effective_count ? base : NULL, - level + 1)) < - H323_ERROR_NONE) + level + 1)) > + H323_ERROR_STOP) return err; bs->cur = beg + len; bs->bit = 0; } else - if ((err = (Decoders[son->type]) (bs, son, - i < - effective_count ? - base : NULL, - level + 1)) < - H323_ERROR_NONE) - return err; + if ((err = (Decoders[son->type]) (bs, son, + i < effective_count ? + base : NULL, + level + 1))) + return err; if (base) base += son->offset; @@ -738,14 +735,13 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level) } beg = bs->cur; - if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) < - H323_ERROR_NONE) + if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) > + H323_ERROR_STOP) return err; bs->cur = beg + len; bs->bit = 0; - } else if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) < - H323_ERROR_NONE) + } else if ((err = (Decoders[son->type]) (bs, son, base, level + 1))) return err; return H323_ERROR_NONE; diff --git a/trunk/net/ipv4/netfilter/ip_conntrack_helper_pptp.c b/trunk/net/ipv4/netfilter/ip_conntrack_helper_pptp.c index 8ccfe17bb253..7d3ba4302e9e 100644 --- a/trunk/net/ipv4/netfilter/ip_conntrack_helper_pptp.c +++ b/trunk/net/ipv4/netfilter/ip_conntrack_helper_pptp.c @@ -469,8 +469,8 @@ pptp_inbound_pkt(struct sk_buff **pskb, DEBUGP("%s but no session\n", pptp_msg_name[msg]); break; } - if (info->cstate != PPTP_CALL_IN_REP - && info->cstate != PPTP_CALL_IN_CONF) { + if (info->sstate != PPTP_CALL_IN_REP + && info->sstate != PPTP_CALL_IN_CONF) { DEBUGP("%s but never sent IN_CALL_REPLY\n", pptp_msg_name[msg]); break; diff --git a/trunk/net/ipv4/netfilter/ip_nat_snmp_basic.c b/trunk/net/ipv4/netfilter/ip_nat_snmp_basic.c index c33244263b90..c62253845538 100644 --- a/trunk/net/ipv4/netfilter/ip_nat_snmp_basic.c +++ b/trunk/net/ipv4/netfilter/ip_nat_snmp_basic.c @@ -768,7 +768,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, len *= sizeof(unsigned long); *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); if (*obj == NULL) { - kfree(lp); kfree(id); if (net_ratelimit()) printk("OOM in bsalg (%d)\n", __LINE__); @@ -1004,12 +1003,12 @@ static unsigned char snmp_trap_decode(struct asn1_ctx *ctx, return 1; -err_addr_free: - kfree((unsigned long *)trap->ip_address); - err_id_free: kfree(trap->id); +err_addr_free: + kfree((unsigned long *)trap->ip_address); + return 0; } @@ -1127,10 +1126,11 @@ static int snmp_parse_mangle(unsigned char *msg, struct snmp_v1_trap trap; unsigned char ret = snmp_trap_decode(&ctx, &trap, map, check); - if (ret) { - kfree(trap.id); - kfree((unsigned long *)trap.ip_address); - } else + /* Discard trap allocations regardless */ + kfree(trap.id); + kfree((unsigned long *)trap.ip_address); + + if (!ret) return ret; } else { diff --git a/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c index 77d974443c7b..5bc9f64d7b5b 100644 --- a/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +++ b/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c @@ -348,7 +348,6 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len) .tuple.dst.u.tcp.port; sin.sin_addr.s_addr = ct->tuplehash[IP_CT_DIR_ORIGINAL] .tuple.dst.u3.ip; - memset(sin.sin_zero, 0, sizeof(sin.sin_zero)); DEBUGP("SO_ORIGINAL_DST: %u.%u.%u.%u %u\n", NIPQUAD(sin.sin_addr.s_addr), ntohs(sin.sin_port)); diff --git a/trunk/net/ipv4/xfrm4_policy.c b/trunk/net/ipv4/xfrm4_policy.c index 8604c747bca5..f285bbf296e2 100644 --- a/trunk/net/ipv4/xfrm4_policy.c +++ b/trunk/net/ipv4/xfrm4_policy.c @@ -221,7 +221,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) if (pskb_may_pull(skb, xprth + 4 - skb->data)) { u16 *ipcomp_hdr = (u16 *)xprth; - fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1])); + fl->fl_ipsec_spi = ntohl(ntohs(ipcomp_hdr[1])); } break; default: diff --git a/trunk/net/ipv6/ipcomp6.c b/trunk/net/ipv6/ipcomp6.c index 48636436028a..05eb67def39f 100644 --- a/trunk/net/ipv6/ipcomp6.c +++ b/trunk/net/ipv6/ipcomp6.c @@ -208,7 +208,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG) return; - spi = htonl(ntohs(ipcomph->cpi)); + spi = ntohl(ntohs(ipcomph->cpi)); x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6); if (!x) return; diff --git a/trunk/net/ipv6/route.c b/trunk/net/ipv6/route.c index 8a777932786d..0190e39096b9 100644 --- a/trunk/net/ipv6/route.c +++ b/trunk/net/ipv6/route.c @@ -280,13 +280,10 @@ static int inline rt6_check_neigh(struct rt6_info *rt) { struct neighbour *neigh = rt->rt6i_nexthop; int m = 0; - if (rt->rt6i_flags & RTF_NONEXTHOP || - !(rt->rt6i_flags & RTF_GATEWAY)) - m = 1; - else if (neigh) { + if (neigh) { read_lock_bh(&neigh->lock); if (neigh->nud_state & NUD_VALID) - m = 2; + m = 1; read_unlock_bh(&neigh->lock); } return m; @@ -295,18 +292,15 @@ static int inline rt6_check_neigh(struct rt6_info *rt) static int rt6_score_route(struct rt6_info *rt, int oif, int strict) { - int m, n; - - m = rt6_check_dev(rt, oif); + int m = rt6_check_dev(rt, oif); if (!m && (strict & RT6_SELECT_F_IFACE)) return -1; #ifdef CONFIG_IPV6_ROUTER_PREF m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2; #endif - n = rt6_check_neigh(rt); - if (n > 1) + if (rt6_check_neigh(rt)) m |= 16; - else if (!n && strict & RT6_SELECT_F_REACHABLE) + else if (strict & RT6_SELECT_F_REACHABLE) return -1; return m; } diff --git a/trunk/net/irda/iriap.c b/trunk/net/irda/iriap.c index 2d2e2b1919f4..254f90746900 100644 --- a/trunk/net/irda/iriap.c +++ b/trunk/net/irda/iriap.c @@ -544,8 +544,7 @@ static void iriap_getvaluebyclass_response(struct iriap_cb *self, { struct sk_buff *tx_skb; int n; - __u32 tmp_be32; - __be16 tmp_be16; + __u32 tmp_be32, tmp_be16; __u8 *fp; IRDA_DEBUG(4, "%s()\n", __FUNCTION__); diff --git a/trunk/net/sunrpc/cache.c b/trunk/net/sunrpc/cache.c index 7026b0866b7b..3ac4193a78ed 100644 --- a/trunk/net/sunrpc/cache.c +++ b/trunk/net/sunrpc/cache.c @@ -159,7 +159,6 @@ struct cache_head *sunrpc_cache_update(struct cache_detail *detail, detail->update(tmp, new); tmp->next = *head; *head = tmp; - detail->entries++; cache_get(tmp); is_new = cache_fresh_locked(tmp, new->expiry_time); cache_fresh_locked(old, 0); diff --git a/trunk/net/xfrm/xfrm_input.c b/trunk/net/xfrm/xfrm_input.c index 891a6090cc09..b54971059f16 100644 --- a/trunk/net/xfrm/xfrm_input.c +++ b/trunk/net/xfrm/xfrm_input.c @@ -62,7 +62,7 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq) case IPPROTO_COMP: if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) return -EINVAL; - *spi = htonl(ntohs(*(u16*)(skb->h.raw + 2))); + *spi = ntohl(ntohs(*(u16*)(skb->h.raw + 2))); *seq = 0; return 0; default: