From c04115162dcf551d15626266e272fabfbdef98e0 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 28 Sep 2006 01:45:21 +0100 Subject: [PATCH] --- yaml --- r: 48155 b: refs/heads/master c: f65e4fa8e0c6022ad58dc88d1b11b12589ed7f9f h: refs/heads/master i: 48153: 66c1ab6b08dc4b1c5162de8d98b97e5844a1b042 48151: abb3cf004d61007946ba63f30981bfe831c7adf9 v: v3 --- [refs] | 2 +- trunk/Documentation/drivers/edac/edac.txt | 16 +- trunk/Documentation/fb/s3fb.txt | 78 - trunk/Documentation/filesystems/ufs.txt | 9 +- trunk/Documentation/gpio.txt | 271 -- trunk/Documentation/isdn/README.gigaset | 65 +- trunk/Documentation/kdump/kdump.txt | 8 +- trunk/Documentation/nfsroot.txt | 4 +- trunk/Documentation/spi/spi-summary | 3 +- trunk/MAINTAINERS | 6 +- trunk/Makefile | 2 +- trunk/arch/alpha/kernel/setup.c | 6 +- trunk/arch/arm/common/rtctime.c | 2 +- trunk/arch/arm/kernel/setup.c | 6 +- trunk/arch/arm/mach-at91rm9200/clock.c | 2 +- trunk/arch/arm/mach-at91rm9200/gpio.c | 48 - trunk/arch/arm26/kernel/setup.c | 6 +- trunk/arch/avr32/kernel/setup.c | 6 +- trunk/arch/avr32/mm/tlb.c | 2 +- trunk/arch/cris/arch-v10/drivers/ds1302.c | 2 +- trunk/arch/cris/arch-v10/drivers/eeprom.c | 2 +- trunk/arch/cris/arch-v10/drivers/gpio.c | 2 +- trunk/arch/cris/arch-v10/drivers/i2c.c | 2 +- trunk/arch/cris/arch-v10/drivers/pcf8563.c | 2 +- trunk/arch/cris/arch-v32/drivers/cryptocop.c | 2 +- trunk/arch/cris/arch-v32/drivers/gpio.c | 2 +- trunk/arch/cris/arch-v32/drivers/i2c.c | 2 +- trunk/arch/cris/arch-v32/drivers/pcf8563.c | 2 +- .../arch/cris/arch-v32/drivers/sync_serial.c | 2 +- trunk/arch/cris/kernel/profile.c | 2 +- trunk/arch/cris/kernel/setup.c | 6 +- trunk/arch/frv/kernel/setup.c | 6 +- trunk/arch/h8300/kernel/setup.c | 6 +- trunk/arch/i386/kernel/apm.c | 2 +- trunk/arch/i386/kernel/cpu/mtrr/if.c | 2 +- trunk/arch/i386/kernel/cpuid.c | 2 +- trunk/arch/i386/kernel/head.S | 2 +- trunk/arch/i386/kernel/microcode.c | 2 +- trunk/arch/i386/kernel/msr.c | 2 +- trunk/arch/i386/kernel/setup.c | 4 +- trunk/arch/ia64/hp/common/sba_iommu.c | 2 +- trunk/arch/ia64/kernel/efi.c | 3 +- trunk/arch/ia64/kernel/perfmon.c | 6 +- trunk/arch/ia64/kernel/sal.c | 3 +- trunk/arch/ia64/kernel/salinfo.c | 4 +- trunk/arch/ia64/kernel/setup.c | 4 +- trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c | 2 +- trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c | 2 +- trunk/arch/m32r/kernel/setup.c | 6 +- trunk/arch/m68k/bvme6000/rtc.c | 2 +- trunk/arch/m68k/kernel/setup.c | 2 +- trunk/arch/m68k/mvme16x/rtc.c | 2 +- trunk/arch/m68knommu/kernel/setup.c | 6 +- trunk/arch/mips/kernel/rtlx.c | 2 +- trunk/arch/mips/kernel/setup.c | 2 +- trunk/arch/mips/kernel/vpe.c | 2 +- .../arch/mips/sibyte/sb1250/bcm1250_tbprof.c | 2 +- trunk/arch/parisc/kernel/perf.c | 2 +- trunk/arch/parisc/kernel/setup.c | 8 +- trunk/arch/parisc/mm/init.c | 3 +- trunk/arch/powerpc/configs/ps3_defconfig | 29 +- trunk/arch/powerpc/kernel/legacy_serial.c | 2 +- trunk/arch/powerpc/kernel/lparcfg.c | 2 +- trunk/arch/powerpc/kernel/nvram_64.c | 2 +- trunk/arch/powerpc/kernel/proc_ppc64.c | 2 +- trunk/arch/powerpc/kernel/prom.c | 2 +- trunk/arch/powerpc/kernel/rtas-proc.c | 14 +- trunk/arch/powerpc/kernel/rtas_flash.c | 8 +- trunk/arch/powerpc/kernel/udbg.c | 2 +- .../arch/powerpc/platforms/cell/spufs/file.c | 40 +- .../arch/powerpc/platforms/cell/spufs/inode.c | 6 +- .../arch/powerpc/platforms/cell/spufs/spufs.h | 2 +- .../arch/powerpc/platforms/iseries/lpevents.c | 2 +- trunk/arch/powerpc/platforms/iseries/mf.c | 2 +- trunk/arch/powerpc/platforms/iseries/proc.c | 2 +- .../arch/powerpc/platforms/iseries/viopath.c | 2 +- trunk/arch/powerpc/platforms/powermac/setup.c | 4 +- trunk/arch/powerpc/platforms/ps3/Kconfig | 11 - trunk/arch/powerpc/platforms/ps3/htab.c | 6 +- trunk/arch/powerpc/platforms/ps3/setup.c | 42 - trunk/arch/powerpc/platforms/pseries/eeh.c | 2 +- .../powerpc/platforms/pseries/hvCall_inst.c | 2 +- .../arch/powerpc/platforms/pseries/reconfig.c | 2 +- trunk/arch/powerpc/platforms/pseries/rtasd.c | 2 +- .../arch/powerpc/platforms/pseries/scanlog.c | 2 +- trunk/arch/ppc/8xx_io/cs4218_tdm.c | 6 +- trunk/arch/ppc/kernel/setup.c | 2 +- trunk/arch/ppc/platforms/lopec.c | 2 +- trunk/arch/ppc/platforms/pplus.c | 2 +- trunk/arch/ppc/platforms/prep_setup.c | 4 +- trunk/arch/s390/hypfs/inode.c | 4 +- trunk/arch/s390/kernel/debug.c | 2 +- trunk/arch/s390/kernel/setup.c | 2 +- trunk/arch/s390/kernel/smp.c | 15 +- trunk/arch/sh/boards/landisk/landisk_pwb.c | 2 +- trunk/arch/sh/kernel/setup.c | 6 +- trunk/arch/sh/mm/cache-debugfs.c | 2 +- trunk/arch/sh/mm/pmb.c | 2 +- trunk/arch/sh/oprofile/op_model_sh7750.c | 2 +- trunk/arch/sh64/kernel/setup.c | 6 +- trunk/arch/sparc/kernel/apc.c | 2 +- trunk/arch/sparc/kernel/setup.c | 2 +- trunk/arch/sparc/kernel/sys_sunos.c | 10 +- trunk/arch/sparc64/Kconfig | 8 + trunk/arch/sparc64/defconfig | 13 +- trunk/arch/sparc64/kernel/setup.c | 2 +- trunk/arch/sparc64/kernel/sys_sunos32.c | 11 +- trunk/arch/sparc64/kernel/time.c | 2 +- trunk/arch/sparc64/mm/init.c | 4 +- trunk/arch/sparc64/solaris/socksys.c | 2 +- trunk/arch/um/drivers/harddog_kern.c | 2 +- trunk/arch/um/drivers/line.c | 2 +- trunk/arch/um/include/user_util.h | 2 + trunk/arch/um/kernel/um_arch.c | 8 +- trunk/arch/v850/kernel/rte_cb_leds.c | 2 +- trunk/arch/v850/kernel/setup.c | 6 +- trunk/arch/x86_64/kernel/head64.c | 4 +- trunk/arch/x86_64/kernel/mce.c | 2 +- trunk/arch/x86_64/kernel/setup.c | 6 +- trunk/arch/xtensa/kernel/setup.c | 6 +- trunk/block/blktrace.c | 2 +- trunk/block/genhd.c | 8 - trunk/crypto/proc.c | 2 +- trunk/drivers/acorn/char/i2c.c | 2 +- trunk/drivers/block/DAC960.c | 2 +- trunk/drivers/block/acsi_slm.c | 2 +- trunk/drivers/block/aoe/aoechr.c | 2 +- trunk/drivers/block/paride/pg.c | 2 +- trunk/drivers/block/paride/pt.c | 2 +- trunk/drivers/block/pktcdvd.c | 6 +- trunk/drivers/bluetooth/hci_vhci.c | 2 +- trunk/drivers/cdrom/viocd.c | 2 +- trunk/drivers/char/briq_panel.c | 2 +- trunk/drivers/char/cyclades.c | 23 +- trunk/drivers/char/drm/drm_drv.c | 2 +- trunk/drivers/char/drm/i810_dma.c | 2 +- trunk/drivers/char/drm/i830_dma.c | 2 +- trunk/drivers/char/drm/via_dmablit.c | 14 +- trunk/drivers/char/ds1302.c | 2 + trunk/drivers/char/dtlk.c | 8 +- trunk/drivers/char/generic_nvram.c | 2 +- trunk/drivers/char/hw_random/intel-rng.c | 76 +- trunk/drivers/char/ip2/i2lib.c | 30 +- trunk/drivers/char/ip2/ip2main.c | 4 +- trunk/drivers/char/keyboard.c | 1 + trunk/drivers/char/mbcs.c | 2 +- trunk/drivers/char/mspec.c | 6 +- trunk/drivers/char/n_r3964.c | 4 +- trunk/drivers/char/n_tty.c | 14 +- trunk/drivers/char/nwbutton.c | 13 +- trunk/drivers/char/pcmcia/cm4000_cs.c | 10 +- trunk/drivers/char/pcmcia/cm4040_cs.c | 3 +- trunk/drivers/char/pcmcia/synclink_cs.c | 10 +- trunk/drivers/char/random.c | 4 +- trunk/drivers/char/rio/rio_linux.c | 12 +- trunk/drivers/char/rocket.c | 10 +- trunk/drivers/char/rtc.c | 12 +- trunk/drivers/char/specialix.c | 14 +- trunk/drivers/char/synclink.c | 10 +- trunk/drivers/char/synclink_gt.c | 19 +- trunk/drivers/char/synclinkmp.c | 22 +- trunk/drivers/char/sysrq.c | 1 + trunk/drivers/char/tpm/tpm.c | 5 +- trunk/drivers/char/tpm/tpm_bios.c | 4 +- trunk/drivers/char/tty_io.c | 162 +- trunk/drivers/char/viotape.c | 2 +- trunk/drivers/char/vt.c | 9 +- trunk/drivers/char/watchdog/acquirewdt.c | 155 +- trunk/drivers/char/watchdog/advantechwdt.c | 142 +- trunk/drivers/char/watchdog/alim1535_wdt.c | 2 +- trunk/drivers/char/watchdog/alim7101_wdt.c | 21 +- trunk/drivers/char/watchdog/cpu5wdt.c | 13 +- trunk/drivers/char/watchdog/eurotechwdt.c | 2 +- trunk/drivers/char/watchdog/i6300esb.c | 2 +- trunk/drivers/char/watchdog/i8xx_tco.c | 2 +- trunk/drivers/char/watchdog/iTCO_wdt.c | 8 +- trunk/drivers/char/watchdog/ib700wdt.c | 192 +- trunk/drivers/char/watchdog/ibmasr.c | 2 +- trunk/drivers/char/watchdog/indydog.c | 2 +- trunk/drivers/char/watchdog/machzwd.c | 18 +- trunk/drivers/char/watchdog/mixcomwd.c | 16 +- trunk/drivers/char/watchdog/omap_wdt.c | 2 +- trunk/drivers/char/watchdog/pc87413_wdt.c | 4 +- trunk/drivers/char/watchdog/pcwd.c | 32 +- trunk/drivers/char/watchdog/pcwd_pci.c | 34 +- trunk/drivers/char/watchdog/pcwd_usb.c | 63 +- trunk/drivers/char/watchdog/pnx4008_wdt.c | 5 +- trunk/drivers/char/watchdog/rm9k_wdt.c | 2 +- trunk/drivers/char/watchdog/s3c2410_wdt.c | 62 +- trunk/drivers/char/watchdog/sbc60xxwdt.c | 14 +- trunk/drivers/char/watchdog/sbc8360.c | 2 +- trunk/drivers/char/watchdog/sbc_epx_c3.c | 2 +- trunk/drivers/char/watchdog/sc1200wdt.c | 2 +- trunk/drivers/char/watchdog/sc520_wdt.c | 14 +- trunk/drivers/char/watchdog/shwdt.c | 8 +- trunk/drivers/char/watchdog/smsc37b787_wdt.c | 4 +- trunk/drivers/char/watchdog/softdog.c | 2 +- trunk/drivers/char/watchdog/w83627hf_wdt.c | 2 +- trunk/drivers/char/watchdog/w83697hf_wdt.c | 4 +- trunk/drivers/char/watchdog/w83877f_wdt.c | 14 +- trunk/drivers/char/watchdog/w83977f_wdt.c | 2 +- trunk/drivers/char/watchdog/wafer5823wdt.c | 2 +- trunk/drivers/char/watchdog/wdt.c | 2 +- trunk/drivers/char/watchdog/wdt977.c | 2 +- trunk/drivers/char/watchdog/wdt_pci.c | 2 +- trunk/drivers/edac/e752x_edac.c | 40 +- trunk/drivers/edac/edac_mc.c | 175 +- trunk/drivers/edac/edac_mc.h | 28 +- trunk/drivers/i2c/chips/tps65010.c | 2 +- trunk/drivers/i2c/i2c-dev.c | 2 +- trunk/drivers/ide/ide-proc.c | 2 +- trunk/drivers/ide/ide-tape.c | 2 +- trunk/drivers/ieee1394/dv1394.c | 2 +- trunk/drivers/ieee1394/raw1394.c | 2 +- trunk/drivers/ieee1394/video1394.c | 2 +- trunk/drivers/infiniband/core/ucm.c | 2 +- trunk/drivers/infiniband/core/ucma.c | 2 +- trunk/drivers/infiniband/core/user_mad.c | 4 +- trunk/drivers/infiniband/core/uverbs_main.c | 6 +- .../drivers/infiniband/hw/ipath/ipath_diag.c | 4 +- .../infiniband/hw/ipath/ipath_file_ops.c | 6 +- trunk/drivers/infiniband/hw/ipath/ipath_fs.c | 14 +- .../infiniband/hw/ipath/ipath_kernel.h | 2 +- trunk/drivers/infiniband/ulp/ipoib/ipoib_fs.c | 4 +- trunk/drivers/input/input.c | 6 +- trunk/drivers/input/misc/hp_sdc_rtc.c | 2 +- trunk/drivers/input/misc/uinput.c | 2 +- trunk/drivers/input/serio/serio_raw.c | 2 +- trunk/drivers/isdn/capi/capi.c | 41 +- trunk/drivers/isdn/capi/capidrv.c | 4 +- trunk/drivers/isdn/capi/kcapi_proc.c | 10 +- trunk/drivers/isdn/divert/divert_procfs.c | 2 +- trunk/drivers/isdn/gigaset/Kconfig | 25 +- trunk/drivers/isdn/gigaset/Makefile | 2 - trunk/drivers/isdn/gigaset/asyncdata.c | 5 - trunk/drivers/isdn/gigaset/common.c | 24 +- trunk/drivers/isdn/gigaset/ev-layer.c | 2 +- trunk/drivers/isdn/gigaset/interface.c | 3 - trunk/drivers/isdn/gigaset/isocdata.c | 4 +- trunk/drivers/isdn/gigaset/ser-gigaset.c | 837 ------ trunk/drivers/isdn/hardware/avm/b1dma.c | 14 +- trunk/drivers/isdn/hardware/avm/c4.c | 16 +- trunk/drivers/isdn/hardware/eicon/capifunc.c | 4 +- trunk/drivers/isdn/hardware/eicon/debug.c | 30 +- trunk/drivers/isdn/hardware/eicon/di.c | 16 +- trunk/drivers/isdn/hardware/eicon/divamnt.c | 2 +- trunk/drivers/isdn/hardware/eicon/divasi.c | 2 +- trunk/drivers/isdn/hardware/eicon/divasmain.c | 2 +- trunk/drivers/isdn/hardware/eicon/divasproc.c | 2 +- trunk/drivers/isdn/hardware/eicon/message.c | 383 +-- trunk/drivers/isdn/hardware/eicon/os_pri.c | 4 +- trunk/drivers/isdn/hardware/eicon/platform.h | 12 + trunk/drivers/isdn/hisax/Kconfig | 2 + trunk/drivers/isdn/hisax/Makefile | 1 + trunk/drivers/isdn/hisax/config.c | 11 +- trunk/drivers/isdn/hisax/elsa_ser.c | 8 +- trunk/drivers/isdn/hisax/hfc4s8s_l1.c | 48 +- trunk/drivers/isdn/hisax/hfc_usb.c | 40 +- trunk/drivers/isdn/hisax/hfc_usb.h | 3 + trunk/drivers/isdn/hisax/hisax.h | 25 + trunk/drivers/isdn/hisax/isar.c | 1 + trunk/drivers/isdn/hisax/isdnl1.h | 17 +- trunk/drivers/isdn/hisax/isdnl3.c | 12 + trunk/drivers/isdn/hisax/isdnl3.h | 26 +- trunk/drivers/isdn/hysdn/hysdn_procconf.c | 2 +- trunk/drivers/isdn/hysdn/hysdn_proclog.c | 2 +- trunk/drivers/isdn/i4l/isdn_common.c | 2 +- trunk/drivers/isdn/pcbit/drv.c | 4 + trunk/drivers/isdn/pcbit/edss1.c | 6 + trunk/drivers/isdn/pcbit/edss1.h | 7 +- trunk/drivers/isdn/pcbit/layer2.c | 16 + trunk/drivers/isdn/pcbit/module.c | 3 + trunk/drivers/isdn/pcbit/pcbit.h | 8 +- trunk/drivers/isdn/sc/card.h | 30 - trunk/drivers/isdn/sc/command.c | 17 +- trunk/drivers/isdn/sc/event.c | 3 + trunk/drivers/isdn/sc/init.c | 6 + trunk/drivers/isdn/sc/interrupt.c | 10 + trunk/drivers/isdn/sc/ioctl.c | 10 + trunk/drivers/isdn/sc/message.c | 10 + trunk/drivers/isdn/sc/packet.c | 10 + trunk/drivers/isdn/sc/scioc.h | 6 - trunk/drivers/isdn/sc/shmem.c | 6 + trunk/drivers/isdn/sc/timer.c | 8 + trunk/drivers/kvm/kvm.h | 4 +- trunk/drivers/kvm/kvm_main.c | 123 +- trunk/drivers/kvm/paging_tmpl.h | 28 +- trunk/drivers/kvm/svm.c | 15 +- trunk/drivers/kvm/vmx.c | 43 +- trunk/drivers/kvm/vmx.h | 1 - trunk/drivers/macintosh/adb.c | 2 +- trunk/drivers/macintosh/ans-lcd.c | 2 +- trunk/drivers/macintosh/apm_emu.c | 2 +- trunk/drivers/macintosh/nvram.c | 2 +- trunk/drivers/macintosh/smu.c | 2 +- trunk/drivers/macintosh/via-pmu.c | 2 +- trunk/drivers/macintosh/via-pmu68k.c | 2 +- trunk/drivers/md/dm-ioctl.c | 2 +- trunk/drivers/md/md.c | 2 +- trunk/drivers/media/common/saa7146_fops.c | 2 +- trunk/drivers/media/radio/dsbr100.c | 2 +- trunk/drivers/media/radio/miropcm20-radio.c | 2 +- trunk/drivers/media/radio/miropcm20-rds.c | 2 +- trunk/drivers/media/radio/radio-aimslab.c | 2 +- trunk/drivers/media/radio/radio-aztech.c | 2 +- trunk/drivers/media/radio/radio-cadet.c | 2 +- trunk/drivers/media/radio/radio-gemtek-pci.c | 2 +- trunk/drivers/media/radio/radio-gemtek.c | 2 +- trunk/drivers/media/radio/radio-maestro.c | 2 +- trunk/drivers/media/radio/radio-maxiradio.c | 2 +- trunk/drivers/media/radio/radio-rtrack2.c | 2 +- trunk/drivers/media/radio/radio-sf16fmi.c | 2 +- trunk/drivers/media/radio/radio-sf16fmr2.c | 2 +- trunk/drivers/media/radio/radio-terratec.c | 2 +- trunk/drivers/media/radio/radio-trust.c | 2 +- trunk/drivers/media/radio/radio-typhoon.c | 2 +- trunk/drivers/media/radio/radio-zoltrix.c | 2 +- trunk/drivers/media/video/arv.c | 2 +- trunk/drivers/media/video/bt8xx/bttv-driver.c | 4 +- trunk/drivers/media/video/bw-qcam.c | 2 +- trunk/drivers/media/video/c-qcam.c | 2 +- trunk/drivers/media/video/cafe_ccic.c | 6 +- trunk/drivers/media/video/cpia.c | 2 +- trunk/drivers/media/video/cpia2/cpia2_v4l.c | 2 +- .../drivers/media/video/cx88/cx88-blackbird.c | 2 +- trunk/drivers/media/video/cx88/cx88-video.c | 4 +- trunk/drivers/media/video/dabusb.c | 2 +- .../drivers/media/video/em28xx/em28xx-video.c | 2 +- .../media/video/et61x251/et61x251_core.c | 2 +- trunk/drivers/media/video/meye.c | 2 +- trunk/drivers/media/video/ov511.c | 2 +- trunk/drivers/media/video/pms.c | 2 +- .../media/video/pvrusb2/pvrusb2-v4l2.c | 2 +- trunk/drivers/media/video/pwc/pwc-if.c | 2 +- trunk/drivers/media/video/saa5246a.c | 2 +- trunk/drivers/media/video/saa5249.c | 2 +- .../media/video/saa7134/saa7134-empress.c | 2 +- .../drivers/media/video/saa7134/saa7134-oss.c | 4 +- .../media/video/saa7134/saa7134-video.c | 4 +- trunk/drivers/media/video/saa7134/saa7134.h | 4 +- trunk/drivers/media/video/se401.c | 2 +- .../media/video/sn9c102/sn9c102_core.c | 2 +- trunk/drivers/media/video/stradis.c | 2 +- trunk/drivers/media/video/stv680.c | 2 +- trunk/drivers/media/video/tvmixer.c | 2 +- trunk/drivers/media/video/usbvideo/usbvideo.c | 2 +- trunk/drivers/media/video/usbvideo/vicam.c | 2 +- .../media/video/usbvision/usbvision-video.c | 6 +- trunk/drivers/media/video/videodev.c | 4 +- trunk/drivers/media/video/vino.c | 2 +- trunk/drivers/media/video/vivi.c | 2 +- trunk/drivers/media/video/w9966.c | 2 +- trunk/drivers/media/video/w9968cf.c | 4 +- .../drivers/media/video/zc0301/zc0301_core.c | 2 +- trunk/drivers/media/video/zoran_driver.c | 2 +- trunk/drivers/media/video/zoran_procfs.c | 2 +- trunk/drivers/message/fusion/mptctl.c | 2 +- trunk/drivers/message/i2o/i2o_config.c | 2 +- trunk/drivers/message/i2o/i2o_proc.c | 38 +- trunk/drivers/misc/hdpuftrs/hdpu_cpustate.c | 2 +- trunk/drivers/misc/ibmasm/ibmasmfs.c | 10 +- trunk/drivers/mtd/mtdchar.c | 2 +- trunk/drivers/net/arcnet/com20020.c | 3 +- trunk/drivers/net/bonding/bond_main.c | 2 +- trunk/drivers/net/hamradio/bpqether.c | 2 +- trunk/drivers/net/hamradio/scc.c | 2 +- trunk/drivers/net/hamradio/yam.c | 2 +- trunk/drivers/net/ibmveth.c | 2 +- trunk/drivers/net/irda/vlsi_ir.c | 2 +- trunk/drivers/net/ppp_generic.c | 2 +- trunk/drivers/net/pppoe.c | 2 +- trunk/drivers/net/tun.c | 2 +- trunk/drivers/net/wan/cosa.c | 2 +- trunk/drivers/net/wireless/airo.c | 16 +- .../net/wireless/bcm43xx/bcm43xx_debugfs.c | 12 +- trunk/drivers/net/wireless/strip.c | 2 +- trunk/drivers/oprofile/event_buffer.c | 2 +- trunk/drivers/oprofile/event_buffer.h | 2 +- trunk/drivers/oprofile/oprofile_files.c | 10 +- trunk/drivers/oprofile/oprofilefs.c | 6 +- trunk/drivers/parisc/ccio-dma.c | 4 +- trunk/drivers/parisc/eisa_eeprom.c | 2 +- trunk/drivers/parisc/sba_iommu.c | 4 +- trunk/drivers/pci/hotplug/cpqphp_sysfs.c | 2 +- trunk/drivers/pci/proc.c | 4 +- trunk/drivers/pcmcia/pcmcia_ioctl.c | 2 +- trunk/drivers/pnp/isapnp/proc.c | 2 +- trunk/drivers/ps3/Makefile | 1 - trunk/drivers/ps3/ps3av.c | 974 ------- trunk/drivers/ps3/ps3av_cmd.c | 1020 ------- trunk/drivers/ps3/vuart.c | 17 - trunk/drivers/ps3/vuart.h | 1 - trunk/drivers/rtc/rtc-dev.c | 2 +- trunk/drivers/rtc/rtc-ds1553.c | 2 +- trunk/drivers/rtc/rtc-ds1742.c | 2 +- trunk/drivers/rtc/rtc-proc.c | 2 +- trunk/drivers/rtc/rtc-sysfs.c | 103 +- trunk/drivers/s390/block/dasd_eer.c | 2 +- trunk/drivers/s390/block/dasd_proc.c | 2 +- trunk/drivers/s390/char/fs3270.c | 2 +- trunk/drivers/s390/char/monreader.c | 2 +- trunk/drivers/s390/char/monwriter.c | 2 +- trunk/drivers/s390/char/tape_char.c | 2 +- trunk/drivers/s390/char/tape_class.c | 2 +- trunk/drivers/s390/char/tape_class.h | 2 +- trunk/drivers/s390/char/tape_proc.c | 2 +- trunk/drivers/s390/char/vmcp.c | 2 +- trunk/drivers/s390/char/vmlogrdr.c | 2 +- trunk/drivers/s390/char/vmwatchdog.c | 2 +- trunk/drivers/s390/cio/blacklist.c | 2 +- trunk/drivers/s390/cio/device_id.c | 3 +- trunk/drivers/s390/cio/device_ops.c | 32 +- trunk/drivers/s390/cio/qdio.c | 2 +- trunk/drivers/s390/crypto/zcrypt_api.c | 2 +- trunk/drivers/s390/net/qeth_proc.c | 4 +- trunk/drivers/s390/scsi/zfcp_aux.c | 2 +- trunk/drivers/sbus/char/bpp.c | 2 +- trunk/drivers/sbus/char/cpwatchdog.c | 2 +- trunk/drivers/sbus/char/display7seg.c | 2 +- trunk/drivers/sbus/char/envctrl.c | 2 +- trunk/drivers/sbus/char/flash.c | 2 +- trunk/drivers/sbus/char/jsflash.c | 2 +- trunk/drivers/sbus/char/openprom.c | 2 +- trunk/drivers/sbus/char/riowatchdog.c | 2 +- trunk/drivers/sbus/char/rtc.c | 2 +- trunk/drivers/sbus/char/uctrl.c | 2 +- trunk/drivers/sbus/char/vfc_dev.c | 4 +- trunk/drivers/scsi/3w-9xxx.c | 2 +- trunk/drivers/scsi/3w-xxxx.c | 2 +- trunk/drivers/scsi/aacraid/linit.c | 2 +- trunk/drivers/scsi/ch.c | 2 +- trunk/drivers/scsi/dpt_i2o.c | 2 +- trunk/drivers/scsi/gdth.c | 2 +- trunk/drivers/scsi/megaraid.c | 2 +- trunk/drivers/scsi/megaraid/megaraid_mm.c | 2 +- trunk/drivers/scsi/megaraid/megaraid_sas.c | 2 +- trunk/drivers/scsi/osst.c | 2 +- trunk/drivers/scsi/scsi_proc.c | 2 +- trunk/drivers/scsi/scsi_tgt_if.c | 2 +- trunk/drivers/scsi/st.c | 2 +- trunk/drivers/serial/atmel_serial.c | 54 +- trunk/drivers/spi/Kconfig | 38 +- trunk/drivers/spi/Makefile | 3 - trunk/drivers/spi/at25.c | 381 --- trunk/drivers/spi/omap_uwire.c | 572 ---- trunk/drivers/spi/pxa2xx_spi.c | 4 +- trunk/drivers/spi/spi.c | 2 +- trunk/drivers/spi/spi_bitbang.c | 11 +- trunk/drivers/spi/spi_imx.c | 1769 ------------ trunk/drivers/telephony/ixj.c | 41 +- trunk/drivers/telephony/ixj.h | 4 + trunk/drivers/telephony/phonedev.c | 2 +- trunk/drivers/usb/misc/adutux.c | 2 +- trunk/drivers/usb/misc/appledisplay.c | 4 +- trunk/drivers/usb/misc/ftdi-elan.c | 2 +- trunk/drivers/video/Kconfig | 89 +- trunk/drivers/video/Makefile | 8 +- trunk/drivers/video/S3triofb.c | 790 ++++++ trunk/drivers/video/aty/atyfb_base.c | 4 +- trunk/drivers/video/au1100fb.c | 6 +- trunk/drivers/video/console/fbcon.c | 4 +- trunk/drivers/video/console/fbcon.h | 2 +- trunk/drivers/video/controlfb.c | 3 +- trunk/drivers/video/cyber2000fb.c | 19 +- trunk/drivers/video/cyberfb.c | 2295 +++++++++++++++ trunk/drivers/video/cyberfb.h | 415 +++ trunk/drivers/video/fbsysfs.c | 2 +- trunk/drivers/video/geode/gx1fb_core.c | 29 +- trunk/drivers/video/i810/i810.h | 3 +- trunk/drivers/video/i810/i810_main.c | 32 +- trunk/drivers/video/igafb.c | 8 +- trunk/drivers/video/intelfb/intelfbdrv.c | 3 +- trunk/drivers/video/matrox/i2c-matroxfb.c | 4 +- trunk/drivers/video/matrox/matroxfb_crtc2.c | 3 +- trunk/drivers/video/mbx/mbxdebugfs.c | 12 +- trunk/drivers/video/modedb.c | 47 +- trunk/drivers/video/neofb.c | 22 +- trunk/drivers/video/nvidia/nvidia.c | 16 +- trunk/drivers/video/pm3fb.c | 29 +- trunk/drivers/video/ps3fb.c | 1229 -------- trunk/drivers/video/retz3fb.c | 1588 +++++++++++ trunk/drivers/video/retz3fb.h | 286 ++ trunk/drivers/video/riva/fbdev.c | 27 +- trunk/drivers/video/riva/rivafb.h | 3 +- trunk/drivers/video/s3fb.c | 1180 -------- trunk/drivers/video/savage/savagefb_driver.c | 12 +- trunk/drivers/video/sis/init.c | 140 +- trunk/drivers/video/sis/init.h | 36 +- trunk/drivers/video/sis/init301.c | 260 +- trunk/drivers/video/sis/init301.h | 14 +- trunk/drivers/video/sis/initextlfb.c | 18 +- trunk/drivers/video/sis/sis.h | 2 +- trunk/drivers/video/sis/sis_main.c | 214 +- trunk/drivers/video/sis/sis_main.h | 112 +- trunk/drivers/video/sis/vgatypes.h | 12 + trunk/drivers/video/sis/vstruct.h | 44 +- trunk/drivers/video/sun3fb.c | 702 +++++ trunk/drivers/video/svgalib.c | 632 ----- trunk/drivers/video/tgafb.c | 185 +- trunk/drivers/video/vga16fb.c | 23 +- trunk/drivers/video/virgefb.c | 2526 +++++++++++++++++ trunk/drivers/video/virgefb.h | 288 ++ trunk/drivers/w1/slaves/w1_therm.c | 6 +- trunk/drivers/zorro/proc.c | 2 +- trunk/fs/9p/vfs_inode.c | 16 +- trunk/fs/9p/vfs_super.c | 4 +- trunk/fs/Kconfig | 2 +- trunk/fs/adfs/adfs.h | 4 +- trunk/fs/adfs/dir.c | 2 +- trunk/fs/adfs/file.c | 2 +- trunk/fs/adfs/super.c | 2 +- trunk/fs/affs/affs.h | 6 +- trunk/fs/affs/dir.c | 2 +- trunk/fs/affs/file.c | 2 +- trunk/fs/affs/inode.c | 2 +- trunk/fs/affs/super.c | 2 +- trunk/fs/affs/symlink.c | 2 +- trunk/fs/afs/dir.c | 2 +- trunk/fs/afs/file.c | 2 +- trunk/fs/afs/internal.h | 6 +- trunk/fs/afs/mntpt.c | 2 +- trunk/fs/afs/super.c | 2 +- trunk/fs/autofs/autofs_i.h | 4 +- trunk/fs/autofs/inode.c | 2 +- trunk/fs/autofs/root.c | 2 +- trunk/fs/autofs/symlink.c | 2 +- trunk/fs/autofs4/autofs_i.h | 10 +- trunk/fs/autofs4/inode.c | 2 +- trunk/fs/autofs4/root.c | 6 +- trunk/fs/autofs4/symlink.c | 2 +- trunk/fs/bad_inode.c | 2 +- trunk/fs/befs/linuxvfs.c | 4 +- trunk/fs/bfs/bfs.h | 4 +- trunk/fs/bfs/dir.c | 2 +- trunk/fs/bfs/file.c | 2 +- trunk/fs/bfs/inode.c | 2 +- trunk/fs/binfmt_misc.c | 2 +- trunk/fs/block_dev.c | 2 +- trunk/fs/buffer.c | 16 +- trunk/fs/char_dev.c | 7 - trunk/fs/cifs/cifsfs.c | 10 +- trunk/fs/cifs/cifsfs.h | 8 +- trunk/fs/coda/cnode.c | 2 +- trunk/fs/coda/dir.c | 2 +- trunk/fs/coda/inode.c | 4 +- trunk/fs/coda/pioctl.c | 2 +- trunk/fs/configfs/configfs_internal.h | 4 +- trunk/fs/configfs/dir.c | 2 +- trunk/fs/configfs/inode.c | 2 +- trunk/fs/configfs/mount.c | 2 +- trunk/fs/configfs/symlink.c | 2 +- trunk/fs/cramfs/inode.c | 8 +- trunk/fs/debugfs/file.c | 2 +- trunk/fs/devpts/inode.c | 2 +- trunk/fs/dlm/debug_fs.c | 4 +- trunk/fs/dlm/user.c | 6 +- trunk/fs/dquot.c | 56 +- trunk/fs/ecryptfs/Makefile | 2 +- trunk/fs/ecryptfs/crypto.c | 331 +-- trunk/fs/ecryptfs/debug.c | 6 +- trunk/fs/ecryptfs/ecryptfs_kernel.h | 160 +- trunk/fs/ecryptfs/file.c | 49 +- trunk/fs/ecryptfs/inode.c | 90 +- trunk/fs/ecryptfs/keystore.c | 798 +----- trunk/fs/ecryptfs/main.c | 74 +- trunk/fs/ecryptfs/messaging.c | 515 ---- trunk/fs/ecryptfs/mmap.c | 378 ++- trunk/fs/ecryptfs/netlink.c | 255 -- trunk/fs/ecryptfs/super.c | 2 +- trunk/fs/efs/dir.c | 2 +- trunk/fs/efs/super.c | 2 +- trunk/fs/ext2/ext2.h | 10 +- trunk/fs/ext2/file.c | 2 +- trunk/fs/ext2/namei.c | 4 +- trunk/fs/ext2/super.c | 2 +- trunk/fs/ext2/symlink.c | 4 +- trunk/fs/ext3/file.c | 2 +- trunk/fs/ext3/namei.c | 4 +- trunk/fs/ext3/super.c | 2 +- trunk/fs/ext3/symlink.c | 4 +- trunk/fs/ext4/file.c | 2 +- trunk/fs/ext4/namei.c | 4 +- trunk/fs/ext4/super.c | 2 +- trunk/fs/ext4/symlink.c | 4 +- trunk/fs/fat/file.c | 2 +- trunk/fs/fat/inode.c | 4 +- trunk/fs/freevxfs/vxfs_extern.h | 2 +- trunk/fs/freevxfs/vxfs_immed.c | 2 +- trunk/fs/freevxfs/vxfs_inode.c | 2 +- trunk/fs/freevxfs/vxfs_lookup.c | 2 +- trunk/fs/freevxfs/vxfs_super.c | 2 +- trunk/fs/fuse/control.c | 2 +- trunk/fs/fuse/dir.c | 6 +- trunk/fs/fuse/inode.c | 2 +- trunk/fs/gfs2/locking/dlm/plock.c | 2 +- trunk/fs/gfs2/ops_inode.c | 8 +- trunk/fs/gfs2/ops_inode.h | 8 +- trunk/fs/gfs2/ops_super.c | 2 +- trunk/fs/gfs2/ops_super.h | 2 +- trunk/fs/hfs/dir.c | 2 +- trunk/fs/hfs/hfs_fs.h | 2 +- trunk/fs/hfs/inode.c | 4 +- trunk/fs/hfs/super.c | 2 +- trunk/fs/hfsplus/dir.c | 2 +- trunk/fs/hfsplus/inode.c | 4 +- trunk/fs/hfsplus/super.c | 2 +- trunk/fs/hostfs/hostfs_kern.c | 10 +- trunk/fs/hpfs/file.c | 2 +- trunk/fs/hpfs/hpfs_fn.h | 4 +- trunk/fs/hpfs/namei.c | 2 +- trunk/fs/hpfs/super.c | 2 +- trunk/fs/hppfs/hppfs_kern.c | 10 +- trunk/fs/hugetlbfs/inode.c | 12 +- trunk/fs/inode.c | 33 +- trunk/fs/inotify_user.c | 10 +- trunk/fs/ioprio.c | 18 +- trunk/fs/isofs/dir.c | 2 +- trunk/fs/isofs/inode.c | 2 +- trunk/fs/isofs/isofs.h | 2 +- trunk/fs/jffs/inode-v23.c | 12 +- trunk/fs/jffs2/dir.c | 2 +- trunk/fs/jffs2/file.c | 2 +- trunk/fs/jffs2/os-linux.h | 6 +- trunk/fs/jffs2/super.c | 2 +- trunk/fs/jffs2/symlink.c | 2 +- trunk/fs/jfs/file.c | 2 +- trunk/fs/jfs/jfs_inode.h | 6 +- trunk/fs/jfs/namei.c | 2 +- trunk/fs/jfs/super.c | 4 +- trunk/fs/jfs/symlink.c | 2 +- trunk/fs/libfs.c | 6 +- trunk/fs/lockd/host.c | 2 +- trunk/fs/lockd/svc.c | 32 +- trunk/fs/lockd/svc4proc.c | 13 +- trunk/fs/lockd/svcproc.c | 13 +- trunk/fs/minix/bitmap.c | 69 +- trunk/fs/minix/dir.c | 162 +- trunk/fs/minix/file.c | 2 +- trunk/fs/minix/inode.c | 53 +- trunk/fs/minix/itree_common.c | 16 +- trunk/fs/minix/itree_v1.c | 4 +- trunk/fs/minix/itree_v2.c | 7 +- trunk/fs/minix/minix.h | 16 +- trunk/fs/minix/namei.c | 2 +- trunk/fs/msdos/namei.c | 2 +- trunk/fs/namei.c | 2 +- trunk/fs/ncpfs/dir.c | 2 +- trunk/fs/ncpfs/file.c | 2 +- trunk/fs/ncpfs/inode.c | 4 +- trunk/fs/nfs/callback.c | 34 +- trunk/fs/nfs/callback_xdr.c | 4 +- trunk/fs/nfs/client.c | 4 +- trunk/fs/nfs/dir.c | 6 +- trunk/fs/nfs/file.c | 4 +- trunk/fs/nfs/namespace.c | 4 +- trunk/fs/nfs/nfs4_fs.h | 2 +- trunk/fs/nfs/nfs4proc.c | 2 +- trunk/fs/nfs/super.c | 5 +- trunk/fs/nfs/symlink.c | 2 +- trunk/fs/nfsd/nfs4state.c | 18 +- trunk/fs/nfsd/nfscache.c | 2 +- trunk/fs/nfsd/nfsfh.c | 7 +- trunk/fs/nfsd/nfsproc.c | 7 +- trunk/fs/nfsd/nfssvc.c | 6 +- trunk/fs/ntfs/attrib.c | 2 +- trunk/fs/ntfs/file.c | 4 +- trunk/fs/ntfs/namei.c | 2 +- trunk/fs/ntfs/ntfs.h | 6 +- trunk/fs/ntfs/super.c | 2 +- trunk/fs/ocfs2/dlm/dlmfs.c | 20 +- trunk/fs/ocfs2/file.c | 4 +- trunk/fs/ocfs2/file.h | 4 +- trunk/fs/ocfs2/namei.c | 2 +- trunk/fs/ocfs2/namei.h | 2 +- trunk/fs/ocfs2/super.c | 2 +- trunk/fs/ocfs2/symlink.c | 4 +- trunk/fs/ocfs2/symlink.h | 4 +- trunk/fs/openpromfs/inode.c | 4 +- trunk/fs/proc/array.c | 2 +- trunk/fs/proc/base.c | 52 +- trunk/fs/proc/generic.c | 10 +- trunk/fs/proc/inode.c | 2 +- trunk/fs/proc/internal.h | 12 +- trunk/fs/proc/nommu.c | 2 +- trunk/fs/proc/proc_misc.c | 26 +- trunk/fs/proc/proc_tty.c | 2 +- trunk/fs/proc/root.c | 4 +- trunk/fs/proc/task_mmu.c | 6 +- trunk/fs/proc/task_nommu.c | 2 +- trunk/fs/qnx4/dir.c | 2 +- trunk/fs/qnx4/file.c | 2 +- trunk/fs/qnx4/inode.c | 4 +- trunk/fs/ramfs/file-mmu.c | 2 +- trunk/fs/ramfs/file-nommu.c | 2 +- trunk/fs/ramfs/inode.c | 8 +- trunk/fs/ramfs/internal.h | 2 +- trunk/fs/read_write.c | 2 +- trunk/fs/reiserfs/do_balan.c | 5 +- trunk/fs/reiserfs/file.c | 2 +- trunk/fs/reiserfs/namei.c | 6 +- trunk/fs/reiserfs/super.c | 2 +- trunk/fs/romfs/inode.c | 6 +- trunk/fs/smbfs/dir.c | 4 +- trunk/fs/smbfs/file.c | 2 +- trunk/fs/smbfs/inode.c | 2 +- trunk/fs/smbfs/proto.h | 8 +- trunk/fs/smbfs/symlink.c | 2 +- trunk/fs/super.c | 2 +- trunk/fs/sysfs/dir.c | 2 +- trunk/fs/sysfs/inode.c | 2 +- trunk/fs/sysfs/mount.c | 2 +- trunk/fs/sysfs/symlink.c | 2 +- trunk/fs/sysfs/sysfs.h | 4 +- trunk/fs/sysv/file.c | 2 +- trunk/fs/sysv/inode.c | 4 +- trunk/fs/sysv/namei.c | 2 +- trunk/fs/sysv/symlink.c | 2 +- trunk/fs/sysv/sysv.h | 8 +- trunk/fs/udf/file.c | 2 +- trunk/fs/udf/namei.c | 2 +- trunk/fs/udf/super.c | 2 +- trunk/fs/udf/udfdecl.h | 4 +- trunk/fs/ufs/balloc.c | 197 +- trunk/fs/ufs/ialloc.c | 116 +- trunk/fs/ufs/inode.c | 193 +- trunk/fs/ufs/namei.c | 2 +- trunk/fs/ufs/super.c | 49 +- trunk/fs/ufs/symlink.c | 2 +- trunk/fs/ufs/truncate.c | 141 +- trunk/fs/ufs/util.h | 57 - trunk/fs/vfat/namei.c | 2 +- trunk/fs/xfs/linux-2.6/xfs_aops.c | 3 + trunk/fs/xfs/linux-2.6/xfs_iops.c | 6 +- trunk/fs/xfs/linux-2.6/xfs_iops.h | 6 +- trunk/fs/xfs/linux-2.6/xfs_linux.h | 10 + trunk/include/asm-arm/arch-at91rm9200/gpio.h | 48 +- trunk/include/asm-arm/arch-imx/spi_imx.h | 72 - trunk/include/asm-arm/arch-omap/gpio.h | 66 - trunk/include/asm-arm/arch-pxa/gpio.h | 72 - trunk/include/asm-arm/arch-s3c2410/gpio.h | 65 - trunk/include/asm-arm/arch-sa1100/gpio.h | 81 - trunk/include/asm-arm/gpio.h | 7 - trunk/include/asm-generic/gpio.h | 25 - trunk/include/asm-i386/setup.h | 2 +- trunk/include/asm-ia64/setup.h | 2 +- trunk/include/asm-mips/atomic.h | 50 +- trunk/include/asm-mips/bitops.h | 33 +- trunk/include/asm-mips/spinlock.h | 56 +- trunk/include/asm-mips/system.h | 20 +- trunk/include/asm-powerpc/Kbuild | 1 - trunk/include/asm-powerpc/ps3.h | 9 - trunk/include/asm-powerpc/ps3av.h | 738 ----- trunk/include/asm-powerpc/ps3fb.h | 56 - trunk/include/asm-s390/ccwdev.h | 2 - trunk/include/asm-s390/io.h | 6 +- trunk/include/asm-sparc64/setup.h | 2 +- trunk/include/asm-x86_64/bootsetup.h | 2 +- trunk/include/asm-x86_64/setup.h | 2 +- trunk/include/linux/Kbuild | 1 - trunk/include/linux/atalk.h | 2 +- trunk/include/linux/buffer_head.h | 12 +- trunk/include/linux/coda_linux.h | 6 +- trunk/include/linux/cpu.h | 12 +- trunk/include/linux/cpuset.h | 2 +- trunk/include/linux/efs_fs.h | 2 +- trunk/include/linux/ext3_fs.h | 10 +- trunk/include/linux/ext4_fs.h | 10 +- trunk/include/linux/fb.h | 38 +- trunk/include/linux/fs.h | 11 +- trunk/include/linux/gigaset_dev.h | 2 + trunk/include/linux/init.h | 5 +- trunk/include/linux/init_task.h | 2 +- trunk/include/linux/kernel.h | 8 +- trunk/include/linux/kvm.h | 5 +- trunk/include/linux/lockdep.h | 2 - trunk/include/linux/magic.h | 1 - trunk/include/linux/minix_fs.h | 25 +- trunk/include/linux/mm.h | 3 - trunk/include/linux/msdos_fs.h | 6 +- trunk/include/linux/ncp_fs.h | 4 +- trunk/include/linux/netfilter.h | 4 +- .../linux/netfilter_ipv4/ip_conntrack.h | 6 - trunk/include/linux/netlink.h | 1 - trunk/include/linux/nfs_fs.h | 14 +- trunk/include/linux/nfs_xdr.h | 4 +- trunk/include/linux/nfsd/const.h | 4 + trunk/include/linux/phonedev.h | 2 +- trunk/include/linux/pid.h | 14 + trunk/include/linux/proc_fs.h | 4 +- trunk/include/linux/qnx4_fs.h | 4 +- trunk/include/linux/quota.h | 1 - trunk/include/linux/random.h | 2 +- trunk/include/linux/reiserfs_fs.h | 8 +- trunk/include/linux/sched.h | 5 +- trunk/include/linux/security.h | 2 +- trunk/include/linux/spi/eeprom.h | 22 - trunk/include/linux/spi/spi.h | 37 +- trunk/include/linux/spi/spi_bitbang.h | 2 +- trunk/include/linux/sunrpc/svc.h | 45 +- trunk/include/linux/sunrpc/svcsock.h | 12 +- trunk/include/linux/svga.h | 124 - trunk/include/linux/toshiba.h | 2 - trunk/include/linux/tty.h | 7 +- trunk/include/linux/ufs_fs.h | 47 +- trunk/include/linux/ufs_fs_i.h | 3 +- trunk/include/linux/ufs_fs_sb.h | 1 + trunk/include/net/ax25.h | 4 +- trunk/include/net/netfilter/nf_conntrack.h | 6 - .../net/netfilter/nf_conntrack_expect.h | 2 +- .../net/netfilter/nf_conntrack_l3proto.h | 4 +- .../net/netfilter/nf_conntrack_l4proto.h | 2 +- trunk/include/net/netrom.h | 4 +- trunk/include/net/rose.h | 6 +- trunk/include/sound/pcm.h | 2 +- trunk/include/video/neomagic.h | 3 +- trunk/include/video/s3blit.h | 79 + trunk/init/main.c | 29 +- trunk/ipc/mqueue.c | 8 +- trunk/ipc/shm.c | 4 +- trunk/ipc/util.c | 62 +- trunk/kernel/capability.c | 8 +- trunk/kernel/cpuset.c | 4 +- trunk/kernel/exit.c | 64 +- trunk/kernel/fork.c | 2 +- trunk/kernel/irq/manage.c | 35 - trunk/kernel/sched.c | 8 +- trunk/kernel/signal.c | 41 +- trunk/kernel/sys.c | 41 +- trunk/lib/Kconfig.debug | 9 - trunk/lib/swiotlb.c | 8 +- trunk/lib/vsprintf.c | 3 +- trunk/mm/memory.c | 51 +- trunk/mm/mincore.c | 102 +- trunk/mm/shmem.c | 20 +- trunk/net/802/tr.c | 2 +- trunk/net/8021q/vlanproc.c | 4 +- trunk/net/appletalk/aarp.c | 2 +- trunk/net/appletalk/atalk_proc.c | 6 +- trunk/net/atm/br2684.c | 2 +- trunk/net/atm/clip.c | 2 +- trunk/net/atm/lec.c | 2 +- trunk/net/atm/mpoa_proc.c | 2 +- trunk/net/atm/proc.c | 12 +- trunk/net/ax25/af_ax25.c | 2 +- trunk/net/ax25/ax25_route.c | 2 +- trunk/net/ax25/ax25_uid.c | 2 +- trunk/net/bridge/netfilter/ebt_log.c | 2 +- trunk/net/bridge/netfilter/ebt_ulog.c | 2 +- trunk/net/core/dev.c | 4 +- trunk/net/core/dev_mcast.c | 2 +- trunk/net/core/neighbour.c | 4 +- trunk/net/core/pktgen.c | 6 +- trunk/net/core/sock.c | 2 +- trunk/net/core/wireless.c | 2 +- trunk/net/dccp/probe.c | 2 +- trunk/net/decnet/af_decnet.c | 2 +- trunk/net/decnet/dn_dev.c | 2 +- trunk/net/decnet/dn_neigh.c | 2 +- trunk/net/decnet/dn_route.c | 2 +- trunk/net/ipv4/arp.c | 2 +- trunk/net/ipv4/fib_hash.c | 2 +- trunk/net/ipv4/fib_trie.c | 6 +- trunk/net/ipv4/igmp.c | 4 +- trunk/net/ipv4/ipconfig.c | 2 +- trunk/net/ipv4/ipmr.c | 4 +- trunk/net/ipv4/ipvs/ip_vs_app.c | 2 +- trunk/net/ipv4/ipvs/ip_vs_conn.c | 2 +- trunk/net/ipv4/ipvs/ip_vs_ctl.c | 4 +- trunk/net/ipv4/netfilter/Kconfig | 8 +- trunk/net/ipv4/netfilter/ip_conntrack_core.c | 51 +- .../ipv4/netfilter/ip_conntrack_standalone.c | 15 +- trunk/net/ipv4/netfilter/ip_nat_core.c | 74 +- trunk/net/ipv4/netfilter/ipt_CLUSTERIP.c | 4 +- trunk/net/ipv4/netfilter/ipt_LOG.c | 2 +- trunk/net/ipv4/netfilter/ipt_ULOG.c | 2 +- trunk/net/ipv4/netfilter/ipt_recent.c | 4 +- .../nf_conntrack_l3proto_ipv4_compat.c | 6 +- .../ipv4/netfilter/nf_conntrack_proto_icmp.c | 2 - trunk/net/ipv4/netfilter/nf_nat_core.c | 75 +- trunk/net/ipv4/proc.c | 6 +- trunk/net/ipv4/raw.c | 2 +- trunk/net/ipv4/route.c | 4 +- trunk/net/ipv4/tcp_cubic.c | 20 +- trunk/net/ipv4/tcp_htcp.c | 65 +- trunk/net/ipv4/tcp_probe.c | 2 +- trunk/net/ipv6/addrconf.c | 2 +- trunk/net/ipv6/anycast.c | 2 +- trunk/net/ipv6/ip6_flowlabel.c | 2 +- trunk/net/ipv6/mcast.c | 4 +- trunk/net/ipv6/netfilter/Kconfig | 3 +- trunk/net/ipv6/netfilter/ip6t_LOG.c | 2 +- trunk/net/ipv6/netfilter/ip6t_mh.c | 7 - .../netfilter/nf_conntrack_l3proto_ipv6.c | 4 +- .../netfilter/nf_conntrack_proto_icmpv6.c | 1 - trunk/net/ipv6/proc.c | 4 +- trunk/net/ipv6/raw.c | 2 +- trunk/net/ipv6/route.c | 2 +- trunk/net/ipx/ipx_proc.c | 6 +- trunk/net/irda/discovery.c | 2 +- trunk/net/irda/ircomm/ircomm_core.c | 2 +- trunk/net/irda/iriap.c | 2 +- trunk/net/irda/irlan/irlan_common.c | 2 +- trunk/net/irda/irlap.c | 2 +- trunk/net/irda/irlmp.c | 2 +- trunk/net/irda/irttp.c | 2 +- trunk/net/key/af_key.c | 11 +- trunk/net/llc/llc_proc.c | 4 +- trunk/net/netfilter/Kconfig | 12 +- trunk/net/netfilter/core.c | 45 +- trunk/net/netfilter/nf_conntrack_core.c | 70 +- trunk/net/netfilter/nf_conntrack_expect.c | 4 +- trunk/net/netfilter/nf_conntrack_ftp.c | 14 +- trunk/net/netfilter/nf_conntrack_h323_main.c | 20 +- trunk/net/netfilter/nf_conntrack_irc.c | 2 +- .../netfilter/nf_conntrack_l3proto_generic.c | 2 +- trunk/net/netfilter/nf_conntrack_netbios_ns.c | 2 +- trunk/net/netfilter/nf_conntrack_netlink.c | 106 +- trunk/net/netfilter/nf_conntrack_pptp.c | 2 +- trunk/net/netfilter/nf_conntrack_proto.c | 73 +- trunk/net/netfilter/nf_conntrack_proto_sctp.c | 72 +- trunk/net/netfilter/nf_conntrack_proto_tcp.c | 210 +- trunk/net/netfilter/nf_conntrack_sip.c | 6 +- trunk/net/netfilter/nf_conntrack_standalone.c | 6 +- trunk/net/netfilter/nf_conntrack_tftp.c | 2 +- trunk/net/netfilter/nf_internals.h | 2 +- trunk/net/netfilter/nf_log.c | 63 +- trunk/net/netfilter/nf_queue.c | 24 +- trunk/net/netfilter/nf_sockopt.c | 12 +- trunk/net/netfilter/nfnetlink.c | 10 +- trunk/net/netfilter/nfnetlink_log.c | 56 +- trunk/net/netfilter/nfnetlink_queue.c | 86 +- trunk/net/netfilter/x_tables.c | 14 +- trunk/net/netfilter/xt_CLASSIFY.c | 10 +- trunk/net/netfilter/xt_MARK.c | 4 +- trunk/net/netfilter/xt_NFQUEUE.c | 4 +- trunk/net/netfilter/xt_NOTRACK.c | 4 +- trunk/net/netfilter/xt_SECMARK.c | 2 +- trunk/net/netfilter/xt_conntrack.c | 32 +- trunk/net/netfilter/xt_dccp.c | 20 +- trunk/net/netfilter/xt_hashlimit.c | 12 +- trunk/net/netfilter/xt_helper.c | 18 +- trunk/net/netfilter/xt_length.c | 4 +- trunk/net/netfilter/xt_limit.c | 2 +- trunk/net/netfilter/xt_mac.c | 7 +- trunk/net/netfilter/xt_mark.c | 6 +- trunk/net/netfilter/xt_multiport.c | 2 +- trunk/net/netfilter/xt_physdev.c | 2 +- trunk/net/netfilter/xt_policy.c | 24 +- trunk/net/netfilter/xt_quota.c | 4 +- trunk/net/netfilter/xt_realm.c | 2 +- trunk/net/netfilter/xt_sctp.c | 30 +- trunk/net/netfilter/xt_string.c | 8 +- trunk/net/netfilter/xt_tcpmss.c | 4 +- trunk/net/netlink/af_netlink.c | 2 +- trunk/net/netrom/af_netrom.c | 2 +- trunk/net/netrom/nr_route.c | 4 +- trunk/net/packet/af_packet.c | 2 +- trunk/net/rose/af_rose.c | 2 +- trunk/net/rose/rose_route.c | 6 +- trunk/net/rxrpc/proc.c | 8 +- trunk/net/sched/sch_api.c | 2 +- trunk/net/sctp/proc.c | 6 +- trunk/net/socket.c | 2 +- trunk/net/sunrpc/cache.c | 12 +- trunk/net/sunrpc/rpc_pipe.c | 4 +- trunk/net/sunrpc/stats.c | 2 +- trunk/net/sunrpc/svcauth_unix.c | 3 +- trunk/net/sunrpc/svcsock.c | 319 +-- trunk/net/unix/af_unix.c | 2 +- trunk/net/wanrouter/wanproc.c | 6 +- trunk/net/x25/x25_proc.c | 4 +- trunk/net/xfrm/xfrm_policy.c | 7 +- trunk/net/xfrm/xfrm_user.c | 12 +- trunk/security/inode.c | 4 +- trunk/security/keys/proc.c | 4 +- trunk/security/selinux/selinuxfs.c | 26 +- trunk/sound/core/control.c | 2 +- trunk/sound/core/hwdep.c | 2 +- trunk/sound/core/info.c | 2 +- trunk/sound/core/init.c | 4 +- trunk/sound/core/oss/mixer_oss.c | 2 +- trunk/sound/core/oss/pcm_oss.c | 2 +- trunk/sound/core/pcm_native.c | 2 +- trunk/sound/core/rawmidi.c | 2 +- trunk/sound/core/seq/oss/seq_oss.c | 2 +- trunk/sound/core/seq/seq_clientmgr.c | 2 +- trunk/sound/core/sound.c | 2 +- trunk/sound/core/timer.c | 2 +- trunk/sound/oss/ad1889.c | 4 +- trunk/sound/oss/au1550_ac97.c | 4 +- trunk/sound/oss/btaudio.c | 6 +- trunk/sound/oss/dmasound/dmasound_core.c | 6 +- trunk/sound/oss/emu10k1/audio.c | 2 +- trunk/sound/oss/emu10k1/midi.c | 2 +- trunk/sound/oss/emu10k1/mixer.c | 2 +- trunk/sound/oss/es1371.c | 3 +- trunk/sound/oss/hal2.c | 4 +- trunk/sound/oss/msnd_pinnacle.c | 2 +- trunk/sound/oss/nec_vrc5477.c | 4 +- trunk/sound/oss/os.h | 2 +- trunk/sound/oss/sh_dac_audio.c | 2 +- trunk/sound/oss/soundcard.c | 7 +- trunk/sound/oss/swarm_cs4297a.c | 3 +- trunk/sound/oss/via82cxxx_audio.c | 4 +- trunk/sound/oss/vwsnd.c | 4 +- trunk/sound/sound_core.c | 2 +- 1006 files changed, 14219 insertions(+), 18857 deletions(-) delete mode 100644 trunk/Documentation/fb/s3fb.txt delete mode 100644 trunk/Documentation/gpio.txt delete mode 100644 trunk/drivers/isdn/gigaset/ser-gigaset.c delete mode 100644 trunk/drivers/ps3/ps3av.c delete mode 100644 trunk/drivers/ps3/ps3av_cmd.c delete mode 100644 trunk/drivers/spi/at25.c delete mode 100644 trunk/drivers/spi/omap_uwire.c delete mode 100644 trunk/drivers/spi/spi_imx.c create mode 100644 trunk/drivers/video/S3triofb.c create mode 100644 trunk/drivers/video/cyberfb.c create mode 100644 trunk/drivers/video/cyberfb.h delete mode 100644 trunk/drivers/video/ps3fb.c create mode 100644 trunk/drivers/video/retz3fb.c create mode 100644 trunk/drivers/video/retz3fb.h delete mode 100644 trunk/drivers/video/s3fb.c create mode 100644 trunk/drivers/video/sun3fb.c delete mode 100644 trunk/drivers/video/svgalib.c create mode 100644 trunk/drivers/video/virgefb.c create mode 100644 trunk/drivers/video/virgefb.h delete mode 100644 trunk/fs/ecryptfs/messaging.c delete mode 100644 trunk/fs/ecryptfs/netlink.c delete mode 100644 trunk/include/asm-arm/arch-imx/spi_imx.h delete mode 100644 trunk/include/asm-arm/arch-pxa/gpio.h delete mode 100644 trunk/include/asm-arm/arch-s3c2410/gpio.h delete mode 100644 trunk/include/asm-arm/arch-sa1100/gpio.h delete mode 100644 trunk/include/asm-arm/gpio.h delete mode 100644 trunk/include/asm-generic/gpio.h delete mode 100644 trunk/include/asm-powerpc/ps3av.h delete mode 100644 trunk/include/asm-powerpc/ps3fb.h delete mode 100644 trunk/include/linux/spi/eeprom.h delete mode 100644 trunk/include/linux/svga.h create mode 100644 trunk/include/video/s3blit.h diff --git a/[refs] b/[refs] index 2fe67729333b..3c938e25d414 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 58a3bb59973e33a428d72fa530a3d1d81feb0e8f +refs/heads/master: f65e4fa8e0c6022ad58dc88d1b11b12589ed7f9f diff --git a/trunk/Documentation/drivers/edac/edac.txt b/trunk/Documentation/drivers/edac/edac.txt index 3c5a9e4297b4..7b3d969d2964 100644 --- a/trunk/Documentation/drivers/edac/edac.txt +++ b/trunk/Documentation/drivers/edac/edac.txt @@ -339,21 +339,7 @@ Device Symlink: 'device' - Symlink to the memory controller device. - -Sdram memory scrubbing rate: - - 'sdram_scrub_rate' - - Read/Write attribute file that controls memory scrubbing. The scrubbing - rate is set by writing a minimum bandwith in bytes/sec to the attribute - file. The rate will be translated to an internal value that gives at - least the specified rate. - - Reading the file will return the actual scrubbing rate employed. - - If configuration fails or memory scrubbing is not implemented, the value - of the attribute file will be -1. + Symlink to the memory controller device diff --git a/trunk/Documentation/fb/s3fb.txt b/trunk/Documentation/fb/s3fb.txt deleted file mode 100644 index 8a04c0da0c91..000000000000 --- a/trunk/Documentation/fb/s3fb.txt +++ /dev/null @@ -1,78 +0,0 @@ - - s3fb - fbdev driver for S3 Trio/Virge chips - =========================================== - - -Supported Hardware -================== - - S3 Trio32 - S3 Trio64 (and variants V+, UV+, V2/DX, V2/GX) - S3 Virge (and variants VX, DX, GX and GX2+) - S3 Plato/PX (completely untested) - S3 Aurora64V+ (completely untested) - - - only PCI bus supported - - only BIOS initialized VGA devices supported - - probably not working on big endian - -I tested s3fb on Trio64 (plain, V+ and V2/DX) and Virge (plain, VX, DX), -all on i386. - - -Supported Features -================== - - * 4 bpp pseudocolor modes (with 18bit palette, two variants) - * 8 bpp pseudocolor mode (with 18bit palette) - * 16 bpp truecolor modes (RGB 555 and RGB 565) - * 24 bpp truecolor mode (RGB 888) on (only on Virge VX) - * 32 bpp truecolor mode (RGB 888) on (not on Virge VX) - * text mode (activated by bpp = 0) - * interlaced mode variant (not available in text mode) - * doublescan mode variant (not available in text mode) - * panning in both directions - * suspend/resume support - * DPMS support - -Text mode is supported even in higher resolutions, but there is limitation -to lower pixclocks (maximum between 50-60 MHz, depending on specific hardware). -This limitation is not enforced by driver. Text mode supports 8bit wide fonts -only (hardware limitation) and 16bit tall fonts (driver limitation). - -There are two 4 bpp modes. First mode (selected if nonstd == 0) is mode with -packed pixels, high nibble first. Second mode (selected if nonstd == 1) is mode -with interleaved planes (1 byte interleave), MSB first. Both modes support -8bit wide fonts only (driver limitation). - -Suspend/resume works on systems that initialize video card during resume and -if device is active (for example used by fbcon). - - -Missing Features -================ -(alias TODO list) - - * secondary (not initialized by BIOS) device support - * big endian support - * Zorro bus support - * MMIO support - * 24 bpp mode support on more cards - * support for fontwidths != 8 in 4 bpp modes - * support for fontheight != 16 in text mode - * composite and external sync (is anyone able to test this?) - * hardware cursor - * video overlay support - * vsync synchronization - * feature connector support - * acceleration support (8514-like 2D, Virge 3D, busmaster transfers) - * better values for some magic registers (performance issues) - - -Known bugs -========== - - * cursor disable in text mode doesn't work - --- -Ondrej Zajicek diff --git a/trunk/Documentation/filesystems/ufs.txt b/trunk/Documentation/filesystems/ufs.txt index 7a602adeca2b..2b5a56a6a558 100644 --- a/trunk/Documentation/filesystems/ufs.txt +++ b/trunk/Documentation/filesystems/ufs.txt @@ -21,7 +21,7 @@ ufstype=type_of_ufs supported as read-write ufs2 used in FreeBSD 5.x - supported as read-write + supported as read-only 5xbsd synonym for ufs2 @@ -50,11 +50,12 @@ ufstype=type_of_ufs POSSIBLE PROBLEMS ================= -See next section, if you have any. +There is still bug in reallocation of fragment, in file fs/ufs/balloc.c, +line 364. But it seems working on current buffer cache configuration. BUG REPORTS =========== -Any ufs bug report you can send to daniel.pirkl@email.cz or -to dushistov@mail.ru (do not send partition tables bug reports). +Any ufs bug report you can send to daniel.pirkl@email.cz (do not send +partition tables bug reports.) diff --git a/trunk/Documentation/gpio.txt b/trunk/Documentation/gpio.txt deleted file mode 100644 index 09dd510c4a5f..000000000000 --- a/trunk/Documentation/gpio.txt +++ /dev/null @@ -1,271 +0,0 @@ -GPIO Interfaces - -This provides an overview of GPIO access conventions on Linux. - - -What is a GPIO? -=============== -A "General Purpose Input/Output" (GPIO) is a flexible software-controlled -digital signal. They are provided from many kinds of chip, and are familiar -to Linux developers working with embedded and custom hardware. Each GPIO -represents a bit connected to a particular pin, or "ball" on Ball Grid Array -(BGA) packages. Board schematics show which external hardware connects to -which GPIOs. Drivers can be written generically, so that board setup code -passes such pin configuration data to drivers. - -System-on-Chip (SOC) processors heavily rely on GPIOs. In some cases, every -non-dedicated pin can be configured as a GPIO; and most chips have at least -several dozen of them. Programmable logic devices (like FPGAs) can easily -provide GPIOs; multifunction chips like power managers, and audio codecs -often have a few such pins to help with pin scarcity on SOCs; and there are -also "GPIO Expander" chips that connect using the I2C or SPI serial busses. -Most PC southbridges have a few dozen GPIO-capable pins (with only the BIOS -firmware knowing how they're used). - -The exact capabilities of GPIOs vary between systems. Common options: - - - Output values are writable (high=1, low=0). Some chips also have - options about how that value is driven, so that for example only one - value might be driven ... supporting "wire-OR" and similar schemes - for the other value. - - - Input values are likewise readable (1, 0). Some chips support readback - of pins configured as "output", which is very useful in such "wire-OR" - cases (to support bidirectional signaling). GPIO controllers may have - input de-glitch logic, sometimes with software controls. - - - Inputs can often be used as IRQ signals, often edge triggered but - sometimes level triggered. Such IRQs may be configurable as system - wakeup events, to wake the system from a low power state. - - - Usually a GPIO will be configurable as either input or output, as needed - by different product boards; single direction ones exist too. - - - Most GPIOs can be accessed while holding spinlocks, but those accessed - through a serial bus normally can't. Some systems support both types. - -On a given board each GPIO is used for one specific purpose like monitoring -MMC/SD card insertion/removal, detecting card writeprotect status, driving -a LED, configuring a transceiver, bitbanging a serial bus, poking a hardware -watchdog, sensing a switch, and so on. - - -GPIO conventions -================ -Note that this is called a "convention" because you don't need to do it this -way, and it's no crime if you don't. There **are** cases where portability -is not the main issue; GPIOs are often used for the kind of board-specific -glue logic that may even change between board revisions, and can't ever be -used on a board that's wired differently. Only least-common-denominator -functionality can be very portable. Other features are platform-specific, -and that can be critical for glue logic. - -Plus, this doesn't define an implementation framework, just an interface. -One platform might implement it as simple inline functions accessing chip -registers; another might implement it by delegating through abstractions -used for several very different kinds of GPIO controller. - -That said, if the convention is supported on their platform, drivers should -use it when possible: - - #include - -If you stick to this convention then it'll be easier for other developers to -see what your code is doing, and help maintain it. - - -Identifying GPIOs ------------------ -GPIOs are identified by unsigned integers in the range 0..MAX_INT. That -reserves "negative" numbers for other purposes like marking signals as -"not available on this board", or indicating faults. - -Platforms define how they use those integers, and usually #define symbols -for the GPIO lines so that board-specific setup code directly corresponds -to the relevant schematics. In contrast, drivers should only use GPIO -numbers passed to them from that setup code, using platform_data to hold -board-specific pin configuration data (along with other board specific -data they need). That avoids portability problems. - -So for example one platform uses numbers 32-159 for GPIOs; while another -uses numbers 0..63 with one set of GPIO controllers, 64-79 with another -type of GPIO controller, and on one particular board 80-95 with an FPGA. -The numbers need not be contiguous; either of those platforms could also -use numbers 2000-2063 to identify GPIOs in a bank of I2C GPIO expanders. - -Whether a platform supports multiple GPIO controllers is currently a -platform-specific implementation issue. - - -Using GPIOs ------------ -One of the first things to do with a GPIO, often in board setup code when -setting up a platform_device using the GPIO, is mark its direction: - - /* set as input or output, returning 0 or negative errno */ - int gpio_direction_input(unsigned gpio); - int gpio_direction_output(unsigned gpio); - -The return value is zero for success, else a negative errno. It should -be checked, since the get/set calls don't have error returns and since -misconfiguration is possible. (These calls could sleep.) - -Setting the direction can fail if the GPIO number is invalid, or when -that particular GPIO can't be used in that mode. It's generally a bad -idea to rely on boot firmware to have set the direction correctly, since -it probably wasn't validated to do more than boot Linux. (Similarly, -that board setup code probably needs to multiplex that pin as a GPIO, -and configure pullups/pulldowns appropriately.) - - -Spinlock-Safe GPIO access -------------------------- -Most GPIO controllers can be accessed with memory read/write instructions. -That doesn't need to sleep, and can safely be done from inside IRQ handlers. - -Use these calls to access such GPIOs: - - /* GPIO INPUT: return zero or nonzero */ - int gpio_get_value(unsigned gpio); - - /* GPIO OUTPUT */ - void gpio_set_value(unsigned gpio, int value); - -The values are boolean, zero for low, nonzero for high. When reading the -value of an output pin, the value returned should be what's seen on the -pin ... that won't always match the specified output value, because of -issues including wire-OR and output latencies. - -The get/set calls have no error returns because "invalid GPIO" should have -been reported earlier in gpio_set_direction(). However, note that not all -platforms can read the value of output pins; those that can't should always -return zero. Also, these calls will be ignored for GPIOs that can't safely -be accessed wihtout sleeping (see below). - -Platform-specific implementations are encouraged to optimise the two -calls to access the GPIO value in cases where the GPIO number (and for -output, value) are constant. It's normal for them to need only a couple -of instructions in such cases (reading or writing a hardware register), -and not to need spinlocks. Such optimized calls can make bitbanging -applications a lot more efficient (in both space and time) than spending -dozens of instructions on subroutine calls. - - -GPIO access that may sleep --------------------------- -Some GPIO controllers must be accessed using message based busses like I2C -or SPI. Commands to read or write those GPIO values require waiting to -get to the head of a queue to transmit a command and get its response. -This requires sleeping, which can't be done from inside IRQ handlers. - -Platforms that support this type of GPIO distinguish them from other GPIOs -by returning nonzero from this call: - - int gpio_cansleep(unsigned gpio); - -To access such GPIOs, a different set of accessors is defined: - - /* GPIO INPUT: return zero or nonzero, might sleep */ - int gpio_get_value_cansleep(unsigned gpio); - - /* GPIO OUTPUT, might sleep */ - void gpio_set_value_cansleep(unsigned gpio, int value); - -Other than the fact that these calls might sleep, and will not be ignored -for GPIOs that can't be accessed from IRQ handlers, these calls act the -same as the spinlock-safe calls. - - -Claiming and Releasing GPIOs (OPTIONAL) ---------------------------------------- -To help catch system configuration errors, two calls are defined. -However, many platforms don't currently support this mechanism. - - /* request GPIO, returning 0 or negative errno. - * non-null labels may be useful for diagnostics. - */ - int gpio_request(unsigned gpio, const char *label); - - /* release previously-claimed GPIO */ - void gpio_free(unsigned gpio); - -Passing invalid GPIO numbers to gpio_request() will fail, as will requesting -GPIOs that have already been claimed with that call. The return value of -gpio_request() must be checked. (These calls could sleep.) - -These calls serve two basic purposes. One is marking the signals which -are actually in use as GPIOs, for better diagnostics; systems may have -several hundred potential GPIOs, but often only a dozen are used on any -given board. Another is to catch conflicts between drivers, reporting -errors when drivers wrongly think they have exclusive use of that signal. - -These two calls are optional because not not all current Linux platforms -offer such functionality in their GPIO support; a valid implementation -could return success for all gpio_request() calls. Unlike the other calls, -the state they represent doesn't normally match anything from a hardware -register; it's just a software bitmap which clearly is not necessary for -correct operation of hardware or (bug free) drivers. - -Note that requesting a GPIO does NOT cause it to be configured in any -way; it just marks that GPIO as in use. Separate code must handle any -pin setup (e.g. controlling which pin the GPIO uses, pullup/pulldown). - - -GPIOs mapped to IRQs --------------------- -GPIO numbers are unsigned integers; so are IRQ numbers. These make up -two logically distinct namespaces (GPIO 0 need not use IRQ 0). You can -map between them using calls like: - - /* map GPIO numbers to IRQ numbers */ - int gpio_to_irq(unsigned gpio); - - /* map IRQ numbers to GPIO numbers */ - int irq_to_gpio(unsigned irq); - -Those return either the corresponding number in the other namespace, or -else a negative errno code if the mapping can't be done. (For example, -some GPIOs can't used as IRQs.) It is an unchecked error to use a GPIO -number that hasn't been marked as an input using gpio_set_direction(), or -to use an IRQ number that didn't originally come from gpio_to_irq(). - -These two mapping calls are expected to cost on the order of a single -addition or subtraction. They're not allowed to sleep. - -Non-error values returned from gpio_to_irq() can be passed to request_irq() -or free_irq(). They will often be stored into IRQ resources for platform -devices, by the board-specific initialization code. Note that IRQ trigger -options are part of the IRQ interface, e.g. IRQF_TRIGGER_FALLING, as are -system wakeup capabilities. - -Non-error values returned from irq_to_gpio() would most commonly be used -with gpio_get_value(). - - - -What do these conventions omit? -=============================== -One of the biggest things these conventions omit is pin multiplexing, since -this is highly chip-specific and nonportable. One platform might not need -explicit multiplexing; another might have just two options for use of any -given pin; another might have eight options per pin; another might be able -to route a given GPIO to any one of several pins. (Yes, those examples all -come from systems that run Linux today.) - -Related to multiplexing is configuration and enabling of the pullups or -pulldowns integrated on some platforms. Not all platforms support them, -or support them in the same way; and any given board might use external -pullups (or pulldowns) so that the on-chip ones should not be used. - -There are other system-specific mechanisms that are not specified here, -like the aforementioned options for input de-glitching and wire-OR output. -Hardware may support reading or writing GPIOs in gangs, but that's usually -configuration dependednt: for GPIOs sharing the same bank. (GPIOs are -commonly grouped in banks of 16 or 32, with a given SOC having several such -banks.) Code relying on such mechanisms will necessarily be nonportable. - -Dynamic definition of GPIOs is not currently supported; for example, as -a side effect of configuring an add-on board with some GPIO expanders. - -These calls are purely for kernel space, but a userspace API could be built -on top of it. diff --git a/trunk/Documentation/isdn/README.gigaset b/trunk/Documentation/isdn/README.gigaset index 55b2852904a4..fa0d4cca964a 100644 --- a/trunk/Documentation/isdn/README.gigaset +++ b/trunk/Documentation/isdn/README.gigaset @@ -8,33 +8,29 @@ GigaSet 307x Device Driver This release supports the connection of the Gigaset 307x/417x family of ISDN DECT bases via Gigaset M101 Data, Gigaset M105 Data or direct USB connection. The following devices are reported to be compatible: - - Bases: - Siemens Gigaset 3070/3075 isdn - Siemens Gigaset 4170/4175 isdn - Siemens Gigaset SX205/255 - Siemens Gigaset SX353 - T-Com Sinus 45 [AB] isdn - T-Com Sinus 721X[A] [SE] + 307x/417x: + Gigaset SX255isdn + Gigaset SX353isdn + Sinus 45 [AB] isdn (Deutsche Telekom) + Sinus 721X/XA Vox Chicago 390 ISDN (KPN Telecom) - - RS232 data boxes: - Siemens Gigaset M101 Data - T-Com Sinus 45 Data 1 - - USB data boxes: - Siemens Gigaset M105 Data - Siemens Gigaset USB Adapter DECT - T-Com Sinus 45 Data 2 - T-Com Sinus 721 data + M101: + Sinus 45 Data 1 (Telekom) + M105: + Gigaset USB Adapter DECT + Sinus 45 Data 2 (Telekom) + Sinus 721 data Chicago 390 USB (KPN) - See also http://www.erbze.info/sinus_gigaset.htm and http://gigaset307x.sourceforge.net/ We had also reports from users of Gigaset M105 who could use the drivers with SX 100 and CX 100 ISDN bases (only in unimodem mode, see section 2.4.) If you have another device that works with our driver, please let us know. + For example, Gigaset SX205isdn/Sinus 721 X SE and Gigaset SX303isdn bases + are just versions without answering machine of models known to work, so + they should work just as well; but so far we are lacking positive reports + on these. Chances of getting an USB device to work are good if the output of lsusb @@ -64,28 +60,14 @@ GigaSet 307x Device Driver To get the device working, you have to load the proper kernel module. You can do this using modprobe modulename - where modulename is ser_gigaset (M101), usb_gigaset (M105), or - bas_gigaset (direct USB connection to the base). - - The module ser_gigaset provides a serial line discipline N_GIGASET_M101 - which drives the device through the regular serial line driver. To use it, - run the Gigaset M101 daemon "gigasetm101d" (also available from - http://sourceforge.net/projects/gigaset307x/) with the device file of the - RS232 port to the M101 as an argument, for example: - gigasetm101d /dev/ttyS1 - This will open the device file, set its line discipline to N_GIGASET_M101, - and then sleep in the background, keeping the device open so that the - line discipline remains active. To deactivate it, kill the daemon, for - example with - killall gigasetm101d - before disconnecting the device. + where modulename is usb_gigaset (M105) or bas_gigaset (direct USB + connection to the base). 2.2. Device nodes for user space programs ------------------------------------ The device can be accessed from user space (eg. by the user space tools mentioned in 1.2.) through the device nodes: - - /dev/ttyGS0 for M101 (RS232 data boxes) - /dev/ttyGU0 for M105 (USB data boxes) - /dev/ttyGB0 for the base driver (direct USB connection) @@ -186,19 +168,6 @@ GigaSet 307x Device Driver You can also use /sys/class/tty/ttyGxy/cidmode for changing the CID mode setting (ttyGxy is ttyGU0 or ttyGB0). -2.6. M105 Undocumented USB Requests - ------------------------------ - - The Gigaset M105 USB data box understands a couple of useful, but - undocumented USB commands. These requests are not used in normal - operation (for wireless access to the base), but are needed for access - to the M105's own configuration mode (registration to the base, baudrate - and line format settings, device status queries) via the gigacontr - utility. Their use is disabled in the driver by default for safety - reasons but can be enabled by setting the kernel configuration option - "Support for undocumented USB requests" (GIGASET_UNDOCREQ) to "Y" and - recompiling. - 3. Troubleshooting --------------- diff --git a/trunk/Documentation/kdump/kdump.txt b/trunk/Documentation/kdump/kdump.txt index 79775a4130b5..073306818347 100644 --- a/trunk/Documentation/kdump/kdump.txt +++ b/trunk/Documentation/kdump/kdump.txt @@ -311,10 +311,10 @@ Following are the arch specific command line options to be used while loading dump-capture kernel. For i386, x86_64 and ia64: - "1 irqpoll maxcpus=1" + "init 1 irqpoll maxcpus=1" For ppc64: - "1 maxcpus=1 noirqdistrib" + "init 1 maxcpus=1 noirqdistrib" Notes on loading the dump-capture kernel: @@ -332,8 +332,8 @@ Notes on loading the dump-capture kernel: * You must specify in the format corresponding to the root device name in the output of mount command. -* Boot parameter "1" boots the dump-capture kernel into single-user - mode without networking. If you want networking, use "3". +* "init 1" boots the dump-capture kernel into single-user mode without + networking. If you want networking, use "init 3." * We generally don' have to bring up a SMP kernel just to capture the dump. Hence generally it is useful either to build a UP dump-capture diff --git a/trunk/Documentation/nfsroot.txt b/trunk/Documentation/nfsroot.txt index 16a7cae2721d..719f9a9d60c0 100644 --- a/trunk/Documentation/nfsroot.txt +++ b/trunk/Documentation/nfsroot.txt @@ -67,8 +67,8 @@ nfsroot=[:][,] Standard NFS options. All options are separated by commas. The following defaults are used: port = as given by server portmap daemon - rsize = 4096 - wsize = 4096 + rsize = 1024 + wsize = 1024 timeo = 7 retrans = 3 acregmin = 3 diff --git a/trunk/Documentation/spi/spi-summary b/trunk/Documentation/spi/spi-summary index ecc7c9eb9f29..72795796b13d 100644 --- a/trunk/Documentation/spi/spi-summary +++ b/trunk/Documentation/spi/spi-summary @@ -284,6 +284,7 @@ SPI protocol drivers somewhat resemble platform device drivers: static struct spi_driver CHIP_driver = { .driver = { .name = "CHIP", + .bus = &spi_bus_type, .owner = THIS_MODULE, }, @@ -311,7 +312,7 @@ might look like this unless you're creating a class_device: chip = kzalloc(sizeof *chip, GFP_KERNEL); if (!chip) return -ENOMEM; - spi_set_drvdata(spi, chip); + dev_set_drvdata(&spi->dev, chip); ... etc return 0; diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index f85c603b02a3..9ea954ace2ff 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -1002,12 +1002,14 @@ L: cycsyn-devel@bazar.conectiva.com.br S: Maintained CYCLADES ASYNC MUX DRIVER +M: async@cyclades.com W: http://www.cyclades.com/ -S: Orphan +S: Supported CYCLADES PC300 DRIVER +M: pc300@cyclades.com W: http://www.cyclades.com/ -S: Orphan +S: Supported DAMA SLAVE for AX.25 P: Joerg Reuter diff --git a/trunk/Makefile b/trunk/Makefile index 7e4968fb2134..cdeda68cf2aa 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -789,7 +789,7 @@ $(vmlinux-dirs): prepare scripts pattern = ".*/localversion[^~]*" string = $(shell cat /dev/null \ - `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort -u`) + `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort`) localver = $(subst $(space),, $(string) \ $(patsubst "%",%,$(CONFIG_LOCALVERSION))) diff --git a/trunk/arch/alpha/kernel/setup.c b/trunk/arch/alpha/kernel/setup.c index d352c2b05f1a..1aea7c7c683c 100644 --- a/trunk/arch/alpha/kernel/setup.c +++ b/trunk/arch/alpha/kernel/setup.c @@ -122,7 +122,7 @@ static void get_sysnames(unsigned long, unsigned long, unsigned long, char **, char **); static void determine_cpu_caches (unsigned int); -static char __initdata command_line[COMMAND_LINE_SIZE]; +static char command_line[COMMAND_LINE_SIZE]; /* * The format of "screen_info" is strange, and due to early @@ -547,7 +547,7 @@ setup_arch(char **cmdline_p) } else { strlcpy(command_line, COMMAND_LINE, sizeof command_line); } - strcpy(boot_command_line, command_line); + strcpy(saved_command_line, command_line); *cmdline_p = command_line; /* @@ -589,7 +589,7 @@ setup_arch(char **cmdline_p) } /* Replace the command line, now that we've killed it with strsep. */ - strcpy(command_line, boot_command_line); + strcpy(command_line, saved_command_line); /* If we want SRM console printk echoing early, do it now. */ if (alpha_using_srm && srmcons_output) { diff --git a/trunk/arch/arm/common/rtctime.c b/trunk/arch/arm/common/rtctime.c index bf1075e1f571..4e5445cfb0ea 100644 --- a/trunk/arch/arm/common/rtctime.c +++ b/trunk/arch/arm/common/rtctime.c @@ -329,7 +329,7 @@ static int rtc_fasync(int fd, struct file *file, int on) return fasync_helper(fd, file, on, &rtc_async_queue); } -static const struct file_operations rtc_fops = { +static struct file_operations rtc_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = rtc_read, diff --git a/trunk/arch/arm/kernel/setup.c b/trunk/arch/arm/kernel/setup.c index ed522151878b..bbab134cd82d 100644 --- a/trunk/arch/arm/kernel/setup.c +++ b/trunk/arch/arm/kernel/setup.c @@ -106,7 +106,7 @@ unsigned long phys_initrd_size __initdata = 0; static struct meminfo meminfo __initdata = { 0, }; static const char *cpu_name; static const char *machine_name; -static char __initdata command_line[COMMAND_LINE_SIZE]; +static char command_line[COMMAND_LINE_SIZE]; static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } }; @@ -803,8 +803,8 @@ void __init setup_arch(char **cmdline_p) init_mm.end_data = (unsigned long) &_edata; init_mm.brk = (unsigned long) &_end; - memcpy(boot_command_line, from, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(saved_command_line, from, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; parse_cmdline(cmdline_p, from); paging_init(&meminfo, mdesc); request_standard_resources(&meminfo, mdesc); diff --git a/trunk/arch/arm/mach-at91rm9200/clock.c b/trunk/arch/arm/mach-at91rm9200/clock.c index 36a8e4d1cc6d..4dee21fefe5a 100644 --- a/trunk/arch/arm/mach-at91rm9200/clock.c +++ b/trunk/arch/arm/mach-at91rm9200/clock.c @@ -407,7 +407,7 @@ static int at91_clk_open(struct inode *inode, struct file *file) return single_open(file, at91_clk_show, NULL); } -static const struct file_operations at91_clk_operations = { +static struct file_operations at91_clk_operations = { .open = at91_clk_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/arm/mach-at91rm9200/gpio.c b/trunk/arch/arm/mach-at91rm9200/gpio.c index 15eb5b6b29f2..af22659c8a28 100644 --- a/trunk/arch/arm/mach-at91rm9200/gpio.c +++ b/trunk/arch/arm/mach-at91rm9200/gpio.c @@ -64,24 +64,6 @@ static inline unsigned pin_to_mask(unsigned pin) */ -/* - * mux the pin to the "GPIO" peripheral role. - */ -int __init_or_module at91_set_GPIO_periph(unsigned pin, int use_pullup) -{ - void __iomem *pio = pin_to_controller(pin); - unsigned mask = pin_to_mask(pin); - - if (!pio) - return -EINVAL; - __raw_writel(mask, pio + PIO_IDR); - __raw_writel(mask, pio + (use_pullup ? PIO_PUER : PIO_PUDR)); - __raw_writel(mask, pio + PIO_PER); - return 0; -} -EXPORT_SYMBOL(at91_set_GPIO_periph); - - /* * mux the pin to the "A" internal peripheral role. */ @@ -199,36 +181,6 @@ EXPORT_SYMBOL(at91_set_multi_drive); /*--------------------------------------------------------------------------*/ -/* new-style GPIO calls; these expect at91_set_GPIO_periph to have been - * called, and maybe at91_set_multi_drive() for putout pins. - */ - -int gpio_direction_input(unsigned pin) -{ - void __iomem *pio = pin_to_controller(pin); - unsigned mask = pin_to_mask(pin); - - if (!pio || !(__raw_readl(pio + PIO_PSR) & mask)) - return -EINVAL; - __raw_writel(mask, pio + PIO_OER); - return 0; -} -EXPORT_SYMBOL(gpio_direction_input); - -int gpio_direction_output(unsigned pin) -{ - void __iomem *pio = pin_to_controller(pin); - unsigned mask = pin_to_mask(pin); - - if (!pio || !(__raw_readl(pio + PIO_PSR) & mask)) - return -EINVAL; - __raw_writel(mask, pio + PIO_OER); - return 0; -} -EXPORT_SYMBOL(gpio_direction_output); - -/*--------------------------------------------------------------------------*/ - /* * assuming the pin is muxed as a gpio output, set its value. */ diff --git a/trunk/arch/arm26/kernel/setup.c b/trunk/arch/arm26/kernel/setup.c index 0e006c6cd5a0..466ddb54b44f 100644 --- a/trunk/arch/arm26/kernel/setup.c +++ b/trunk/arch/arm26/kernel/setup.c @@ -80,7 +80,7 @@ unsigned long phys_initrd_size __initdata = 0; static struct meminfo meminfo __initdata = { 0, }; static struct proc_info_item proc_info; static const char *machine_name; -static char __initdata command_line[COMMAND_LINE_SIZE]; +static char command_line[COMMAND_LINE_SIZE]; static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; @@ -492,8 +492,8 @@ void __init setup_arch(char **cmdline_p) init_mm.end_data = (unsigned long) &_edata; init_mm.brk = (unsigned long) &_end; - memcpy(boot_command_line, from, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(saved_command_line, from, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; parse_cmdline(&meminfo, cmdline_p, from); bootmem_init(&meminfo); paging_init(&meminfo); diff --git a/trunk/arch/avr32/kernel/setup.c b/trunk/arch/avr32/kernel/setup.c index a1a7c3c3f522..c6734aefb559 100644 --- a/trunk/arch/avr32/kernel/setup.c +++ b/trunk/arch/avr32/kernel/setup.c @@ -45,7 +45,7 @@ struct avr32_cpuinfo boot_cpu_data = { }; EXPORT_SYMBOL(boot_cpu_data); -static char __initdata command_line[COMMAND_LINE_SIZE]; +static char command_line[COMMAND_LINE_SIZE]; /* * Should be more than enough, but if you have a _really_ complex @@ -202,7 +202,7 @@ __tagtable(ATAG_MEM, parse_tag_mem); static int __init parse_tag_cmdline(struct tag *tag) { - strlcpy(boot_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE); + strlcpy(saved_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE); return 0; } __tagtable(ATAG_CMDLINE, parse_tag_cmdline); @@ -294,7 +294,7 @@ void __init setup_arch (char **cmdline_p) init_mm.end_data = (unsigned long) &_edata; init_mm.brk = (unsigned long) &_end; - strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); + strlcpy(command_line, saved_command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; parse_early_param(); diff --git a/trunk/arch/avr32/mm/tlb.c b/trunk/arch/avr32/mm/tlb.c index 56672018e42f..7b073052203d 100644 --- a/trunk/arch/avr32/mm/tlb.c +++ b/trunk/arch/avr32/mm/tlb.c @@ -360,7 +360,7 @@ static int tlb_open(struct inode *inode, struct file *file) return seq_open(file, &tlb_ops); } -static const struct file_operations proc_tlb_operations = { +static struct file_operations proc_tlb_operations = { .open = tlb_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/cris/arch-v10/drivers/ds1302.c b/trunk/arch/cris/arch-v10/drivers/ds1302.c index 88eff7f54ea6..3cf4f23de1d0 100644 --- a/trunk/arch/cris/arch-v10/drivers/ds1302.c +++ b/trunk/arch/cris/arch-v10/drivers/ds1302.c @@ -499,7 +499,7 @@ print_rtc_status(void) /* The various file operations we support. */ -static const struct file_operations rtc_fops = { +static struct file_operations rtc_fops = { .owner = THIS_MODULE, .ioctl = rtc_ioctl, }; diff --git a/trunk/arch/cris/arch-v10/drivers/eeprom.c b/trunk/arch/cris/arch-v10/drivers/eeprom.c index be35a70798aa..284ebfda03f0 100644 --- a/trunk/arch/cris/arch-v10/drivers/eeprom.c +++ b/trunk/arch/cris/arch-v10/drivers/eeprom.c @@ -172,7 +172,7 @@ static const char eeprom_name[] = "eeprom"; static struct eeprom_type eeprom; /* This is the exported file-operations structure for this device. */ -const struct file_operations eeprom_fops = +struct file_operations eeprom_fops = { .llseek = eeprom_lseek, .read = eeprom_read, diff --git a/trunk/arch/cris/arch-v10/drivers/gpio.c b/trunk/arch/cris/arch-v10/drivers/gpio.c index f389ed6998fe..9aba18b931dd 100644 --- a/trunk/arch/cris/arch-v10/drivers/gpio.c +++ b/trunk/arch/cris/arch-v10/drivers/gpio.c @@ -838,7 +838,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg) return 0; } -const struct file_operations gpio_fops = { +struct file_operations gpio_fops = { .owner = THIS_MODULE, .poll = gpio_poll, .ioctl = gpio_ioctl, diff --git a/trunk/arch/cris/arch-v10/drivers/i2c.c b/trunk/arch/cris/arch-v10/drivers/i2c.c index aca81ddaf60f..092c724a645f 100644 --- a/trunk/arch/cris/arch-v10/drivers/i2c.c +++ b/trunk/arch/cris/arch-v10/drivers/i2c.c @@ -692,7 +692,7 @@ i2c_ioctl(struct inode *inode, struct file *file, return 0; } -static const struct file_operations i2c_fops = { +static struct file_operations i2c_fops = { .owner = THIS_MODULE, .ioctl = i2c_ioctl, .open = i2c_open, diff --git a/trunk/arch/cris/arch-v10/drivers/pcf8563.c b/trunk/arch/cris/arch-v10/drivers/pcf8563.c index 107796e50149..8c830eefc89c 100644 --- a/trunk/arch/cris/arch-v10/drivers/pcf8563.c +++ b/trunk/arch/cris/arch-v10/drivers/pcf8563.c @@ -56,7 +56,7 @@ static const unsigned char days_in_month[] = int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); -static const struct file_operations pcf8563_fops = { +static struct file_operations pcf8563_fops = { .owner = THIS_MODULE, .ioctl = pcf8563_ioctl, }; diff --git a/trunk/arch/cris/arch-v32/drivers/cryptocop.c b/trunk/arch/cris/arch-v32/drivers/cryptocop.c index 1a071f17446d..2449637e6fc0 100644 --- a/trunk/arch/cris/arch-v32/drivers/cryptocop.c +++ b/trunk/arch/cris/arch-v32/drivers/cryptocop.c @@ -266,7 +266,7 @@ static void print_user_dma_lists(struct cryptocop_dma_list_operation *dma_op); -const struct file_operations cryptocop_fops = { +struct file_operations cryptocop_fops = { owner: THIS_MODULE, open: cryptocop_open, release: cryptocop_release, diff --git a/trunk/arch/cris/arch-v32/drivers/gpio.c b/trunk/arch/cris/arch-v32/drivers/gpio.c index d82c5c561135..08d36f0955c6 100644 --- a/trunk/arch/cris/arch-v32/drivers/gpio.c +++ b/trunk/arch/cris/arch-v32/drivers/gpio.c @@ -705,7 +705,7 @@ gpio_leds_ioctl(unsigned int cmd, unsigned long arg) return 0; } -const struct file_operations gpio_fops = { +struct file_operations gpio_fops = { .owner = THIS_MODULE, .poll = gpio_poll, .ioctl = gpio_ioctl, diff --git a/trunk/arch/cris/arch-v32/drivers/i2c.c b/trunk/arch/cris/arch-v32/drivers/i2c.c index 5d6c52737df3..95f00188c628 100644 --- a/trunk/arch/cris/arch-v32/drivers/i2c.c +++ b/trunk/arch/cris/arch-v32/drivers/i2c.c @@ -573,7 +573,7 @@ i2c_ioctl(struct inode *inode, struct file *file, return 0; } -static const struct file_operations i2c_fops = { +static struct file_operations i2c_fops = { owner: THIS_MODULE, ioctl: i2c_ioctl, open: i2c_open, diff --git a/trunk/arch/cris/arch-v32/drivers/pcf8563.c b/trunk/arch/cris/arch-v32/drivers/pcf8563.c index 544ab0179411..2fc7d75a35de 100644 --- a/trunk/arch/cris/arch-v32/drivers/pcf8563.c +++ b/trunk/arch/cris/arch-v32/drivers/pcf8563.c @@ -50,7 +50,7 @@ int pcf8563_ioctl(struct inode *, struct file *, unsigned int, unsigned long); int pcf8563_open(struct inode *, struct file *); int pcf8563_release(struct inode *, struct file *); -static const struct file_operations pcf8563_fops = { +static struct file_operations pcf8563_fops = { owner: THIS_MODULE, ioctl: pcf8563_ioctl, open: pcf8563_open, diff --git a/trunk/arch/cris/arch-v32/drivers/sync_serial.c b/trunk/arch/cris/arch-v32/drivers/sync_serial.c index df89298aafc4..424eb0eb1cd5 100644 --- a/trunk/arch/cris/arch-v32/drivers/sync_serial.c +++ b/trunk/arch/cris/arch-v32/drivers/sync_serial.c @@ -187,7 +187,7 @@ static struct sync_port ports[]= #define NUMBER_OF_PORTS (sizeof(ports)/sizeof(sync_port)) -static const struct file_operations sync_serial_fops = { +static struct file_operations sync_serial_fops = { .owner = THIS_MODULE, .write = sync_serial_write, .read = sync_serial_read, diff --git a/trunk/arch/cris/kernel/profile.c b/trunk/arch/cris/kernel/profile.c index 4cfcae620507..f60ab785f235 100644 --- a/trunk/arch/cris/kernel/profile.c +++ b/trunk/arch/cris/kernel/profile.c @@ -50,7 +50,7 @@ write_cris_profile(struct file *file, const char __user *buf, memset(sample_buffer, 0, SAMPLE_BUFFER_SIZE); } -static const struct file_operations cris_proc_profile_operations = { +static struct file_operations cris_proc_profile_operations = { .read = read_cris_profile, .write = write_cris_profile, }; diff --git a/trunk/arch/cris/kernel/setup.c b/trunk/arch/cris/kernel/setup.c index 65466c49d7a9..ca8b45a0fe2e 100644 --- a/trunk/arch/cris/kernel/setup.c +++ b/trunk/arch/cris/kernel/setup.c @@ -29,7 +29,7 @@ struct screen_info screen_info; extern int root_mountflags; extern char _etext, _edata, _end; -char __initdata cris_command_line[COMMAND_LINE_SIZE] = { 0, }; +char cris_command_line[COMMAND_LINE_SIZE] = { 0, }; extern const unsigned long text_start, edata; /* set by the linker script */ extern unsigned long dram_start, dram_end; @@ -153,8 +153,8 @@ setup_arch(char **cmdline_p) #endif /* Save command line for future references. */ - memcpy(boot_command_line, cris_command_line, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE - 1] = '\0'; + memcpy(saved_command_line, cris_command_line, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE - 1] = '\0'; /* give credit for the CRIS port */ show_etrax_copyright(); diff --git a/trunk/arch/frv/kernel/setup.c b/trunk/arch/frv/kernel/setup.c index 8ea3ca2aba62..1a5eb6c301c9 100644 --- a/trunk/arch/frv/kernel/setup.c +++ b/trunk/arch/frv/kernel/setup.c @@ -110,7 +110,7 @@ unsigned long __initdata num_mappedpages; struct cpuinfo_frv __nongprelbss boot_cpu_data; -char __initdata command_line[COMMAND_LINE_SIZE]; +char command_line[COMMAND_LINE_SIZE]; char __initdata redboot_command_line[COMMAND_LINE_SIZE]; #ifdef CONFIG_PM @@ -762,7 +762,7 @@ void __init setup_arch(char **cmdline_p) printk("uClinux FR-V port done by Red Hat Inc \n"); #endif - memcpy(boot_command_line, redboot_command_line, COMMAND_LINE_SIZE); + memcpy(saved_command_line, redboot_command_line, COMMAND_LINE_SIZE); determine_cpu(); determine_clocks(1); @@ -803,7 +803,7 @@ void __init setup_arch(char **cmdline_p) #endif /* deal with the command line - RedBoot may have passed one to the kernel */ - memcpy(command_line, boot_command_line, sizeof(command_line)); + memcpy(command_line, saved_command_line, sizeof(command_line)); *cmdline_p = &command_line[0]; parse_cmdline_early(command_line); diff --git a/trunk/arch/h8300/kernel/setup.c b/trunk/arch/h8300/kernel/setup.c index 313cd8081044..6adf8f41d2a1 100644 --- a/trunk/arch/h8300/kernel/setup.c +++ b/trunk/arch/h8300/kernel/setup.c @@ -54,7 +54,7 @@ unsigned long rom_length; unsigned long memory_start; unsigned long memory_end; -char __initdata command_line[COMMAND_LINE_SIZE]; +char command_line[COMMAND_LINE_SIZE]; extern int _stext, _etext, _sdata, _edata, _sbss, _ebss, _end; extern int _ramstart, _ramend; @@ -154,8 +154,8 @@ void __init setup_arch(char **cmdline_p) #endif /* Keep a copy of command line */ *cmdline_p = &command_line[0]; - memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE-1] = 0; + memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE-1] = 0; #ifdef DEBUG if (strlen(*cmdline_p)) diff --git a/trunk/arch/i386/kernel/apm.c b/trunk/arch/i386/kernel/apm.c index db99a8948dae..199016927541 100644 --- a/trunk/arch/i386/kernel/apm.c +++ b/trunk/arch/i386/kernel/apm.c @@ -1894,7 +1894,7 @@ static int __init apm_setup(char *str) __setup("apm=", apm_setup); #endif -static const struct file_operations apm_bios_fops = { +static struct file_operations apm_bios_fops = { .owner = THIS_MODULE, .read = do_read, .poll = do_poll, diff --git a/trunk/arch/i386/kernel/cpu/mtrr/if.c b/trunk/arch/i386/kernel/cpu/mtrr/if.c index ee771f305f96..5ae1705eafa6 100644 --- a/trunk/arch/i386/kernel/cpu/mtrr/if.c +++ b/trunk/arch/i386/kernel/cpu/mtrr/if.c @@ -339,7 +339,7 @@ static int mtrr_open(struct inode *inode, struct file *file) return single_open(file, mtrr_seq_show, NULL); } -static const struct file_operations mtrr_fops = { +static struct file_operations mtrr_fops = { .owner = THIS_MODULE, .open = mtrr_open, .read = seq_read, diff --git a/trunk/arch/i386/kernel/cpuid.c b/trunk/arch/i386/kernel/cpuid.c index 4da75fa3208d..51130b39cd2e 100644 --- a/trunk/arch/i386/kernel/cpuid.c +++ b/trunk/arch/i386/kernel/cpuid.c @@ -148,7 +148,7 @@ static int cpuid_open(struct inode *inode, struct file *file) /* * File operations we support */ -static const struct file_operations cpuid_fops = { +static struct file_operations cpuid_fops = { .owner = THIS_MODULE, .llseek = cpuid_seek, .read = cpuid_read, diff --git a/trunk/arch/i386/kernel/head.S b/trunk/arch/i386/kernel/head.S index cb9abdfced9b..edef5084ce17 100644 --- a/trunk/arch/i386/kernel/head.S +++ b/trunk/arch/i386/kernel/head.S @@ -103,7 +103,7 @@ ENTRY(startup_32) movzwl OLD_CL_OFFSET,%esi addl $(OLD_CL_BASE_ADDR),%esi 2: - movl $(boot_command_line - __PAGE_OFFSET),%edi + movl $(saved_command_line - __PAGE_OFFSET),%edi movl $(COMMAND_LINE_SIZE/4),%ecx rep movsl diff --git a/trunk/arch/i386/kernel/microcode.c b/trunk/arch/i386/kernel/microcode.c index 381252bae3d8..c8fa13721bcb 100644 --- a/trunk/arch/i386/kernel/microcode.c +++ b/trunk/arch/i386/kernel/microcode.c @@ -451,7 +451,7 @@ static ssize_t microcode_write (struct file *file, const char __user *buf, size_ return ret; } -static const struct file_operations microcode_fops = { +static struct file_operations microcode_fops = { .owner = THIS_MODULE, .write = microcode_write, .open = microcode_open, diff --git a/trunk/arch/i386/kernel/msr.c b/trunk/arch/i386/kernel/msr.c index 4e14264f392a..4a472a17d1c6 100644 --- a/trunk/arch/i386/kernel/msr.c +++ b/trunk/arch/i386/kernel/msr.c @@ -230,7 +230,7 @@ static int msr_open(struct inode *inode, struct file *file) /* * File operations we support */ -static const struct file_operations msr_fops = { +static struct file_operations msr_fops = { .owner = THIS_MODULE, .llseek = msr_seek, .read = msr_read, diff --git a/trunk/arch/i386/kernel/setup.c b/trunk/arch/i386/kernel/setup.c index 4694ac980cd2..4b31ad70c1ac 100644 --- a/trunk/arch/i386/kernel/setup.c +++ b/trunk/arch/i386/kernel/setup.c @@ -132,7 +132,7 @@ unsigned long saved_videomode; #define RAMDISK_PROMPT_FLAG 0x8000 #define RAMDISK_LOAD_FLAG 0x4000 -static char __initdata command_line[COMMAND_LINE_SIZE]; +static char command_line[COMMAND_LINE_SIZE]; unsigned char __initdata boot_params[PARAM_SIZE]; @@ -576,7 +576,7 @@ void __init setup_arch(char **cmdline_p) print_memory_map("user"); } - strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); + strlcpy(command_line, saved_command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; max_low_pfn = setup_memory(); diff --git a/trunk/arch/ia64/hp/common/sba_iommu.c b/trunk/arch/ia64/hp/common/sba_iommu.c index c1dca226b479..ce49fe3a3b56 100644 --- a/trunk/arch/ia64/hp/common/sba_iommu.c +++ b/trunk/arch/ia64/hp/common/sba_iommu.c @@ -1881,7 +1881,7 @@ ioc_open(struct inode *inode, struct file *file) return seq_open(file, &ioc_seq_ops); } -static const struct file_operations ioc_fops = { +static struct file_operations ioc_fops = { .open = ioc_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/ia64/kernel/efi.c b/trunk/arch/ia64/kernel/efi.c index 772ba6fe110f..6c03928544c2 100644 --- a/trunk/arch/ia64/kernel/efi.c +++ b/trunk/arch/ia64/kernel/efi.c @@ -413,10 +413,11 @@ efi_init (void) efi_char16_t *c16; u64 efi_desc_size; char *cp, vendor[100] = "unknown"; + extern char saved_command_line[]; int i; /* it's too early to be able to use the standard kernel command line support... */ - for (cp = boot_command_line; *cp; ) { + for (cp = saved_command_line; *cp; ) { if (memcmp(cp, "mem=", 4) == 0) { mem_limit = memparse(cp + 4, &cp); } else if (memcmp(cp, "max_addr=", 9) == 0) { diff --git a/trunk/arch/ia64/kernel/perfmon.c b/trunk/arch/ia64/kernel/perfmon.c index 9860794a68fb..86e144f321ff 100644 --- a/trunk/arch/ia64/kernel/perfmon.c +++ b/trunk/arch/ia64/kernel/perfmon.c @@ -621,7 +621,7 @@ EXPORT_PER_CPU_SYMBOL_GPL(pfm_syst_info); /* forward declaration */ -static const struct file_operations pfm_file_ops; +static struct file_operations pfm_file_ops; /* * forward declarations @@ -2126,7 +2126,7 @@ pfm_no_open(struct inode *irrelevant, struct file *dontcare) -static const struct file_operations pfm_file_ops = { +static struct file_operations pfm_file_ops = { .llseek = no_llseek, .read = pfm_read, .write = pfm_write, @@ -6596,7 +6596,7 @@ pfm_probe_pmu(void) return 0; } -static const struct file_operations pfm_proc_fops = { +static struct file_operations pfm_proc_fops = { .open = pfm_proc_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/ia64/kernel/sal.c b/trunk/arch/ia64/kernel/sal.c index 37c876f95dba..20bad78b5073 100644 --- a/trunk/arch/ia64/kernel/sal.c +++ b/trunk/arch/ia64/kernel/sal.c @@ -194,8 +194,9 @@ static void __init chk_nointroute_opt(void) { char *cp; + extern char saved_command_line[]; - for (cp = boot_command_line; *cp; ) { + for (cp = saved_command_line; *cp; ) { if (memcmp(cp, "nointroute", 10) == 0) { no_int_routing = 1; printk ("no_int_routing on\n"); diff --git a/trunk/arch/ia64/kernel/salinfo.c b/trunk/arch/ia64/kernel/salinfo.c index af9f8754d847..e375a2f0f2c3 100644 --- a/trunk/arch/ia64/kernel/salinfo.c +++ b/trunk/arch/ia64/kernel/salinfo.c @@ -352,7 +352,7 @@ salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t return size; } -static const struct file_operations salinfo_event_fops = { +static struct file_operations salinfo_event_fops = { .open = salinfo_event_open, .read = salinfo_event_read, }; @@ -568,7 +568,7 @@ salinfo_log_write(struct file *file, const char __user *buffer, size_t count, lo return count; } -static const struct file_operations salinfo_data_fops = { +static struct file_operations salinfo_data_fops = { .open = salinfo_log_open, .release = salinfo_log_release, .read = salinfo_log_read, diff --git a/trunk/arch/ia64/kernel/setup.c b/trunk/arch/ia64/kernel/setup.c index 5fa09d141ab7..83c2629e1c4c 100644 --- a/trunk/arch/ia64/kernel/setup.c +++ b/trunk/arch/ia64/kernel/setup.c @@ -262,7 +262,7 @@ reserve_memory (void) * appropriate after a kernel panic. */ { - char *from = strstr(boot_command_line, "crashkernel="); + char *from = strstr(saved_command_line, "crashkernel="); unsigned long base, size; if (from) { size = memparse(from + 12, &from); @@ -463,7 +463,7 @@ setup_arch (char **cmdline_p) ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist); *cmdline_p = __va(ia64_boot_param->command_line); - strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE); + strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE); efi_init(); io_port_init(); diff --git a/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c b/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c index 601747b1e22a..d9d306c79f2d 100644 --- a/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/trunk/arch/ia64/sn/kernel/sn2/sn2_smp.c @@ -455,7 +455,7 @@ static int sn2_ptc_proc_open(struct inode *inode, struct file *file) return seq_open(file, &sn2_ptc_seq_ops); } -static const struct file_operations proc_sn2_ptc_operations = { +static struct file_operations proc_sn2_ptc_operations = { .open = sn2_ptc_proc_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 6da9854751cd..33367996d72d 100644 --- a/trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/trunk/arch/ia64/sn/kernel/sn2/sn_hwperf.c @@ -865,7 +865,7 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg) return r; } -static const struct file_operations sn_hwperf_fops = { +static struct file_operations sn_hwperf_fops = { .ioctl = sn_hwperf_ioctl, }; diff --git a/trunk/arch/m32r/kernel/setup.c b/trunk/arch/m32r/kernel/setup.c index d64814385d70..936205f7aba0 100644 --- a/trunk/arch/m32r/kernel/setup.c +++ b/trunk/arch/m32r/kernel/setup.c @@ -64,7 +64,7 @@ struct screen_info screen_info = { extern int root_mountflags; -static char __initdata command_line[COMMAND_LINE_SIZE]; +static char command_line[COMMAND_LINE_SIZE]; static struct resource data_resource = { .name = "Kernel data", @@ -95,8 +95,8 @@ static __inline__ void parse_mem_cmdline(char ** cmdline_p) int usermem = 0; /* Save unparsed command line copy for /proc/cmdline */ - memcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; memory_start = (unsigned long)CONFIG_MEMORY_START+PAGE_OFFSET; memory_end = memory_start+(unsigned long)CONFIG_MEMORY_SIZE; diff --git a/trunk/arch/m68k/bvme6000/rtc.c b/trunk/arch/m68k/bvme6000/rtc.c index a812d03879f8..15c16b62dff5 100644 --- a/trunk/arch/m68k/bvme6000/rtc.c +++ b/trunk/arch/m68k/bvme6000/rtc.c @@ -159,7 +159,7 @@ static int rtc_release(struct inode *inode, struct file *file) * The various file operations we support. */ -static const struct file_operations rtc_fops = { +static struct file_operations rtc_fops = { .ioctl = rtc_ioctl, .open = rtc_open, .release = rtc_release, diff --git a/trunk/arch/m68k/kernel/setup.c b/trunk/arch/m68k/kernel/setup.c index 42b8fd09ea8f..9af3ee0e555d 100644 --- a/trunk/arch/m68k/kernel/setup.c +++ b/trunk/arch/m68k/kernel/setup.c @@ -256,7 +256,7 @@ void __init setup_arch(char **cmdline_p) init_mm.brk = (unsigned long) &_end; *cmdline_p = m68k_command_line; - memcpy(boot_command_line, *cmdline_p, CL_SIZE); + memcpy(saved_command_line, *cmdline_p, CL_SIZE); /* Parse the command line for arch-specific options. * For the m68k, this is currently only "debug=xxx" to enable printing diff --git a/trunk/arch/m68k/mvme16x/rtc.c b/trunk/arch/m68k/mvme16x/rtc.c index 272d47eac58d..b0e4c084df8a 100644 --- a/trunk/arch/m68k/mvme16x/rtc.c +++ b/trunk/arch/m68k/mvme16x/rtc.c @@ -147,7 +147,7 @@ static int rtc_release(struct inode *inode, struct file *file) * The various file operations we support. */ -static const struct file_operations rtc_fops = { +static struct file_operations rtc_fops = { .ioctl = rtc_ioctl, .open = rtc_open, .release = rtc_release, diff --git a/trunk/arch/m68knommu/kernel/setup.c b/trunk/arch/m68knommu/kernel/setup.c index d5c25d27b64d..9cf2e4d1fc77 100644 --- a/trunk/arch/m68knommu/kernel/setup.c +++ b/trunk/arch/m68knommu/kernel/setup.c @@ -44,7 +44,7 @@ unsigned long memory_end; EXPORT_SYMBOL(memory_start); EXPORT_SYMBOL(memory_end); -char __initdata command_line[COMMAND_LINE_SIZE]; +char command_line[COMMAND_LINE_SIZE]; /* setup some dummy routines */ static void dummy_waitbut(void) @@ -231,8 +231,8 @@ void setup_arch(char **cmdline_p) /* Keep a copy of command line */ *cmdline_p = &command_line[0]; - memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE-1] = 0; + memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE-1] = 0; #ifdef DEBUG if (strlen(*cmdline_p)) diff --git a/trunk/arch/mips/kernel/rtlx.c b/trunk/arch/mips/kernel/rtlx.c index d92c48e0d7a6..f29e93c6ccfc 100644 --- a/trunk/arch/mips/kernel/rtlx.c +++ b/trunk/arch/mips/kernel/rtlx.c @@ -478,7 +478,7 @@ static ssize_t file_write(struct file *file, const char __user * buffer, return rtlx_write(minor, (void *)buffer, count, 1); } -static const struct file_operations rtlx_fops = { +static struct file_operations rtlx_fops = { .owner = THIS_MODULE, .open = file_open, .release = file_release, diff --git a/trunk/arch/mips/kernel/setup.c b/trunk/arch/mips/kernel/setup.c index 394540fad769..d2e01e7167b8 100644 --- a/trunk/arch/mips/kernel/setup.c +++ b/trunk/arch/mips/kernel/setup.c @@ -452,7 +452,7 @@ static void __init arch_mem_init(char **cmdline_p) print_memory_map(); strlcpy(command_line, arcs_cmdline, sizeof(command_line)); - strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); + strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; diff --git a/trunk/arch/mips/kernel/vpe.c b/trunk/arch/mips/kernel/vpe.c index 9aca871a307f..4e832da48c69 100644 --- a/trunk/arch/mips/kernel/vpe.c +++ b/trunk/arch/mips/kernel/vpe.c @@ -1208,7 +1208,7 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer, return ret; } -static const struct file_operations vpe_fops = { +static struct file_operations vpe_fops = { .owner = THIS_MODULE, .open = vpe_open, .release = vpe_release, diff --git a/trunk/arch/mips/sibyte/sb1250/bcm1250_tbprof.c b/trunk/arch/mips/sibyte/sb1250/bcm1250_tbprof.c index 212547c57310..d1a906e683b2 100644 --- a/trunk/arch/mips/sibyte/sb1250/bcm1250_tbprof.c +++ b/trunk/arch/mips/sibyte/sb1250/bcm1250_tbprof.c @@ -374,7 +374,7 @@ static long sbprof_tb_ioctl(struct file *filp, return error; } -static const struct file_operations sbprof_tb_fops = { +static struct file_operations sbprof_tb_fops = { .owner = THIS_MODULE, .open = sbprof_tb_open, .release = sbprof_tb_release, diff --git a/trunk/arch/parisc/kernel/perf.c b/trunk/arch/parisc/kernel/perf.c index a46bc62b643e..ac8ee205c351 100644 --- a/trunk/arch/parisc/kernel/perf.c +++ b/trunk/arch/parisc/kernel/perf.c @@ -479,7 +479,7 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return error; } -static const struct file_operations perf_fops = { +static struct file_operations perf_fops = { .llseek = no_llseek, .read = perf_read, .write = perf_write, diff --git a/trunk/arch/parisc/kernel/setup.c b/trunk/arch/parisc/kernel/setup.c index 74b3686dd1e0..3c7a3faf78ed 100644 --- a/trunk/arch/parisc/kernel/setup.c +++ b/trunk/arch/parisc/kernel/setup.c @@ -45,7 +45,7 @@ #include #include -char __initdata command_line[COMMAND_LINE_SIZE] __read_mostly; +char command_line[COMMAND_LINE_SIZE] __read_mostly; /* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */ struct proc_dir_entry * proc_runway_root __read_mostly = NULL; @@ -71,9 +71,9 @@ void __init setup_cmdline(char **cmdline_p) /* boot_args[0] is free-mem start, boot_args[1] is ptr to command line */ if (boot_args[0] < 64) { /* called from hpux boot loader */ - boot_command_line[0] = '\0'; + saved_command_line[0] = '\0'; } else { - strcpy(boot_command_line, (char *)__va(boot_args[1])); + strcpy(saved_command_line, (char *)__va(boot_args[1])); #ifdef CONFIG_BLK_DEV_INITRD if (boot_args[2] != 0) /* did palo pass us a ramdisk? */ @@ -84,7 +84,7 @@ void __init setup_cmdline(char **cmdline_p) #endif } - strcpy(command_line, boot_command_line); + strcpy(command_line, saved_command_line); *cmdline_p = command_line; } diff --git a/trunk/arch/parisc/mm/init.c b/trunk/arch/parisc/mm/init.c index 12117db0043b..0c118e584e73 100644 --- a/trunk/arch/parisc/mm/init.c +++ b/trunk/arch/parisc/mm/init.c @@ -77,11 +77,12 @@ static void __init mem_limit_func(void) { char *cp, *end; unsigned long limit; + extern char saved_command_line[]; /* We need this before __setup() functions are called */ limit = MAX_MEM; - for (cp = boot_command_line; *cp; ) { + for (cp = saved_command_line; *cp; ) { if (memcmp(cp, "mem=", 4) == 0) { cp += 4; limit = memparse(cp, &end); diff --git a/trunk/arch/powerpc/configs/ps3_defconfig b/trunk/arch/powerpc/configs/ps3_defconfig index 0345a2ceec59..ec644b34a082 100644 --- a/trunk/arch/powerpc/configs/ps3_defconfig +++ b/trunk/arch/powerpc/configs/ps3_defconfig @@ -163,7 +163,6 @@ CONFIG_PS3_HTAB_SIZE=20 # CONFIG_PS3_DYNAMIC_DMA is not set CONFIG_PS3_USE_LPAR_ADDR=y CONFIG_PS3_VUART=y -CONFIG_PS3_PS3AV=y # # Kernel options @@ -612,40 +611,14 @@ CONFIG_GEN_RTC=y # Graphics support # # CONFIG_FIRMWARE_EDID is not set -CONFIG_FB=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_IMAGEBLIT=y -# CONFIG_FB_MACMODES is not set -# CONFIG_FB_BACKLIGHT is not set -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_TILEBLITTING is not set -# CONFIG_FB_OF is not set -# CONFIG_FB_VGA16 is not set -# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB is not set # CONFIG_FB_IBM_GXT4500 is not set -CONFIG_FB_PS3=y -CONFIG_FB_PS3_DEFAULT_SIZE_M=18 -# CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE=y -# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set -# CONFIG_FONTS is not set -CONFIG_FONT_8x8=y -CONFIG_FONT_8x16=y - -# -# Logo configuration -# -CONFIG_LOGO=y -# CONFIG_LOGO_LINUX_MONO is not set -# CONFIG_LOGO_LINUX_VGA16 is not set -CONFIG_LOGO_LINUX_CLUT224=y # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # diff --git a/trunk/arch/powerpc/kernel/legacy_serial.c b/trunk/arch/powerpc/kernel/legacy_serial.c index 89f46f377922..5e6ddfa474c0 100644 --- a/trunk/arch/powerpc/kernel/legacy_serial.c +++ b/trunk/arch/powerpc/kernel/legacy_serial.c @@ -498,7 +498,7 @@ static int __init check_legacy_serial_console(void) DBG(" -> check_legacy_serial_console()\n"); /* The user has requested a console so this is already set up. */ - if (strstr(boot_command_line, "console=")) { + if (strstr(saved_command_line, "console=")) { DBG(" console was specified !\n"); return -EBUSY; } diff --git a/trunk/arch/powerpc/kernel/lparcfg.c b/trunk/arch/powerpc/kernel/lparcfg.c index 89486b631284..0de5a08cf9b0 100644 --- a/trunk/arch/powerpc/kernel/lparcfg.c +++ b/trunk/arch/powerpc/kernel/lparcfg.c @@ -571,7 +571,7 @@ static int lparcfg_open(struct inode *inode, struct file *file) return single_open(file, lparcfg_data, NULL); } -const struct file_operations lparcfg_fops = { +struct file_operations lparcfg_fops = { .owner = THIS_MODULE, .read = seq_read, .write = lparcfg_write, diff --git a/trunk/arch/powerpc/kernel/nvram_64.c b/trunk/arch/powerpc/kernel/nvram_64.c index f9676f52c6d8..869cebbba967 100644 --- a/trunk/arch/powerpc/kernel/nvram_64.c +++ b/trunk/arch/powerpc/kernel/nvram_64.c @@ -179,7 +179,7 @@ static int dev_nvram_ioctl(struct inode *inode, struct file *file, } } -const struct file_operations nvram_fops = { +struct file_operations nvram_fops = { .owner = THIS_MODULE, .llseek = dev_nvram_llseek, .read = dev_nvram_read, diff --git a/trunk/arch/powerpc/kernel/proc_ppc64.c b/trunk/arch/powerpc/kernel/proc_ppc64.c index f78dfce1b771..3d437c32546e 100644 --- a/trunk/arch/powerpc/kernel/proc_ppc64.c +++ b/trunk/arch/powerpc/kernel/proc_ppc64.c @@ -33,7 +33,7 @@ static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes loff_t *ppos); static int page_map_mmap( struct file *file, struct vm_area_struct *vma ); -static const struct file_operations page_map_fops = { +static struct file_operations page_map_fops = { .llseek = page_map_seek, .read = page_map_read, .mmap = page_map_mmap diff --git a/trunk/arch/powerpc/kernel/prom.c b/trunk/arch/powerpc/kernel/prom.c index 3e86e6e0f778..3be52d693eca 100644 --- a/trunk/arch/powerpc/kernel/prom.c +++ b/trunk/arch/powerpc/kernel/prom.c @@ -991,7 +991,7 @@ void __init early_init_devtree(void *params) of_scan_flat_dt(early_init_dt_scan_memory, NULL); /* Save command line for /proc/cmdline and then parse parameters */ - strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); + strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); parse_early_param(); /* Reserve LMB regions used by kernel, initrd, dt, etc... */ diff --git a/trunk/arch/powerpc/kernel/rtas-proc.c b/trunk/arch/powerpc/kernel/rtas-proc.c index 6cbf2ae5d7aa..2fe82abf1c52 100644 --- a/trunk/arch/powerpc/kernel/rtas-proc.c +++ b/trunk/arch/powerpc/kernel/rtas-proc.c @@ -160,7 +160,7 @@ static int sensors_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_sensors_show, NULL); } -const struct file_operations ppc_rtas_sensors_operations = { +struct file_operations ppc_rtas_sensors_operations = { .open = sensors_open, .read = seq_read, .llseek = seq_lseek, @@ -172,7 +172,7 @@ static int poweron_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_poweron_show, NULL); } -const struct file_operations ppc_rtas_poweron_operations = { +struct file_operations ppc_rtas_poweron_operations = { .open = poweron_open, .read = seq_read, .llseek = seq_lseek, @@ -185,7 +185,7 @@ static int progress_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_progress_show, NULL); } -const struct file_operations ppc_rtas_progress_operations = { +struct file_operations ppc_rtas_progress_operations = { .open = progress_open, .read = seq_read, .llseek = seq_lseek, @@ -198,7 +198,7 @@ static int clock_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_clock_show, NULL); } -const struct file_operations ppc_rtas_clock_operations = { +struct file_operations ppc_rtas_clock_operations = { .open = clock_open, .read = seq_read, .llseek = seq_lseek, @@ -211,7 +211,7 @@ static int tone_freq_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_tone_freq_show, NULL); } -const struct file_operations ppc_rtas_tone_freq_operations = { +struct file_operations ppc_rtas_tone_freq_operations = { .open = tone_freq_open, .read = seq_read, .llseek = seq_lseek, @@ -224,7 +224,7 @@ static int tone_volume_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_tone_volume_show, NULL); } -const struct file_operations ppc_rtas_tone_volume_operations = { +struct file_operations ppc_rtas_tone_volume_operations = { .open = tone_volume_open, .read = seq_read, .llseek = seq_lseek, @@ -237,7 +237,7 @@ static int rmo_buf_open(struct inode *inode, struct file *file) return single_open(file, ppc_rtas_rmo_buf_show, NULL); } -const struct file_operations ppc_rtas_rmo_buf_ops = { +struct file_operations ppc_rtas_rmo_buf_ops = { .open = rmo_buf_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/powerpc/kernel/rtas_flash.c b/trunk/arch/powerpc/kernel/rtas_flash.c index f72118c0844f..65e4ebe8db31 100644 --- a/trunk/arch/powerpc/kernel/rtas_flash.c +++ b/trunk/arch/powerpc/kernel/rtas_flash.c @@ -702,7 +702,7 @@ static int initialize_flash_pde_data(const char *rtas_call_name, } static struct proc_dir_entry *create_flash_pde(const char *filename, - const struct file_operations *fops) + struct file_operations *fops) { struct proc_dir_entry *ent = NULL; @@ -715,21 +715,21 @@ static struct proc_dir_entry *create_flash_pde(const char *filename, return ent; } -static const struct file_operations rtas_flash_operations = { +static struct file_operations rtas_flash_operations = { .read = rtas_flash_read, .write = rtas_flash_write, .open = rtas_excl_open, .release = rtas_flash_release, }; -static const struct file_operations manage_flash_operations = { +static struct file_operations manage_flash_operations = { .read = manage_flash_read, .write = manage_flash_write, .open = rtas_excl_open, .release = rtas_excl_release, }; -static const struct file_operations validate_flash_operations = { +static struct file_operations validate_flash_operations = { .read = validate_flash_read, .write = validate_flash_write, .open = rtas_excl_open, diff --git a/trunk/arch/powerpc/kernel/udbg.c b/trunk/arch/powerpc/kernel/udbg.c index 194a93eeb3e7..8f5afdbad0d5 100644 --- a/trunk/arch/powerpc/kernel/udbg.c +++ b/trunk/arch/powerpc/kernel/udbg.c @@ -150,7 +150,7 @@ void __init disable_early_printk(void) { if (!early_console_initialized) return; - if (strstr(boot_command_line, "udbg-immortal")) { + if (strstr(saved_command_line, "udbg-immortal")) { printk(KERN_INFO "early console immortal !\n"); return; } diff --git a/trunk/arch/powerpc/platforms/cell/spufs/file.c b/trunk/arch/powerpc/platforms/cell/spufs/file.c index af9e9455a706..347eff56fcbd 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/file.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/file.c @@ -144,7 +144,7 @@ spufs_mem_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -static const struct file_operations spufs_mem_fops = { +static struct file_operations spufs_mem_fops = { .open = spufs_mem_open, .read = spufs_mem_read, .write = spufs_mem_write, @@ -249,7 +249,7 @@ static int spufs_cntl_open(struct inode *inode, struct file *file) spufs_cntl_set, "0x%08lx"); } -static const struct file_operations spufs_cntl_fops = { +static struct file_operations spufs_cntl_fops = { .open = spufs_cntl_open, .release = simple_attr_close, .read = simple_attr_read, @@ -309,7 +309,7 @@ spufs_regs_write(struct file *file, const char __user *buffer, return ret; } -static const struct file_operations spufs_regs_fops = { +static struct file_operations spufs_regs_fops = { .open = spufs_regs_open, .read = spufs_regs_read, .write = spufs_regs_write, @@ -360,7 +360,7 @@ spufs_fpcr_write(struct file *file, const char __user * buffer, return ret; } -static const struct file_operations spufs_fpcr_fops = { +static struct file_operations spufs_fpcr_fops = { .open = spufs_regs_open, .read = spufs_fpcr_read, .write = spufs_fpcr_write, @@ -426,7 +426,7 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf, return count; } -static const struct file_operations spufs_mbox_fops = { +static struct file_operations spufs_mbox_fops = { .open = spufs_pipe_open, .read = spufs_mbox_read, }; @@ -452,7 +452,7 @@ static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf, return 4; } -static const struct file_operations spufs_mbox_stat_fops = { +static struct file_operations spufs_mbox_stat_fops = { .open = spufs_pipe_open, .read = spufs_mbox_stat_read, }; @@ -559,7 +559,7 @@ static unsigned int spufs_ibox_poll(struct file *file, poll_table *wait) return mask; } -static const struct file_operations spufs_ibox_fops = { +static struct file_operations spufs_ibox_fops = { .open = spufs_pipe_open, .read = spufs_ibox_read, .poll = spufs_ibox_poll, @@ -585,7 +585,7 @@ static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf, return 4; } -static const struct file_operations spufs_ibox_stat_fops = { +static struct file_operations spufs_ibox_stat_fops = { .open = spufs_pipe_open, .read = spufs_ibox_stat_read, }; @@ -692,7 +692,7 @@ static unsigned int spufs_wbox_poll(struct file *file, poll_table *wait) return mask; } -static const struct file_operations spufs_wbox_fops = { +static struct file_operations spufs_wbox_fops = { .open = spufs_pipe_open, .write = spufs_wbox_write, .poll = spufs_wbox_poll, @@ -718,7 +718,7 @@ static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf, return 4; } -static const struct file_operations spufs_wbox_stat_fops = { +static struct file_operations spufs_wbox_stat_fops = { .open = spufs_pipe_open, .read = spufs_wbox_stat_read, }; @@ -823,7 +823,7 @@ static int spufs_signal1_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -static const struct file_operations spufs_signal1_fops = { +static struct file_operations spufs_signal1_fops = { .open = spufs_signal1_open, .read = spufs_signal1_read, .write = spufs_signal1_write, @@ -934,7 +934,7 @@ static int spufs_signal2_mmap(struct file *file, struct vm_area_struct *vma) #define spufs_signal2_mmap NULL #endif /* !SPUFS_MMAP_4K */ -static const struct file_operations spufs_signal2_fops = { +static struct file_operations spufs_signal2_fops = { .open = spufs_signal2_open, .read = spufs_signal2_read, .write = spufs_signal2_write, @@ -1037,7 +1037,7 @@ static int spufs_mss_open(struct inode *inode, struct file *file) return nonseekable_open(inode, file); } -static const struct file_operations spufs_mss_fops = { +static struct file_operations spufs_mss_fops = { .open = spufs_mss_open, .mmap = spufs_mss_mmap, }; @@ -1076,7 +1076,7 @@ static int spufs_psmap_open(struct inode *inode, struct file *file) return nonseekable_open(inode, file); } -static const struct file_operations spufs_psmap_fops = { +static struct file_operations spufs_psmap_fops = { .open = spufs_psmap_open, .mmap = spufs_psmap_mmap, }; @@ -1393,7 +1393,7 @@ static int spufs_mfc_fasync(int fd, struct file *file, int on) return fasync_helper(fd, file, on, &ctx->mfc_fasync); } -static const struct file_operations spufs_mfc_fops = { +static struct file_operations spufs_mfc_fops = { .open = spufs_mfc_open, .read = spufs_mfc_read, .write = spufs_mfc_write, @@ -1650,7 +1650,7 @@ static ssize_t spufs_mbox_info_read(struct file *file, char __user *buf, return ret; } -static const struct file_operations spufs_mbox_info_fops = { +static struct file_operations spufs_mbox_info_fops = { .open = spufs_info_open, .read = spufs_mbox_info_read, .llseek = generic_file_llseek, @@ -1688,7 +1688,7 @@ static ssize_t spufs_ibox_info_read(struct file *file, char __user *buf, return ret; } -static const struct file_operations spufs_ibox_info_fops = { +static struct file_operations spufs_ibox_info_fops = { .open = spufs_info_open, .read = spufs_ibox_info_read, .llseek = generic_file_llseek, @@ -1729,7 +1729,7 @@ static ssize_t spufs_wbox_info_read(struct file *file, char __user *buf, return ret; } -static const struct file_operations spufs_wbox_info_fops = { +static struct file_operations spufs_wbox_info_fops = { .open = spufs_info_open, .read = spufs_wbox_info_read, .llseek = generic_file_llseek, @@ -1779,7 +1779,7 @@ static ssize_t spufs_dma_info_read(struct file *file, char __user *buf, return ret; } -static const struct file_operations spufs_dma_info_fops = { +static struct file_operations spufs_dma_info_fops = { .open = spufs_info_open, .read = spufs_dma_info_read, }; @@ -1830,7 +1830,7 @@ static ssize_t spufs_proxydma_info_read(struct file *file, char __user *buf, return ret; } -static const struct file_operations spufs_proxydma_info_fops = { +static struct file_operations spufs_proxydma_info_fops = { .open = spufs_info_open, .read = spufs_proxydma_info_read, }; diff --git a/trunk/arch/powerpc/platforms/cell/spufs/inode.c b/trunk/arch/powerpc/platforms/cell/spufs/inode.c index 8079983ef94f..738b9244382f 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/inode.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/inode.c @@ -220,11 +220,11 @@ static int spufs_dir_close(struct inode *inode, struct file *file) return dcache_dir_close(inode, file); } -const struct inode_operations spufs_dir_inode_operations = { +struct inode_operations spufs_dir_inode_operations = { .lookup = simple_lookup, }; -const struct file_operations spufs_context_fops = { +struct file_operations spufs_context_fops = { .open = dcache_dir_open, .release = spufs_dir_close, .llseek = dcache_dir_lseek, @@ -372,7 +372,7 @@ static int spufs_gang_close(struct inode *inode, struct file *file) return dcache_dir_close(inode, file); } -const struct file_operations spufs_gang_fops = { +struct file_operations spufs_gang_fops = { .open = dcache_dir_open, .release = spufs_gang_close, .llseek = dcache_dir_lseek, diff --git a/trunk/arch/powerpc/platforms/cell/spufs/spufs.h b/trunk/arch/powerpc/platforms/cell/spufs/spufs.h index 56864469215e..70fb13395c04 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/trunk/arch/powerpc/platforms/cell/spufs/spufs.h @@ -149,7 +149,7 @@ long spufs_run_spu(struct file *file, struct spu_context *ctx, u32 *npc, u32 *status); long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode); -extern const struct file_operations spufs_context_fops; +extern struct file_operations spufs_context_fops; /* gang management */ struct spu_gang *alloc_spu_gang(void); diff --git a/trunk/arch/powerpc/platforms/iseries/lpevents.c b/trunk/arch/powerpc/platforms/iseries/lpevents.c index 91df52a1899a..c1f4502a3c6a 100644 --- a/trunk/arch/powerpc/platforms/iseries/lpevents.c +++ b/trunk/arch/powerpc/platforms/iseries/lpevents.c @@ -308,7 +308,7 @@ static int proc_lpevents_open(struct inode *inode, struct file *file) return single_open(file, proc_lpevents_show, NULL); } -static const struct file_operations proc_lpevents_operations = { +static struct file_operations proc_lpevents_operations = { .open = proc_lpevents_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/powerpc/platforms/iseries/mf.c b/trunk/arch/powerpc/platforms/iseries/mf.c index b1187d95e3b2..90d3d49f713e 100644 --- a/trunk/arch/powerpc/platforms/iseries/mf.c +++ b/trunk/arch/powerpc/platforms/iseries/mf.c @@ -1224,7 +1224,7 @@ static ssize_t proc_mf_change_vmlinux(struct file *file, return rc; } -static const struct file_operations proc_vmlinux_operations = { +static struct file_operations proc_vmlinux_operations = { .write = proc_mf_change_vmlinux, }; diff --git a/trunk/arch/powerpc/platforms/iseries/proc.c b/trunk/arch/powerpc/platforms/iseries/proc.c index f2cde4180204..b54e37101e69 100644 --- a/trunk/arch/powerpc/platforms/iseries/proc.c +++ b/trunk/arch/powerpc/platforms/iseries/proc.c @@ -101,7 +101,7 @@ static int proc_titantod_open(struct inode *inode, struct file *file) return single_open(file, proc_titantod_show, NULL); } -static const struct file_operations proc_titantod_operations = { +static struct file_operations proc_titantod_operations = { .open = proc_titantod_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/powerpc/platforms/iseries/viopath.c b/trunk/arch/powerpc/platforms/iseries/viopath.c index e2100ece9c65..a6799ed34a66 100644 --- a/trunk/arch/powerpc/platforms/iseries/viopath.c +++ b/trunk/arch/powerpc/platforms/iseries/viopath.c @@ -173,7 +173,7 @@ static int proc_viopath_open(struct inode *inode, struct file *file) return single_open(file, proc_viopath_show, NULL); } -static const struct file_operations proc_viopath_operations = { +static struct file_operations proc_viopath_operations = { .open = proc_viopath_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/powerpc/platforms/powermac/setup.c b/trunk/arch/powerpc/platforms/powermac/setup.c index 651fa424ea06..d949e9df41ef 100644 --- a/trunk/arch/powerpc/platforms/powermac/setup.c +++ b/trunk/arch/powerpc/platforms/powermac/setup.c @@ -506,8 +506,8 @@ void note_bootable_part(dev_t dev, int part, int goodness) if ((goodness <= current_root_goodness) && ROOT_DEV != DEFAULT_ROOT_DEVICE) return; - p = strstr(boot_command_line, "root="); - if (p != NULL && (p == boot_command_line || p[-1] == ' ')) + p = strstr(saved_command_line, "root="); + if (p != NULL && (p == saved_command_line || p[-1] == ' ')) return; if (!found_boot) { diff --git a/trunk/arch/powerpc/platforms/ps3/Kconfig b/trunk/arch/powerpc/platforms/ps3/Kconfig index 4be3943d1c0d..de52ec4e9e58 100644 --- a/trunk/arch/powerpc/platforms/ps3/Kconfig +++ b/trunk/arch/powerpc/platforms/ps3/Kconfig @@ -51,15 +51,4 @@ config PS3_VUART including the System Manager and AV Settings. In general, all users will say Y. -config PS3_PS3AV - tristate "PS3 AV settings driver" - depends on PPC_PS3 - select PS3_VUART - default y - help - Include support for the PS3 AV Settings driver. - - This support is required for graphics and sound. In - general, all users will say Y or M. - endmenu diff --git a/trunk/arch/powerpc/platforms/ps3/htab.c b/trunk/arch/powerpc/platforms/ps3/htab.c index e12e59fea13a..a4b5a1bc60f4 100644 --- a/trunk/arch/powerpc/platforms/ps3/htab.c +++ b/trunk/arch/powerpc/platforms/ps3/htab.c @@ -2,7 +2,7 @@ * PS3 pagetable management routines. * * Copyright (C) 2006 Sony Computer Entertainment Inc. - * Copyright 2006, 2007 Sony Corporation + * Copyright 2006 Sony Corp. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,6 @@ #include #include #include -#include #include "platform.h" @@ -234,9 +233,6 @@ static void ps3_hpte_invalidate(unsigned long slot, unsigned long va, static void ps3_hpte_clear(void) { - /* Make sure to clean up the frame buffer device first */ - ps3fb_cleanup(); - lv1_unmap_htab(htab_addr); } diff --git a/trunk/arch/powerpc/platforms/ps3/setup.c b/trunk/arch/powerpc/platforms/ps3/setup.c index 13d669a8ecae..e62505e18813 100644 --- a/trunk/arch/powerpc/platforms/ps3/setup.c +++ b/trunk/arch/powerpc/platforms/ps3/setup.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -81,46 +80,6 @@ static void ps3_panic(char *str) for (;;) ; } - -static void prealloc(struct ps3_prealloc *p) -{ - if (!p->size) - return; - - p->address = __alloc_bootmem(p->size, p->align, __pa(MAX_DMA_ADDRESS)); - if (!p->address) { - printk(KERN_ERR "%s: Cannot allocate %s\n", __FUNCTION__, - p->name); - return; - } - - printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size, - p->address); -} - -#ifdef CONFIG_FB_PS3 -struct ps3_prealloc ps3fb_videomemory = { - .name = "ps3fb videomemory", - .size = CONFIG_FB_PS3_DEFAULT_SIZE_M*1024*1024, - .align = 1024*1024 /* the GPU requires 1 MiB alignment */ -}; -#define prealloc_ps3fb_videomemory() prealloc(&ps3fb_videomemory) - -static int __init early_parse_ps3fb(char *p) -{ - if (!p) - return 1; - - ps3fb_videomemory.size = _ALIGN_UP(memparse(p, &p), - ps3fb_videomemory.align); - return 0; -} -early_param("ps3fb", early_parse_ps3fb); -#else -#define prealloc_ps3fb_videomemory() do { } while (0) -#endif - - static void __init ps3_setup_arch(void) { union ps3_firmware_version v; @@ -142,7 +101,6 @@ static void __init ps3_setup_arch(void) conswitchp = &dummy_con; #endif - prealloc_ps3fb_videomemory(); ppc_md.power_save = ps3_power_save; DBG(" <- %s:%d\n", __func__, __LINE__); diff --git a/trunk/arch/powerpc/platforms/pseries/eeh.c b/trunk/arch/powerpc/platforms/pseries/eeh.c index 6cedbc002e0f..9437f48cc9e7 100644 --- a/trunk/arch/powerpc/platforms/pseries/eeh.c +++ b/trunk/arch/powerpc/platforms/pseries/eeh.c @@ -1078,7 +1078,7 @@ static int proc_eeh_open(struct inode *inode, struct file *file) return single_open(file, proc_eeh_show, NULL); } -static const struct file_operations proc_eeh_operations = { +static struct file_operations proc_eeh_operations = { .open = proc_eeh_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/powerpc/platforms/pseries/hvCall_inst.c b/trunk/arch/powerpc/platforms/pseries/hvCall_inst.c index eae51ef9af24..3ddc04925d50 100644 --- a/trunk/arch/powerpc/platforms/pseries/hvCall_inst.c +++ b/trunk/arch/powerpc/platforms/pseries/hvCall_inst.c @@ -90,7 +90,7 @@ static int hcall_inst_seq_open(struct inode *inode, struct file *file) return rc; } -static const struct file_operations hcall_inst_seq_fops = { +static struct file_operations hcall_inst_seq_fops = { .open = hcall_inst_seq_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/arch/powerpc/platforms/pseries/reconfig.c b/trunk/arch/powerpc/platforms/pseries/reconfig.c index 5aa97aff3391..789a5e99aefd 100644 --- a/trunk/arch/powerpc/platforms/pseries/reconfig.c +++ b/trunk/arch/powerpc/platforms/pseries/reconfig.c @@ -499,7 +499,7 @@ static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t coun return rv ? rv : count; } -static const struct file_operations ofdt_fops = { +static struct file_operations ofdt_fops = { .write = ofdt_write }; diff --git a/trunk/arch/powerpc/platforms/pseries/rtasd.c b/trunk/arch/powerpc/platforms/pseries/rtasd.c index 77d0937d5c07..8ca2612221d6 100644 --- a/trunk/arch/powerpc/platforms/pseries/rtasd.c +++ b/trunk/arch/powerpc/platforms/pseries/rtasd.c @@ -331,7 +331,7 @@ static unsigned int rtas_log_poll(struct file *file, poll_table * wait) return 0; } -const struct file_operations proc_rtas_log_operations = { +struct file_operations proc_rtas_log_operations = { .read = rtas_log_read, .poll = rtas_log_poll, .open = rtas_log_open, diff --git a/trunk/arch/powerpc/platforms/pseries/scanlog.c b/trunk/arch/powerpc/platforms/pseries/scanlog.c index 8e1ef168e2dd..45368a57d7dd 100644 --- a/trunk/arch/powerpc/platforms/pseries/scanlog.c +++ b/trunk/arch/powerpc/platforms/pseries/scanlog.c @@ -184,7 +184,7 @@ static int scanlog_release(struct inode * inode, struct file * file) return 0; } -const struct file_operations scanlog_fops = { +struct file_operations scanlog_fops = { .owner = THIS_MODULE, .read = scanlog_read, .write = scanlog_write, diff --git a/trunk/arch/ppc/8xx_io/cs4218_tdm.c b/trunk/arch/ppc/8xx_io/cs4218_tdm.c index a956f28ab162..684ed04eb8b8 100644 --- a/trunk/arch/ppc/8xx_io/cs4218_tdm.c +++ b/trunk/arch/ppc/8xx_io/cs4218_tdm.c @@ -1711,7 +1711,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd, } -static const struct file_operations mixer_fops = +static struct file_operations mixer_fops = { .owner = THIS_MODULE, .llseek = sound_lseek, @@ -2298,7 +2298,7 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd, -static const struct file_operations sq_fops = +static struct file_operations sq_fops = { .owner = THIS_MODULE, .llseek = sound_lseek, @@ -2433,7 +2433,7 @@ static ssize_t state_read(struct file *file, char *buf, size_t count, } -static const struct file_operations state_fops = +static struct file_operations state_fops = { .owner = THIS_MODULE, .llseek = sound_lseek, diff --git a/trunk/arch/ppc/kernel/setup.c b/trunk/arch/ppc/kernel/setup.c index c79704f5409c..3c506af19880 100644 --- a/trunk/arch/ppc/kernel/setup.c +++ b/trunk/arch/ppc/kernel/setup.c @@ -543,7 +543,7 @@ void __init setup_arch(char **cmdline_p) init_mm.brk = (unsigned long) klimit; /* Save unparsed command line copy for /proc/cmdline */ - strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE); + strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); *cmdline_p = cmd_line; parse_early_param(); diff --git a/trunk/arch/ppc/platforms/lopec.c b/trunk/arch/ppc/platforms/lopec.c index b947c774f524..18dc6e8dd4f4 100644 --- a/trunk/arch/ppc/platforms/lopec.c +++ b/trunk/arch/ppc/platforms/lopec.c @@ -344,7 +344,7 @@ lopec_setup_arch(void) if (bootargs != NULL) { strcpy(cmd_line, bootargs); /* again.. */ - strcpy(boot_command_line, cmd_line); + strcpy(saved_command_line, cmd_line); } } #endif diff --git a/trunk/arch/ppc/platforms/pplus.c b/trunk/arch/ppc/platforms/pplus.c index 8a1788c48155..9778105d4dfe 100644 --- a/trunk/arch/ppc/platforms/pplus.c +++ b/trunk/arch/ppc/platforms/pplus.c @@ -592,7 +592,7 @@ static void __init pplus_setup_arch(void) if (bootargs != NULL) { strcpy(cmd_line, bootargs); /* again.. */ - strcpy(boot_command_line, cmd_line); + strcpy(saved_command_line, cmd_line); } } #endif diff --git a/trunk/arch/ppc/platforms/prep_setup.c b/trunk/arch/ppc/platforms/prep_setup.c index f166299571d6..1cb75a1f825e 100644 --- a/trunk/arch/ppc/platforms/prep_setup.c +++ b/trunk/arch/ppc/platforms/prep_setup.c @@ -634,7 +634,7 @@ static void __init prep_init_sound(void) /* * Find a way to push these informations to the cs4232 driver * Give it out with printk, when not in cmd_line? - * Append it to cmd_line and boot_command_line? + * Append it to cmd_line and saved_command_line? * Format is cs4232=io,irq,dma,dma2 */ } @@ -897,7 +897,7 @@ prep_setup_arch(void) if (bootargs != NULL) { strcpy(cmd_line, bootargs); /* again.. */ - strcpy(boot_command_line, cmd_line); + strcpy(saved_command_line, cmd_line); } } diff --git a/trunk/arch/s390/hypfs/inode.c b/trunk/arch/s390/hypfs/inode.c index ba5d3167df0d..a4fda7b53640 100644 --- a/trunk/arch/s390/hypfs/inode.c +++ b/trunk/arch/s390/hypfs/inode.c @@ -34,7 +34,7 @@ struct hypfs_sb_info { struct mutex lock; /* lock to protect update process */ }; -static const struct file_operations hypfs_file_ops; +static struct file_operations hypfs_file_ops; static struct file_system_type hypfs_type; static struct super_operations hypfs_s_ops; @@ -440,7 +440,7 @@ struct dentry *hypfs_create_str(struct super_block *sb, struct dentry *dir, return dentry; } -static const struct file_operations hypfs_file_ops = { +static struct file_operations hypfs_file_ops = { .open = hypfs_open, .release = hypfs_release, .read = do_sync_read, diff --git a/trunk/arch/s390/kernel/debug.c b/trunk/arch/s390/kernel/debug.c index 51653d82d7df..f4b62df02aa2 100644 --- a/trunk/arch/s390/kernel/debug.c +++ b/trunk/arch/s390/kernel/debug.c @@ -167,7 +167,7 @@ static DECLARE_MUTEX(debug_lock); static int initialized; -static const struct file_operations debug_file_ops = { +static struct file_operations debug_file_ops = { .owner = THIS_MODULE, .read = debug_output, .write = debug_input, diff --git a/trunk/arch/s390/kernel/setup.c b/trunk/arch/s390/kernel/setup.c index 50c5210fbc64..03739813d3bf 100644 --- a/trunk/arch/s390/kernel/setup.c +++ b/trunk/arch/s390/kernel/setup.c @@ -740,7 +740,7 @@ setup_arch(char **cmdline_p) #endif /* CONFIG_64BIT */ /* Save unparsed command line copy for /proc/cmdline */ - strlcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + strlcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); *cmdline_p = COMMAND_LINE; *(*cmdline_p + COMMAND_LINE_SIZE - 1) = '\0'; diff --git a/trunk/arch/s390/kernel/smp.c b/trunk/arch/s390/kernel/smp.c index 83a4ea6e3d60..65b52320d145 100644 --- a/trunk/arch/s390/kernel/smp.c +++ b/trunk/arch/s390/kernel/smp.c @@ -57,7 +57,7 @@ static void smp_ext_bitcall(int, ec_bit_sig); static void smp_ext_bitcall_others(ec_bit_sig); /* - * Structure and data for smp_call_function(). This is designed to minimise +5B * Structure and data for smp_call_function(). This is designed to minimise * static memory requirements. It also looks cleaner. */ static DEFINE_SPINLOCK(call_lock); @@ -104,7 +104,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, * remote CPUs are nearly ready to execute <> or are or have executed. * * You must not call this function with disabled interrupts or from a - * hardware interrupt handler. + * hardware interrupt handler or from a bottom half handler. */ { struct call_data_struct data; @@ -113,8 +113,8 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, if (cpus <= 0) return 0; - /* Can deadlock when interrupts are disabled or if in wrong context */ - WARN_ON(irqs_disabled() || in_irq()); + /* Can deadlock when called with interrupts disabled */ + WARN_ON(irqs_disabled()); data.func = func; data.info = info; @@ -123,7 +123,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, if (wait) atomic_set(&data.finished, 0); - spin_lock_bh(&call_lock); + spin_lock(&call_lock); call_data = &data; /* Send a message to all other CPUs and wait for them to respond */ smp_ext_bitcall_others(ec_call_function); @@ -135,7 +135,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, if (wait) while (atomic_read(&data.finished) != cpus) cpu_relax(); - spin_unlock_bh(&call_lock); + spin_unlock(&call_lock); return 0; } @@ -159,9 +159,6 @@ int smp_call_function_on(void (*func) (void *info), void *info, if (!cpu_online(cpu)) return -EINVAL; - /* Can deadlock when interrupts are disabled or if in wrong context */ - WARN_ON(irqs_disabled() || in_irq()); - /* disable preemption for local function call */ curr_cpu = get_cpu(); diff --git a/trunk/arch/sh/boards/landisk/landisk_pwb.c b/trunk/arch/sh/boards/landisk/landisk_pwb.c index 47a63c6617ed..e62524978160 100644 --- a/trunk/arch/sh/boards/landisk/landisk_pwb.c +++ b/trunk/arch/sh/boards/landisk/landisk_pwb.c @@ -150,7 +150,7 @@ static irqreturn_t sw_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static const struct file_operations swdrv_fops = { +static struct file_operations swdrv_fops = { .read = swdrv_read, /* read */ .write = swdrv_write, /* write */ .open = swdrv_open, /* open */ diff --git a/trunk/arch/sh/kernel/setup.c b/trunk/arch/sh/kernel/setup.c index d6b817aa568f..225f9ea5cdd7 100644 --- a/trunk/arch/sh/kernel/setup.c +++ b/trunk/arch/sh/kernel/setup.c @@ -75,7 +75,7 @@ static struct sh_machine_vector* __init get_mv_byname(const char* name); #define RAMDISK_PROMPT_FLAG 0x8000 #define RAMDISK_LOAD_FLAG 0x4000 -static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, }; +static char command_line[COMMAND_LINE_SIZE] = { 0, }; static struct resource code_resource = { .name = "Kernel code", }; static struct resource data_resource = { .name = "Kernel data", }; @@ -90,8 +90,8 @@ static inline void parse_cmdline (char ** cmdline_p, char mv_name[MV_NAME_SIZE], int len = 0; /* Save unparsed command line copy for /proc/cmdline */ - memcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START; memory_end = memory_start + __MEMORY_SIZE; diff --git a/trunk/arch/sh/mm/cache-debugfs.c b/trunk/arch/sh/mm/cache-debugfs.c index 909dcfa8c8c6..e0122bd33ddb 100644 --- a/trunk/arch/sh/mm/cache-debugfs.c +++ b/trunk/arch/sh/mm/cache-debugfs.c @@ -114,7 +114,7 @@ static int cache_debugfs_open(struct inode *inode, struct file *file) return single_open(file, cache_seq_show, inode->i_private); } -static const struct file_operations cache_debugfs_fops = { +static struct file_operations cache_debugfs_fops = { .owner = THIS_MODULE, .open = cache_debugfs_open, .read = seq_read, diff --git a/trunk/arch/sh/mm/pmb.c b/trunk/arch/sh/mm/pmb.c index d0d45e2e0ab3..b60ad83a7635 100644 --- a/trunk/arch/sh/mm/pmb.c +++ b/trunk/arch/sh/mm/pmb.c @@ -378,7 +378,7 @@ static int pmb_debugfs_open(struct inode *inode, struct file *file) return single_open(file, pmb_seq_show, NULL); } -static const struct file_operations pmb_debugfs_fops = { +static struct file_operations pmb_debugfs_fops = { .owner = THIS_MODULE, .open = pmb_debugfs_open, .read = seq_read, diff --git a/trunk/arch/sh/oprofile/op_model_sh7750.c b/trunk/arch/sh/oprofile/op_model_sh7750.c index 0104e44bc76a..60402eec4b4d 100644 --- a/trunk/arch/sh/oprofile/op_model_sh7750.c +++ b/trunk/arch/sh/oprofile/op_model_sh7750.c @@ -187,7 +187,7 @@ static ssize_t sh7750_write_count(struct file *file, const char __user *buf, return count; } -static const struct file_operations count_fops = { +static struct file_operations count_fops = { .read = sh7750_read_count, .write = sh7750_write_count, }; diff --git a/trunk/arch/sh64/kernel/setup.c b/trunk/arch/sh64/kernel/setup.c index 53e9d20a874a..b9e7d54d7b85 100644 --- a/trunk/arch/sh64/kernel/setup.c +++ b/trunk/arch/sh64/kernel/setup.c @@ -83,7 +83,7 @@ extern int sh64_tlb_init(void); #define RAMDISK_PROMPT_FLAG 0x8000 #define RAMDISK_LOAD_FLAG 0x4000 -static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, }; +static char command_line[COMMAND_LINE_SIZE] = { 0, }; unsigned long long memory_start = CONFIG_MEMORY_START; unsigned long long memory_end = CONFIG_MEMORY_START + (CONFIG_MEMORY_SIZE_IN_MB * 1024 * 1024); @@ -95,8 +95,8 @@ static inline void parse_mem_cmdline (char ** cmdline_p) int len = 0; /* Save unparsed command line copy for /proc/cmdline */ - memcpy(boot_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(saved_command_line, COMMAND_LINE, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; for (;;) { /* diff --git a/trunk/arch/sparc/kernel/apc.c b/trunk/arch/sparc/kernel/apc.c index d06a405ca718..406dd94afb45 100644 --- a/trunk/arch/sparc/kernel/apc.c +++ b/trunk/arch/sparc/kernel/apc.c @@ -127,7 +127,7 @@ static int apc_ioctl(struct inode *inode, struct file *f, return 0; } -static const struct file_operations apc_fops = { +static struct file_operations apc_fops = { .ioctl = apc_ioctl, .open = apc_open, .release = apc_release, diff --git a/trunk/arch/sparc/kernel/setup.c b/trunk/arch/sparc/kernel/setup.c index eccd8e87f529..383526ad94fc 100644 --- a/trunk/arch/sparc/kernel/setup.c +++ b/trunk/arch/sparc/kernel/setup.c @@ -246,7 +246,7 @@ void __init setup_arch(char **cmdline_p) /* Initialize PROM console and command line. */ *cmdline_p = prom_getbootargs(); - strcpy(boot_command_line, *cmdline_p); + strcpy(saved_command_line, *cmdline_p); /* Set sparc_cpu_model */ sparc_cpu_model = sun_unknown; diff --git a/trunk/arch/sparc/kernel/sys_sunos.c b/trunk/arch/sparc/kernel/sys_sunos.c index da6606f0cffc..0bf8c165fc92 100644 --- a/trunk/arch/sparc/kernel/sys_sunos.c +++ b/trunk/arch/sparc/kernel/sys_sunos.c @@ -859,16 +859,14 @@ asmlinkage int sunos_wait4(pid_t pid, unsigned int __user *stat_addr, return ret; } +extern int kill_pg(int, int, int); asmlinkage int sunos_killpg(int pgrp, int sig) { int ret; - rcu_read_lock(); - ret = -EINVAL; - if (pgrp > 0) - ret = kill_pgrp(find_pid(pgrp), sig, 0); - rcu_read_unlock(); - + lock_kernel(); + ret = kill_pg(pgrp, sig, 0); + unlock_kernel(); return ret; } diff --git a/trunk/arch/sparc64/Kconfig b/trunk/arch/sparc64/Kconfig index f75a686ba644..fb84647dbf3d 100644 --- a/trunk/arch/sparc64/Kconfig +++ b/trunk/arch/sparc64/Kconfig @@ -232,6 +232,14 @@ config LARGE_ALLOCS source "mm/Kconfig" +config ZONE_DMA + bool + default y + +config GENERIC_ISA_DMA + bool + default y + config ISA bool help diff --git a/trunk/arch/sparc64/defconfig b/trunk/arch/sparc64/defconfig index 0f44a6a6675f..069ee3ccd849 100644 --- a/trunk/arch/sparc64/defconfig +++ b/trunk/arch/sparc64/defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.20 -# Sun Feb 11 23:47:40 2007 +# Sat Feb 10 23:08:12 2007 # CONFIG_SPARC=y CONFIG_SPARC64=y @@ -49,6 +49,7 @@ CONFIG_POSIX_MQUEUE=y # CONFIG_IKCONFIG is not set CONFIG_SYSFS_DEPRECATED=y CONFIG_RELAY=y +CONFIG_INITRAMFS_SOURCE="" CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_SYSCTL=y # CONFIG_EMBEDDED is not set @@ -143,7 +144,7 @@ CONFIG_HAVE_MEMORY_PRESENT=y CONFIG_SPARSEMEM_EXTREME=y CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_RESOURCES_64BIT=y -CONFIG_ZONE_DMA_FLAG=0 +CONFIG_GENERIC_ISA_DMA=y CONFIG_SBUS=y CONFIG_SBUSCHAR=y CONFIG_SUN_AUXIO=y @@ -1258,10 +1259,6 @@ CONFIG_USB_HIDDEV=y # DMA Devices # -# -# Auxiliary Display support -# - # # Virtualization # @@ -1453,6 +1450,7 @@ CONFIG_SCHEDSTATS=y # CONFIG_RT_MUTEX_TESTER is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_RWSEMS is not set # CONFIG_DEBUG_LOCK_ALLOC is not set # CONFIG_PROVE_LOCKING is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set @@ -1535,5 +1533,4 @@ CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y CONFIG_PLIST=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT=y +CONFIG_IOMAP_COPY=y diff --git a/trunk/arch/sparc64/kernel/setup.c b/trunk/arch/sparc64/kernel/setup.c index 451028341c75..bf033b31d437 100644 --- a/trunk/arch/sparc64/kernel/setup.c +++ b/trunk/arch/sparc64/kernel/setup.c @@ -315,7 +315,7 @@ void __init setup_arch(char **cmdline_p) { /* Initialize PROM console and command line. */ *cmdline_p = prom_getbootargs(); - strcpy(boot_command_line, *cmdline_p); + strcpy(saved_command_line, *cmdline_p); if (tlb_type == hypervisor) printk("ARCH: SUN4V\n"); diff --git a/trunk/arch/sparc64/kernel/sys_sunos32.c b/trunk/arch/sparc64/kernel/sys_sunos32.c index 4cff95b7b3a4..2ebc2c051383 100644 --- a/trunk/arch/sparc64/kernel/sys_sunos32.c +++ b/trunk/arch/sparc64/kernel/sys_sunos32.c @@ -824,17 +824,10 @@ asmlinkage int sunos_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, in return ret; } +extern int kill_pg(int, int, int); asmlinkage int sunos_killpg(int pgrp, int sig) { - int ret; - - rcu_read_lock(); - ret = -EINVAL; - if (pgrp > 0) - ret = kill_pgrp(find_pid(pgrp), sig, 0); - rcu_read_unlock(); - - return ret; + return kill_pg(pgrp, sig, 0); } asmlinkage int sunos_audit(void) diff --git a/trunk/arch/sparc64/kernel/time.c b/trunk/arch/sparc64/kernel/time.c index f84da4f1b706..061e1b1fa583 100644 --- a/trunk/arch/sparc64/kernel/time.c +++ b/trunk/arch/sparc64/kernel/time.c @@ -1327,7 +1327,7 @@ static int mini_rtc_release(struct inode *inode, struct file *file) } -static const struct file_operations mini_rtc_fops = { +static struct file_operations mini_rtc_fops = { .owner = THIS_MODULE, .ioctl = mini_rtc_ioctl, .open = mini_rtc_open, diff --git a/trunk/arch/sparc64/mm/init.c b/trunk/arch/sparc64/mm/init.c index b1a1ee0cc6bd..09d434f41e4b 100644 --- a/trunk/arch/sparc64/mm/init.c +++ b/trunk/arch/sparc64/mm/init.c @@ -1467,8 +1467,8 @@ void __init paging_init(void) for (znum = 0; znum < MAX_NR_ZONES; znum++) zones_size[znum] = zholes_size[znum] = 0; - zones_size[ZONE_NORMAL] = end_pfn; - zholes_size[ZONE_NORMAL] = end_pfn - pages_avail; + zones_size[ZONE_DMA] = end_pfn; + zholes_size[ZONE_DMA] = end_pfn - pages_avail; free_area_init_node(0, &contig_page_data, zones_size, __pa(PAGE_OFFSET) >> PAGE_SHIFT, diff --git a/trunk/arch/sparc64/solaris/socksys.c b/trunk/arch/sparc64/solaris/socksys.c index c2864447de82..89a4757f192f 100644 --- a/trunk/arch/sparc64/solaris/socksys.c +++ b/trunk/arch/sparc64/solaris/socksys.c @@ -163,7 +163,7 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait) return mask; } -static const struct file_operations socksys_fops = { +static struct file_operations socksys_fops = { .open = socksys_open, .release = socksys_release, }; diff --git a/trunk/arch/um/drivers/harddog_kern.c b/trunk/arch/um/drivers/harddog_kern.c index 55601687b3bc..73c5caa7a150 100644 --- a/trunk/arch/um/drivers/harddog_kern.c +++ b/trunk/arch/um/drivers/harddog_kern.c @@ -145,7 +145,7 @@ static int harddog_ioctl(struct inode *inode, struct file *file, } } -static const struct file_operations harddog_fops = { +static struct file_operations harddog_fops = { .owner = THIS_MODULE, .write = harddog_write, .ioctl = harddog_ioctl, diff --git a/trunk/arch/um/drivers/line.c b/trunk/arch/um/drivers/line.c index 01d4ab6b0ef1..0e1e9a20a4d6 100644 --- a/trunk/arch/um/drivers/line.c +++ b/trunk/arch/um/drivers/line.c @@ -774,7 +774,7 @@ static irqreturn_t winch_interrupt(int irq, void *data) line = tty->driver_data; chan_window_size(&line->chan_list, &tty->winsize.ws_row, &tty->winsize.ws_col); - kill_pgrp(tty->pgrp, SIGWINCH, 1); + kill_pg(tty->pgrp, SIGWINCH, 1); } out: if(winch->fd != -1) diff --git a/trunk/arch/um/include/user_util.h b/trunk/arch/um/include/user_util.h index 023575f67343..06625fefef33 100644 --- a/trunk/arch/um/include/user_util.h +++ b/trunk/arch/um/include/user_util.h @@ -38,6 +38,8 @@ extern unsigned long long highmem; extern char host_info[]; +extern char saved_command_line[]; + extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; extern unsigned long _unprotected_end; extern unsigned long brk_start; diff --git a/trunk/arch/um/kernel/um_arch.c b/trunk/arch/um/kernel/um_arch.c index 89c6dba731f8..84e57f6da1d3 100644 --- a/trunk/arch/um/kernel/um_arch.c +++ b/trunk/arch/um/kernel/um_arch.c @@ -43,9 +43,9 @@ #define DEFAULT_COMMAND_LINE "root=98:0" /* Changed in linux_main and setup_arch, which run before SMP is started */ -static char __initdata command_line[COMMAND_LINE_SIZE] = { 0 }; +static char command_line[COMMAND_LINE_SIZE] = { 0 }; -static void __init add_arg(char *arg) +static void add_arg(char *arg) { if (strlen(command_line) + strlen(arg) + 1 > COMMAND_LINE_SIZE) { printf("add_arg: Too many command line arguments!\n"); @@ -330,7 +330,7 @@ EXPORT_SYMBOL(end_iomem); extern char __binary_start; -int __init linux_main(int argc, char **argv) +int linux_main(int argc, char **argv) { unsigned long avail, diff; unsigned long virtmem_size, max_physmem; @@ -481,7 +481,7 @@ void __init setup_arch(char **cmdline_p) atomic_notifier_chain_register(&panic_notifier_list, &panic_exit_notifier); paging_init(); - strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); + strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; setup_hostinfo(); } diff --git a/trunk/arch/v850/kernel/rte_cb_leds.c b/trunk/arch/v850/kernel/rte_cb_leds.c index aa47ab1dcd87..996bd4f33ecb 100644 --- a/trunk/arch/v850/kernel/rte_cb_leds.c +++ b/trunk/arch/v850/kernel/rte_cb_leds.c @@ -117,7 +117,7 @@ static loff_t leds_dev_lseek (struct file *file, loff_t offs, int whence) return 0; } -static const struct file_operations leds_fops = { +static struct file_operations leds_fops = { .read = leds_dev_read, .write = leds_dev_write, .llseek = leds_dev_lseek diff --git a/trunk/arch/v850/kernel/setup.c b/trunk/arch/v850/kernel/setup.c index a914f244f494..1bf672a25692 100644 --- a/trunk/arch/v850/kernel/setup.c +++ b/trunk/arch/v850/kernel/setup.c @@ -42,7 +42,7 @@ extern char _root_fs_image_start __attribute__ ((__weak__)); extern char _root_fs_image_end __attribute__ ((__weak__)); -char __initdata command_line[COMMAND_LINE_SIZE]; +char command_line[COMMAND_LINE_SIZE]; /* Memory not used by the kernel. */ static unsigned long total_ram_pages; @@ -64,8 +64,8 @@ void __init setup_arch (char **cmdline) { /* Keep a copy of command line */ *cmdline = command_line; - memcpy (boot_command_line, command_line, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE - 1] = '\0'; + memcpy (saved_command_line, command_line, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE - 1] = '\0'; console_verbose (); diff --git a/trunk/arch/x86_64/kernel/head64.c b/trunk/arch/x86_64/kernel/head64.c index 5f197b0a330a..cc230b93cd1c 100644 --- a/trunk/arch/x86_64/kernel/head64.c +++ b/trunk/arch/x86_64/kernel/head64.c @@ -34,6 +34,8 @@ static void __init clear_bss(void) #define OLD_CL_BASE_ADDR 0x90000 #define OLD_CL_OFFSET 0x90022 +extern char saved_command_line[]; + static void __init copy_bootdata(char *real_mode_data) { int new_data; @@ -48,7 +50,7 @@ static void __init copy_bootdata(char *real_mode_data) new_data = OLD_CL_BASE_ADDR + * (u16 *) OLD_CL_OFFSET; } command_line = (char *) ((u64)(new_data)); - memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); + memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); } void __init x86_64_start_kernel(char * real_mode_data) diff --git a/trunk/arch/x86_64/kernel/mce.c b/trunk/arch/x86_64/kernel/mce.c index bdb54a2c9f18..ac085038af29 100644 --- a/trunk/arch/x86_64/kernel/mce.c +++ b/trunk/arch/x86_64/kernel/mce.c @@ -516,7 +516,7 @@ static int mce_ioctl(struct inode *i, struct file *f,unsigned int cmd, unsigned } } -static const struct file_operations mce_chrdev_ops = { +static struct file_operations mce_chrdev_ops = { .read = mce_read, .ioctl = mce_ioctl, }; diff --git a/trunk/arch/x86_64/kernel/setup.c b/trunk/arch/x86_64/kernel/setup.c index 60477244d1a3..af425a8049fb 100644 --- a/trunk/arch/x86_64/kernel/setup.c +++ b/trunk/arch/x86_64/kernel/setup.c @@ -100,7 +100,7 @@ EXPORT_SYMBOL_GPL(edid_info); extern int root_mountflags; -char __initdata command_line[COMMAND_LINE_SIZE]; +char command_line[COMMAND_LINE_SIZE]; struct resource standard_io_resources[] = { { .name = "dma1", .start = 0x00, .end = 0x1f, @@ -343,7 +343,7 @@ static void discover_ebda(void) void __init setup_arch(char **cmdline_p) { - printk(KERN_INFO "Command line: %s\n", boot_command_line); + printk(KERN_INFO "Command line: %s\n", saved_command_line); ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); screen_info = SCREEN_INFO; @@ -373,7 +373,7 @@ void __init setup_arch(char **cmdline_p) early_identify_cpu(&boot_cpu_data); - strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); + strlcpy(command_line, saved_command_line, COMMAND_LINE_SIZE); *cmdline_p = command_line; parse_early_param(); diff --git a/trunk/arch/xtensa/kernel/setup.c b/trunk/arch/xtensa/kernel/setup.c index 1ecf6716c327..b6374c09de20 100644 --- a/trunk/arch/xtensa/kernel/setup.c +++ b/trunk/arch/xtensa/kernel/setup.c @@ -78,7 +78,7 @@ extern unsigned long loops_per_jiffy; /* Command line specified as configuration option. */ -static char __initdata command_line[COMMAND_LINE_SIZE]; +static char command_line[COMMAND_LINE_SIZE]; #ifdef CONFIG_CMDLINE_BOOL static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; @@ -253,8 +253,8 @@ void __init setup_arch(char **cmdline_p) extern int mem_reserve(unsigned long, unsigned long, int); extern void bootmem_init(void); - memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); - boot_command_line[COMMAND_LINE_SIZE-1] = '\0'; + memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE); + saved_command_line[COMMAND_LINE_SIZE-1] = '\0'; *cmdline_p = command_line; /* Reserve some memory regions */ diff --git a/trunk/block/blktrace.c b/trunk/block/blktrace.c index 3f0e7c37c059..d36b32ed22f4 100644 --- a/trunk/block/blktrace.c +++ b/trunk/block/blktrace.c @@ -264,7 +264,7 @@ static ssize_t blk_dropped_read(struct file *filp, char __user *buffer, return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf)); } -static const struct file_operations blk_dropped_fops = { +static struct file_operations blk_dropped_fops = { .owner = THIS_MODULE, .open = blk_dropped_open, .read = blk_dropped_read, diff --git a/trunk/block/genhd.c b/trunk/block/genhd.c index 36bd3e12a6d4..457fdac4c17d 100644 --- a/trunk/block/genhd.c +++ b/trunk/block/genhd.c @@ -61,14 +61,6 @@ int register_blkdev(unsigned int major, const char *name) /* temporary */ if (major == 0) { for (index = ARRAY_SIZE(major_names)-1; index > 0; index--) { - /* - * Disallow the LANANA-assigned LOCAL/EXPERIMENTAL - * majors - */ - if ((60 <= index && index <= 63) || - (120 <= index && index <= 127) || - (240 <= index && index <= 254)) - continue; if (major_names[index] == NULL) break; } diff --git a/trunk/crypto/proc.c b/trunk/crypto/proc.c index 102c751a124c..dabce0676f63 100644 --- a/trunk/crypto/proc.c +++ b/trunk/crypto/proc.c @@ -101,7 +101,7 @@ static int crypto_info_open(struct inode *inode, struct file *file) return seq_open(file, &crypto_seq_ops); } -static const struct file_operations proc_crypto_ops = { +static struct file_operations proc_crypto_ops = { .open = crypto_info_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/acorn/char/i2c.c b/trunk/drivers/acorn/char/i2c.c index 157d8b73bb64..9e584a7af434 100644 --- a/trunk/drivers/acorn/char/i2c.c +++ b/trunk/drivers/acorn/char/i2c.c @@ -238,7 +238,7 @@ static int rtc_ioctl(struct inode *inode, struct file *file, return -EINVAL; } -static const struct file_operations rtc_fops = { +static struct file_operations rtc_fops = { .ioctl = rtc_ioctl, }; diff --git a/trunk/drivers/block/DAC960.c b/trunk/drivers/block/DAC960.c index 92bf868ca056..7b2fa3d8f61c 100644 --- a/trunk/drivers/block/DAC960.c +++ b/trunk/drivers/block/DAC960.c @@ -7024,7 +7024,7 @@ static int DAC960_gam_ioctl(struct inode *inode, struct file *file, return -EINVAL; } -static const struct file_operations DAC960_gam_fops = { +static struct file_operations DAC960_gam_fops = { .owner = THIS_MODULE, .ioctl = DAC960_gam_ioctl }; diff --git a/trunk/drivers/block/acsi_slm.c b/trunk/drivers/block/acsi_slm.c index e2e043290963..e04be94d195c 100644 --- a/trunk/drivers/block/acsi_slm.c +++ b/trunk/drivers/block/acsi_slm.c @@ -269,7 +269,7 @@ static int slm_get_pagesize( int device, int *w, int *h ); static DEFINE_TIMER(slm_timer, slm_test_ready, 0, 0); -static const struct file_operations slm_fops = { +static struct file_operations slm_fops = { .owner = THIS_MODULE, .read = slm_read, .write = slm_write, diff --git a/trunk/drivers/block/aoe/aoechr.c b/trunk/drivers/block/aoe/aoechr.c index 39e563ea0878..e22b4c9520a9 100644 --- a/trunk/drivers/block/aoe/aoechr.c +++ b/trunk/drivers/block/aoe/aoechr.c @@ -233,7 +233,7 @@ aoechr_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off) } } -static const struct file_operations aoe_fops = { +static struct file_operations aoe_fops = { .write = aoechr_write, .read = aoechr_read, .open = aoechr_open, diff --git a/trunk/drivers/block/paride/pg.c b/trunk/drivers/block/paride/pg.c index d89e7d32a3b6..9970aedbb5d9 100644 --- a/trunk/drivers/block/paride/pg.c +++ b/trunk/drivers/block/paride/pg.c @@ -227,7 +227,7 @@ static struct class *pg_class; /* kernel glue structures */ -static const struct file_operations pg_fops = { +static struct file_operations pg_fops = { .owner = THIS_MODULE, .read = pg_read, .write = pg_write, diff --git a/trunk/drivers/block/paride/pt.c b/trunk/drivers/block/paride/pt.c index 9f4e67ee1eb0..c902b25e4869 100644 --- a/trunk/drivers/block/paride/pt.c +++ b/trunk/drivers/block/paride/pt.c @@ -232,7 +232,7 @@ static char pt_scratch[512]; /* scratch block buffer */ /* kernel glue structures */ -static const struct file_operations pt_fops = { +static struct file_operations pt_fops = { .owner = THIS_MODULE, .read = pt_read, .write = pt_write, diff --git a/trunk/drivers/block/pktcdvd.c b/trunk/drivers/block/pktcdvd.c index 93fb6ed4ed52..c0e89490e3d5 100644 --- a/trunk/drivers/block/pktcdvd.c +++ b/trunk/drivers/block/pktcdvd.c @@ -435,7 +435,7 @@ static int pkt_debugfs_fops_open(struct inode *inode, struct file *file) return single_open(file, pkt_debugfs_seq_show, inode->i_private); } -static const struct file_operations debug_fops = { +static struct file_operations debug_fops = { .open = pkt_debugfs_fops_open, .read = seq_read, .llseek = seq_lseek, @@ -2725,7 +2725,7 @@ static int pkt_seq_open(struct inode *inode, struct file *file) return single_open(file, pkt_seq_show, PDE(inode)->data); } -static const struct file_operations pkt_proc_fops = { +static struct file_operations pkt_proc_fops = { .open = pkt_seq_open, .read = seq_read, .llseek = seq_lseek, @@ -3052,7 +3052,7 @@ static int pkt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cm } -static const struct file_operations pkt_ctl_fops = { +static struct file_operations pkt_ctl_fops = { .ioctl = pkt_ctl_ioctl, .owner = THIS_MODULE, }; diff --git a/trunk/drivers/bluetooth/hci_vhci.c b/trunk/drivers/bluetooth/hci_vhci.c index b71a5ccc587f..a278d98a9151 100644 --- a/trunk/drivers/bluetooth/hci_vhci.c +++ b/trunk/drivers/bluetooth/hci_vhci.c @@ -332,7 +332,7 @@ static int vhci_fasync(int fd, struct file *file, int on) return 0; } -static const struct file_operations vhci_fops = { +static struct file_operations vhci_fops = { .owner = THIS_MODULE, .llseek = vhci_llseek, .read = vhci_read, diff --git a/trunk/drivers/cdrom/viocd.c b/trunk/drivers/cdrom/viocd.c index dc13ebacedfb..93fbf84dcc4a 100644 --- a/trunk/drivers/cdrom/viocd.c +++ b/trunk/drivers/cdrom/viocd.c @@ -176,7 +176,7 @@ static int proc_viocd_open(struct inode *inode, struct file *file) return single_open(file, proc_viocd_show, NULL); } -static const struct file_operations proc_viocd_operations = { +static struct file_operations proc_viocd_operations = { .open = proc_viocd_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/char/briq_panel.c b/trunk/drivers/char/briq_panel.c index 7f60a18ef76b..9f8082f8dd29 100644 --- a/trunk/drivers/char/briq_panel.c +++ b/trunk/drivers/char/briq_panel.c @@ -187,7 +187,7 @@ static ssize_t briq_panel_write(struct file *file, const char __user *buf, size_ return len; } -static const struct file_operations briq_panel_fops = { +static struct file_operations briq_panel_fops = { .owner = THIS_MODULE, .read = briq_panel_read, .write = briq_panel_write, diff --git a/trunk/drivers/char/cyclades.c b/trunk/drivers/char/cyclades.c index 54df35527bc5..363beb165729 100644 --- a/trunk/drivers/char/cyclades.c +++ b/trunk/drivers/char/cyclades.c @@ -829,18 +829,17 @@ static unsigned short cy_pci_nboard; static unsigned short cy_isa_nboard; static unsigned short cy_nboard; #ifdef CONFIG_PCI -static struct pci_device_id cy_pci_dev_id[] __devinitdata = { - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Y_Lo) }, /* PCI < 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Y_Hi) }, /* PCI > 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_4Y_Lo) }, /* 4Y PCI < 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_4Y_Hi) }, /* 4Y PCI > 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_8Y_Lo) }, /* 8Y PCI < 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_8Y_Hi) }, /* 8Y PCI > 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Z_Lo) }, /* Z PCI < 1Mb */ - { PCI_DEVICE(PCI_VENDOR_ID_CYCLADES, PCI_DEVICE_ID_CYCLOM_Z_Hi) }, /* Z PCI > 1Mb */ - { } /* end of table */ +static unsigned short cy_pci_dev_id[] = { + PCI_DEVICE_ID_CYCLOM_Y_Lo, /* PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_Y_Hi, /* PCI > 1Mb */ + PCI_DEVICE_ID_CYCLOM_4Y_Lo, /* 4Y PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_4Y_Hi, /* 4Y PCI > 1Mb */ + PCI_DEVICE_ID_CYCLOM_8Y_Lo, /* 8Y PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_8Y_Hi, /* 8Y PCI > 1Mb */ + PCI_DEVICE_ID_CYCLOM_Z_Lo, /* Z PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_Z_Hi, /* Z PCI > 1Mb */ + 0 /* end of table */ }; -MODULE_DEVICE_TABLE(pci, cy_pci_dev_id); #endif static void cy_start(struct tty_struct *); @@ -4759,7 +4758,7 @@ static int __init cy_detect_pci(void) for (i = 0; i < NR_CARDS; i++) { /* look for a Cyclades card by vendor and device id */ - while ((device_id = cy_pci_dev_id[dev_index].device) != 0) { + while ((device_id = cy_pci_dev_id[dev_index]) != 0) { if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES, device_id, pdev)) == NULL) { dev_index++; /* try next device id */ diff --git a/trunk/drivers/char/drm/drm_drv.c b/trunk/drivers/char/drm/drm_drv.c index f5b9b2480c14..a70af0de4453 100644 --- a/trunk/drivers/char/drm/drm_drv.c +++ b/trunk/drivers/char/drm/drm_drv.c @@ -371,7 +371,7 @@ void drm_exit(struct drm_driver *driver) EXPORT_SYMBOL(drm_exit); /** File operations structure */ -static const struct file_operations drm_stub_fops = { +static struct file_operations drm_stub_fops = { .owner = THIS_MODULE, .open = drm_stub_open }; diff --git a/trunk/drivers/char/drm/i810_dma.c b/trunk/drivers/char/drm/i810_dma.c index 603d17fd2d69..60cb4e45a75e 100644 --- a/trunk/drivers/char/drm/i810_dma.c +++ b/trunk/drivers/char/drm/i810_dma.c @@ -112,7 +112,7 @@ static int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma) return 0; } -static const struct file_operations i810_buffer_fops = { +static struct file_operations i810_buffer_fops = { .open = drm_open, .release = drm_release, .ioctl = drm_ioctl, diff --git a/trunk/drivers/char/drm/i830_dma.c b/trunk/drivers/char/drm/i830_dma.c index 3314a9fea9e5..95224455ec0c 100644 --- a/trunk/drivers/char/drm/i830_dma.c +++ b/trunk/drivers/char/drm/i830_dma.c @@ -114,7 +114,7 @@ static int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma) return 0; } -static const struct file_operations i830_buffer_fops = { +static struct file_operations i830_buffer_fops = { .open = drm_open, .release = drm_release, .ioctl = drm_ioctl, diff --git a/trunk/drivers/char/drm/via_dmablit.c b/trunk/drivers/char/drm/via_dmablit.c index 2881a06b6f55..2054d5773717 100644 --- a/trunk/drivers/char/drm/via_dmablit.c +++ b/trunk/drivers/char/drm/via_dmablit.c @@ -376,8 +376,10 @@ via_dmablit_handler(drm_device_t *dev, int engine, int from_irq) blitq->cur = cur; blitq->num_outstanding--; blitq->end = jiffies + DRM_HZ; - if (!timer_pending(&blitq->poll_timer)) - mod_timer(&blitq->poll_timer, jiffies + 1); + if (!timer_pending(&blitq->poll_timer)) { + blitq->poll_timer.expires = jiffies+1; + add_timer(&blitq->poll_timer); + } } else { if (timer_pending(&blitq->poll_timer)) { del_timer(&blitq->poll_timer); @@ -476,7 +478,8 @@ via_dmablit_timer(unsigned long data) via_dmablit_handler(dev, engine, 0); if (!timer_pending(&blitq->poll_timer)) { - mod_timer(&blitq->poll_timer, jiffies + 1); + blitq->poll_timer.expires = jiffies+1; + add_timer(&blitq->poll_timer); /* * Rerun handler to delete timer if engines are off, and @@ -571,8 +574,9 @@ via_init_dmablit(drm_device_t *dev) } DRM_INIT_WAITQUEUE(&blitq->busy_queue); INIT_WORK(&blitq->wq, via_dmablit_workqueue); - setup_timer(&blitq->poll_timer, via_dmablit_timer, - (unsigned long)blitq); + init_timer(&blitq->poll_timer); + blitq->poll_timer.function = &via_dmablit_timer; + blitq->poll_timer.data = (unsigned long) blitq; } } diff --git a/trunk/drivers/char/ds1302.c b/trunk/drivers/char/ds1302.c index fada6ddefbae..bcdb107aa967 100644 --- a/trunk/drivers/char/ds1302.c +++ b/trunk/drivers/char/ds1302.c @@ -120,6 +120,7 @@ get_rtc_time(struct rtc_time *rtc_tm) unsigned long flags; local_irq_save(flags); + local_irq_disable(); rtc_tm->tm_sec = CMOS_READ(RTC_SECONDS); rtc_tm->tm_min = CMOS_READ(RTC_MINUTES); @@ -218,6 +219,7 @@ rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, BIN_TO_BCD(yrs); local_irq_save(flags); + local_irq_disable(); CMOS_WRITE(yrs, RTC_YEAR); CMOS_WRITE(mon, RTC_MONTH); CMOS_WRITE(day, RTC_DAY_OF_MONTH); diff --git a/trunk/drivers/char/dtlk.c b/trunk/drivers/char/dtlk.c index d8dbdb916232..d4005e94fe5f 100644 --- a/trunk/drivers/char/dtlk.c +++ b/trunk/drivers/char/dtlk.c @@ -72,7 +72,6 @@ #define TRACE_RET ((void) 0) #endif /* TRACING */ -static void dtlk_timer_tick(unsigned long data); static int dtlk_major; static int dtlk_port_lpc; @@ -82,7 +81,7 @@ static int dtlk_has_indexing; static unsigned int dtlk_portlist[] = {0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0}; static wait_queue_head_t dtlk_process_list; -static DEFINE_TIMER(dtlk_timer, dtlk_timer_tick, 0, 0); +static struct timer_list dtlk_timer; /* prototypes for file_operations struct */ static ssize_t dtlk_read(struct file *, char __user *, @@ -118,6 +117,7 @@ static char dtlk_write_tts(char); /* static void dtlk_handle_error(char, char, unsigned int); */ +static void dtlk_timer_tick(unsigned long data); static ssize_t dtlk_read(struct file *file, char __user *buf, size_t count, loff_t * ppos) @@ -318,7 +318,7 @@ static int dtlk_release(struct inode *inode, struct file *file) } TRACE_RET; - del_timer_sync(&dtlk_timer); + del_timer(&dtlk_timer); return 0; } @@ -336,6 +336,8 @@ static int __init dtlk_init(void) if (dtlk_dev_probe() == 0) printk(", MAJOR %d\n", dtlk_major); + init_timer(&dtlk_timer); + dtlk_timer.function = dtlk_timer_tick; init_waitqueue_head(&dtlk_process_list); return 0; diff --git a/trunk/drivers/char/generic_nvram.c b/trunk/drivers/char/generic_nvram.c index 2398e864c28d..43ff59816511 100644 --- a/trunk/drivers/char/generic_nvram.c +++ b/trunk/drivers/char/generic_nvram.c @@ -117,7 +117,7 @@ static int nvram_ioctl(struct inode *inode, struct file *file, return 0; } -const struct file_operations nvram_fops = { +struct file_operations nvram_fops = { .owner = THIS_MODULE, .llseek = nvram_llseek, .read = read_nvram, diff --git a/trunk/drivers/char/hw_random/intel-rng.c b/trunk/drivers/char/hw_random/intel-rng.c index cc1046e6ee02..f22e78e3c70f 100644 --- a/trunk/drivers/char/hw_random/intel-rng.c +++ b/trunk/drivers/char/hw_random/intel-rng.c @@ -96,49 +96,49 @@ */ static const struct pci_device_id pci_tbl[] = { /* AA - { PCI_DEVICE(0x8086, 0x2418) }, */ - { PCI_DEVICE(0x8086, 0x2410) }, /* AA */ + { 0x8086, 0x2418, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, */ + { 0x8086, 0x2410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* AA */ /* AB - { PCI_DEVICE(0x8086, 0x2428) }, */ - { PCI_DEVICE(0x8086, 0x2420) }, /* AB */ + { 0x8086, 0x2428, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, */ + { 0x8086, 0x2420, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* AB */ /* ?? - { PCI_DEVICE(0x8086, 0x2430) }, */ + { 0x8086, 0x2430, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, */ /* BAM, CAM, DBM, FBM, GxM - { PCI_DEVICE(0x8086, 0x2448) }, */ - { PCI_DEVICE(0x8086, 0x244c) }, /* BAM */ - { PCI_DEVICE(0x8086, 0x248c) }, /* CAM */ - { PCI_DEVICE(0x8086, 0x24cc) }, /* DBM */ - { PCI_DEVICE(0x8086, 0x2641) }, /* FBM */ - { PCI_DEVICE(0x8086, 0x27b9) }, /* GxM */ - { PCI_DEVICE(0x8086, 0x27bd) }, /* GxM DH */ + { 0x8086, 0x2448, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, */ + { 0x8086, 0x244c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* BAM */ + { 0x8086, 0x248c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CAM */ + { 0x8086, 0x24cc, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* DBM */ + { 0x8086, 0x2641, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* FBM */ + { 0x8086, 0x27b9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* GxM */ + { 0x8086, 0x27bd, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* GxM DH */ /* BA, CA, DB, Ex, 6300, Fx, 631x/632x, Gx - { PCI_DEVICE(0x8086, 0x244e) }, */ - { PCI_DEVICE(0x8086, 0x2440) }, /* BA */ - { PCI_DEVICE(0x8086, 0x2480) }, /* CA */ - { PCI_DEVICE(0x8086, 0x24c0) }, /* DB */ - { PCI_DEVICE(0x8086, 0x24d0) }, /* Ex */ - { PCI_DEVICE(0x8086, 0x25a1) }, /* 6300 */ - { PCI_DEVICE(0x8086, 0x2640) }, /* Fx */ - { PCI_DEVICE(0x8086, 0x2670) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x2671) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x2672) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x2673) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x2674) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x2675) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x2676) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x2677) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x2678) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x2679) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x267a) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x267b) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x267c) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x267d) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x267e) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x267f) }, /* 631x/632x */ - { PCI_DEVICE(0x8086, 0x27b8) }, /* Gx */ + { 0x8086, 0x244e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, */ + { 0x8086, 0x2440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* BA */ + { 0x8086, 0x2480, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* CA */ + { 0x8086, 0x24c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* DB */ + { 0x8086, 0x24d0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Ex */ + { 0x8086, 0x25a1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 6300 */ + { 0x8086, 0x2640, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Fx */ + { 0x8086, 0x2670, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x2671, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x2672, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x2673, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x2674, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x2675, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x2676, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x2677, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x2678, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x2679, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x267a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x267b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x267c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x267d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x267e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x267f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* 631x/632x */ + { 0x8086, 0x27b8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* Gx */ /* E - { PCI_DEVICE(0x8086, 0x245e) }, */ - { PCI_DEVICE(0x8086, 0x2450) }, /* E */ + { 0x8086, 0x245e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, */ + { 0x8086, 0x2450, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, /* E */ { 0, }, /* terminate list */ }; MODULE_DEVICE_TABLE(pci, pci_tbl); diff --git a/trunk/drivers/char/ip2/i2lib.c b/trunk/drivers/char/ip2/i2lib.c index f86fa0c55d36..88b9d338da53 100644 --- a/trunk/drivers/char/ip2/i2lib.c +++ b/trunk/drivers/char/ip2/i2lib.c @@ -80,7 +80,7 @@ static int i2RetryFlushOutput(i2ChanStrPtr); // Not a documented part of the library routines (careful...) but the Diagnostic // i2diag.c finds them useful to help the throughput in certain limited // single-threaded operations. -static inline void iiSendPendingMail(i2eBordStrPtr); +static void iiSendPendingMail(i2eBordStrPtr); static void serviceOutgoingFifo(i2eBordStrPtr); // Functions defined in ip2.c as part of interrupt handling @@ -150,13 +150,6 @@ i2Validate ( i2ChanStrPtr pCh ) == (CHANNEL_MAGIC | CHANNEL_SUPPORT)); } -static void iiSendPendingMail_t(unsigned long data) -{ - i2eBordStrPtr pB = (i2eBordStrPtr)data; - - iiSendPendingMail(pB); -} - //****************************************************************************** // Function: iiSendPendingMail(pB) // Parameters: Pointer to a board structure @@ -191,9 +184,12 @@ iiSendPendingMail(i2eBordStrPtr pB) /\/\|=mhw=|\/\/ */ if( ++pB->SendPendingRetry < 16 ) { - setup_timer(&pB->SendPendingTimer, - iiSendPendingMail_t, (unsigned long)pB); - mod_timer(&pB->SendPendingTimer, jiffies + 1); + + init_timer( &(pB->SendPendingTimer) ); + pB->SendPendingTimer.expires = jiffies + 1; + pB->SendPendingTimer.function = (void*)(unsigned long)iiSendPendingMail; + pB->SendPendingTimer.data = (unsigned long)pB; + add_timer( &(pB->SendPendingTimer) ); } else { printk( KERN_ERR "IP2: iiSendPendingMail unable to queue outbound mail\n" ); } @@ -1269,10 +1265,8 @@ i2RetryFlushOutput(i2ChanStrPtr pCh) // soon as all the data is completely sent. //****************************************************************************** static void -i2DrainWakeup(unsigned long d) +i2DrainWakeup(i2ChanStrPtr pCh) { - i2ChanStrPtr pCh = (i2ChanStrPtr)d; - ip2trace (CHANN, ITRC_DRAIN, 10, 1, pCh->BookmarkTimer.expires ); pCh->BookmarkTimer.expires = 0; @@ -1298,12 +1292,14 @@ i2DrainOutput(i2ChanStrPtr pCh, int timeout) } if ((timeout > 0) && (pCh->BookmarkTimer.expires == 0 )) { // One per customer (channel) - setup_timer(&pCh->BookmarkTimer, i2DrainWakeup, - (unsigned long)pCh); + init_timer( &(pCh->BookmarkTimer) ); + pCh->BookmarkTimer.expires = jiffies + timeout; + pCh->BookmarkTimer.function = (void*)(unsigned long)i2DrainWakeup; + pCh->BookmarkTimer.data = (unsigned long)pCh; ip2trace (CHANN, ITRC_DRAIN, 1, 1, pCh->BookmarkTimer.expires ); - mod_timer(&pCh->BookmarkTimer, jiffies + timeout); + add_timer( &(pCh->BookmarkTimer) ); } i2QueueCommands( PTYPE_INLINE, pCh, -1, 1, CMD_BMARK_REQ ); diff --git a/trunk/drivers/char/ip2/ip2main.c b/trunk/drivers/char/ip2/ip2main.c index 83c7258d3580..7c70310a49b5 100644 --- a/trunk/drivers/char/ip2/ip2main.c +++ b/trunk/drivers/char/ip2/ip2main.c @@ -1271,8 +1271,8 @@ static void do_input(struct work_struct *work) // code duplicated from n_tty (ldisc) static inline void isig(int sig, struct tty_struct *tty, int flush) { - if (tty->pgrp) - kill_pgrp(tty->pgrp, sig, 1); + if (tty->pgrp > 0) + kill_pg(tty->pgrp, sig, 1); if (flush || !L_NOFLSH(tty)) { if ( tty->ldisc.flush_buffer ) tty->ldisc.flush_buffer(tty); diff --git a/trunk/drivers/char/keyboard.c b/trunk/drivers/char/keyboard.c index cb8d691576da..c654a3e0c697 100644 --- a/trunk/drivers/char/keyboard.c +++ b/trunk/drivers/char/keyboard.c @@ -596,6 +596,7 @@ static void fn_spawn_con(struct vc_data *vc) static void fn_SAK(struct vc_data *vc) { struct work_struct *SAK_work = &vc_cons[fg_console].SAK_work; + PREPARE_WORK(SAK_work, vc_SAK); schedule_work(SAK_work); } diff --git a/trunk/drivers/char/mbcs.c b/trunk/drivers/char/mbcs.c index 57f9115a456c..0afb7ba999cf 100644 --- a/trunk/drivers/char/mbcs.c +++ b/trunk/drivers/char/mbcs.c @@ -46,7 +46,7 @@ LIST_HEAD(soft_list); /* * file operations */ -const struct file_operations mbcs_ops = { +struct file_operations mbcs_ops = { .open = mbcs_open, .llseek = mbcs_sram_llseek, .read = mbcs_sram_read, diff --git a/trunk/drivers/char/mspec.c b/trunk/drivers/char/mspec.c index 7ac30612068b..235e89226112 100644 --- a/trunk/drivers/char/mspec.c +++ b/trunk/drivers/char/mspec.c @@ -291,7 +291,7 @@ uncached_mmap(struct file *file, struct vm_area_struct *vma) return mspec_mmap(file, vma, MSPEC_UNCACHED); } -static const struct file_operations fetchop_fops = { +static struct file_operations fetchop_fops = { .owner = THIS_MODULE, .mmap = fetchop_mmap }; @@ -302,7 +302,7 @@ static struct miscdevice fetchop_miscdev = { .fops = &fetchop_fops }; -static const struct file_operations cached_fops = { +static struct file_operations cached_fops = { .owner = THIS_MODULE, .mmap = cached_mmap }; @@ -313,7 +313,7 @@ static struct miscdevice cached_miscdev = { .fops = &cached_fops }; -static const struct file_operations uncached_fops = { +static struct file_operations uncached_fops = { .owner = THIS_MODULE, .mmap = uncached_mmap }; diff --git a/trunk/drivers/char/n_r3964.c b/trunk/drivers/char/n_r3964.c index 65f2d3a96b85..fab1b7d42858 100644 --- a/trunk/drivers/char/n_r3964.c +++ b/trunk/drivers/char/n_r3964.c @@ -1005,7 +1005,9 @@ static int r3964_open(struct tty_struct *tty) tty->disc_data = pInfo; tty->receive_room = 65536; - setup_timer(&pInfo->tmr, on_timeout, (unsigned long)pInfo); + init_timer(&pInfo->tmr); + pInfo->tmr.data = (unsigned long)pInfo; + pInfo->tmr.function = on_timeout; return 0; } diff --git a/trunk/drivers/char/n_tty.c b/trunk/drivers/char/n_tty.c index 6ac3ca4c723c..2bdb0144a22e 100644 --- a/trunk/drivers/char/n_tty.c +++ b/trunk/drivers/char/n_tty.c @@ -579,8 +579,8 @@ static void eraser(unsigned char c, struct tty_struct *tty) static inline void isig(int sig, struct tty_struct *tty, int flush) { - if (tty->pgrp) - kill_pgrp(tty->pgrp, sig, 1); + if (tty->pgrp > 0) + kill_pg(tty->pgrp, sig, 1); if (flush || !L_NOFLSH(tty)) { n_tty_flush_buffer(tty); if (tty->driver->flush_buffer) @@ -1184,13 +1184,13 @@ static int job_control(struct tty_struct *tty, struct file *file) /* don't stop on /dev/console */ if (file->f_op->write != redirected_tty_write && current->signal->tty == tty) { - if (!tty->pgrp) - printk("read_chan: no tty->pgrp!\n"); - else if (task_pgrp(current) != tty->pgrp) { + if (tty->pgrp <= 0) + printk("read_chan: tty->pgrp <= 0!\n"); + else if (process_group(current) != tty->pgrp) { if (is_ignored(SIGTTIN) || - is_current_pgrp_orphaned()) + is_orphaned_pgrp(process_group(current))) return -EIO; - kill_pgrp(task_pgrp(current), SIGTTIN, 1); + kill_pg(process_group(current), SIGTTIN, 1); return -ERESTARTSYS; } } diff --git a/trunk/drivers/char/nwbutton.c b/trunk/drivers/char/nwbutton.c index 2604246501e4..2d264971d839 100644 --- a/trunk/drivers/char/nwbutton.c +++ b/trunk/drivers/char/nwbutton.c @@ -23,11 +23,8 @@ #define __NWBUTTON_C /* Tell the header file who we are */ #include "nwbutton.h" -static void button_sequence_finished (unsigned long parameters); - static int button_press_count; /* The count of button presses */ -/* Times for the end of a sequence */ -static DEFINE_TIMER(button_timer, button_sequence_finished, 0, 0); +static struct timer_list button_timer; /* Times for the end of a sequence */ static DECLARE_WAIT_QUEUE_HEAD(button_wait_queue); /* Used for blocking read */ static char button_output_buffer[32]; /* Stores data to write out of device */ static int bcount; /* The number of bytes in the buffer */ @@ -149,8 +146,14 @@ static void button_sequence_finished (unsigned long parameters) static irqreturn_t button_handler (int irq, void *dev_id) { + if (button_press_count) { + del_timer (&button_timer); + } button_press_count++; - mod_timer(&button_timer, jiffies + bdelay); + init_timer (&button_timer); + button_timer.function = button_sequence_finished; + button_timer.expires = (jiffies + bdelay); + add_timer (&button_timer); return IRQ_HANDLED; } diff --git a/trunk/drivers/char/pcmcia/cm4000_cs.c b/trunk/drivers/char/pcmcia/cm4000_cs.c index e91b43a014b0..211c93fda6fc 100644 --- a/trunk/drivers/char/pcmcia/cm4000_cs.c +++ b/trunk/drivers/char/pcmcia/cm4000_cs.c @@ -946,7 +946,8 @@ static void monitor_card(unsigned long p) return_with_timer: DEBUGP(7, dev, "<- monitor_card (returns with timer)\n"); - mod_timer(&dev->timer, jiffies + dev->mdelay); + dev->timer.expires = jiffies + dev->mdelay; + add_timer(&dev->timer); clear_bit(LOCK_MONITOR, &dev->flags); } @@ -1405,9 +1406,12 @@ static void start_monitor(struct cm4000_dev *dev) DEBUGP(3, dev, "-> start_monitor\n"); if (!dev->monitor_running) { DEBUGP(5, dev, "create, init and add timer\n"); - setup_timer(&dev->timer, monitor_card, (unsigned long)dev); + init_timer(&dev->timer); dev->monitor_running = 1; - mod_timer(&dev->timer, jiffies); + dev->timer.expires = jiffies; + dev->timer.data = (unsigned long) dev; + dev->timer.function = monitor_card; + add_timer(&dev->timer); } else DEBUGP(5, dev, "monitor already running\n"); DEBUGP(3, dev, "<- start_monitor\n"); diff --git a/trunk/drivers/char/pcmcia/cm4040_cs.c b/trunk/drivers/char/pcmcia/cm4040_cs.c index 0e82968c2f38..9b1ff7e8f896 100644 --- a/trunk/drivers/char/pcmcia/cm4040_cs.c +++ b/trunk/drivers/char/pcmcia/cm4040_cs.c @@ -632,7 +632,8 @@ static int reader_probe(struct pcmcia_device *link) init_waitqueue_head(&dev->poll_wait); init_waitqueue_head(&dev->read_wait); init_waitqueue_head(&dev->write_wait); - setup_timer(&dev->poll_timer, cm4040_do_poll, 0); + init_timer(&dev->poll_timer); + dev->poll_timer.function = &cm4040_do_poll; ret = reader_config(link, i); if (ret) diff --git a/trunk/drivers/char/pcmcia/synclink_cs.c b/trunk/drivers/char/pcmcia/synclink_cs.c index 8d025e9b5bce..4ab2c98f978c 100644 --- a/trunk/drivers/char/pcmcia/synclink_cs.c +++ b/trunk/drivers/char/pcmcia/synclink_cs.c @@ -1361,7 +1361,9 @@ static int startup(MGSLPC_INFO * info) memset(&info->icount, 0, sizeof(info->icount)); - setup_timer(&info->tx_timer, tx_timeout, (unsigned long)info); + init_timer(&info->tx_timer); + info->tx_timer.data = (unsigned long)info; + info->tx_timer.function = tx_timeout; /* Allocate and claim adapter resources */ retval = claim_resources(info); @@ -1406,7 +1408,7 @@ static void shutdown(MGSLPC_INFO * info) wake_up_interruptible(&info->status_event_wait_q); wake_up_interruptible(&info->event_wait_q); - del_timer_sync(&info->tx_timer); + del_timer(&info->tx_timer); if (info->tx_buf) { free_page((unsigned long) info->tx_buf); @@ -3547,8 +3549,8 @@ static void tx_start(MGSLPC_INFO *info) } else { info->tx_active = 1; tx_ready(info); - mod_timer(&info->tx_timer, jiffies + - msecs_to_jiffies(5000)); + info->tx_timer.expires = jiffies + msecs_to_jiffies(5000); + add_timer(&info->tx_timer); } } diff --git a/trunk/drivers/char/random.c b/trunk/drivers/char/random.c index b9dc7aa1dfb3..13d0b1350a62 100644 --- a/trunk/drivers/char/random.c +++ b/trunk/drivers/char/random.c @@ -1117,14 +1117,14 @@ random_ioctl(struct inode * inode, struct file * file, } } -const struct file_operations random_fops = { +struct file_operations random_fops = { .read = random_read, .write = random_write, .poll = random_poll, .ioctl = random_ioctl, }; -const struct file_operations urandom_fops = { +struct file_operations urandom_fops = { .read = urandom_read, .write = random_write, .ioctl = random_ioctl, diff --git a/trunk/drivers/char/rio/rio_linux.c b/trunk/drivers/char/rio/rio_linux.c index 85c161845260..e79b2ede8510 100644 --- a/trunk/drivers/char/rio/rio_linux.c +++ b/trunk/drivers/char/rio/rio_linux.c @@ -418,7 +418,8 @@ static void rio_pollfunc(unsigned long data) func_enter(); rio_interrupt(0, &p->RIOHosts[data]); - mod_timer(&p->RIOHosts[data].timer, jiffies + rio_poll); + p->RIOHosts[data].timer.expires = jiffies + rio_poll; + add_timer(&p->RIOHosts[data].timer); func_exit(); } @@ -1153,10 +1154,13 @@ static int __init rio_init(void) /* Init the timer "always" to make sure that it can safely be deleted when we unload... */ - setup_timer(&hp->timer, rio_pollfunc, i); + init_timer(&hp->timer); if (!hp->Ivec) { rio_dprintk(RIO_DEBUG_INIT, "Starting polling at %dj intervals.\n", rio_poll); - mod_timer(&hp->timer, jiffies + rio_poll); + hp->timer.data = i; + hp->timer.function = rio_pollfunc; + hp->timer.expires = jiffies + rio_poll; + add_timer(&hp->timer); } } @@ -1187,7 +1191,7 @@ static void __exit rio_exit(void) rio_dprintk(RIO_DEBUG_INIT, "freed irq %d.\n", hp->Ivec); } /* It is safe/allowed to del_timer a non-active timer */ - del_timer_sync(&hp->timer); + del_timer(&hp->timer); if (hp->Caddr) iounmap(hp->Caddr); if (hp->Type == RIO_PCI) diff --git a/trunk/drivers/char/rocket.c b/trunk/drivers/char/rocket.c index 76357c855ce3..106f225e745f 100644 --- a/trunk/drivers/char/rocket.c +++ b/trunk/drivers/char/rocket.c @@ -106,8 +106,6 @@ /****** RocketPort Local Variables ******/ -static void rp_do_poll(unsigned long dummy); - static struct tty_driver *rocket_driver; static struct rocket_version driver_version = { @@ -118,7 +116,7 @@ static struct r_port *rp_table[MAX_RP_PORTS]; /* The main repository of static unsigned int xmit_flags[NUM_BOARDS]; /* Bit significant, indicates port had data to transmit. */ /* eg. Bit 0 indicates port 0 has xmit data, ... */ static atomic_t rp_num_ports_open; /* Number of serial ports open */ -static DEFINE_TIMER(rocket_timer, rp_do_poll, 0, 0); +static struct timer_list rocket_timer; static unsigned long board1; /* ISA addresses, retrieved from rocketport.conf */ static unsigned long board2; @@ -2369,6 +2367,12 @@ static int __init rp_init(void) if (!rocket_driver) return -ENOMEM; + /* + * Set up the timer channel. + */ + init_timer(&rocket_timer); + rocket_timer.function = rp_do_poll; + /* * Initialize the array of pointers to our own internal state * structures. diff --git a/trunk/drivers/char/rtc.c b/trunk/drivers/char/rtc.c index b6d3072dce5a..664f36c98e6a 100644 --- a/trunk/drivers/char/rtc.c +++ b/trunk/drivers/char/rtc.c @@ -135,9 +135,7 @@ static struct fasync_struct *rtc_async_queue; static DECLARE_WAIT_QUEUE_HEAD(rtc_wait); #ifdef RTC_IRQ -static void rtc_dropped_irq(unsigned long data); - -static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq, 0, 0); +static struct timer_list rtc_irq_timer; #endif static ssize_t rtc_read(struct file *file, char __user *buf, @@ -152,6 +150,8 @@ static unsigned int rtc_poll(struct file *file, poll_table *wait); static void get_rtc_alm_time (struct rtc_time *alm_tm); #ifdef RTC_IRQ +static void rtc_dropped_irq(unsigned long data); + static void set_rtc_irq_bit_locked(unsigned char bit); static void mask_rtc_irq_bit_locked(unsigned char bit); @@ -454,8 +454,8 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel) spin_lock_irqsave (&rtc_lock, flags); if (!(rtc_status & RTC_TIMER_ON)) { - mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq + - 2*HZ/100); + rtc_irq_timer.expires = jiffies + HZ/rtc_freq + 2*HZ/100; + add_timer(&rtc_irq_timer); rtc_status |= RTC_TIMER_ON; } set_rtc_irq_bit_locked(RTC_PIE); @@ -1084,6 +1084,8 @@ static int __init rtc_init(void) if (rtc_has_irq == 0) goto no_irq2; + init_timer(&rtc_irq_timer); + rtc_irq_timer.function = rtc_dropped_irq; spin_lock_irq(&rtc_lock); rtc_freq = 1024; if (!hpet_set_periodic_freq(rtc_freq)) { diff --git a/trunk/drivers/char/specialix.c b/trunk/drivers/char/specialix.c index baf7234b6e66..92043c8f2355 100644 --- a/trunk/drivers/char/specialix.c +++ b/trunk/drivers/char/specialix.c @@ -459,9 +459,10 @@ void missed_irq (unsigned long data) if (irq) { printk (KERN_INFO "Missed interrupt... Calling int from timer. \n"); sx_interrupt (((struct specialix_board *)data)->irq, - (void*)data); + (void*)data, NULL); } - mod_timer(&missed_irq_timer, jiffies + sx_poll); + missed_irq_timer.expires = jiffies + sx_poll; + add_timer (&missed_irq_timer); } #endif @@ -596,8 +597,11 @@ static int sx_probe(struct specialix_board *bp) dprintk (SX_DEBUG_INIT, " GFCR = 0x%02x\n", sx_in_off(bp, CD186x_GFRCR) ); #ifdef SPECIALIX_TIMER - setup_timer(&missed_irq_timer, missed_irq, (unsigned long)bp); - mod_timer(&missed_irq_timer, jiffies + sx_poll); + init_timer (&missed_irq_timer); + missed_irq_timer.function = missed_irq; + missed_irq_timer.data = (unsigned long) bp; + missed_irq_timer.expires = jiffies + sx_poll; + add_timer (&missed_irq_timer); #endif printk(KERN_INFO"sx%d: specialix IO8+ board detected at 0x%03x, IRQ %d, CD%d Rev. %c.\n", @@ -2555,7 +2559,7 @@ static void __exit specialix_exit_module(void) if (sx_board[i].flags & SX_BOARD_PRESENT) sx_release_io_range(&sx_board[i]); #ifdef SPECIALIX_TIMER - del_timer_sync(&missed_irq_timer); + del_timer (&missed_irq_timer); #endif func_exit(); diff --git a/trunk/drivers/char/synclink.c b/trunk/drivers/char/synclink.c index ce4db6f52362..bf76db1342c5 100644 --- a/trunk/drivers/char/synclink.c +++ b/trunk/drivers/char/synclink.c @@ -1798,7 +1798,9 @@ static int startup(struct mgsl_struct * info) memset(&info->icount, 0, sizeof(info->icount)); - setup_timer(&info->tx_timer, mgsl_tx_timeout, (unsigned long)info); + init_timer(&info->tx_timer); + info->tx_timer.data = (unsigned long)info; + info->tx_timer.function = mgsl_tx_timeout; /* Allocate and claim adapter resources */ retval = mgsl_claim_resources(info); @@ -1849,7 +1851,7 @@ static void shutdown(struct mgsl_struct * info) wake_up_interruptible(&info->status_event_wait_q); wake_up_interruptible(&info->event_wait_q); - del_timer_sync(&info->tx_timer); + del_timer(&info->tx_timer); if (info->xmit_buf) { free_page((unsigned long) info->xmit_buf); @@ -5708,8 +5710,8 @@ static void usc_start_transmitter( struct mgsl_struct *info ) usc_TCmd( info, TCmd_SendFrame ); - mod_timer(&info->tx_timer, jiffies + - msecs_to_jiffies(5000)); + info->tx_timer.expires = jiffies + msecs_to_jiffies(5000); + add_timer(&info->tx_timer); } info->tx_active = 1; } diff --git a/trunk/drivers/char/synclink_gt.c b/trunk/drivers/char/synclink_gt.c index 0a367cd4121f..54af763518fe 100644 --- a/trunk/drivers/char/synclink_gt.c +++ b/trunk/drivers/char/synclink_gt.c @@ -1825,7 +1825,8 @@ static void rx_async(struct slgt_info *info) if (i < count) { /* receive buffer not completed */ info->rbuf_index += i; - mod_timer(&info->rx_timer, jiffies + 1); + info->rx_timer.expires = jiffies + 1; + add_timer(&info->rx_timer); break; } @@ -3339,8 +3340,13 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev info->adapter_num = adapter_num; info->port_num = port_num; - setup_timer(&info->tx_timer, tx_timeout, (unsigned long)info); - setup_timer(&info->rx_timer, rx_timeout, (unsigned long)info); + init_timer(&info->tx_timer); + info->tx_timer.data = (unsigned long)info; + info->tx_timer.function = tx_timeout; + + init_timer(&info->rx_timer); + info->rx_timer.data = (unsigned long)info; + info->rx_timer.function = rx_timeout; /* Copy configuration info to device instance data */ info->pdev = pdev; @@ -3788,9 +3794,10 @@ static void tx_start(struct slgt_info *info) } } - if (info->params.mode == MGSL_MODE_HDLC) - mod_timer(&info->tx_timer, jiffies + - msecs_to_jiffies(5000)); + if (info->params.mode == MGSL_MODE_HDLC) { + info->tx_timer.expires = jiffies + msecs_to_jiffies(5000); + add_timer(&info->tx_timer); + } } else { tdma_reset(info); /* set 1st descriptor address */ diff --git a/trunk/drivers/char/synclinkmp.c b/trunk/drivers/char/synclinkmp.c index ef93d055bdd7..ebde4e552335 100644 --- a/trunk/drivers/char/synclinkmp.c +++ b/trunk/drivers/char/synclinkmp.c @@ -2744,7 +2744,8 @@ static int startup(SLMP_INFO * info) change_params(info); - mod_timer(&info->status_timer, jiffies + msecs_to_jiffies(10)); + info->status_timer.expires = jiffies + msecs_to_jiffies(10); + add_timer(&info->status_timer); if (info->tty) clear_bit(TTY_IO_ERROR, &info->tty->flags); @@ -3840,9 +3841,13 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev) info->bus_type = MGSL_BUS_TYPE_PCI; info->irq_flags = IRQF_SHARED; - setup_timer(&info->tx_timer, tx_timeout, (unsigned long)info); - setup_timer(&info->status_timer, status_timeout, - (unsigned long)info); + init_timer(&info->tx_timer); + info->tx_timer.data = (unsigned long)info; + info->tx_timer.function = tx_timeout; + + init_timer(&info->status_timer); + info->status_timer.data = (unsigned long)info; + info->status_timer.function = status_timeout; /* Store the PCI9050 misc control register value because a flaw * in the PCI9050 prevents LCR registers from being read if @@ -4286,8 +4291,8 @@ void tx_start(SLMP_INFO *info) write_reg(info, TXDMA + DIR, 0x40); /* enable Tx DMA interrupts (EOM) */ write_reg(info, TXDMA + DSR, 0xf2); /* clear Tx DMA IRQs, enable Tx DMA */ - mod_timer(&info->tx_timer, jiffies + - msecs_to_jiffies(5000)); + info->tx_timer.expires = jiffies + msecs_to_jiffies(5000); + add_timer(&info->tx_timer); } else { tx_load_fifo(info); @@ -5569,7 +5574,10 @@ void status_timeout(unsigned long context) if (status) isr_io_pin(info,status); - mod_timer(&info->status_timer, jiffies + msecs_to_jiffies(10)); + info->status_timer.data = (unsigned long)info; + info->status_timer.function = status_timeout; + info->status_timer.expires = jiffies + msecs_to_jiffies(10); + add_timer(&info->status_timer); } diff --git a/trunk/drivers/char/sysrq.c b/trunk/drivers/char/sysrq.c index be73c80d699d..3757610b7835 100644 --- a/trunk/drivers/char/sysrq.c +++ b/trunk/drivers/char/sysrq.c @@ -89,6 +89,7 @@ static struct sysrq_key_op sysrq_loglevel_op = { static void sysrq_handle_SAK(int key, struct tty_struct *tty) { struct work_struct *SAK_work = &vc_cons[fg_console].SAK_work; + PREPARE_WORK(SAK_work, vc_SAK); schedule_work(SAK_work); } static struct sysrq_key_op sysrq_SAK_op = { diff --git a/trunk/drivers/char/tpm/tpm.c b/trunk/drivers/char/tpm/tpm.c index 2f572b97c16d..33e1f66e39cb 100644 --- a/trunk/drivers/char/tpm/tpm.c +++ b/trunk/drivers/char/tpm/tpm.c @@ -1107,8 +1107,9 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vend INIT_WORK(&chip->work, timeout_work); - setup_timer(&chip->user_read_timer, user_reader_timeout, - (unsigned long)chip); + init_timer(&chip->user_read_timer); + chip->user_read_timer.function = user_reader_timeout; + chip->user_read_timer.data = (unsigned long) chip; memcpy(&chip->vendor, entry, sizeof(struct tpm_vendor_specific)); diff --git a/trunk/drivers/char/tpm/tpm_bios.c b/trunk/drivers/char/tpm/tpm_bios.c index 4eba32b23b29..7fca5f470beb 100644 --- a/trunk/drivers/char/tpm/tpm_bios.c +++ b/trunk/drivers/char/tpm/tpm_bios.c @@ -441,7 +441,7 @@ static int tpm_ascii_bios_measurements_open(struct inode *inode, return err; } -const struct file_operations tpm_ascii_bios_measurements_ops = { +struct file_operations tpm_ascii_bios_measurements_ops = { .open = tpm_ascii_bios_measurements_open, .read = seq_read, .llseek = seq_lseek, @@ -474,7 +474,7 @@ static int tpm_binary_bios_measurements_open(struct inode *inode, return err; } -const struct file_operations tpm_binary_bios_measurements_ops = { +struct file_operations tpm_binary_bios_measurements_ops = { .open = tpm_binary_bios_measurements_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/char/tty_io.c b/trunk/drivers/char/tty_io.c index 5289254e7ab3..558ca927e32b 100644 --- a/trunk/drivers/char/tty_io.c +++ b/trunk/drivers/char/tty_io.c @@ -155,8 +155,6 @@ int tty_ioctl(struct inode * inode, struct file * file, unsigned int cmd, unsigned long arg); static int tty_fasync(int fd, struct file * filp, int on); static void release_tty(struct tty_struct *tty, int idx); -static struct pid *__proc_set_tty(struct task_struct *tsk, - struct tty_struct *tty); /** * alloc_tty_struct - allocate a tty object @@ -1111,17 +1109,17 @@ int tty_check_change(struct tty_struct * tty) { if (current->signal->tty != tty) return 0; - if (!tty->pgrp) { - printk(KERN_WARNING "tty_check_change: tty->pgrp == NULL!\n"); + if (tty->pgrp <= 0) { + printk(KERN_WARNING "tty_check_change: tty->pgrp <= 0!\n"); return 0; } - if (task_pgrp(current) == tty->pgrp) + if (process_group(current) == tty->pgrp) return 0; if (is_ignored(SIGTTOU)) return 0; - if (is_current_pgrp_orphaned()) + if (is_orphaned_pgrp(process_group(current))) return -EIO; - (void) kill_pgrp(task_pgrp(current), SIGTTOU, 1); + (void) kill_pg(process_group(current), SIGTTOU, 1); return -ERESTARTSYS; } @@ -1356,8 +1354,8 @@ static void do_tty_hangup(struct work_struct *work) tty_release is called */ read_lock(&tasklist_lock); - if (tty->session) { - do_each_pid_task(tty->session, PIDTYPE_SID, p) { + if (tty->session > 0) { + do_each_task_pid(tty->session, PIDTYPE_SID, p) { spin_lock_irq(&p->sighand->siglock); if (p->signal->tty == tty) p->signal->tty = NULL; @@ -1367,17 +1365,16 @@ static void do_tty_hangup(struct work_struct *work) } __group_send_sig_info(SIGHUP, SEND_SIG_PRIV, p); __group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p); - put_pid(p->signal->tty_old_pgrp); /* A noop */ - if (tty->pgrp) - p->signal->tty_old_pgrp = get_pid(tty->pgrp); + if (tty->pgrp > 0) + p->signal->tty_old_pgrp = tty->pgrp; spin_unlock_irq(&p->sighand->siglock); - } while_each_pid_task(tty->session, PIDTYPE_SID, p); + } while_each_task_pid(tty->session, PIDTYPE_SID, p); } read_unlock(&tasklist_lock); tty->flags = 0; - tty->session = NULL; - tty->pgrp = NULL; + tty->session = 0; + tty->pgrp = -1; tty->ctrl_status = 0; /* * If one of the devices matches a console pointer, we @@ -1462,12 +1459,12 @@ int tty_hung_up_p(struct file * filp) EXPORT_SYMBOL(tty_hung_up_p); -static void session_clear_tty(struct pid *session) +static void session_clear_tty(pid_t session) { struct task_struct *p; - do_each_pid_task(session, PIDTYPE_SID, p) { + do_each_task_pid(session, PIDTYPE_SID, p) { proc_clear_tty(p); - } while_each_pid_task(session, PIDTYPE_SID, p); + } while_each_task_pid(session, PIDTYPE_SID, p); } /** @@ -1497,54 +1494,46 @@ static void session_clear_tty(struct pid *session) void disassociate_ctty(int on_exit) { struct tty_struct *tty; - struct pid *tty_pgrp = NULL; + int tty_pgrp = -1; + int session; lock_kernel(); mutex_lock(&tty_mutex); tty = get_current_tty(); if (tty) { - tty_pgrp = get_pid(tty->pgrp); + tty_pgrp = tty->pgrp; mutex_unlock(&tty_mutex); /* XXX: here we race, there is nothing protecting tty */ if (on_exit && tty->driver->type != TTY_DRIVER_TYPE_PTY) tty_vhangup(tty); - } else if (on_exit) { - struct pid *old_pgrp; - spin_lock_irq(¤t->sighand->siglock); - old_pgrp = current->signal->tty_old_pgrp; - current->signal->tty_old_pgrp = NULL; - spin_unlock_irq(¤t->sighand->siglock); + } else { + pid_t old_pgrp = current->signal->tty_old_pgrp; if (old_pgrp) { - kill_pgrp(old_pgrp, SIGHUP, on_exit); - kill_pgrp(old_pgrp, SIGCONT, on_exit); - put_pid(old_pgrp); + kill_pg(old_pgrp, SIGHUP, on_exit); + kill_pg(old_pgrp, SIGCONT, on_exit); } mutex_unlock(&tty_mutex); unlock_kernel(); return; } - if (tty_pgrp) { - kill_pgrp(tty_pgrp, SIGHUP, on_exit); + if (tty_pgrp > 0) { + kill_pg(tty_pgrp, SIGHUP, on_exit); if (!on_exit) - kill_pgrp(tty_pgrp, SIGCONT, on_exit); - put_pid(tty_pgrp); + kill_pg(tty_pgrp, SIGCONT, on_exit); } spin_lock_irq(¤t->sighand->siglock); - tty_pgrp = current->signal->tty_old_pgrp; current->signal->tty_old_pgrp = 0; + session = process_session(current); spin_unlock_irq(¤t->sighand->siglock); - put_pid(tty_pgrp); mutex_lock(&tty_mutex); /* It is possible that do_tty_hangup has free'd this tty */ tty = get_current_tty(); if (tty) { - put_pid(tty->session); - put_pid(tty->pgrp); - tty->session = NULL; - tty->pgrp = NULL; + tty->session = 0; + tty->pgrp = 0; } else { #ifdef TTY_DEBUG_HANGUP printk(KERN_DEBUG "error attempted to write to tty [0x%p]" @@ -1555,7 +1544,7 @@ void disassociate_ctty(int on_exit) /* Now clear signal->tty under the lock */ read_lock(&tasklist_lock); - session_clear_tty(task_session(current)); + session_clear_tty(session); read_unlock(&tasklist_lock); unlock_kernel(); } @@ -2492,7 +2481,6 @@ static int tty_open(struct inode * inode, struct file * filp) int index; dev_t device = inode->i_rdev; unsigned short saved_flags = filp->f_flags; - struct pid *old_pgrp; nonseekable_open(inode, filp); @@ -2586,17 +2574,15 @@ static int tty_open(struct inode * inode, struct file * filp) goto retry_open; } - old_pgrp = NULL; mutex_lock(&tty_mutex); spin_lock_irq(¤t->sighand->siglock); if (!noctty && current->signal->leader && !current->signal->tty && - tty->session == NULL) - old_pgrp = __proc_set_tty(current, tty); + tty->session == 0) + __proc_set_tty(current, tty); spin_unlock_irq(¤t->sighand->siglock); mutex_unlock(&tty_mutex); - put_pid(old_pgrp); return 0; } @@ -2735,18 +2721,9 @@ static int tty_fasync(int fd, struct file * filp, int on) return retval; if (on) { - enum pid_type type; - struct pid *pid; if (!waitqueue_active(&tty->read_wait)) tty->minimum_to_wake = 1; - if (tty->pgrp) { - pid = tty->pgrp; - type = PIDTYPE_PGID; - } else { - pid = task_pid(current); - type = PIDTYPE_PID; - } - retval = __f_setown(filp, pid, type, 0); + retval = f_setown(filp, (-tty->pgrp) ? : current->pid, 0); if (retval) return retval; } else { @@ -2848,10 +2825,10 @@ static int tiocswinsz(struct tty_struct *tty, struct tty_struct *real_tty, } } #endif - if (tty->pgrp) - kill_pgrp(tty->pgrp, SIGWINCH, 1); - if ((real_tty->pgrp != tty->pgrp) && real_tty->pgrp) - kill_pgrp(real_tty->pgrp, SIGWINCH, 1); + if (tty->pgrp > 0) + kill_pg(tty->pgrp, SIGWINCH, 1); + if ((real_tty->pgrp != tty->pgrp) && (real_tty->pgrp > 0)) + kill_pg(real_tty->pgrp, SIGWINCH, 1); tty->winsize = tmp_ws; real_tty->winsize = tmp_ws; done: @@ -2936,7 +2913,8 @@ static int fionbio(struct file *file, int __user *p) static int tiocsctty(struct tty_struct *tty, int arg) { int ret = 0; - if (current->signal->leader && (task_session(current) == tty->session)) + if (current->signal->leader && + (process_session(current) == tty->session)) return ret; mutex_lock(&tty_mutex); @@ -2949,7 +2927,7 @@ static int tiocsctty(struct tty_struct *tty, int arg) goto unlock; } - if (tty->session) { + if (tty->session > 0) { /* * This tty is already the controlling * tty for another session group! @@ -2992,7 +2970,7 @@ static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t */ if (tty == real_tty && current->signal->tty != real_tty) return -ENOTTY; - return put_user(pid_nr(real_tty->pgrp), p); + return put_user(real_tty->pgrp, p); } /** @@ -3009,8 +2987,7 @@ static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p) { - struct pid *pgrp; - pid_t pgrp_nr; + pid_t pgrp; int retval = tty_check_change(real_tty); if (retval == -EIO) @@ -3019,26 +2996,16 @@ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t return retval; if (!current->signal->tty || (current->signal->tty != real_tty) || - (real_tty->session != task_session(current))) + (real_tty->session != process_session(current))) return -ENOTTY; - if (get_user(pgrp_nr, p)) + if (get_user(pgrp, p)) return -EFAULT; - if (pgrp_nr < 0) + if (pgrp < 0) return -EINVAL; - rcu_read_lock(); - pgrp = find_pid(pgrp_nr); - retval = -ESRCH; - if (!pgrp) - goto out_unlock; - retval = -EPERM; - if (session_of_pgrp(pgrp) != task_session(current)) - goto out_unlock; - retval = 0; - put_pid(real_tty->pgrp); - real_tty->pgrp = get_pid(pgrp); -out_unlock: - rcu_read_unlock(); - return retval; + if (session_of_pgrp(pgrp) != process_session(current)) + return -EPERM; + real_tty->pgrp = pgrp; + return 0; } /** @@ -3061,9 +3028,9 @@ static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t _ */ if (tty == real_tty && current->signal->tty != real_tty) return -ENOTTY; - if (!real_tty->session) + if (real_tty->session <= 0) return -ENOTTY; - return put_user(pid_nr(real_tty->session), p); + return put_user(real_tty->session, p); } /** @@ -3363,7 +3330,7 @@ void __do_SAK(struct tty_struct *tty) tty_hangup(tty); #else struct task_struct *g, *p; - struct pid *session; + int session; int i; struct file *filp; struct fdtable *fdt; @@ -3379,12 +3346,12 @@ void __do_SAK(struct tty_struct *tty) read_lock(&tasklist_lock); /* Kill the entire session */ - do_each_pid_task(session, PIDTYPE_SID, p) { + do_each_task_pid(session, PIDTYPE_SID, p) { printk(KERN_NOTICE "SAK: killed process %d" " (%s): process_session(p)==tty->session\n", p->pid, p->comm); send_sig(SIGKILL, p, 1); - } while_each_pid_task(session, PIDTYPE_SID, p); + } while_each_task_pid(session, PIDTYPE_SID, p); /* Now kill any processes that happen to have the * tty open. */ @@ -3442,6 +3409,7 @@ void do_SAK(struct tty_struct *tty) { if (!tty) return; + PREPARE_WORK(&tty->SAK_work, do_SAK_work); schedule_work(&tty->SAK_work); } @@ -3552,8 +3520,7 @@ static void initialize_tty_struct(struct tty_struct *tty) memset(tty, 0, sizeof(struct tty_struct)); tty->magic = TTY_MAGIC; tty_ldisc_assign(tty, tty_ldisc_get(N_TTY)); - tty->session = NULL; - tty->pgrp = NULL; + tty->pgrp = -1; tty->overrun_time = jiffies; tty->buf.head = tty->buf.tail = NULL; tty_buffer_init(tty); @@ -3567,7 +3534,7 @@ static void initialize_tty_struct(struct tty_struct *tty) mutex_init(&tty->atomic_write_lock); spin_lock_init(&tty->read_lock); INIT_LIST_HEAD(&tty->tty_files); - INIT_WORK(&tty->SAK_work, do_SAK_work); + INIT_WORK(&tty->SAK_work, NULL); } /* @@ -3824,28 +3791,21 @@ void proc_clear_tty(struct task_struct *p) } EXPORT_SYMBOL(proc_clear_tty); -static struct pid *__proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) +void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) { - struct pid *old_pgrp; if (tty) { - tty->session = get_pid(task_session(tsk)); - tty->pgrp = get_pid(task_pgrp(tsk)); + tty->session = process_session(tsk); + tty->pgrp = process_group(tsk); } - old_pgrp = tsk->signal->tty_old_pgrp; tsk->signal->tty = tty; - tsk->signal->tty_old_pgrp = NULL; - return old_pgrp; + tsk->signal->tty_old_pgrp = 0; } void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) { - struct pid *old_pgrp; - spin_lock_irq(&tsk->sighand->siglock); - old_pgrp = __proc_set_tty(tsk, tty); + __proc_set_tty(tsk, tty); spin_unlock_irq(&tsk->sighand->siglock); - - put_pid(old_pgrp); } struct tty_struct *get_current_tty(void) diff --git a/trunk/drivers/char/viotape.c b/trunk/drivers/char/viotape.c index 13faf8d17482..9438512b17f1 100644 --- a/trunk/drivers/char/viotape.c +++ b/trunk/drivers/char/viotape.c @@ -872,7 +872,7 @@ static int viotap_release(struct inode *inode, struct file *file) return ret; } -const struct file_operations viotap_fops = { +struct file_operations viotap_fops = { owner: THIS_MODULE, read: viotap_read, write: viotap_write, diff --git a/trunk/drivers/char/vt.c b/trunk/drivers/char/vt.c index c3f8e383933b..13299b8fdbd6 100644 --- a/trunk/drivers/char/vt.c +++ b/trunk/drivers/char/vt.c @@ -210,7 +210,7 @@ static int scrollback_delta; */ int (*console_blank_hook)(int); -static DEFINE_TIMER(console_timer, blank_screen_t, 0, 0); +static struct timer_list console_timer; static int blank_state; static int blank_timer_expired; enum { @@ -866,8 +866,8 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) ws.ws_col = vc->vc_cols; ws.ws_ypixel = vc->vc_scan_lines; if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col) && - vc->vc_tty->pgrp) - kill_pgrp(vc->vc_tty->pgrp, SIGWINCH, 1); + vc->vc_tty->pgrp > 0) + kill_pg(vc->vc_tty->pgrp, SIGWINCH, 1); *cws = ws; } @@ -2625,6 +2625,8 @@ static int __init con_init(void) for (i = 0; i < MAX_NR_CONSOLES; i++) con_driver_map[i] = conswitchp; + init_timer(&console_timer); + console_timer.function = blank_screen_t; if (blankinterval) { blank_state = blank_normal_wait; mod_timer(&console_timer, jiffies + blankinterval); @@ -2635,7 +2637,6 @@ static int __init con_init(void) */ for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) { vc_cons[currcons].d = vc = alloc_bootmem(sizeof(struct vc_data)); - INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); visual_init(vc, currcons, 1); vc->vc_screenbuf = (unsigned short *)alloc_bootmem(vc->vc_screenbuf_size); vc->vc_kmalloced = 0; diff --git a/trunk/drivers/char/watchdog/acquirewdt.c b/trunk/drivers/char/watchdog/acquirewdt.c index 85269c365a10..154d67e591e5 100644 --- a/trunk/drivers/char/watchdog/acquirewdt.c +++ b/trunk/drivers/char/watchdog/acquirewdt.c @@ -48,52 +48,46 @@ * It can be 1, 2, 10, 20, 110 or 220 seconds. */ -/* - * Includes, defines, variables, module parameters, ... - */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include -/* Includes */ -#include /* For module specific items */ -#include /* For new moduleparam's */ -#include /* For standard types (like size_t) */ -#include /* For the -ENODEV/... values */ -#include /* For printk/panic/... */ -#include /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */ -#include /* For the watchdog specific items */ -#include /* For file operations */ -#include /* For io-port access */ -#include /* For platform_driver framework */ -#include /* For __init/__exit/... */ - -#include /* For copy_to_user/put_user/... */ -#include /* For inb/outb/... */ - -/* Module information */ -#define DRV_NAME "acquirewdt" -#define PFX DRV_NAME ": " #define WATCHDOG_NAME "Acquire WDT" +#define PFX WATCHDOG_NAME ": " #define WATCHDOG_HEARTBEAT 0 /* There is no way to see what the correct time-out period is */ -/* internal variables */ -static struct platform_device *acq_platform_device; /* the watchdog platform device */ static unsigned long acq_is_open; static char expect_close; -/* module parameters */ -static int wdt_stop = 0x43; /* You must set this - there is no sane way to probe for this board. */ +/* + * You must set these - there is no sane way to probe for this board. + */ + +static int wdt_stop = 0x43; module_param(wdt_stop, int, 0); MODULE_PARM_DESC(wdt_stop, "Acquire WDT 'stop' io port (default 0x43)"); -static int wdt_start = 0x443; /* You must set this - there is no sane way to probe for this board. */ +static int wdt_start = 0x443; module_param(wdt_start, int, 0); MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)"); static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); /* - * Watchdog Operations + * Kernel methods. */ static void acq_keepalive(void) @@ -109,7 +103,7 @@ static void acq_stop(void) } /* - * /dev/watchdog handling + * /dev/watchdog handling. */ static ssize_t acq_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) @@ -149,7 +143,7 @@ static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd, { .options = WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, .firmware_version = 1, - .identity = WATCHDOG_NAME, + .identity = "Acquire WDT", }; switch(cmd) @@ -219,6 +213,20 @@ static int acq_close(struct inode *inode, struct file *file) return 0; } +/* + * Notifier for system down + */ + +static int acq_notify_sys(struct notifier_block *this, unsigned long code, + void *unused) +{ + if(code==SYS_DOWN || code==SYS_HALT) { + /* Turn the WDT off */ + acq_stop(); + } + return NOTIFY_DONE; +} + /* * Kernel Interfaces */ @@ -232,20 +240,29 @@ static const struct file_operations acq_fops = { .release = acq_close, }; -static struct miscdevice acq_miscdev = { - .minor = WATCHDOG_MINOR, - .name = "watchdog", - .fops = &acq_fops, +static struct miscdevice acq_miscdev= +{ + .minor = WATCHDOG_MINOR, + .name = "watchdog", + .fops = &acq_fops, }; /* - * Init & exit routines + * The WDT card needs to learn about soft shutdowns in order to + * turn the timebomb registers off. */ -static int __devinit acq_probe(struct platform_device *dev) +static struct notifier_block acq_notifier = +{ + .notifier_call = acq_notify_sys, +}; + +static int __init acq_init(void) { int ret; + printk(KERN_INFO "WDT driver for Acquire single board computer initialising.\n"); + if (wdt_stop != wdt_start) { if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", @@ -262,11 +279,18 @@ static int __devinit acq_probe(struct platform_device *dev) goto unreg_stop; } + ret = register_reboot_notifier(&acq_notifier); + if (ret != 0) { + printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", + ret); + goto unreg_regions; + } + ret = misc_register(&acq_miscdev); if (ret != 0) { printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", WATCHDOG_MINOR, ret); - goto unreg_regions; + goto unreg_reboot; } printk (KERN_INFO PFX "initialized. (nowayout=%d)\n", @@ -274,6 +298,8 @@ static int __devinit acq_probe(struct platform_device *dev) return 0; +unreg_reboot: + unregister_reboot_notifier(&acq_notifier); unreg_regions: release_region(wdt_start, 1); unreg_stop: @@ -283,60 +309,13 @@ static int __devinit acq_probe(struct platform_device *dev) return ret; } -static int __devexit acq_remove(struct platform_device *dev) +static void __exit acq_exit(void) { misc_deregister(&acq_miscdev); - release_region(wdt_start,1); + unregister_reboot_notifier(&acq_notifier); if(wdt_stop != wdt_start) release_region(wdt_stop,1); - - return 0; -} - -static void acq_shutdown(struct platform_device *dev) -{ - /* Turn the WDT off if we have a soft shutdown */ - acq_stop(); -} - -static struct platform_driver acquirewdt_driver = { - .probe = acq_probe, - .remove = __devexit_p(acq_remove), - .shutdown = acq_shutdown, - .driver = { - .owner = THIS_MODULE, - .name = DRV_NAME, - }, -}; - -static int __init acq_init(void) -{ - int err; - - printk(KERN_INFO "WDT driver for Acquire single board computer initialising.\n"); - - err = platform_driver_register(&acquirewdt_driver); - if (err) - return err; - - acq_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0); - if (IS_ERR(acq_platform_device)) { - err = PTR_ERR(acq_platform_device); - goto unreg_platform_driver; - } - - return 0; - -unreg_platform_driver: - platform_driver_unregister(&acquirewdt_driver); - return err; -} - -static void __exit acq_exit(void) -{ - platform_device_unregister(acq_platform_device); - platform_driver_unregister(&acquirewdt_driver); - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); + release_region(wdt_start,1); } module_init(acq_init); diff --git a/trunk/drivers/char/watchdog/advantechwdt.c b/trunk/drivers/char/watchdog/advantechwdt.c index 8121cc247343..9d732769ba01 100644 --- a/trunk/drivers/char/watchdog/advantechwdt.c +++ b/trunk/drivers/char/watchdog/advantechwdt.c @@ -35,19 +35,18 @@ #include #include #include -#include +#include +#include #include #include #include #include -#define DRV_NAME "advantechwdt" -#define PFX DRV_NAME ": " #define WATCHDOG_NAME "Advantech WDT" +#define PFX WATCHDOG_NAME ": " #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ -static struct platform_device *advwdt_platform_device; /* the watchdog platform device */ static unsigned long advwdt_is_open; static char adv_expect_close; @@ -76,10 +75,10 @@ MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, defaul static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); /* - * Watchdog Operations + * Kernel methods. */ static void @@ -95,20 +94,6 @@ advwdt_disable(void) inb_p(wdt_stop); } -static int -advwdt_set_heartbeat(int t) -{ - if ((t < 1) || (t > 63)) - return -EINVAL; - - timeout = t; - return 0; -} - -/* - * /dev/watchdog handling - */ - static ssize_t advwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { @@ -141,7 +126,7 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static struct watchdog_info ident = { .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, .firmware_version = 1, - .identity = WATCHDOG_NAME, + .identity = "Advantech WDT", }; switch (cmd) { @@ -161,8 +146,9 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case WDIOC_SETTIMEOUT: if (get_user(new_timeout, p)) return -EFAULT; - if (advwdt_set_heartbeat(new_timeout)) + if ((new_timeout < 1) || (new_timeout > 63)) return -EINVAL; + timeout = new_timeout; advwdt_ping(); /* Fall */ @@ -222,6 +208,21 @@ advwdt_close(struct inode *inode, struct file *file) return 0; } +/* + * Notifier for system down + */ + +static int +advwdt_notify_sys(struct notifier_block *this, unsigned long code, + void *unused) +{ + if (code == SYS_DOWN || code == SYS_HALT) { + /* Turn the WDT off */ + advwdt_disable(); + } + return NOTIFY_DONE; +} + /* * Kernel Interfaces */ @@ -236,20 +237,33 @@ static const struct file_operations advwdt_fops = { }; static struct miscdevice advwdt_miscdev = { - .minor = WATCHDOG_MINOR, - .name = "watchdog", - .fops = &advwdt_fops, + .minor = WATCHDOG_MINOR, + .name = "watchdog", + .fops = &advwdt_fops, }; /* - * Init & exit routines + * The WDT needs to learn about soft shutdowns in order to + * turn the timebomb registers off. */ -static int __devinit -advwdt_probe(struct platform_device *dev) +static struct notifier_block advwdt_notifier = { + .notifier_call = advwdt_notify_sys, +}; + +static int __init +advwdt_init(void) { int ret; + printk(KERN_INFO "WDT driver for Advantech single board computer initialising.\n"); + + if (timeout < 1 || timeout > 63) { + timeout = WATCHDOG_TIMEOUT; + printk (KERN_INFO PFX "timeout value must be 1<=x<=63, using %d\n", + timeout); + } + if (wdt_stop != wdt_start) { if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", @@ -266,18 +280,18 @@ advwdt_probe(struct platform_device *dev) goto unreg_stop; } - /* Check that the heartbeat value is within it's range ; if not reset to the default */ - if (advwdt_set_heartbeat(timeout)) { - advwdt_set_heartbeat(WATCHDOG_TIMEOUT); - printk (KERN_INFO PFX "timeout value must be 1<=x<=63, using %d\n", - timeout); + ret = register_reboot_notifier(&advwdt_notifier); + if (ret != 0) { + printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", + ret); + goto unreg_regions; } ret = misc_register(&advwdt_miscdev); if (ret != 0) { printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", WATCHDOG_MINOR, ret); - goto unreg_regions; + goto unreg_reboot; } printk (KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", @@ -285,6 +299,8 @@ advwdt_probe(struct platform_device *dev) out: return ret; +unreg_reboot: + unregister_reboot_notifier(&advwdt_notifier); unreg_regions: release_region(wdt_start, 1); unreg_stop: @@ -293,64 +309,14 @@ advwdt_probe(struct platform_device *dev) goto out; } -static int __devexit -advwdt_remove(struct platform_device *dev) +static void __exit +advwdt_exit(void) { misc_deregister(&advwdt_miscdev); - release_region(wdt_start,1); + unregister_reboot_notifier(&advwdt_notifier); if(wdt_stop != wdt_start) release_region(wdt_stop,1); - - return 0; -} - -static void -advwdt_shutdown(struct platform_device *dev) -{ - /* Turn the WDT off if we have a soft shutdown */ - advwdt_disable(); -} - -static struct platform_driver advwdt_driver = { - .probe = advwdt_probe, - .remove = __devexit_p(advwdt_remove), - .shutdown = advwdt_shutdown, - .driver = { - .owner = THIS_MODULE, - .name = DRV_NAME, - }, -}; - -static int __init -advwdt_init(void) -{ - int err; - - printk(KERN_INFO "WDT driver for Advantech single board computer initialising.\n"); - - err = platform_driver_register(&advwdt_driver); - if (err) - return err; - - advwdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0); - if (IS_ERR(advwdt_platform_device)) { - err = PTR_ERR(advwdt_platform_device); - goto unreg_platform_driver; - } - - return 0; - -unreg_platform_driver: - platform_driver_unregister(&advwdt_driver); - return err; -} - -static void __exit -advwdt_exit(void) -{ - platform_device_unregister(advwdt_platform_device); - platform_driver_unregister(&advwdt_driver); - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); + release_region(wdt_start,1); } module_init(advwdt_init); diff --git a/trunk/drivers/char/watchdog/alim1535_wdt.c b/trunk/drivers/char/watchdog/alim1535_wdt.c index e3f6a7d0c83d..01b0d132ee41 100644 --- a/trunk/drivers/char/watchdog/alim1535_wdt.c +++ b/trunk/drivers/char/watchdog/alim1535_wdt.c @@ -40,7 +40,7 @@ MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0. + * (c) Copyright 2006 Wim Van Sebroeck . * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -49,7 +49,7 @@ /* Module and version information */ #define DRV_NAME "iTCO_wdt" #define DRV_VERSION "1.01" -#define DRV_RELDATE "21-Jan-2007" +#define DRV_RELDATE "11-Nov-2006" #define PFX DRV_NAME ": " /* Includes */ @@ -187,7 +187,7 @@ MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2 * - * Based on advantechwdt.c which is based on acquirewdt.c which - * is based on wdt.c. + * Based on advantechwdt.c which is based on acquirewdt.c which + * is based on wdt.c. * * (c) Copyright 2000-2001 Marek Michalkiewicz * @@ -25,9 +25,9 @@ * * (c) Copyright 1995 Alan Cox * - * 14-Dec-2001 Matt Domsch - * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT - * Added timeout module option to override default + * 14-Dec-2001 Matt Domsch + * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT + * Added timeout module option to override default * */ @@ -36,24 +36,22 @@ #include #include #include +#include #include +#include #include #include #include -#include #include #include #include -static struct platform_device *ibwdt_platform_device; static unsigned long ibwdt_is_open; static spinlock_t ibwdt_lock; static char expect_close; -/* Module information */ -#define DRV_NAME "ib700wdt" -#define PFX DRV_NAME ": " +#define PFX "ib700wdt: " /* * @@ -120,51 +118,20 @@ static int wd_margin = WD_TIMO; static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); /* - * Watchdog Operations + * Kernel methods. */ static void ibwdt_ping(void) { - spin_lock(&ibwdt_lock); - /* Write a watchdog value */ outb_p(wd_margin, WDT_START); - - spin_unlock(&ibwdt_lock); } -static void -ibwdt_disable(void) -{ - spin_lock(&ibwdt_lock); - outb_p(0, WDT_STOP); - spin_unlock(&ibwdt_lock); -} - -static int -ibwdt_set_heartbeat(int t) -{ - int i; - - if ((t < 0) || (t > 30)) - return -EINVAL; - - for (i = 0x0F; i > -1; i--) - if (wd_times[i] > t) - break; - wd_margin = i; - return 0; -} - -/* - * /dev/watchdog handling - */ - static ssize_t ibwdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { @@ -192,7 +159,7 @@ static int ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - int new_margin; + int i, new_margin; void __user *argp = (void __user *)arg; int __user *p = argp; @@ -209,7 +176,6 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, break; case WDIOC_GETSTATUS: - case WDIOC_GETBOOTSTATUS: return put_user(0, p); case WDIOC_KEEPALIVE: @@ -219,33 +185,18 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, case WDIOC_SETTIMEOUT: if (get_user(new_margin, p)) return -EFAULT; - if (ibwdt_set_heartbeat(new_margin)) + if ((new_margin < 0) || (new_margin > 30)) return -EINVAL; + for (i = 0x0F; i > -1; i--) + if (wd_times[i] > new_margin) + break; + wd_margin = i; ibwdt_ping(); /* Fall */ case WDIOC_GETTIMEOUT: return put_user(wd_times[wd_margin], p); - - case WDIOC_SETOPTIONS: - { - int options, retval = -EINVAL; - - if (get_user(options, p)) - return -EFAULT; - - if (options & WDIOS_DISABLECARD) { - ibwdt_disable(); - retval = 0; - } - - if (options & WDIOS_ENABLECARD) { - ibwdt_ping(); - retval = 0; - } - - return retval; - } + break; default: return -ENOTTY; @@ -256,7 +207,9 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static int ibwdt_open(struct inode *inode, struct file *file) { + spin_lock(&ibwdt_lock); if (test_and_set_bit(0, &ibwdt_is_open)) { + spin_unlock(&ibwdt_lock); return -EBUSY; } if (nowayout) @@ -264,23 +217,40 @@ ibwdt_open(struct inode *inode, struct file *file) /* Activate */ ibwdt_ping(); + spin_unlock(&ibwdt_lock); return nonseekable_open(inode, file); } static int ibwdt_close(struct inode *inode, struct file *file) { - if (expect_close == 42) { - ibwdt_disable(); - } else { + spin_lock(&ibwdt_lock); + if (expect_close == 42) + outb_p(0, WDT_STOP); + else printk(KERN_CRIT PFX "WDT device closed unexpectedly. WDT will not stop!\n"); - ibwdt_ping(); - } + clear_bit(0, &ibwdt_is_open); expect_close = 0; + spin_unlock(&ibwdt_lock); return 0; } +/* + * Notifier for system down + */ + +static int +ibwdt_notify_sys(struct notifier_block *this, unsigned long code, + void *unused) +{ + if (code == SYS_DOWN || code == SYS_HALT) { + /* Turn the WDT off */ + outb_p(0, WDT_STOP); + } + return NOTIFY_DONE; +} + /* * Kernel Interfaces */ @@ -301,14 +271,26 @@ static struct miscdevice ibwdt_miscdev = { }; /* - * Init & exit routines + * The WDT needs to learn about soft shutdowns in order to + * turn the timebomb registers off. */ -static int __devinit ibwdt_probe(struct platform_device *dev) +static struct notifier_block ibwdt_notifier = { + .notifier_call = ibwdt_notify_sys, +}; + +static int __init ibwdt_init(void) { int res; + printk(KERN_INFO PFX "WDT driver for IB700 single board computer initialising.\n"); + spin_lock_init(&ibwdt_lock); + res = misc_register(&ibwdt_miscdev); + if (res) { + printk (KERN_ERR PFX "failed to register misc device\n"); + goto out_nomisc; + } #if WDT_START != WDT_STOP if (!request_region(WDT_STOP, 1, "IB700 WDT")) { @@ -323,78 +305,34 @@ static int __devinit ibwdt_probe(struct platform_device *dev) res = -EIO; goto out_nostartreg; } - - res = misc_register(&ibwdt_miscdev); + res = register_reboot_notifier(&ibwdt_notifier); if (res) { - printk (KERN_ERR PFX "failed to register misc device\n"); - goto out_nomisc; + printk (KERN_ERR PFX "Failed to register reboot notifier.\n"); + goto out_noreboot; } return 0; -out_nomisc: +out_noreboot: release_region(WDT_START, 1); out_nostartreg: #if WDT_START != WDT_STOP release_region(WDT_STOP, 1); #endif out_nostopreg: + misc_deregister(&ibwdt_miscdev); +out_nomisc: return res; } -static int __devexit ibwdt_remove(struct platform_device *dev) +static void __exit +ibwdt_exit(void) { misc_deregister(&ibwdt_miscdev); - release_region(WDT_START,1); + unregister_reboot_notifier(&ibwdt_notifier); #if WDT_START != WDT_STOP release_region(WDT_STOP,1); #endif - return 0; -} - -static void ibwdt_shutdown(struct platform_device *dev) -{ - /* Turn the WDT off if we have a soft shutdown */ - ibwdt_disable(); -} - -static struct platform_driver ibwdt_driver = { - .probe = ibwdt_probe, - .remove = __devexit_p(ibwdt_remove), - .shutdown = ibwdt_shutdown, - .driver = { - .owner = THIS_MODULE, - .name = DRV_NAME, - }, -}; - -static int __init ibwdt_init(void) -{ - int err; - - printk(KERN_INFO PFX "WDT driver for IB700 single board computer initialising.\n"); - - err = platform_driver_register(&ibwdt_driver); - if (err) - return err; - - ibwdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0); - if (IS_ERR(ibwdt_platform_device)) { - err = PTR_ERR(ibwdt_platform_device); - goto unreg_platform_driver; - } - - return 0; - -unreg_platform_driver: - platform_driver_unregister(&ibwdt_driver); - return err; -} - -static void __exit ibwdt_exit(void) -{ - platform_device_unregister(ibwdt_platform_device); - platform_driver_unregister(&ibwdt_driver); - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); + release_region(WDT_START,1); } module_init(ibwdt_init); diff --git a/trunk/drivers/char/watchdog/ibmasr.c b/trunk/drivers/char/watchdog/ibmasr.c index 8195f5023d85..dd6760f1a23b 100644 --- a/trunk/drivers/char/watchdog/ibmasr.c +++ b/trunk/drivers/char/watchdog/ibmasr.c @@ -396,7 +396,7 @@ module_init(ibmasr_init); module_exit(ibmasr_exit); module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_DESCRIPTION("IBM Automatic Server Restart driver"); MODULE_AUTHOR("Andrey Panin"); diff --git a/trunk/drivers/char/watchdog/indydog.c b/trunk/drivers/char/watchdog/indydog.c index 788245bdaa7f..0bc239308989 100644 --- a/trunk/drivers/char/watchdog/indydog.c +++ b/trunk/drivers/char/watchdog/indydog.c @@ -32,7 +32,7 @@ static int indydog_alive; static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); static void indydog_start(void) { diff --git a/trunk/drivers/char/watchdog/machzwd.c b/trunk/drivers/char/watchdog/machzwd.c index 81fb3dec180f..4d730fdbd528 100644 --- a/trunk/drivers/char/watchdog/machzwd.c +++ b/trunk/drivers/char/watchdog/machzwd.c @@ -95,7 +95,7 @@ MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); #define PFX "machzwd" @@ -118,14 +118,12 @@ static int action = 0; module_param(action, int, 0); MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI"); -static void zf_ping(unsigned long data); - static int zf_action = GEN_RESET; static unsigned long zf_is_open; static char zf_expect_close; static spinlock_t zf_lock; static spinlock_t zf_port_lock; -static DEFINE_TIMER(zf_timer, zf_ping, 0, 0); +static struct timer_list zf_timer; static unsigned long next_heartbeat = 0; @@ -222,7 +220,9 @@ static void zf_timer_on(void) next_heartbeat = jiffies + ZF_USER_TIMEO; /* start the timer for internal ping */ - mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO); + zf_timer.expires = jiffies + ZF_HW_TIMEO; + + add_timer(&zf_timer); /* start watchdog timer */ ctrl_reg = zf_get_control(); @@ -260,7 +260,8 @@ static void zf_ping(unsigned long data) zf_set_control(ctrl_reg); spin_unlock_irqrestore(&zf_port_lock, flags); - mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO); + zf_timer.expires = jiffies + ZF_HW_TIMEO; + add_timer(&zf_timer); }else{ printk(KERN_CRIT PFX ": I will reset your machine\n"); } @@ -464,6 +465,11 @@ static int __init zf_init(void) zf_set_status(0); zf_set_control(0); + /* this is the timer that will do the hard work */ + init_timer(&zf_timer); + zf_timer.function = zf_ping; + zf_timer.data = 0; + return 0; no_reboot: diff --git a/trunk/drivers/char/watchdog/mixcomwd.c b/trunk/drivers/char/watchdog/mixcomwd.c index f35e2848aa3e..c2dac0aa1d62 100644 --- a/trunk/drivers/char/watchdog/mixcomwd.c +++ b/trunk/drivers/char/watchdog/mixcomwd.c @@ -56,18 +56,16 @@ static int mixcomwd_ioports[] = { 0x180, 0x280, 0x380, 0x000 }; #define FLASHCOM_WATCHDOG_OFFSET 0x4 #define FLASHCOM_ID 0x18 -static void mixcomwd_timerfun(unsigned long d); - static unsigned long mixcomwd_opened; /* long req'd for setbit --RR */ static int watchdog_port; static int mixcomwd_timer_alive; -static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun, 0, 0); +static DEFINE_TIMER(mixcomwd_timer, NULL, 0, 0); static char expect_close; static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); static void mixcomwd_ping(void) { @@ -79,7 +77,7 @@ static void mixcomwd_timerfun(unsigned long d) { mixcomwd_ping(); - mod_timer(&mixcomwd_timer, jiffies + 5 * HZ); + mod_timer(&mixcomwd_timer,jiffies+ 5*HZ); } /* @@ -116,8 +114,12 @@ static int mixcomwd_release(struct inode *inode, struct file *file) printk(KERN_ERR "mixcomwd: release called while internal timer alive"); return -EBUSY; } + init_timer(&mixcomwd_timer); + mixcomwd_timer.expires=jiffies + 5 * HZ; + mixcomwd_timer.function=mixcomwd_timerfun; + mixcomwd_timer.data=0; mixcomwd_timer_alive=1; - mod_timer(&mixcomwd_timer, jiffies + 5 * HZ); + add_timer(&mixcomwd_timer); } else { printk(KERN_CRIT "mixcomwd: WDT device closed unexpectedly. WDT will not stop!\n"); } @@ -283,7 +285,7 @@ static void __exit mixcomwd_exit(void) if(mixcomwd_timer_alive) { printk(KERN_WARNING "mixcomwd: I quit now, hardware will" " probably reboot!\n"); - del_timer_sync(&mixcomwd_timer); + del_timer(&mixcomwd_timer); mixcomwd_timer_alive=0; } } diff --git a/trunk/drivers/char/watchdog/omap_wdt.c b/trunk/drivers/char/watchdog/omap_wdt.c index 84074a697dce..6c6f97332dbb 100644 --- a/trunk/drivers/char/watchdog/omap_wdt.c +++ b/trunk/drivers/char/watchdog/omap_wdt.c @@ -230,7 +230,7 @@ omap_wdt_ioctl(struct inode *inode, struct file *file, } } -static const struct file_operations omap_wdt_fops = { +static struct file_operations omap_wdt_fops = { .owner = THIS_MODULE, .write = omap_wdt_write, .ioctl = omap_wdt_ioctl, diff --git a/trunk/drivers/char/watchdog/pc87413_wdt.c b/trunk/drivers/char/watchdog/pc87413_wdt.c index 3d3deae0d64b..1d447e32af41 100644 --- a/trunk/drivers/char/watchdog/pc87413_wdt.c +++ b/trunk/drivers/char/watchdog/pc87413_wdt.c @@ -526,7 +526,7 @@ static int pc87413_notify_sys(struct notifier_block *this, /* -- Module's structures ---------------------------------------*/ -static const struct file_operations pc87413_fops = { +static struct file_operations pc87413_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = pc87413_write, @@ -631,5 +631,5 @@ module_param(timeout, int, 0); MODULE_PARM_DESC(timeout, "Watchdog timeout in minutes (default=" __MODULE_STRING(timeout) ")."); module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); diff --git a/trunk/drivers/char/watchdog/pcwd.c b/trunk/drivers/char/watchdog/pcwd.c index 6e8b5705b5b7..8e1e6e48e0a7 100644 --- a/trunk/drivers/char/watchdog/pcwd.c +++ b/trunk/drivers/char/watchdog/pcwd.c @@ -2,7 +2,7 @@ * PC Watchdog Driver * by Ken Hollis (khollis@bitgate.com) * - * Permission granted from Simon Machell (smachell@berkprod.com) + * Permission granted from Simon Machell (73244.1270@compuserve.com) * Written for the Linux Kernel, and GPLed by Ken Hollis * * 960107 Added request_region routines, modulized the whole thing. @@ -70,8 +70,8 @@ #include /* For inb/outb/... */ /* Module and version information */ -#define WATCHDOG_VERSION "1.18" -#define WATCHDOG_DATE "21 Jan 2007" +#define WATCHDOG_VERSION "1.17" +#define WATCHDOG_DATE "12 Feb 2006" #define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog" #define WATCHDOG_NAME "pcwd" #define PFX WATCHDOG_NAME ": " @@ -132,18 +132,6 @@ #define CMD_ISA_DELAY_TIME_8SECS 0x0C #define CMD_ISA_RESET_RELAYS 0x0D -/* Watchdog's Dip Switch heartbeat values */ -static const int heartbeat_tbl [] = { - 20, /* OFF-OFF-OFF = 20 Sec */ - 40, /* OFF-OFF-ON = 40 Sec */ - 60, /* OFF-ON-OFF = 1 Min */ - 300, /* OFF-ON-ON = 5 Min */ - 600, /* ON-OFF-OFF = 10 Min */ - 1800, /* ON-OFF-ON = 30 Min */ - 3600, /* ON-ON-OFF = 1 Hour */ - 7200, /* ON-ON-ON = 2 hour */ -}; - /* * We are using an kernel timer to do the pinging of the watchdog * every ~500ms. We try to set the internal heartbeat of the @@ -179,14 +167,14 @@ static int debug = QUIET; module_param(debug, int, 0); MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)"); -#define WATCHDOG_HEARTBEAT 0 /* default heartbeat = delay-time from dip-switches */ +#define WATCHDOG_HEARTBEAT 60 /* 60 sec default heartbeat */ static int heartbeat = WATCHDOG_HEARTBEAT; module_param(heartbeat, int, 0); -MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<=heartbeat<=7200 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); +MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<=heartbeat<=7200, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); /* * Internal functions @@ -843,7 +831,9 @@ static int __devinit pcwatchdog_init(int base_addr) /* clear the "card caused reboot" flag */ pcwd_clear_status(); - setup_timer(&pcwd_private.timer, pcwd_timer_ping, 0); + init_timer(&pcwd_private.timer); + pcwd_private.timer.function = pcwd_timer_ping; + pcwd_private.timer.data = 0; /* Disable the board */ pcwd_stop(); @@ -854,10 +844,6 @@ static int __devinit pcwatchdog_init(int base_addr) /* Show info about the card itself */ pcwd_show_card_info(); - /* If heartbeat = 0 then we use the heartbeat from the dip-switches */ - if (heartbeat == 0) - heartbeat = heartbeat_tbl[(pcwd_get_option_switches() & 0x07)]; - /* Check that the heartbeat value is within it's range ; if not reset to the default */ if (pcwd_set_heartbeat(heartbeat)) { pcwd_set_heartbeat(WATCHDOG_HEARTBEAT); diff --git a/trunk/drivers/char/watchdog/pcwd_pci.c b/trunk/drivers/char/watchdog/pcwd_pci.c index 61a89e959642..f4872c871063 100644 --- a/trunk/drivers/char/watchdog/pcwd_pci.c +++ b/trunk/drivers/char/watchdog/pcwd_pci.c @@ -1,7 +1,7 @@ /* * Berkshire PCI-PC Watchdog Card Driver * - * (c) Copyright 2003-2007 Wim Van Sebroeck . + * (c) Copyright 2003-2005 Wim Van Sebroeck . * * Based on source code of the following authors: * Ken Hollis , @@ -51,8 +51,8 @@ #include /* For inb/outb/... */ /* Module and version information */ -#define WATCHDOG_VERSION "1.03" -#define WATCHDOG_DATE "21 Jan 2007" +#define WATCHDOG_VERSION "1.02" +#define WATCHDOG_DATE "03 Sep 2005" #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog" #define WATCHDOG_NAME "pcwd_pci" #define PFX WATCHDOG_NAME ": " @@ -96,18 +96,6 @@ #define CMD_WRITE_WATCHDOG_TIMEOUT 0x19 #define CMD_GET_CLEAR_RESET_COUNT 0x84 -/* Watchdog's Dip Switch heartbeat values */ -static const int heartbeat_tbl [] = { - 5, /* OFF-OFF-OFF = 5 Sec */ - 10, /* OFF-OFF-ON = 10 Sec */ - 30, /* OFF-ON-OFF = 30 Sec */ - 60, /* OFF-ON-ON = 1 Min */ - 300, /* ON-OFF-OFF = 5 Min */ - 600, /* ON-OFF-ON = 10 Min */ - 1800, /* ON-ON-OFF = 30 Min */ - 3600, /* ON-ON-ON = 1 hour */ -}; - /* We can only use 1 card due to the /dev/watchdog restriction */ static int cards_found; @@ -131,14 +119,14 @@ static int debug = QUIET; module_param(debug, int, 0); MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)"); -#define WATCHDOG_HEARTBEAT 0 /* default heartbeat = delay-time from dip-switches */ +#define WATCHDOG_HEARTBEAT 2 /* 2 sec default heartbeat */ static int heartbeat = WATCHDOG_HEARTBEAT; module_param(heartbeat, int, 0); -MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0= DEBUG) printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n"); @@ -387,9 +373,7 @@ static int pcipcwd_get_temperature(int *temperature) if (!pcipcwd_private.supports_temp) return -ENODEV; - spin_lock(&pcipcwd_private.io_lock); *temperature = inb_p(pcipcwd_private.io_addr); - spin_unlock(&pcipcwd_private.io_lock); /* * Convert celsius to fahrenheit, since this was @@ -727,10 +711,6 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev, /* Show info about the card itself */ pcipcwd_show_card_info(); - /* If heartbeat = 0 then we use the heartbeat from the dip-switches */ - if (heartbeat == 0) - heartbeat = heartbeat_tbl[(pcipcwd_get_option_switches() & 0x07)]; - /* Check that the heartbeat value is within it's range ; if not reset to the default */ if (pcipcwd_set_heartbeat(heartbeat)) { pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT); @@ -818,8 +798,6 @@ static int __init pcipcwd_init_module(void) static void __exit pcipcwd_cleanup_module(void) { pci_unregister_driver(&pcipcwd_driver); - - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); } module_init(pcipcwd_init_module); diff --git a/trunk/drivers/char/watchdog/pcwd_usb.c b/trunk/drivers/char/watchdog/pcwd_usb.c index 31037f9c9ffe..2da5ac99687c 100644 --- a/trunk/drivers/char/watchdog/pcwd_usb.c +++ b/trunk/drivers/char/watchdog/pcwd_usb.c @@ -1,7 +1,7 @@ /* * Berkshire USB-PC Watchdog Card Driver * - * (c) Copyright 2004-2007 Wim Van Sebroeck . + * (c) Copyright 2004 Wim Van Sebroeck . * * Based on source code of the following authors: * Ken Hollis , @@ -24,25 +24,26 @@ * http://www.berkprod.com/ or http://www.pcwatchdog.com/ */ -#include /* For module specific items */ -#include /* For new moduleparam's */ -#include /* For standard types (like size_t) */ -#include /* For the -ENODEV/... values */ -#include /* For printk/panic/... */ -#include /* For mdelay function */ -#include /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */ -#include /* For the watchdog specific items */ -#include /* For notifier support */ -#include /* For reboot_notifier stuff */ -#include /* For __init/__exit/... */ -#include /* For file operations */ -#include /* For USB functions */ -#include /* For kmalloc, ... */ -#include /* For mutex locking */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include /* For HID_REQ_SET_REPORT & HID_DT_REPORT */ -#include /* For copy_to_user/put_user/... */ - #ifdef CONFIG_USB_DEBUG static int debug = 1; @@ -56,8 +57,8 @@ /* Module and Version Information */ -#define DRIVER_VERSION "1.02" -#define DRIVER_DATE "21 Jan 2007" +#define DRIVER_VERSION "1.01" +#define DRIVER_DATE "15 Mar 2005" #define DRIVER_AUTHOR "Wim Van Sebroeck " #define DRIVER_DESC "Berkshire USB-PC Watchdog driver" #define DRIVER_LICENSE "GPL" @@ -74,14 +75,14 @@ MODULE_ALIAS_MISCDEV(TEMP_MINOR); module_param(debug, int, 0); MODULE_PARM_DESC(debug, "Debug enabled or not"); -#define WATCHDOG_HEARTBEAT 0 /* default heartbeat = delay-time from dip-switches */ +#define WATCHDOG_HEARTBEAT 2 /* 2 sec default heartbeat */ static int heartbeat = WATCHDOG_HEARTBEAT; module_param(heartbeat, int, 0); -MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0start); wdt_clk = clk_get(&pdev->dev, "wdt_ck"); - if (IS_ERR(wdt_clk)) { - ret = PTR_ERR(wdt_clk); + if (!wdt_clk) { release_resource(wdt_mem); kfree(wdt_mem); goto out; diff --git a/trunk/drivers/char/watchdog/rm9k_wdt.c b/trunk/drivers/char/watchdog/rm9k_wdt.c index b4678839d3bb..7576a13e86bc 100644 --- a/trunk/drivers/char/watchdog/rm9k_wdt.c +++ b/trunk/drivers/char/watchdog/rm9k_wdt.c @@ -95,7 +95,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be disabled once started"); /* Kernel interfaces */ -static const struct file_operations fops = { +static struct file_operations fops = { .owner = THIS_MODULE, .open = wdt_gpi_open, .release = wdt_gpi_release, diff --git a/trunk/drivers/char/watchdog/s3c2410_wdt.c b/trunk/drivers/char/watchdog/s3c2410_wdt.c index dff6cb5dc9a7..18cb050c3862 100644 --- a/trunk/drivers/char/watchdog/s3c2410_wdt.c +++ b/trunk/drivers/char/watchdog/s3c2410_wdt.c @@ -78,7 +78,7 @@ MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default=" __MODULE MODULE_PARM_DESC(tmr_atboot, "Watchdog is started at boot time if set to 1, default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_ATBOOT)); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, 0 to reboot (default depends on ONLY_TESTING)"); @@ -366,15 +366,13 @@ static int s3c2410wdt_probe(struct platform_device *pdev) wdt_mem = request_mem_region(res->start, size, pdev->name); if (wdt_mem == NULL) { printk(KERN_INFO PFX "failed to get memory region\n"); - ret = -ENOENT; - goto err_req; + return -ENOENT; } wdt_base = ioremap(res->start, size); if (wdt_base == 0) { printk(KERN_INFO PFX "failed to ioremap() region\n"); - ret = -EINVAL; - goto err_req; + return -EINVAL; } DBG("probe: mapped wdt_base=%p\n", wdt_base); @@ -382,21 +380,22 @@ static int s3c2410wdt_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (res == NULL) { printk(KERN_INFO PFX "failed to get irq resource\n"); - ret = -ENOENT; - goto err_map; + iounmap(wdt_base); + return -ENOENT; } ret = request_irq(res->start, s3c2410wdt_irq, 0, pdev->name, pdev); if (ret != 0) { printk(KERN_INFO PFX "failed to install irq (%d)\n", ret); - goto err_map; + iounmap(wdt_base); + return ret; } wdt_clock = clk_get(&pdev->dev, "watchdog"); - if (IS_ERR(wdt_clock)) { + if (wdt_clock == NULL) { printk(KERN_INFO PFX "failed to find watchdog clock source\n"); - ret = PTR_ERR(wdt_clock); - goto err_irq; + iounmap(wdt_base); + return -ENOENT; } clk_enable(wdt_clock); @@ -419,7 +418,8 @@ static int s3c2410wdt_probe(struct platform_device *pdev) if (ret) { printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n", WATCHDOG_MINOR, ret); - goto err_clk; + iounmap(wdt_base); + return ret; } if (tmr_atboot && started == 0) { @@ -434,36 +434,26 @@ static int s3c2410wdt_probe(struct platform_device *pdev) } return 0; - - err_clk: - clk_disable(wdt_clock); - clk_put(wdt_clock); - - err_irq: - free_irq(wdt_irq->start, pdev); - - err_map: - iounmap(wdt_base); - - err_req: - release_resource(wdt_mem); - kfree(wdt_mem); - - return ret; } static int s3c2410wdt_remove(struct platform_device *dev) { - release_resource(wdt_mem); - kfree(wdt_mem); - wdt_mem = NULL; + if (wdt_mem != NULL) { + release_resource(wdt_mem); + kfree(wdt_mem); + wdt_mem = NULL; + } - free_irq(wdt_irq->start, dev); - wdt_irq = NULL; + if (wdt_irq != NULL) { + free_irq(wdt_irq->start, dev); + wdt_irq = NULL; + } - clk_disable(wdt_clock); - clk_put(wdt_clock); - wdt_clock = NULL; + if (wdt_clock != NULL) { + clk_disable(wdt_clock); + clk_put(wdt_clock); + wdt_clock = NULL; + } iounmap(wdt_base); misc_deregister(&s3c2410wdt_miscdev); diff --git a/trunk/drivers/char/watchdog/sbc60xxwdt.c b/trunk/drivers/char/watchdog/sbc60xxwdt.c index b6282039198c..c7b2045bc76b 100644 --- a/trunk/drivers/char/watchdog/sbc60xxwdt.c +++ b/trunk/drivers/char/watchdog/sbc60xxwdt.c @@ -100,10 +100,10 @@ MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, defau static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); static void wdt_timer_ping(unsigned long); -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0); +static struct timer_list timer; static unsigned long next_heartbeat; static unsigned long wdt_is_open; static char wdt_expect_close; @@ -122,7 +122,8 @@ static void wdt_timer_ping(unsigned long data) /* Ping the WDT by reading from wdt_start */ inb_p(wdt_start); /* Re-set the timer interval */ - mod_timer(&timer, jiffies + WDT_INTERVAL); + timer.expires = jiffies + WDT_INTERVAL; + add_timer(&timer); } else { printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n"); } @@ -137,7 +138,8 @@ static void wdt_startup(void) next_heartbeat = jiffies + (timeout * HZ); /* Start the timer */ - mod_timer(&timer, jiffies + WDT_INTERVAL); + timer.expires = jiffies + WDT_INTERVAL; + add_timer(&timer); printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); } @@ -361,6 +363,10 @@ static int __init sbc60xxwdt_init(void) } } + init_timer(&timer); + timer.function = wdt_timer_ping; + timer.data = 0; + rc = misc_register(&wdt_miscdev); if (rc) { diff --git a/trunk/drivers/char/watchdog/sbc8360.c b/trunk/drivers/char/watchdog/sbc8360.c index 67ae42685e75..41fc6f80c493 100644 --- a/trunk/drivers/char/watchdog/sbc8360.c +++ b/trunk/drivers/char/watchdog/sbc8360.c @@ -204,7 +204,7 @@ module_param(timeout, int, 0); MODULE_PARM_DESC(timeout, "Index into timeout table (0-63) (default=27 (60s))"); module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, - "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); + "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); /* * Kernel methods. diff --git a/trunk/drivers/char/watchdog/sbc_epx_c3.c b/trunk/drivers/char/watchdog/sbc_epx_c3.c index 82cbd8809a69..8882b427d24f 100644 --- a/trunk/drivers/char/watchdog/sbc_epx_c3.c +++ b/trunk/drivers/char/watchdog/sbc_epx_c3.c @@ -35,7 +35,7 @@ static int epx_c3_alive; static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); #define EPXC3_WATCHDOG_CTL_REG 0x1ee /* write 1 to enable, 0 to disable */ #define EPXC3_WATCHDOG_PET_REG 0x1ef /* write anything to pet once enabled */ diff --git a/trunk/drivers/char/watchdog/sc1200wdt.c b/trunk/drivers/char/watchdog/sc1200wdt.c index 1e4a8d751a71..e3239833e4b0 100644 --- a/trunk/drivers/char/watchdog/sc1200wdt.c +++ b/trunk/drivers/char/watchdog/sc1200wdt.c @@ -92,7 +92,7 @@ MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1"); static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); diff --git a/trunk/drivers/char/watchdog/sc520_wdt.c b/trunk/drivers/char/watchdog/sc520_wdt.c index 2676a43895a7..caec37ba750a 100644 --- a/trunk/drivers/char/watchdog/sc520_wdt.c +++ b/trunk/drivers/char/watchdog/sc520_wdt.c @@ -97,7 +97,7 @@ MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, defau static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); /* * AMD Elan SC520 - Watchdog Timer Registers @@ -121,7 +121,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" _ static __u16 __iomem *wdtmrctl; static void wdt_timer_ping(unsigned long); -static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0); +static struct timer_list timer; static unsigned long next_heartbeat; static unsigned long wdt_is_open; static char wdt_expect_close; @@ -145,7 +145,8 @@ static void wdt_timer_ping(unsigned long data) spin_unlock(&wdt_spinlock); /* Re-set the timer interval */ - mod_timer(&timer, jiffies + WDT_INTERVAL); + timer.expires = jiffies + WDT_INTERVAL; + add_timer(&timer); } else { printk(KERN_WARNING PFX "Heartbeat lost! Will not ping the watchdog\n"); } @@ -178,7 +179,8 @@ static int wdt_startup(void) next_heartbeat = jiffies + (timeout * HZ); /* Start the timer */ - mod_timer(&timer, jiffies + WDT_INTERVAL); + timer.expires = jiffies + WDT_INTERVAL; + add_timer(&timer); /* Start the watchdog */ wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04); @@ -387,6 +389,10 @@ static int __init sc520_wdt_init(void) spin_lock_init(&wdt_spinlock); + init_timer(&timer); + timer.function = wdt_timer_ping; + timer.data = 0; + /* Check that the timeout value is within it's range ; if not reset to the default */ if (wdt_set_heartbeat(timeout)) { wdt_set_heartbeat(WATCHDOG_TIMEOUT); diff --git a/trunk/drivers/char/watchdog/shwdt.c b/trunk/drivers/char/watchdog/shwdt.c index cecbedd473a4..dc403629aeb3 100644 --- a/trunk/drivers/char/watchdog/shwdt.c +++ b/trunk/drivers/char/watchdog/shwdt.c @@ -65,12 +65,10 @@ static int clock_division_ratio = WTCSR_CKS_4096; #define next_ping_period(cks) msecs_to_jiffies(cks - 4) -static void sh_wdt_ping(unsigned long data); - static unsigned long shwdt_is_open; static struct watchdog_info sh_wdt_info; static char shwdt_expect_close; -static DEFINE_TIMER(timer, sh_wdt_ping, 0, 0); +static struct timer_list timer; static unsigned long next_heartbeat; #define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */ @@ -435,6 +433,10 @@ static int __init sh_wdt_init(void) "be 1<=x<=3600, using %d\n", heartbeat); } + init_timer(&timer); + timer.function = sh_wdt_ping; + timer.data = 0; + rc = register_reboot_notifier(&sh_wdt_notifier); if (unlikely(rc)) { printk(KERN_ERR PFX "Can't register reboot notifier (err=%d)\n", diff --git a/trunk/drivers/char/watchdog/smsc37b787_wdt.c b/trunk/drivers/char/watchdog/smsc37b787_wdt.c index d3cb0a766020..9f56913b484f 100644 --- a/trunk/drivers/char/watchdog/smsc37b787_wdt.c +++ b/trunk/drivers/char/watchdog/smsc37b787_wdt.c @@ -510,7 +510,7 @@ static int wb_smsc_wdt_notify_sys(struct notifier_block *this, unsigned long cod /* -- Module's structures ---------------------------------------*/ -static const struct file_operations wb_smsc_wdt_fops = +static struct file_operations wb_smsc_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, @@ -624,4 +624,4 @@ module_param(timeout, int, 0); MODULE_PARM_DESC(timeout, "range is 1-255 units, default is 60"); module_param(nowayout, int, 0); -MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); diff --git a/trunk/drivers/char/watchdog/softdog.c b/trunk/drivers/char/watchdog/softdog.c index 9c3694909243..4067e1f8a368 100644 --- a/trunk/drivers/char/watchdog/softdog.c +++ b/trunk/drivers/char/watchdog/softdog.c @@ -59,7 +59,7 @@ MODULE_PARM_DESC(soft_margin, "Watchdog soft_margin in seconds. (0map_type) row = 7 - row; - /* e752x mc reads 34:6 of the DRAM linear address */ - edac_mc_handle_ce(mci, page, offset_in_page(sec1_add << 4), - sec1_syndrome, row, channel, "e752x CE"); + edac_mc_handle_ce(mci, page, 0, sec1_syndrome, row, channel, + "e752x CE"); } static inline void process_ce(struct mem_ctl_info *mci, u16 error_one, @@ -320,10 +319,8 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, ((block_page >> 1) & 3) : edac_mc_find_csrow_by_page(mci, block_page); - /* e752x mc reads 34:6 of the DRAM linear address */ - edac_mc_handle_ue(mci, block_page, - offset_in_page(error_2b << 4), - row, "e752x UE from Read"); + edac_mc_handle_ue(mci, block_page, 0, row, + "e752x UE from Read"); } if (error_one & 0x0404) { error_2b = scrb_add; @@ -336,10 +333,8 @@ static void do_process_ue(struct mem_ctl_info *mci, u16 error_one, ((block_page >> 1) & 3) : edac_mc_find_csrow_by_page(mci, block_page); - /* e752x mc reads 34:6 of the DRAM linear address */ - edac_mc_handle_ue(mci, block_page, - offset_in_page(error_2b << 4), - row, "e752x UE from Scruber"); + edac_mc_handle_ue(mci, block_page, 0, row, + "e752x UE from Scruber"); } } @@ -561,17 +556,17 @@ static void e752x_check_sysbus(struct e752x_error_info *info, error32 = (stat32 >> 16) & 0x3ff; stat32 = stat32 & 0x3ff; - if(stat32 & 0x087) - sysbus_error(1, stat32 & 0x087, error_found, handle_error); + if(stat32 & 0x083) + sysbus_error(1, stat32 & 0x083, error_found, handle_error); - if(stat32 & 0x378) - sysbus_error(0, stat32 & 0x378, error_found, handle_error); + if(stat32 & 0x37c) + sysbus_error(0, stat32 & 0x37c, error_found, handle_error); - if(error32 & 0x087) - sysbus_error(1, error32 & 0x087, error_found, handle_error); + if(error32 & 0x083) + sysbus_error(1, error32 & 0x083, error_found, handle_error); - if(error32 & 0x378) - sysbus_error(0, error32 & 0x378, error_found, handle_error); + if(error32 & 0x37c) + sysbus_error(0, error32 & 0x37c, error_found, handle_error); } static void e752x_check_membuf (struct e752x_error_info *info, @@ -787,12 +782,7 @@ static void e752x_init_csrows(struct mem_ctl_info *mci, struct pci_dev *pdev, u8 value; u32 dra, drc, cumul_size; - dra = 0; - for (index=0; index < 4; index++) { - u8 dra_reg; - pci_read_config_byte(pdev, E752X_DRA+index, &dra_reg); - dra |= dra_reg << (index * 8); - } + pci_read_config_dword(pdev, E752X_DRA, &dra); pci_read_config_dword(pdev, E752X_DRC, &drc); drc_chan = dual_channel_active(ddrcsr); drc_drbg = drc_chan + 1; /* 128 in dual mode, 64 in single */ diff --git a/trunk/drivers/edac/edac_mc.c b/trunk/drivers/edac/edac_mc.c index 7b622300d0e5..1b4fc9221803 100644 --- a/trunk/drivers/edac/edac_mc.c +++ b/trunk/drivers/edac/edac_mc.c @@ -927,57 +927,6 @@ static ssize_t mci_reset_counters_store(struct mem_ctl_info *mci, return count; } -/* memory scrubbing */ -static ssize_t mci_sdram_scrub_rate_store(struct mem_ctl_info *mci, - const char *data, size_t count) -{ - u32 bandwidth = -1; - - if (mci->set_sdram_scrub_rate) { - - memctrl_int_store(&bandwidth, data, count); - - if (!(*mci->set_sdram_scrub_rate)(mci, &bandwidth)) { - edac_printk(KERN_DEBUG, EDAC_MC, - "Scrub rate set successfully, applied: %d\n", - bandwidth); - } else { - /* FIXME: error codes maybe? */ - edac_printk(KERN_DEBUG, EDAC_MC, - "Scrub rate set FAILED, could not apply: %d\n", - bandwidth); - } - } else { - /* FIXME: produce "not implemented" ERROR for user-side. */ - edac_printk(KERN_WARNING, EDAC_MC, - "Memory scrubbing 'set'control is not implemented!\n"); - } - return count; -} - -static ssize_t mci_sdram_scrub_rate_show(struct mem_ctl_info *mci, char *data) -{ - u32 bandwidth = -1; - - if (mci->get_sdram_scrub_rate) { - if (!(*mci->get_sdram_scrub_rate)(mci, &bandwidth)) { - edac_printk(KERN_DEBUG, EDAC_MC, - "Scrub rate successfully, fetched: %d\n", - bandwidth); - } else { - /* FIXME: error codes maybe? */ - edac_printk(KERN_DEBUG, EDAC_MC, - "Scrub rate fetch FAILED, got: %d\n", - bandwidth); - } - } else { - /* FIXME: produce "not implemented" ERROR for user-side. */ - edac_printk(KERN_WARNING, EDAC_MC, - "Memory scrubbing 'get' control is not implemented!\n"); - } - return sprintf(data, "%d\n", bandwidth); -} - /* default attribute files for the MCI object */ static ssize_t mci_ue_count_show(struct mem_ctl_info *mci, char *data) { @@ -1084,9 +1033,6 @@ MCIDEV_ATTR(ce_noinfo_count,S_IRUGO,mci_ce_noinfo_show,NULL); MCIDEV_ATTR(ue_count,S_IRUGO,mci_ue_count_show,NULL); MCIDEV_ATTR(ce_count,S_IRUGO,mci_ce_count_show,NULL); -/* memory scrubber attribute file */ -MCIDEV_ATTR(sdram_scrub_rate,S_IRUGO|S_IWUSR,mci_sdram_scrub_rate_show,mci_sdram_scrub_rate_store); - static struct mcidev_attribute *mci_attr[] = { &mci_attr_reset_counters, &mci_attr_mc_name, @@ -1096,7 +1042,6 @@ static struct mcidev_attribute *mci_attr[] = { &mci_attr_ce_noinfo_count, &mci_attr_ue_count, &mci_attr_ce_count, - &mci_attr_sdram_scrub_rate, NULL }; @@ -1497,11 +1442,11 @@ int edac_mc_add_mc(struct mem_ctl_info *mci, int mc_idx) /* set load time so that error rate can be tracked */ mci->start_time = jiffies; - if (edac_create_sysfs_mci_device(mci)) { - edac_mc_printk(mci, KERN_WARNING, + if (edac_create_sysfs_mci_device(mci)) { + edac_mc_printk(mci, KERN_WARNING, "failed to create sysfs device\n"); - goto fail1; - } + goto fail1; + } /* Report action taken */ edac_mc_printk(mci, KERN_INFO, "Giving out device to %s %s: DEV %s\n", @@ -1758,116 +1703,6 @@ void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg) EXPORT_SYMBOL_GPL(edac_mc_handle_ue_no_info); -/************************************************************* - * On Fully Buffered DIMM modules, this help function is - * called to process UE events - */ -void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci, - unsigned int csrow, - unsigned int channela, - unsigned int channelb, - char *msg) -{ - int len = EDAC_MC_LABEL_LEN * 4; - char labels[len + 1]; - char *pos = labels; - int chars; - - if (csrow >= mci->nr_csrows) { - /* something is wrong */ - edac_mc_printk(mci, KERN_ERR, - "INTERNAL ERROR: row out of range (%d >= %d)\n", - csrow, mci->nr_csrows); - edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR"); - return; - } - - if (channela >= mci->csrows[csrow].nr_channels) { - /* something is wrong */ - edac_mc_printk(mci, KERN_ERR, - "INTERNAL ERROR: channel-a out of range " - "(%d >= %d)\n", - channela, mci->csrows[csrow].nr_channels); - edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR"); - return; - } - - if (channelb >= mci->csrows[csrow].nr_channels) { - /* something is wrong */ - edac_mc_printk(mci, KERN_ERR, - "INTERNAL ERROR: channel-b out of range " - "(%d >= %d)\n", - channelb, mci->csrows[csrow].nr_channels); - edac_mc_handle_ue_no_info(mci, "INTERNAL ERROR"); - return; - } - - mci->ue_count++; - mci->csrows[csrow].ue_count++; - - /* Generate the DIMM labels from the specified channels */ - chars = snprintf(pos, len + 1, "%s", - mci->csrows[csrow].channels[channela].label); - len -= chars; pos += chars; - chars = snprintf(pos, len + 1, "-%s", - mci->csrows[csrow].channels[channelb].label); - - if (log_ue) - edac_mc_printk(mci, KERN_EMERG, - "UE row %d, channel-a= %d channel-b= %d " - "labels \"%s\": %s\n", csrow, channela, channelb, - labels, msg); - - if (panic_on_ue) - panic("UE row %d, channel-a= %d channel-b= %d " - "labels \"%s\": %s\n", csrow, channela, - channelb, labels, msg); -} -EXPORT_SYMBOL(edac_mc_handle_fbd_ue); - -/************************************************************* - * On Fully Buffered DIMM modules, this help function is - * called to process CE events - */ -void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci, - unsigned int csrow, - unsigned int channel, - char *msg) -{ - - /* Ensure boundary values */ - if (csrow >= mci->nr_csrows) { - /* something is wrong */ - edac_mc_printk(mci, KERN_ERR, - "INTERNAL ERROR: row out of range (%d >= %d)\n", - csrow, mci->nr_csrows); - edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); - return; - } - if (channel >= mci->csrows[csrow].nr_channels) { - /* something is wrong */ - edac_mc_printk(mci, KERN_ERR, - "INTERNAL ERROR: channel out of range (%d >= %d)\n", - channel, mci->csrows[csrow].nr_channels); - edac_mc_handle_ce_no_info(mci, "INTERNAL ERROR"); - return; - } - - if (log_ce) - /* FIXME - put in DIMM location */ - edac_mc_printk(mci, KERN_WARNING, - "CE row %d, channel %d, label \"%s\": %s\n", - csrow, channel, - mci->csrows[csrow].channels[channel].label, - msg); - - mci->ce_count++; - mci->csrows[csrow].ce_count++; - mci->csrows[csrow].channels[channel].ce_count++; -} -EXPORT_SYMBOL(edac_mc_handle_fbd_ce); - - /* * Iterate over all MC instances and check for ECC, et al, errors */ @@ -1971,7 +1806,7 @@ static void __exit edac_mc_exit(void) debugf0("%s()\n", __func__); kthread_stop(edac_thread); - /* tear down the sysfs device */ + /* tear down the sysfs device */ edac_sysfs_memctrl_teardown(); edac_sysfs_pci_teardown(); } diff --git a/trunk/drivers/edac/edac_mc.h b/trunk/drivers/edac/edac_mc.h index 713444cc4105..a1cfd4e3c97d 100644 --- a/trunk/drivers/edac/edac_mc.h +++ b/trunk/drivers/edac/edac_mc.h @@ -123,9 +123,7 @@ enum mem_type { MEM_RDR, /* Registered single data rate SDRAM */ MEM_DDR, /* Double data rate SDRAM */ MEM_RDDR, /* Registered Double data rate SDRAM */ - MEM_RMBS, /* Rambus DRAM */ - MEM_DDR2, /* DDR2 RAM */ - MEM_FB_DDR2, /* fully buffered DDR2 */ + MEM_RMBS /* Rambus DRAM */ }; #define MEM_FLAG_EMPTY BIT(MEM_EMPTY) @@ -139,8 +137,6 @@ enum mem_type { #define MEM_FLAG_DDR BIT(MEM_DDR) #define MEM_FLAG_RDDR BIT(MEM_RDDR) #define MEM_FLAG_RMBS BIT(MEM_RMBS) -#define MEM_FLAG_DDR2 BIT(MEM_DDR2) -#define MEM_FLAG_FB_DDR2 BIT(MEM_FB_DDR2) /* chipset Error Detection and Correction capabilities and mode */ enum edac_type { @@ -319,21 +315,8 @@ struct mem_ctl_info { unsigned long scrub_cap; /* chipset scrub capabilities */ enum scrub_type scrub_mode; /* current scrub mode */ - /* Translates sdram memory scrub rate given in bytes/sec to the - internal representation and configures whatever else needs - to be configured. - */ - int (*set_sdram_scrub_rate) (struct mem_ctl_info *mci, u32 *bw); - - /* Get the current sdram memory scrub rate from the internal - representation and converts it to the closest matching - bandwith in bytes/sec. - */ - int (*get_sdram_scrub_rate) (struct mem_ctl_info *mci, u32 *bw); - /* pointer to edac checking routine */ void (*edac_check) (struct mem_ctl_info * mci); - /* * Remaps memory pages: controller pages to physical pages. * For most MC's, this will be NULL. @@ -458,15 +441,6 @@ extern void edac_mc_handle_ue(struct mem_ctl_info *mci, int row, const char *msg); extern void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg); -extern void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci, - unsigned int csrow, - unsigned int channel0, - unsigned int channel1, - char *msg); -extern void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci, - unsigned int csrow, - unsigned int channel, - char *msg); /* * This kmalloc's and initializes all the structures. diff --git a/trunk/drivers/i2c/chips/tps65010.c b/trunk/drivers/i2c/chips/tps65010.c index 214fbb1423c5..4ee56def61f2 100644 --- a/trunk/drivers/i2c/chips/tps65010.c +++ b/trunk/drivers/i2c/chips/tps65010.c @@ -308,7 +308,7 @@ static int dbg_tps_open(struct inode *inode, struct file *file) return single_open(file, dbg_show, inode->i_private); } -static const struct file_operations debug_fops = { +static struct file_operations debug_fops = { .open = dbg_tps_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/i2c/i2c-dev.c b/trunk/drivers/i2c/i2c-dev.c index cb4fa9bef8cd..ac5bd2a7ca99 100644 --- a/trunk/drivers/i2c/i2c-dev.c +++ b/trunk/drivers/i2c/i2c-dev.c @@ -392,7 +392,7 @@ static int i2cdev_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations i2cdev_fops = { +static struct file_operations i2cdev_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = i2cdev_read, diff --git a/trunk/drivers/ide/ide-proc.c b/trunk/drivers/ide/ide-proc.c index 30a5780f4185..ad49bd823ebd 100644 --- a/trunk/drivers/ide/ide-proc.c +++ b/trunk/drivers/ide/ide-proc.c @@ -548,7 +548,7 @@ static int ide_drivers_open(struct inode *inode, struct file *file) return single_open(file, &ide_drivers_show, NULL); } -static const struct file_operations ide_drivers_operations = { +static struct file_operations ide_drivers_operations = { .open = ide_drivers_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/ide/ide-tape.c b/trunk/drivers/ide/ide-tape.c index c6eec0413a6c..b3bcd1d7315e 100644 --- a/trunk/drivers/ide/ide-tape.c +++ b/trunk/drivers/ide/ide-tape.c @@ -4779,7 +4779,7 @@ static ide_driver_t idetape_driver = { /* * Our character device supporting functions, passed to register_chrdev. */ -static const struct file_operations idetape_fops = { +static struct file_operations idetape_fops = { .owner = THIS_MODULE, .read = idetape_chrdev_read, .write = idetape_chrdev_write, diff --git a/trunk/drivers/ieee1394/dv1394.c b/trunk/drivers/ieee1394/dv1394.c index dee9529aa8e7..55d6ae664fd6 100644 --- a/trunk/drivers/ieee1394/dv1394.c +++ b/trunk/drivers/ieee1394/dv1394.c @@ -2147,7 +2147,7 @@ static void ir_tasklet_func(unsigned long data) } static struct cdev dv1394_cdev; -static const struct file_operations dv1394_fops= +static struct file_operations dv1394_fops= { .owner = THIS_MODULE, .poll = dv1394_poll, diff --git a/trunk/drivers/ieee1394/raw1394.c b/trunk/drivers/ieee1394/raw1394.c index aa9ca8385ec7..a77a832828c8 100644 --- a/trunk/drivers/ieee1394/raw1394.c +++ b/trunk/drivers/ieee1394/raw1394.c @@ -3013,7 +3013,7 @@ static struct hpsb_highlevel raw1394_highlevel = { }; static struct cdev raw1394_cdev; -static const struct file_operations raw1394_fops = { +static struct file_operations raw1394_fops = { .owner = THIS_MODULE, .read = raw1394_read, .write = raw1394_write, diff --git a/trunk/drivers/ieee1394/video1394.c b/trunk/drivers/ieee1394/video1394.c index 95ca26d75272..f4d1ec00af65 100644 --- a/trunk/drivers/ieee1394/video1394.c +++ b/trunk/drivers/ieee1394/video1394.c @@ -1277,7 +1277,7 @@ static long video1394_compat_ioctl(struct file *f, unsigned cmd, unsigned long a #endif static struct cdev video1394_cdev; -static const struct file_operations video1394_fops= +static struct file_operations video1394_fops= { .owner = THIS_MODULE, .unlocked_ioctl = video1394_ioctl, diff --git a/trunk/drivers/infiniband/core/ucm.c b/trunk/drivers/infiniband/core/ucm.c index ee51d79a7ad5..f15220a0ee75 100644 --- a/trunk/drivers/infiniband/core/ucm.c +++ b/trunk/drivers/infiniband/core/ucm.c @@ -1221,7 +1221,7 @@ static void ib_ucm_release_class_dev(struct class_device *class_dev) kfree(dev); } -static const struct file_operations ucm_fops = { +static struct file_operations ucm_fops = { .owner = THIS_MODULE, .open = ib_ucm_open, .release = ib_ucm_close, diff --git a/trunk/drivers/infiniband/core/ucma.c b/trunk/drivers/infiniband/core/ucma.c index 6b81b98961c7..e2e8d329b443 100644 --- a/trunk/drivers/infiniband/core/ucma.c +++ b/trunk/drivers/infiniband/core/ucma.c @@ -833,7 +833,7 @@ static int ucma_close(struct inode *inode, struct file *filp) return 0; } -static const struct file_operations ucma_fops = { +static struct file_operations ucma_fops = { .owner = THIS_MODULE, .open = ucma_open, .release = ucma_close, diff --git a/trunk/drivers/infiniband/core/user_mad.c b/trunk/drivers/infiniband/core/user_mad.c index c069ebeba8e3..807fbd6b8414 100644 --- a/trunk/drivers/infiniband/core/user_mad.c +++ b/trunk/drivers/infiniband/core/user_mad.c @@ -771,7 +771,7 @@ static int ib_umad_close(struct inode *inode, struct file *filp) return 0; } -static const struct file_operations umad_fops = { +static struct file_operations umad_fops = { .owner = THIS_MODULE, .read = ib_umad_read, .write = ib_umad_write, @@ -846,7 +846,7 @@ static int ib_umad_sm_close(struct inode *inode, struct file *filp) return ret; } -static const struct file_operations umad_sm_fops = { +static struct file_operations umad_sm_fops = { .owner = THIS_MODULE, .open = ib_umad_sm_open, .release = ib_umad_sm_close diff --git a/trunk/drivers/infiniband/core/uverbs_main.c b/trunk/drivers/infiniband/core/uverbs_main.c index f8bc822a3cc3..a617ca7b6923 100644 --- a/trunk/drivers/infiniband/core/uverbs_main.c +++ b/trunk/drivers/infiniband/core/uverbs_main.c @@ -375,7 +375,7 @@ static int ib_uverbs_event_close(struct inode *inode, struct file *filp) return 0; } -static const struct file_operations uverbs_event_fops = { +static struct file_operations uverbs_event_fops = { .owner = THIS_MODULE, .read = ib_uverbs_event_read, .poll = ib_uverbs_event_poll, @@ -679,14 +679,14 @@ static int ib_uverbs_close(struct inode *inode, struct file *filp) return 0; } -static const struct file_operations uverbs_fops = { +static struct file_operations uverbs_fops = { .owner = THIS_MODULE, .write = ib_uverbs_write, .open = ib_uverbs_open, .release = ib_uverbs_close }; -static const struct file_operations uverbs_mmap_fops = { +static struct file_operations uverbs_mmap_fops = { .owner = THIS_MODULE, .write = ib_uverbs_write, .mmap = ib_uverbs_mmap, diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_diag.c b/trunk/drivers/infiniband/hw/ipath/ipath_diag.c index 0f13a2182cc7..28c087b824c2 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_diag.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_diag.c @@ -59,7 +59,7 @@ static ssize_t ipath_diag_read(struct file *fp, char __user *data, static ssize_t ipath_diag_write(struct file *fp, const char __user *data, size_t count, loff_t *off); -static const struct file_operations diag_file_ops = { +static struct file_operations diag_file_ops = { .owner = THIS_MODULE, .write = ipath_diag_write, .read = ipath_diag_read, @@ -71,7 +71,7 @@ static ssize_t ipath_diagpkt_write(struct file *fp, const char __user *data, size_t count, loff_t *off); -static const struct file_operations diagpkt_file_ops = { +static struct file_operations diagpkt_file_ops = { .owner = THIS_MODULE, .write = ipath_diagpkt_write, }; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c b/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c index 5d64ff875297..b932bcb67a5e 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_file_ops.c @@ -54,7 +54,7 @@ static ssize_t ipath_write(struct file *, const char __user *, size_t, static unsigned int ipath_poll(struct file *, struct poll_table_struct *); static int ipath_mmap(struct file *, struct vm_area_struct *); -static const struct file_operations ipath_file_ops = { +static struct file_operations ipath_file_ops = { .owner = THIS_MODULE, .write = ipath_write, .open = ipath_open, @@ -2153,7 +2153,7 @@ static ssize_t ipath_write(struct file *fp, const char __user *data, static struct class *ipath_class; -static int init_cdev(int minor, char *name, const struct file_operations *fops, +static int init_cdev(int minor, char *name, struct file_operations *fops, struct cdev **cdevp, struct class_device **class_devp) { const dev_t dev = MKDEV(IPATH_MAJOR, minor); @@ -2210,7 +2210,7 @@ static int init_cdev(int minor, char *name, const struct file_operations *fops, return ret; } -int ipath_cdev_init(int minor, char *name, const struct file_operations *fops, +int ipath_cdev_init(int minor, char *name, struct file_operations *fops, struct cdev **cdevp, struct class_device **class_devp) { return init_cdev(minor, name, fops, cdevp, class_devp); diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_fs.c b/trunk/drivers/infiniband/hw/ipath/ipath_fs.c index 5b40a846ff95..79a60f020a21 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_fs.c +++ b/trunk/drivers/infiniband/hw/ipath/ipath_fs.c @@ -47,7 +47,7 @@ static struct super_block *ipath_super; static int ipathfs_mknod(struct inode *dir, struct dentry *dentry, - int mode, const struct file_operations *fops, + int mode, struct file_operations *fops, void *data) { int error; @@ -81,7 +81,7 @@ static int ipathfs_mknod(struct inode *dir, struct dentry *dentry, static int create_file(const char *name, mode_t mode, struct dentry *parent, struct dentry **dentry, - const struct file_operations *fops, void *data) + struct file_operations *fops, void *data) { int error; @@ -105,7 +105,7 @@ static ssize_t atomic_stats_read(struct file *file, char __user *buf, sizeof ipath_stats); } -static const struct file_operations atomic_stats_ops = { +static struct file_operations atomic_stats_ops = { .read = atomic_stats_read, }; @@ -127,7 +127,7 @@ static ssize_t atomic_counters_read(struct file *file, char __user *buf, sizeof counters); } -static const struct file_operations atomic_counters_ops = { +static struct file_operations atomic_counters_ops = { .read = atomic_counters_read, }; @@ -166,7 +166,7 @@ static ssize_t atomic_node_info_read(struct file *file, char __user *buf, sizeof nodeinfo); } -static const struct file_operations atomic_node_info_ops = { +static struct file_operations atomic_node_info_ops = { .read = atomic_node_info_read, }; @@ -291,7 +291,7 @@ static ssize_t atomic_port_info_read(struct file *file, char __user *buf, sizeof portinfo); } -static const struct file_operations atomic_port_info_ops = { +static struct file_operations atomic_port_info_ops = { .read = atomic_port_info_read, }; @@ -394,7 +394,7 @@ static ssize_t flash_write(struct file *file, const char __user *buf, return ret; } -static const struct file_operations flash_ops = { +static struct file_operations flash_ops = { .read = flash_read, .write = flash_write, }; diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h b/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h index 6d8d05fb5999..986b2125b8f5 100644 --- a/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/trunk/drivers/infiniband/hw/ipath/ipath_kernel.h @@ -593,7 +593,7 @@ void ipath_shutdown_device(struct ipath_devdata *); void ipath_disarm_senderrbufs(struct ipath_devdata *); struct file_operations; -int ipath_cdev_init(int minor, char *name, const struct file_operations *fops, +int ipath_cdev_init(int minor, char *name, struct file_operations *fops, struct cdev **cdevp, struct class_device **class_devp); void ipath_cdev_cleanup(struct cdev **cdevp, struct class_device **class_devp); diff --git a/trunk/drivers/infiniband/ulp/ipoib/ipoib_fs.c b/trunk/drivers/infiniband/ulp/ipoib/ipoib_fs.c index 44c174182a82..f1cb83688b31 100644 --- a/trunk/drivers/infiniband/ulp/ipoib/ipoib_fs.c +++ b/trunk/drivers/infiniband/ulp/ipoib/ipoib_fs.c @@ -146,7 +146,7 @@ static int ipoib_mcg_open(struct inode *inode, struct file *file) return 0; } -static const struct file_operations ipoib_mcg_fops = { +static struct file_operations ipoib_mcg_fops = { .owner = THIS_MODULE, .open = ipoib_mcg_open, .read = seq_read, @@ -252,7 +252,7 @@ static int ipoib_path_open(struct inode *inode, struct file *file) return 0; } -static const struct file_operations ipoib_path_fops = { +static struct file_operations ipoib_path_fops = { .owner = THIS_MODULE, .open = ipoib_path_open, .read = seq_read, diff --git a/trunk/drivers/input/input.c b/trunk/drivers/input/input.c index 14d4c0493c36..7cf2b4f603a3 100644 --- a/trunk/drivers/input/input.c +++ b/trunk/drivers/input/input.c @@ -482,7 +482,7 @@ static int input_proc_devices_open(struct inode *inode, struct file *file) return seq_open(file, &input_devices_seq_ops); } -static const struct file_operations input_devices_fileops = { +static struct file_operations input_devices_fileops = { .owner = THIS_MODULE, .open = input_proc_devices_open, .poll = input_proc_devices_poll, @@ -533,7 +533,7 @@ static int input_proc_handlers_open(struct inode *inode, struct file *file) return seq_open(file, &input_handlers_seq_ops); } -static const struct file_operations input_handlers_fileops = { +static struct file_operations input_handlers_fileops = { .owner = THIS_MODULE, .open = input_proc_handlers_open, .read = seq_read, @@ -1142,7 +1142,7 @@ static int input_open_file(struct inode *inode, struct file *file) return err; } -static const struct file_operations input_fops = { +static struct file_operations input_fops = { .owner = THIS_MODULE, .open = input_open_file, }; diff --git a/trunk/drivers/input/misc/hp_sdc_rtc.c b/trunk/drivers/input/misc/hp_sdc_rtc.c index ab76ea442fa5..31d5a13bfd6b 100644 --- a/trunk/drivers/input/misc/hp_sdc_rtc.c +++ b/trunk/drivers/input/misc/hp_sdc_rtc.c @@ -670,7 +670,7 @@ static int hp_sdc_rtc_ioctl(struct inode *inode, struct file *file, #endif } -static const struct file_operations hp_sdc_rtc_fops = { +static struct file_operations hp_sdc_rtc_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = hp_sdc_rtc_read, diff --git a/trunk/drivers/input/misc/uinput.c b/trunk/drivers/input/misc/uinput.c index 42556232c523..9516439b7c78 100644 --- a/trunk/drivers/input/misc/uinput.c +++ b/trunk/drivers/input/misc/uinput.c @@ -627,7 +627,7 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return retval; } -static const struct file_operations uinput_fops = { +static struct file_operations uinput_fops = { .owner = THIS_MODULE, .open = uinput_open, .release = uinput_release, diff --git a/trunk/drivers/input/serio/serio_raw.c b/trunk/drivers/input/serio/serio_raw.c index 887357666c68..088ebc348ba3 100644 --- a/trunk/drivers/input/serio/serio_raw.c +++ b/trunk/drivers/input/serio/serio_raw.c @@ -234,7 +234,7 @@ static unsigned int serio_raw_poll(struct file *file, poll_table *wait) return 0; } -static const struct file_operations serio_raw_fops = { +static struct file_operations serio_raw_fops = { .owner = THIS_MODULE, .open = serio_raw_open, .release = serio_raw_release, diff --git a/trunk/drivers/isdn/capi/capi.c b/trunk/drivers/isdn/capi/capi.c index db1260f73f10..d22c0224fde6 100644 --- a/trunk/drivers/isdn/capi/capi.c +++ b/trunk/drivers/isdn/capi/capi.c @@ -118,15 +118,6 @@ struct capiminor { }; #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ -/* FIXME: The following lock is a sledgehammer-workaround to a - * locking issue with the capiminor (and maybe other) data structure(s). - * Access to this data is done in a racy way and crashes the machine with - * a FritzCard DSL driver; sooner or later. This is a workaround - * which trades scalability vs stability, so it doesn't crash the kernel anymore. - * The correct (and scalable) fix for the issue seems to require - * an API change to the drivers... . */ -static DEFINE_SPINLOCK(workaround_lock); - struct capincci { struct capincci *next; u32 ncci; @@ -598,7 +589,6 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ struct capincci *np; u32 ncci; - unsigned long flags; if (CAPIMSG_CMD(skb->data) == CAPI_CONNECT_B3_CONF) { u16 info = CAPIMSG_U16(skb->data, 12); // Info field @@ -613,11 +603,9 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) capincci_alloc(cdev, CAPIMSG_NCCI(skb->data)); up(&cdev->ncci_list_sem); } - spin_lock_irqsave(&workaround_lock, flags); if (CAPIMSG_COMMAND(skb->data) != CAPI_DATA_B3) { skb_queue_tail(&cdev->recvqueue, skb); wake_up_interruptible(&cdev->recvwait); - spin_unlock_irqrestore(&workaround_lock, flags); return; } ncci = CAPIMSG_CONTROL(skb->data); @@ -627,7 +615,6 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) printk(KERN_ERR "BUG: capi_signal: ncci not found\n"); skb_queue_tail(&cdev->recvqueue, skb); wake_up_interruptible(&cdev->recvwait); - spin_unlock_irqrestore(&workaround_lock, flags); return; } #ifndef CONFIG_ISDN_CAPI_MIDDLEWARE @@ -638,7 +625,6 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) if (!mp) { skb_queue_tail(&cdev->recvqueue, skb); wake_up_interruptible(&cdev->recvwait); - spin_unlock_irqrestore(&workaround_lock, flags); return; } @@ -674,7 +660,6 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb) wake_up_interruptible(&cdev->recvwait); } #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ - spin_unlock_irqrestore(&workaround_lock, flags); } /* -------- file_operations for capidev ----------------------------- */ @@ -1003,7 +988,7 @@ capi_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations capi_fops = +static struct file_operations capi_fops = { .owner = THIS_MODULE, .llseek = no_llseek, @@ -1021,7 +1006,6 @@ static const struct file_operations capi_fops = static int capinc_tty_open(struct tty_struct * tty, struct file * file) { struct capiminor *mp; - unsigned long flags; if ((mp = capiminor_find(iminor(file->f_path.dentry->d_inode))) == 0) return -ENXIO; @@ -1030,7 +1014,6 @@ static int capinc_tty_open(struct tty_struct * tty, struct file * file) tty->driver_data = (void *)mp; - spin_lock_irqsave(&workaround_lock, flags); if (atomic_read(&mp->ttyopencount) == 0) mp->tty = tty; atomic_inc(&mp->ttyopencount); @@ -1038,7 +1021,6 @@ static int capinc_tty_open(struct tty_struct * tty, struct file * file) printk(KERN_DEBUG "capinc_tty_open ocount=%d\n", atomic_read(&mp->ttyopencount)); #endif handle_minor_recv(mp); - spin_unlock_irqrestore(&workaround_lock, flags); return 0; } @@ -1072,7 +1054,6 @@ static int capinc_tty_write(struct tty_struct * tty, { struct capiminor *mp = (struct capiminor *)tty->driver_data; struct sk_buff *skb; - unsigned long flags; #ifdef _DEBUG_TTYFUNCS printk(KERN_DEBUG "capinc_tty_write(count=%d)\n", count); @@ -1085,7 +1066,6 @@ static int capinc_tty_write(struct tty_struct * tty, return 0; } - spin_lock_irqsave(&workaround_lock, flags); skb = mp->ttyskb; if (skb) { mp->ttyskb = NULL; @@ -1096,7 +1076,6 @@ static int capinc_tty_write(struct tty_struct * tty, skb = alloc_skb(CAPI_DATA_B3_REQ_LEN+count, GFP_ATOMIC); if (!skb) { printk(KERN_ERR "capinc_tty_write: alloc_skb failed\n"); - spin_unlock_irqrestore(&workaround_lock, flags); return -ENOMEM; } @@ -1107,7 +1086,6 @@ static int capinc_tty_write(struct tty_struct * tty, mp->outbytes += skb->len; (void)handle_minor_send(mp); (void)handle_minor_recv(mp); - spin_unlock_irqrestore(&workaround_lock, flags); return count; } @@ -1115,7 +1093,6 @@ static void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch) { struct capiminor *mp = (struct capiminor *)tty->driver_data; struct sk_buff *skb; - unsigned long flags; #ifdef _DEBUG_TTYFUNCS printk(KERN_DEBUG "capinc_put_char(%u)\n", ch); @@ -1128,12 +1105,10 @@ static void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch) return; } - spin_lock_irqsave(&workaround_lock, flags); skb = mp->ttyskb; if (skb) { if (skb_tailroom(skb) > 0) { *(skb_put(skb, 1)) = ch; - spin_unlock_irqrestore(&workaround_lock, flags); return; } mp->ttyskb = NULL; @@ -1149,14 +1124,12 @@ static void capinc_tty_put_char(struct tty_struct *tty, unsigned char ch) } else { printk(KERN_ERR "capinc_put_char: char %u lost\n", ch); } - spin_unlock_irqrestore(&workaround_lock, flags); } static void capinc_tty_flush_chars(struct tty_struct *tty) { struct capiminor *mp = (struct capiminor *)tty->driver_data; struct sk_buff *skb; - unsigned long flags; #ifdef _DEBUG_TTYFUNCS printk(KERN_DEBUG "capinc_tty_flush_chars\n"); @@ -1169,7 +1142,6 @@ static void capinc_tty_flush_chars(struct tty_struct *tty) return; } - spin_lock_irqsave(&workaround_lock, flags); skb = mp->ttyskb; if (skb) { mp->ttyskb = NULL; @@ -1178,7 +1150,6 @@ static void capinc_tty_flush_chars(struct tty_struct *tty) (void)handle_minor_send(mp); } (void)handle_minor_recv(mp); - spin_unlock_irqrestore(&workaround_lock, flags); } static int capinc_tty_write_room(struct tty_struct *tty) @@ -1249,15 +1220,12 @@ static void capinc_tty_throttle(struct tty_struct * tty) static void capinc_tty_unthrottle(struct tty_struct * tty) { struct capiminor *mp = (struct capiminor *)tty->driver_data; - unsigned long flags; #ifdef _DEBUG_TTYFUNCS printk(KERN_DEBUG "capinc_tty_unthrottle\n"); #endif if (mp) { - spin_lock_irqsave(&workaround_lock, flags); mp->ttyinstop = 0; handle_minor_recv(mp); - spin_unlock_irqrestore(&workaround_lock, flags); } } @@ -1275,15 +1243,12 @@ static void capinc_tty_stop(struct tty_struct *tty) static void capinc_tty_start(struct tty_struct *tty) { struct capiminor *mp = (struct capiminor *)tty->driver_data; - unsigned long flags; #ifdef _DEBUG_TTYFUNCS printk(KERN_DEBUG "capinc_tty_start\n"); #endif if (mp) { - spin_lock_irqsave(&workaround_lock, flags); mp->ttyoutstop = 0; (void)handle_minor_send(mp); - spin_unlock_irqrestore(&workaround_lock, flags); } } @@ -1491,7 +1456,7 @@ static struct procfsentries { static void __init proc_init(void) { - int nelem = ARRAY_SIZE(procfsentries); + int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); int i; for (i=0; i < nelem; i++) { @@ -1503,7 +1468,7 @@ static void __init proc_init(void) static void __exit proc_exit(void) { - int nelem = ARRAY_SIZE(procfsentries); + int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); int i; for (i=nelem-1; i >= 0; i--) { diff --git a/trunk/drivers/isdn/capi/capidrv.c b/trunk/drivers/isdn/capi/capidrv.c index 8cec9c3898ec..c4d438c17dab 100644 --- a/trunk/drivers/isdn/capi/capidrv.c +++ b/trunk/drivers/isdn/capi/capidrv.c @@ -2218,7 +2218,7 @@ static struct procfsentries { static void __init proc_init(void) { - int nelem = ARRAY_SIZE(procfsentries); + int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); int i; for (i=0; i < nelem; i++) { @@ -2230,7 +2230,7 @@ static void __init proc_init(void) static void __exit proc_exit(void) { - int nelem = ARRAY_SIZE(procfsentries); + int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); int i; for (i=nelem-1; i >= 0; i--) { diff --git a/trunk/drivers/isdn/capi/kcapi_proc.c b/trunk/drivers/isdn/capi/kcapi_proc.c index 31f4fd8b8b0a..ca9dc00a45c4 100644 --- a/trunk/drivers/isdn/capi/kcapi_proc.c +++ b/trunk/drivers/isdn/capi/kcapi_proc.c @@ -113,14 +113,14 @@ static int seq_contrstats_open(struct inode *inode, struct file *file) return seq_open(file, &seq_contrstats_ops); } -static const struct file_operations proc_controller_ops = { +static struct file_operations proc_controller_ops = { .open = seq_controller_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, }; -static const struct file_operations proc_contrstats_ops = { +static struct file_operations proc_contrstats_ops = { .open = seq_contrstats_open, .read = seq_read, .llseek = seq_lseek, @@ -218,14 +218,14 @@ seq_applstats_open(struct inode *inode, struct file *file) return seq_open(file, &seq_applstats_ops); } -static const struct file_operations proc_applications_ops = { +static struct file_operations proc_applications_ops = { .open = seq_applications_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, }; -static const struct file_operations proc_applstats_ops = { +static struct file_operations proc_applstats_ops = { .open = seq_applstats_open, .read = seq_read, .llseek = seq_lseek, @@ -302,7 +302,7 @@ seq_capi_driver_open(struct inode *inode, struct file *file) return err; } -static const struct file_operations proc_driver_ops = { +static struct file_operations proc_driver_ops = { .open = seq_capi_driver_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/isdn/divert/divert_procfs.c b/trunk/drivers/isdn/divert/divert_procfs.c index 53a189003355..06967da7c4a8 100644 --- a/trunk/drivers/isdn/divert/divert_procfs.c +++ b/trunk/drivers/isdn/divert/divert_procfs.c @@ -256,7 +256,7 @@ isdn_divert_ioctl(struct inode *inode, struct file *file, #ifdef CONFIG_PROC_FS -static const struct file_operations isdn_fops = +static struct file_operations isdn_fops = { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/isdn/gigaset/Kconfig b/trunk/drivers/isdn/gigaset/Kconfig index bcbb6502a773..708d47a6484b 100644 --- a/trunk/drivers/isdn/gigaset/Kconfig +++ b/trunk/drivers/isdn/gigaset/Kconfig @@ -7,13 +7,7 @@ config ISDN_DRV_GIGASET select CRC_CCITT select BITREVERSE help - This driver supports the Siemens Gigaset SX205/255 family of - ISDN DECT bases, including the predecessors Gigaset 3070/3075 - and 4170/4175 and their T-Com versions Sinus 45isdn and Sinus - 721X. - If you have one of these devices, say M here and for at least - one of the connection specific parts that follow. - This will build a module called "gigaset". + Say m here if you have a Gigaset or Sinus isdn device. if ISDN_DRV_GIGASET!=n @@ -21,25 +15,14 @@ config GIGASET_BASE tristate "Gigaset base station support" depends on ISDN_DRV_GIGASET && USB help - Say M here if you want to use the USB interface of the Gigaset - base for connection to your system. - This will build a module called "bas_gigaset". + Say m here if you need to communicate with the base + directly via USB. config GIGASET_M105 tristate "Gigaset M105 support" depends on ISDN_DRV_GIGASET && USB help - Say M here if you want to connect to the Gigaset base via DECT - using a Gigaset M105 (Sinus 45 Data 2) USB DECT device. - This will build a module called "usb_gigaset". - -config GIGASET_M101 - tristate "Gigaset M101 support" - depends on ISDN_DRV_GIGASET - help - Say M here if you want to connect to the Gigaset base via DECT - using a Gigaset M101 (Sinus 45 Data 1) RS232 DECT device. - This will build a module called "ser_gigaset". + Say m here if you need the driver for the Gigaset M105 device. config GIGASET_DEBUG bool "Gigaset debugging" diff --git a/trunk/drivers/isdn/gigaset/Makefile b/trunk/drivers/isdn/gigaset/Makefile index 835b806a9de7..9b9acf1a21ad 100644 --- a/trunk/drivers/isdn/gigaset/Makefile +++ b/trunk/drivers/isdn/gigaset/Makefile @@ -1,8 +1,6 @@ gigaset-y := common.o interface.o proc.o ev-layer.o i4l.o usb_gigaset-y := usb-gigaset.o asyncdata.o bas_gigaset-y := bas-gigaset.o isocdata.o -ser_gigaset-y := ser-gigaset.o asyncdata.o obj-$(CONFIG_GIGASET_M105) += usb_gigaset.o gigaset.o obj-$(CONFIG_GIGASET_BASE) += bas_gigaset.o gigaset.o -obj-$(CONFIG_GIGASET_M105) += ser_gigaset.o gigaset.o diff --git a/trunk/drivers/isdn/gigaset/asyncdata.c b/trunk/drivers/isdn/gigaset/asyncdata.c index ddf5e92be444..88e958f176d2 100644 --- a/trunk/drivers/isdn/gigaset/asyncdata.c +++ b/trunk/drivers/isdn/gigaset/asyncdata.c @@ -13,11 +13,6 @@ * ===================================================================== */ -/* not set by Kbuild when building both ser_gigaset and usb_gigaset */ -#ifndef KBUILD_MODNAME -#define KBUILD_MODNAME "asy_gigaset" -#endif - #include "gigaset.h" #include #include diff --git a/trunk/drivers/isdn/gigaset/common.c b/trunk/drivers/isdn/gigaset/common.c index b460a73a7c85..4f75cce6fdff 100644 --- a/trunk/drivers/isdn/gigaset/common.c +++ b/trunk/drivers/isdn/gigaset/common.c @@ -640,6 +640,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, return NULL; } mutex_init(&cs->mutex); + mutex_lock(&cs->mutex); gig_dbg(DEBUG_INIT, "allocating bcs[0..%d]", channels - 1); cs->bcs = kmalloc(channels * sizeof(struct bc_state), GFP_KERNEL); @@ -737,7 +738,6 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, ++cs->cs_init; - /* set up character device */ gigaset_if_init(cs); /* set up device sysfs */ @@ -753,9 +753,11 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels, add_timer(&cs->timer); gig_dbg(DEBUG_INIT, "cs initialized"); + mutex_unlock(&cs->mutex); return cs; error: + mutex_unlock(&cs->mutex); gig_dbg(DEBUG_INIT, "failed"); gigaset_freecs(cs); return NULL; @@ -906,7 +908,20 @@ void gigaset_shutdown(struct cardstate *cs) gig_dbg(DEBUG_CMD, "scheduling SHUTDOWN"); gigaset_schedule_event(cs); - wait_event(cs->waitqueue, !cs->waiting); + if (wait_event_interruptible(cs->waitqueue, !cs->waiting)) { + warn("%s: aborted", __func__); + //FIXME + } + + if (atomic_read(&cs->mstate) != MS_LOCKED) { + //FIXME? + //gigaset_baud_rate(cs, B115200); + //gigaset_set_line_ctrl(cs, CS8); + //gigaset_set_modem_ctrl(cs, TIOCM_DTR|TIOCM_RTS, 0); + //cs->control_state = 0; + } else { + //FIXME use some saved values? + } cleanup_cs(cs); @@ -929,7 +944,10 @@ void gigaset_stop(struct cardstate *cs) gig_dbg(DEBUG_CMD, "scheduling STOP"); gigaset_schedule_event(cs); - wait_event(cs->waitqueue, !cs->waiting); + if (wait_event_interruptible(cs->waitqueue, !cs->waiting)) { + warn("%s: aborted", __func__); + //FIXME + } cleanup_cs(cs); diff --git a/trunk/drivers/isdn/gigaset/ev-layer.c b/trunk/drivers/isdn/gigaset/ev-layer.c index 4661e2c722bc..44f02dbd1111 100644 --- a/trunk/drivers/isdn/gigaset/ev-layer.c +++ b/trunk/drivers/isdn/gigaset/ev-layer.c @@ -1015,7 +1015,7 @@ static void finish_shutdown(struct cardstate *cs) cs->cmd_result = -ENODEV; cs->waiting = 0; - wake_up(&cs->waitqueue); + wake_up_interruptible(&cs->waitqueue); } static void do_shutdown(struct cardstate *cs) diff --git a/trunk/drivers/isdn/gigaset/interface.c b/trunk/drivers/isdn/gigaset/interface.c index eb50f3dab5f7..f13de20947e0 100644 --- a/trunk/drivers/isdn/gigaset/interface.c +++ b/trunk/drivers/isdn/gigaset/interface.c @@ -615,8 +615,6 @@ void gigaset_if_init(struct cardstate *cs) return; tasklet_init(&cs->if_wake_tasklet, &if_wake, (unsigned long) cs); - - mutex_lock(&cs->mutex); cs->tty_dev = tty_register_device(drv->tty, cs->minor_index, NULL); if (!IS_ERR(cs->tty_dev)) @@ -625,7 +623,6 @@ void gigaset_if_init(struct cardstate *cs) warn("could not register device to the tty subsystem"); cs->tty_dev = NULL; } - mutex_unlock(&cs->mutex); } void gigaset_if_free(struct cardstate *cs) diff --git a/trunk/drivers/isdn/gigaset/isocdata.c b/trunk/drivers/isdn/gigaset/isocdata.c index 8c0eb522dab1..df988eb0e36f 100644 --- a/trunk/drivers/isdn/gigaset/isocdata.c +++ b/trunk/drivers/isdn/gigaset/isocdata.c @@ -921,8 +921,6 @@ static void cmd_loop(unsigned char *src, int numbytes, struct inbuf_t *inbuf) /* end of line */ gig_dbg(DEBUG_TRANSCMD, "%s: End of Command (%d Bytes)", __func__, cbytes); - if (cbytes >= MAX_RESP_SIZE - 1) - dev_warn(cs->dev, "response too large\n"); cs->cbytes = cbytes; gigaset_handle_modem_response(cs); cbytes = 0; @@ -931,6 +929,8 @@ static void cmd_loop(unsigned char *src, int numbytes, struct inbuf_t *inbuf) /* advance in line buffer, checking for overflow */ if (cbytes < MAX_RESP_SIZE - 1) cbytes++; + else + dev_warn(cs->dev, "response too large\n"); } } diff --git a/trunk/drivers/isdn/gigaset/ser-gigaset.c b/trunk/drivers/isdn/gigaset/ser-gigaset.c deleted file mode 100644 index c8b7db65e48f..000000000000 --- a/trunk/drivers/isdn/gigaset/ser-gigaset.c +++ /dev/null @@ -1,837 +0,0 @@ -/* This is the serial hardware link layer (HLL) for the Gigaset 307x isdn - * DECT base (aka Sinus 45 isdn) using the RS232 DECT data module M101, - * written as a line discipline. - * - * ===================================================================== - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * ===================================================================== - */ - -#include "gigaset.h" - -#include -#include -#include -#include -#include - -/* Version Information */ -#define DRIVER_AUTHOR "Tilman Schmidt" -#define DRIVER_DESC "Serial Driver for Gigaset 307x using Siemens M101" - -#define GIGASET_MINORS 1 -#define GIGASET_MINOR 0 -#define GIGASET_MODULENAME "ser_gigaset" -#define GIGASET_DEVNAME "ttyGS" - -/* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */ -#define IF_WRITEBUF 264 - -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); -MODULE_ALIAS_LDISC(N_GIGASET_M101); - -static int startmode = SM_ISDN; -module_param(startmode, int, S_IRUGO); -MODULE_PARM_DESC(startmode, "initial operation mode"); -static int cidmode = 1; -module_param(cidmode, int, S_IRUGO); -MODULE_PARM_DESC(cidmode, "stay in CID mode when idle"); - -static struct gigaset_driver *driver; - -struct ser_cardstate { - struct platform_device dev; - struct tty_struct *tty; - atomic_t refcnt; - struct mutex dead_mutex; -}; - -static struct platform_driver device_driver = { - .driver = { - .name = GIGASET_MODULENAME, - }, -}; - -static void flush_send_queue(struct cardstate *); - -/* transmit data from current open skb - * result: number of bytes sent or error code < 0 - */ -static int write_modem(struct cardstate *cs) -{ - struct tty_struct *tty = cs->hw.ser->tty; - struct bc_state *bcs = &cs->bcs[0]; /* only one channel */ - struct sk_buff *skb = bcs->tx_skb; - int sent; - - if (!tty || !tty->driver || !skb) - return -EFAULT; - - if (!skb->len) { - dev_kfree_skb_any(skb); - bcs->tx_skb = NULL; - return -EINVAL; - } - - set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - sent = tty->driver->write(tty, skb->data, skb->len); - gig_dbg(DEBUG_OUTPUT, "write_modem: sent %d", sent); - if (sent < 0) { - /* error */ - flush_send_queue(cs); - return sent; - } - skb_pull(skb, sent); - if (!skb->len) { - /* skb sent completely */ - gigaset_skb_sent(bcs, skb); - - gig_dbg(DEBUG_INTR, "kfree skb (Adr: %lx)!", - (unsigned long) skb); - dev_kfree_skb_any(skb); - bcs->tx_skb = NULL; - } - return sent; -} - -/* - * transmit first queued command buffer - * result: number of bytes sent or error code < 0 - */ -static int send_cb(struct cardstate *cs) -{ - struct tty_struct *tty = cs->hw.ser->tty; - struct cmdbuf_t *cb, *tcb; - unsigned long flags; - int sent = 0; - - if (!tty || !tty->driver) - return -EFAULT; - - cb = cs->cmdbuf; - if (!cb) - return 0; /* nothing to do */ - - if (cb->len) { - set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - sent = tty->driver->write(tty, cb->buf + cb->offset, cb->len); - if (sent < 0) { - /* error */ - gig_dbg(DEBUG_OUTPUT, "send_cb: write error %d", sent); - flush_send_queue(cs); - return sent; - } - cb->offset += sent; - cb->len -= sent; - gig_dbg(DEBUG_OUTPUT, "send_cb: sent %d, left %u, queued %u", - sent, cb->len, cs->cmdbytes); - } - - while (cb && !cb->len) { - spin_lock_irqsave(&cs->cmdlock, flags); - cs->cmdbytes -= cs->curlen; - tcb = cb; - cs->cmdbuf = cb = cb->next; - if (cb) { - cb->prev = NULL; - cs->curlen = cb->len; - } else { - cs->lastcmdbuf = NULL; - cs->curlen = 0; - } - spin_unlock_irqrestore(&cs->cmdlock, flags); - - if (tcb->wake_tasklet) - tasklet_schedule(tcb->wake_tasklet); - kfree(tcb); - } - return sent; -} - -/* - * send queue tasklet - * If there is already a skb opened, put data to the transfer buffer - * by calling "write_modem". - * Otherwise take a new skb out of the queue. - */ -static void gigaset_modem_fill(unsigned long data) -{ - struct cardstate *cs = (struct cardstate *) data; - struct bc_state *bcs; - int sent = 0; - - if (!cs || !(bcs = cs->bcs)) { - gig_dbg(DEBUG_OUTPUT, "%s: no cardstate", __func__); - return; - } - if (!bcs->tx_skb) { - /* no skb is being sent; send command if any */ - sent = send_cb(cs); - gig_dbg(DEBUG_OUTPUT, "%s: send_cb -> %d", __func__, sent); - if (sent) - /* something sent or error */ - return; - - /* no command to send; get skb */ - if (!(bcs->tx_skb = skb_dequeue(&bcs->squeue))) - /* no skb either, nothing to do */ - return; - - gig_dbg(DEBUG_INTR, "Dequeued skb (Adr: %lx)", - (unsigned long) bcs->tx_skb); - } - - /* send skb */ - gig_dbg(DEBUG_OUTPUT, "%s: tx_skb", __func__); - if (write_modem(cs) < 0) - gig_dbg(DEBUG_OUTPUT, "%s: write_modem failed", __func__); -} - -/* - * throw away all data queued for sending - */ -static void flush_send_queue(struct cardstate *cs) -{ - struct sk_buff *skb; - struct cmdbuf_t *cb; - unsigned long flags; - - /* command queue */ - spin_lock_irqsave(&cs->cmdlock, flags); - while ((cb = cs->cmdbuf) != NULL) { - cs->cmdbuf = cb->next; - if (cb->wake_tasklet) - tasklet_schedule(cb->wake_tasklet); - kfree(cb); - } - cs->cmdbuf = cs->lastcmdbuf = NULL; - cs->cmdbytes = cs->curlen = 0; - spin_unlock_irqrestore(&cs->cmdlock, flags); - - /* data queue */ - if (cs->bcs->tx_skb) - dev_kfree_skb_any(cs->bcs->tx_skb); - while ((skb = skb_dequeue(&cs->bcs->squeue)) != NULL) - dev_kfree_skb_any(skb); -} - - -/* Gigaset Driver Interface */ -/* ======================== */ - -/* - * queue an AT command string for transmission to the Gigaset device - * parameters: - * cs controller state structure - * buf buffer containing the string to send - * len number of characters to send - * wake_tasklet tasklet to run when transmission is complete, or NULL - * return value: - * number of bytes queued, or error code < 0 - */ -static int gigaset_write_cmd(struct cardstate *cs, const unsigned char *buf, - int len, struct tasklet_struct *wake_tasklet) -{ - struct cmdbuf_t *cb; - unsigned long flags; - - gigaset_dbg_buffer(atomic_read(&cs->mstate) != MS_LOCKED ? - DEBUG_TRANSCMD : DEBUG_LOCKCMD, - "CMD Transmit", len, buf); - - if (len <= 0) - return 0; - - if (!(cb = kmalloc(sizeof(struct cmdbuf_t) + len, GFP_ATOMIC))) { - dev_err(cs->dev, "%s: out of memory!\n", __func__); - return -ENOMEM; - } - - memcpy(cb->buf, buf, len); - cb->len = len; - cb->offset = 0; - cb->next = NULL; - cb->wake_tasklet = wake_tasklet; - - spin_lock_irqsave(&cs->cmdlock, flags); - cb->prev = cs->lastcmdbuf; - if (cs->lastcmdbuf) - cs->lastcmdbuf->next = cb; - else { - cs->cmdbuf = cb; - cs->curlen = len; - } - cs->cmdbytes += len; - cs->lastcmdbuf = cb; - spin_unlock_irqrestore(&cs->cmdlock, flags); - - spin_lock_irqsave(&cs->lock, flags); - if (cs->connected) - tasklet_schedule(&cs->write_tasklet); - spin_unlock_irqrestore(&cs->lock, flags); - return len; -} - -/* - * tty_driver.write_room interface routine - * return number of characters the driver will accept to be written - * parameter: - * controller state structure - * return value: - * number of characters - */ -static int gigaset_write_room(struct cardstate *cs) -{ - unsigned bytes; - - bytes = cs->cmdbytes; - return bytes < IF_WRITEBUF ? IF_WRITEBUF - bytes : 0; -} - -/* - * tty_driver.chars_in_buffer interface routine - * return number of characters waiting to be sent - * parameter: - * controller state structure - * return value: - * number of characters - */ -static int gigaset_chars_in_buffer(struct cardstate *cs) -{ - return cs->cmdbytes; -} - -/* - * implementation of ioctl(GIGASET_BRKCHARS) - * parameter: - * controller state structure - * return value: - * -EINVAL (unimplemented function) - */ -static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6]) -{ - /* not implemented */ - return -EINVAL; -} - -/* - * Open B channel - * Called by "do_action" in ev-layer.c - */ -static int gigaset_init_bchannel(struct bc_state *bcs) -{ - /* nothing to do for M10x */ - gigaset_bchannel_up(bcs); - return 0; -} - -/* - * Close B channel - * Called by "do_action" in ev-layer.c - */ -static int gigaset_close_bchannel(struct bc_state *bcs) -{ - /* nothing to do for M10x */ - gigaset_bchannel_down(bcs); - return 0; -} - -/* - * Set up B channel structure - * This is called by "gigaset_initcs" in common.c - */ -static int gigaset_initbcshw(struct bc_state *bcs) -{ - /* unused */ - bcs->hw.ser = NULL; - return 1; -} - -/* - * Free B channel structure - * Called by "gigaset_freebcs" in common.c - */ -static int gigaset_freebcshw(struct bc_state *bcs) -{ - /* unused */ - return 1; -} - -/* - * Reinitialize B channel structure - * This is called by "bcs_reinit" in common.c - */ -static void gigaset_reinitbcshw(struct bc_state *bcs) -{ - /* nothing to do for M10x */ -} - -/* - * Free hardware specific device data - * This will be called by "gigaset_freecs" in common.c - */ -static void gigaset_freecshw(struct cardstate *cs) -{ - tasklet_kill(&cs->write_tasklet); - if (!cs->hw.ser) - return; - dev_set_drvdata(&cs->hw.ser->dev.dev, NULL); - platform_device_unregister(&cs->hw.ser->dev); - kfree(cs->hw.ser); - cs->hw.ser = NULL; -} - -static void gigaset_device_release(struct device *dev) -{ - struct platform_device *pdev = - container_of(dev, struct platform_device, dev); - - /* adapted from platform_device_release() in drivers/base/platform.c */ - //FIXME is this actually necessary? - kfree(dev->platform_data); - kfree(pdev->resource); -} - -/* - * Set up hardware specific device data - * This is called by "gigaset_initcs" in common.c - */ -static int gigaset_initcshw(struct cardstate *cs) -{ - int rc; - - if (!(cs->hw.ser = kzalloc(sizeof(struct ser_cardstate), GFP_KERNEL))) { - err("%s: out of memory!", __func__); - return 0; - } - - cs->hw.ser->dev.name = GIGASET_MODULENAME; - cs->hw.ser->dev.id = cs->minor_index; - cs->hw.ser->dev.dev.release = gigaset_device_release; - if ((rc = platform_device_register(&cs->hw.ser->dev)) != 0) { - err("error %d registering platform device", rc); - kfree(cs->hw.ser); - cs->hw.ser = NULL; - return 0; - } - dev_set_drvdata(&cs->hw.ser->dev.dev, cs); - - tasklet_init(&cs->write_tasklet, - &gigaset_modem_fill, (unsigned long) cs); - return 1; -} - -/* - * set modem control lines - * Parameters: - * card state structure - * modem control line state ([TIOCM_DTR]|[TIOCM_RTS]) - * Called by "gigaset_start" and "gigaset_enterconfigmode" in common.c - * and by "if_lock" and "if_termios" in interface.c - */ -static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state, unsigned new_state) -{ - struct tty_struct *tty = cs->hw.ser->tty; - unsigned int set, clear; - - if (!tty || !tty->driver || !tty->driver->tiocmset) - return -EFAULT; - set = new_state & ~old_state; - clear = old_state & ~new_state; - if (!set && !clear) - return 0; - gig_dbg(DEBUG_IF, "tiocmset set %x clear %x", set, clear); - return tty->driver->tiocmset(tty, NULL, set, clear); -} - -static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag) -{ - return -EINVAL; -} - -static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag) -{ - return -EINVAL; -} - -static struct gigaset_ops ops = { - gigaset_write_cmd, - gigaset_write_room, - gigaset_chars_in_buffer, - gigaset_brkchars, - gigaset_init_bchannel, - gigaset_close_bchannel, - gigaset_initbcshw, - gigaset_freebcshw, - gigaset_reinitbcshw, - gigaset_initcshw, - gigaset_freecshw, - gigaset_set_modem_ctrl, - gigaset_baud_rate, - gigaset_set_line_ctrl, - gigaset_m10x_send_skb, /* asyncdata.c */ - gigaset_m10x_input, /* asyncdata.c */ -}; - - -/* Line Discipline Interface */ -/* ========================= */ - -/* helper functions for cardstate refcounting */ -static struct cardstate *cs_get(struct tty_struct *tty) -{ - struct cardstate *cs = tty->disc_data; - - if (!cs || !cs->hw.ser) { - gig_dbg(DEBUG_ANY, "%s: no cardstate", __func__); - return NULL; - } - atomic_inc(&cs->hw.ser->refcnt); - return cs; -} - -static void cs_put(struct cardstate *cs) -{ - if (atomic_dec_and_test(&cs->hw.ser->refcnt)) - mutex_unlock(&cs->hw.ser->dead_mutex); -} - -/* - * Called by the tty driver when the line discipline is pushed onto the tty. - * Called in process context. - */ -static int -gigaset_tty_open(struct tty_struct *tty) -{ - struct cardstate *cs; - - gig_dbg(DEBUG_INIT, "Starting HLL for Gigaset M101"); - - info(DRIVER_AUTHOR); - info(DRIVER_DESC); - - if (!driver) { - err("%s: no driver structure", __func__); - return -ENODEV; - } - - /* allocate memory for our device state and intialize it */ - if (!(cs = gigaset_initcs(driver, 1, 1, 0, cidmode, - GIGASET_MODULENAME))) - goto error; - - cs->dev = &cs->hw.ser->dev.dev; - cs->hw.ser->tty = tty; - mutex_init(&cs->hw.ser->dead_mutex); - atomic_set(&cs->hw.ser->refcnt, 1); - - tty->disc_data = cs; - - /* OK.. Initialization of the datastructures and the HW is done.. Now - * startup system and notify the LL that we are ready to run - */ - if (startmode == SM_LOCKED) - atomic_set(&cs->mstate, MS_LOCKED); - if (!gigaset_start(cs)) { - tasklet_kill(&cs->write_tasklet); - goto error; - } - - gig_dbg(DEBUG_INIT, "Startup of HLL done"); - mutex_lock(&cs->hw.ser->dead_mutex); - return 0; - -error: - gig_dbg(DEBUG_INIT, "Startup of HLL failed"); - tty->disc_data = NULL; - gigaset_freecs(cs); - return -ENODEV; -} - -/* - * Called by the tty driver when the line discipline is removed. - * Called from process context. - */ -static void -gigaset_tty_close(struct tty_struct *tty) -{ - struct cardstate *cs = tty->disc_data; - - gig_dbg(DEBUG_INIT, "Stopping HLL for Gigaset M101"); - - if (!cs) { - gig_dbg(DEBUG_INIT, "%s: no cardstate", __func__); - return; - } - - /* prevent other callers from entering ldisc methods */ - tty->disc_data = NULL; - - if (!cs->hw.ser) - err("%s: no hw cardstate", __func__); - else { - /* wait for running methods to finish */ - if (!atomic_dec_and_test(&cs->hw.ser->refcnt)) - mutex_lock(&cs->hw.ser->dead_mutex); - } - - /* stop operations */ - gigaset_stop(cs); - tasklet_kill(&cs->write_tasklet); - flush_send_queue(cs); - cs->dev = NULL; - gigaset_freecs(cs); - - gig_dbg(DEBUG_INIT, "Shutdown of HLL done"); -} - -/* - * Called by the tty driver when the tty line is hung up. - * Wait for I/O to driver to complete and unregister ISDN device. - * This is already done by the close routine, so just call that. - * Called from process context. - */ -static int gigaset_tty_hangup(struct tty_struct *tty) -{ - gigaset_tty_close(tty); - return 0; -} - -/* - * Read on the tty. - * Unused, received data goes only to the Gigaset driver. - */ -static ssize_t -gigaset_tty_read(struct tty_struct *tty, struct file *file, - unsigned char __user *buf, size_t count) -{ - return -EAGAIN; -} - -/* - * Write on the tty. - * Unused, transmit data comes only from the Gigaset driver. - */ -static ssize_t -gigaset_tty_write(struct tty_struct *tty, struct file *file, - const unsigned char *buf, size_t count) -{ - return -EAGAIN; -} - -/* - * Ioctl on the tty. - * Called in process context only. - * May be re-entered by multiple ioctl calling threads. - */ -static int -gigaset_tty_ioctl(struct tty_struct *tty, struct file *file, - unsigned int cmd, unsigned long arg) -{ - struct cardstate *cs = cs_get(tty); - int rc, val; - int __user *p = (int __user *)arg; - - if (!cs) - return -ENXIO; - - switch (cmd) { - case TCGETS: - case TCGETA: - /* pass through to underlying serial device */ - rc = n_tty_ioctl(tty, file, cmd, arg); - break; - - case TCFLSH: - /* flush our buffers and the serial port's buffer */ - switch (arg) { - case TCIFLUSH: - /* no own input buffer to flush */ - break; - case TCIOFLUSH: - case TCOFLUSH: - flush_send_queue(cs); - break; - } - /* flush the serial port's buffer */ - rc = n_tty_ioctl(tty, file, cmd, arg); - break; - - case FIONREAD: - /* unused, always return zero */ - val = 0; - rc = put_user(val, p); - break; - - default: - rc = -ENOIOCTLCMD; - } - - cs_put(cs); - return rc; -} - -/* - * Poll on the tty. - * Unused, always return zero. - */ -static unsigned int -gigaset_tty_poll(struct tty_struct *tty, struct file *file, poll_table *wait) -{ - return 0; -} - -/* - * Called by the tty driver when a block of data has been received. - * Will not be re-entered while running but other ldisc functions - * may be called in parallel. - * Can be called from hard interrupt level as well as soft interrupt - * level or mainline. - * Parameters: - * tty tty structure - * buf buffer containing received characters - * cflags buffer containing error flags for received characters (ignored) - * count number of received characters - */ -static void -gigaset_tty_receive(struct tty_struct *tty, const unsigned char *buf, - char *cflags, int count) -{ - struct cardstate *cs = cs_get(tty); - unsigned tail, head, n; - struct inbuf_t *inbuf; - - if (!cs) - return; - if (!(inbuf = cs->inbuf)) { - dev_err(cs->dev, "%s: no inbuf\n", __func__); - cs_put(cs); - return; - } - - tail = atomic_read(&inbuf->tail); - head = atomic_read(&inbuf->head); - gig_dbg(DEBUG_INTR, "buffer state: %u -> %u, receive %u bytes", - head, tail, count); - - if (head <= tail) { - /* possible buffer wraparound */ - n = min_t(unsigned, count, RBUFSIZE - tail); - memcpy(inbuf->data + tail, buf, n); - tail = (tail + n) % RBUFSIZE; - buf += n; - count -= n; - } - - if (count > 0) { - /* tail < head and some data left */ - n = head - tail - 1; - if (count > n) { - dev_err(cs->dev, - "inbuf overflow, discarding %d bytes\n", - count - n); - count = n; - } - memcpy(inbuf->data + tail, buf, count); - tail += count; - } - - gig_dbg(DEBUG_INTR, "setting tail to %u", tail); - atomic_set(&inbuf->tail, tail); - - /* Everything was received .. Push data into handler */ - gig_dbg(DEBUG_INTR, "%s-->BH", __func__); - gigaset_schedule_event(cs); - cs_put(cs); -} - -/* - * Called by the tty driver when there's room for more data to send. - */ -static void -gigaset_tty_wakeup(struct tty_struct *tty) -{ - struct cardstate *cs = cs_get(tty); - - clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - if (!cs) - return; - tasklet_schedule(&cs->write_tasklet); - cs_put(cs); -} - -static struct tty_ldisc gigaset_ldisc = { - .owner = THIS_MODULE, - .magic = TTY_LDISC_MAGIC, - .name = "ser_gigaset", - .open = gigaset_tty_open, - .close = gigaset_tty_close, - .hangup = gigaset_tty_hangup, - .read = gigaset_tty_read, - .write = gigaset_tty_write, - .ioctl = gigaset_tty_ioctl, - .poll = gigaset_tty_poll, - .receive_buf = gigaset_tty_receive, - .write_wakeup = gigaset_tty_wakeup, -}; - - -/* Initialization / Shutdown */ -/* ========================= */ - -static int __init ser_gigaset_init(void) -{ - int rc; - - gig_dbg(DEBUG_INIT, "%s", __func__); - if ((rc = platform_driver_register(&device_driver)) != 0) { - err("error %d registering platform driver", rc); - return rc; - } - - /* allocate memory for our driver state and intialize it */ - if (!(driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS, - GIGASET_MODULENAME, GIGASET_DEVNAME, - &ops, THIS_MODULE))) - goto error; - - if ((rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc)) != 0) { - err("error %d registering line discipline", rc); - goto error; - } - - return 0; - -error: - if (driver) { - gigaset_freedriver(driver); - driver = NULL; - } - platform_driver_unregister(&device_driver); - return rc; -} - -static void __exit ser_gigaset_exit(void) -{ - int rc; - - gig_dbg(DEBUG_INIT, "%s", __func__); - - if (driver) { - gigaset_freedriver(driver); - driver = NULL; - } - - if ((rc = tty_unregister_ldisc(N_GIGASET_M101)) != 0) - err("error %d unregistering line discipline", rc); - - platform_driver_unregister(&device_driver); -} - -module_init(ser_gigaset_init); -module_exit(ser_gigaset_exit); diff --git a/trunk/drivers/isdn/hardware/avm/b1dma.c b/trunk/drivers/isdn/hardware/avm/b1dma.c index 1e2d38e3d68c..ddd47cdfdb1f 100644 --- a/trunk/drivers/isdn/hardware/avm/b1dma.c +++ b/trunk/drivers/isdn/hardware/avm/b1dma.c @@ -29,7 +29,7 @@ static char *revision = "$Revision: 1.1.2.3 $"; -#undef AVM_B1DMA_DEBUG +#undef CONFIG_B1DMA_DEBUG /* ------------------------------------------------------------- */ @@ -391,16 +391,16 @@ static void b1dma_dispatch_tx(avmcard *card) _put_slice(&p, skb->data, len); } txlen = (u8 *)p - (u8 *)dma->sendbuf.dmabuf; -#ifdef AVM_B1DMA_DEBUG +#ifdef CONFIG_B1DMA_DEBUG printk(KERN_DEBUG "tx: put msg len=%d\n", txlen); #endif } else { txlen = skb->len-2; -#ifdef AVM_B1DMA_POLLDEBUG +#ifdef CONFIG_B1DMA_POLLDEBUG if (skb->data[2] == SEND_POLLACK) printk(KERN_INFO "%s: send ack\n", card->name); #endif -#ifdef AVM_B1DMA_DEBUG +#ifdef CONFIG_B1DMA_DEBUG printk(KERN_DEBUG "tx: put 0x%x len=%d\n", skb->data[2], txlen); #endif @@ -450,7 +450,7 @@ static void b1dma_handle_rx(avmcard *card) u32 ApplId, MsgLen, DataB3Len, NCCI, WindowSize; u8 b1cmd = _get_byte(&p); -#ifdef AVM_B1DMA_DEBUG +#ifdef CONFIG_B1DMA_DEBUG printk(KERN_DEBUG "rx: 0x%x %lu\n", b1cmd, (unsigned long)dma->recvlen); #endif @@ -515,7 +515,7 @@ static void b1dma_handle_rx(avmcard *card) break; case RECEIVE_START: -#ifdef AVM_B1DMA_POLLDEBUG +#ifdef CONFIG_B1DMA_POLLDEBUG printk(KERN_INFO "%s: receive poll\n", card->name); #endif if (!suppress_pollack) @@ -601,7 +601,7 @@ static void b1dma_handle_interrupt(avmcard *card) rxlen = (dma->recvlen + 3) & ~3; b1dma_writel(card, dma->recvbuf.dmaaddr+4, AMCC_RXPTR); b1dma_writel(card, rxlen, AMCC_RXLEN); -#ifdef AVM_B1DMA_DEBUG +#ifdef CONFIG_B1DMA_DEBUG } else { printk(KERN_ERR "%s: rx not complete (%d).\n", card->name, rxlen); diff --git a/trunk/drivers/isdn/hardware/avm/c4.c b/trunk/drivers/isdn/hardware/avm/c4.c index 6f5efa8d78cb..2a3eb38f0ebb 100644 --- a/trunk/drivers/isdn/hardware/avm/c4.c +++ b/trunk/drivers/isdn/hardware/avm/c4.c @@ -28,8 +28,8 @@ #include #include "avmcard.h" -#undef AVM_C4_DEBUG -#undef AVM_C4_POLLDEBUG +#undef CONFIG_C4_DEBUG +#undef CONFIG_C4_POLLDEBUG /* ------------------------------------------------------------- */ @@ -420,7 +420,7 @@ static void c4_dispatch_tx(avmcard *card) skb = skb_dequeue(&dma->send_queue); if (!skb) { -#ifdef AVM_C4_DEBUG +#ifdef CONFIG_C4_DEBUG printk(KERN_DEBUG "%s: tx underrun\n", card->name); #endif return; @@ -444,16 +444,16 @@ static void c4_dispatch_tx(avmcard *card) _put_slice(&p, skb->data, len); } txlen = (u8 *)p - (u8 *)dma->sendbuf.dmabuf; -#ifdef AVM_C4_DEBUG +#ifdef CONFIG_C4_DEBUG printk(KERN_DEBUG "%s: tx put msg len=%d\n", card->name, txlen); #endif } else { txlen = skb->len-2; -#ifdef AVM_C4_POLLDEBUG +#ifdef CONFIG_C4_POLLDEBUG if (skb->data[2] == SEND_POLLACK) printk(KERN_INFO "%s: ack to c4\n", card->name); #endif -#ifdef AVM_C4_DEBUG +#ifdef CONFIG_C4_DEBUG printk(KERN_DEBUG "%s: tx put 0x%x len=%d\n", card->name, skb->data[2], txlen); #endif @@ -508,7 +508,7 @@ static void c4_handle_rx(avmcard *card) u32 cidx; -#ifdef AVM_C4_DEBUG +#ifdef CONFIG_C4_DEBUG printk(KERN_DEBUG "%s: rx 0x%x len=%lu\n", card->name, b1cmd, (unsigned long)dma->recvlen); #endif @@ -586,7 +586,7 @@ static void c4_handle_rx(avmcard *card) break; case RECEIVE_START: -#ifdef AVM_C4_POLLDEBUG +#ifdef CONFIG_C4_POLLDEBUG printk(KERN_INFO "%s: poll from c4\n", card->name); #endif if (!suppress_pollack) diff --git a/trunk/drivers/isdn/hardware/eicon/capifunc.c b/trunk/drivers/isdn/hardware/eicon/capifunc.c index ff284aeb8fbb..0afd7633556d 100644 --- a/trunk/drivers/isdn/hardware/eicon/capifunc.c +++ b/trunk/drivers/isdn/hardware/eicon/capifunc.c @@ -187,7 +187,7 @@ static diva_card *find_card_by_ctrl(word controller) */ void *TransmitBufferSet(APPL * appl, dword ref) { - appl->xbuffer_used[ref] = true; + appl->xbuffer_used[ref] = TRUE; DBG_PRV1(("%d:xbuf_used(%d)", appl->Id, ref + 1)) return (void *) ref; } @@ -202,7 +202,7 @@ void *TransmitBufferGet(APPL * appl, void *p) void TransmitBufferFree(APPL * appl, void *p) { - appl->xbuffer_used[(dword) p] = false; + appl->xbuffer_used[(dword) p] = FALSE; DBG_PRV1(("%d:xbuf_free(%d)", appl->Id, ((dword) p) + 1)) } diff --git a/trunk/drivers/isdn/hardware/eicon/debug.c b/trunk/drivers/isdn/hardware/eicon/debug.c index 0db9cc661e28..d835e74ecf18 100644 --- a/trunk/drivers/isdn/hardware/eicon/debug.c +++ b/trunk/drivers/isdn/hardware/eicon/debug.c @@ -287,7 +287,7 @@ void* diva_maint_finit (void) { } external_dbg_queue = 0; - for (i = 1; i < ARRAY_SIZE(clients); i++) { + for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) { if (clients[i].pmem) { diva_os_free (0, clients[i].pmem); } @@ -391,7 +391,7 @@ static void DI_register (void *arg) { diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "register"); - for (id = 1; id < ARRAY_SIZE(clients); id++) { + for (id = 1; id < (sizeof(clients)/sizeof(clients[0])); id++) { if (clients[id].hDbg == hDbg) { /* driver already registered @@ -494,7 +494,7 @@ static void DI_deregister (pDbgHandle hDbg) { diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "read"); diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "read"); - for (i = 1; i < ARRAY_SIZE(clients); i++) { + for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) { if (clients[i].hDbg == hDbg) { diva_dbg_entry_head_t* pmsg; char tmp[256]; @@ -736,7 +736,7 @@ int diva_get_driver_info (dword id, byte* data, int data_length) { int to_copy; if (!data || !id || (data_length < 17) || - (id >= ARRAY_SIZE(clients))) { + (id >= (sizeof(clients)/sizeof(clients[0])))) { return (-1); } @@ -786,7 +786,7 @@ int diva_get_driver_dbg_mask (dword id, byte* data) { diva_os_spin_lock_magic_t old_irql; int ret = -1; - if (!data || !id || (id >= ARRAY_SIZE(clients))) { + if (!data || !id || (id >= (sizeof(clients)/sizeof(clients[0])))) { return (-1); } diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "driver info"); @@ -809,7 +809,7 @@ int diva_set_driver_dbg_mask (dword id, dword mask) { int ret = -1; - if (!id || (id >= ARRAY_SIZE(clients))) { + if (!id || (id >= (sizeof(clients)/sizeof(clients[0])))) { return (-1); } @@ -887,7 +887,7 @@ void diva_mnt_add_xdi_adapter (const DESCRIPTOR* d) { diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "register"); diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "register"); - for (id = 1; id < ARRAY_SIZE(clients); id++) { + for (id = 1; id < (sizeof(clients)/sizeof(clients[0])); id++) { if (clients[id].hDbg && (clients[id].request == d->request)) { diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "register"); diva_os_leave_spin_lock (&dbg_adapter_lock, &old_irql1, "register"); @@ -1037,7 +1037,7 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d) { diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "read"); diva_os_enter_spin_lock (&dbg_q_lock, &old_irql, "read"); - for (i = 1; i < ARRAY_SIZE(clients); i++) { + for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) { if (clients[i].hDbg && (clients[i].request == d->request)) { diva_dbg_entry_head_t* pmsg; char tmp[256]; @@ -1115,7 +1115,7 @@ void diva_mnt_remove_xdi_adapter (const DESCRIPTOR* d) { void* SuperTraceOpenAdapter (int AdapterNumber) { int i; - for (i = 1; i < ARRAY_SIZE(clients); i++) { + for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) { if (clients[i].hDbg && clients[i].request && (clients[i].logical == AdapterNumber)) { return (&clients[i]); } @@ -1508,7 +1508,7 @@ static void diva_maint_state_change_notify (void* user_context, int ch = TraceFilterChannel; int id = TraceFilterIdent; - if ((id >= 0) && (ch >= 0) && (id < ARRAY_SIZE(clients)) && + if ((id >= 0) && (ch >= 0) && (id < sizeof(clients)/sizeof(clients[0])) && (clients[id].Dbg.id == (byte)id) && (clients[id].pIdiLib == hLib)) { if (ch != (int)modem->ChannelNumber) { break; @@ -1555,7 +1555,7 @@ static void diva_maint_state_change_notify (void* user_context, int ch = TraceFilterChannel; int id = TraceFilterIdent; - if ((id >= 0) && (ch >= 0) && (id < ARRAY_SIZE(clients)) && + if ((id >= 0) && (ch >= 0) && (id < sizeof(clients)/sizeof(clients[0])) && (clients[id].Dbg.id == (byte)id) && (clients[id].pIdiLib == hLib)) { if (ch != (int)fax->ChannelNumber) { break; @@ -1803,7 +1803,7 @@ static void diva_maint_trace_notify (void* user_context, /* Selective trace */ - if ((id >= 0) && (ch >= 0) && (id < ARRAY_SIZE(clients)) && + if ((id >= 0) && (ch >= 0) && (id < sizeof(clients)/sizeof(clients[0])) && (clients[id].Dbg.id == (byte)id) && (clients[id].pIdiLib == hLib)) { const char* p = NULL; int ch_value = -1; @@ -1925,7 +1925,7 @@ int diva_mnt_shutdown_xdi_adapters (void) { byte * pmem; - for (i = 1; i < ARRAY_SIZE(clients); i++) { + for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) { pmem = NULL; diva_os_enter_spin_lock (&dbg_adapter_lock, &old_irql1, "unload"); @@ -2006,7 +2006,7 @@ int diva_set_trace_filter (int filter_length, const char* filter) { on = (TraceFilter[0] == 0); - for (i = 1; i < ARRAY_SIZE(clients); i++) { + for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) { if (clients[i].hDbg && clients[i].pIdiLib && clients[i].request) { client_b_on = on && ((clients[i].hDbg->dbgMask & DIVA_MGT_DBG_IFC_BCHANNEL) != 0); client_atap_on = on && ((clients[i].hDbg->dbgMask & DIVA_MGT_DBG_IFC_AUDIO) != 0); @@ -2017,7 +2017,7 @@ int diva_set_trace_filter (int filter_length, const char* filter) { } } - for (i = 1; i < ARRAY_SIZE(clients); i++) { + for (i = 1; i < (sizeof(clients)/sizeof(clients[0])); i++) { if (clients[i].hDbg && clients[i].pIdiLib && clients[i].request && clients[i].request_pending) { diva_os_leave_spin_lock (&dbg_q_lock, &old_irql, "write_filter"); clients[i].request_pending = 0; diff --git a/trunk/drivers/isdn/hardware/eicon/di.c b/trunk/drivers/isdn/hardware/eicon/di.c index ce8df3878908..e1df8d98c311 100644 --- a/trunk/drivers/isdn/hardware/eicon/di.c +++ b/trunk/drivers/isdn/hardware/eicon/di.c @@ -173,16 +173,16 @@ void pr_out(ADAPTER * a) xdi_xlog_request (XDI_A_NR(a), this->Id, this->ReqCh, this->MInd, a->IdTypeTable[this->No]); a->ram_out(a, &ReqOut->Req, this->MInd); - more = true; + more = TRUE; } else { xdi_xlog_request (XDI_A_NR(a), this->Id, this->ReqCh, this->Req, a->IdTypeTable[this->No]); this->More |=XMOREF; a->ram_out(a, &ReqOut->Req, this->Req); - more = false; + more = FALSE; if (a->FlowControlIdTable[this->ReqCh] == this->Id) - a->FlowControlSkipTable[this->ReqCh] = true; + a->FlowControlSkipTable[this->ReqCh] = TRUE; /* Note that remove request was sent to the card */ @@ -311,7 +311,7 @@ byte pr_dpc(ADAPTER * a) /* are marked RNR */ if(RNRId && RNRId==a->ram_in(a, &IndIn->IndId)) { a->ram_out(a, &IndIn->Ind, 0); - a->ram_out(a, &IndIn->RNR, true); + a->ram_out(a, &IndIn->RNR, TRUE); } else { Ind = a->ram_in(a, &IndIn->Ind); @@ -331,7 +331,7 @@ byte pr_dpc(ADAPTER * a) dtrc(dprintf("RNR")); a->ram_out(a, &IndIn->Ind, 0); RNRId = a->ram_in(a, &IndIn->IndId); - a->ram_out(a, &IndIn->RNR, true); + a->ram_out(a, &IndIn->RNR, TRUE); } } } @@ -340,7 +340,7 @@ byte pr_dpc(ADAPTER * a) } a->ram_out(a, &PR_RAM->IndOutput, 0); } - return false; + return FALSE; } byte scom_test_int(ADAPTER * a) { @@ -399,7 +399,7 @@ byte isdn_rc(ADAPTER * a, return (0); } if (extended_info_type == DIVA_RC_TYPE_REMOVE_COMPLETE) - a->RcExtensionSupported = true; + a->RcExtensionSupported = TRUE; } a->misc_flags_table[e_no] &= ~DIVA_MISC_FLAGS_REMOVE_PENDING; a->misc_flags_table[e_no] &= ~DIVA_MISC_FLAGS_NO_RC_CANCELLING; @@ -428,7 +428,7 @@ byte isdn_rc(ADAPTER * a, } if (Rc==OK_FC) { a->FlowControlIdTable[Ch] = Id; - a->FlowControlSkipTable[Ch] = false; + a->FlowControlSkipTable[Ch] = FALSE; this->Rc = Rc; this->More &= ~(XBUSY | XMOREC); this->complete=0xff; diff --git a/trunk/drivers/isdn/hardware/eicon/divamnt.c b/trunk/drivers/isdn/hardware/eicon/divamnt.c index 6b2940ed0776..77155d9f399b 100644 --- a/trunk/drivers/isdn/hardware/eicon/divamnt.c +++ b/trunk/drivers/isdn/hardware/eicon/divamnt.c @@ -164,7 +164,7 @@ static ssize_t divas_maint_read(struct file *file, char __user *buf, return (maint_read_write(buf, (int) count)); } -static const struct file_operations divas_maint_fops = { +static struct file_operations divas_maint_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = divas_maint_read, diff --git a/trunk/drivers/isdn/hardware/eicon/divasi.c b/trunk/drivers/isdn/hardware/eicon/divasi.c index 556b19615bc7..fff0d89c806b 100644 --- a/trunk/drivers/isdn/hardware/eicon/divasi.c +++ b/trunk/drivers/isdn/hardware/eicon/divasi.c @@ -131,7 +131,7 @@ static void remove_um_idi_proc(void) } } -static const struct file_operations divas_idi_fops = { +static struct file_operations divas_idi_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = um_idi_read, diff --git a/trunk/drivers/isdn/hardware/eicon/divasmain.c b/trunk/drivers/isdn/hardware/eicon/divasmain.c index b365e44072c0..91fc92c01afe 100644 --- a/trunk/drivers/isdn/hardware/eicon/divasmain.c +++ b/trunk/drivers/isdn/hardware/eicon/divasmain.c @@ -663,7 +663,7 @@ static unsigned int divas_poll(struct file *file, poll_table * wait) return (POLLIN | POLLRDNORM); } -static const struct file_operations divas_fops = { +static struct file_operations divas_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = divas_read, diff --git a/trunk/drivers/isdn/hardware/eicon/divasproc.c b/trunk/drivers/isdn/hardware/eicon/divasproc.c index 0632a2606998..6a4373a4f1e8 100644 --- a/trunk/drivers/isdn/hardware/eicon/divasproc.c +++ b/trunk/drivers/isdn/hardware/eicon/divasproc.c @@ -113,7 +113,7 @@ static int divas_close(struct inode *inode, struct file *file) return (0); } -static const struct file_operations divas_fops = { +static struct file_operations divas_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = divas_read, diff --git a/trunk/drivers/isdn/hardware/eicon/message.c b/trunk/drivers/isdn/hardware/eicon/message.c index 784232a144c8..f9b00f19afd2 100644 --- a/trunk/drivers/isdn/hardware/eicon/message.c +++ b/trunk/drivers/isdn/hardware/eicon/message.c @@ -253,7 +253,7 @@ extern APPL * application; -static byte remove_started = false; +static byte remove_started = FALSE; static PLCI dummy_plci; @@ -456,12 +456,12 @@ word api_put(APPL * appl, CAPI_MSG * msg) return _QUEUE_FULL; } - c = false; + c = FALSE; if ((((byte *) msg) < ((byte *)(plci->msg_in_queue))) || (((byte *) msg) >= ((byte *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue))) { if (plci->msg_in_write_pos != plci->msg_in_read_pos) - c = true; + c = TRUE; } if (msg->header.command == _DATA_B3_R) { @@ -506,13 +506,13 @@ word api_put(APPL * appl, CAPI_MSG * msg) return _QUEUE_FULL; } - c = true; + c = TRUE; } } else { if (plci->req_in || plci->internal_command) - c = true; + c = TRUE; else { plci->command = msg->header.command; @@ -626,10 +626,10 @@ word api_parse(byte * msg, word length, byte * format, API_PARSE * parms) break; } - if(p>length) return true; + if(p>length) return TRUE; } if(parms) parms[i].info = NULL; - return false; + return FALSE; } void api_save_msg(API_PARSE *in, byte *format, API_SAVE *out) @@ -687,7 +687,7 @@ word api_remove_start(void) word j; if(!remove_started) { - remove_started = true; + remove_started = TRUE; for(i=0;ichannels = 0; @@ -1226,7 +1226,7 @@ byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, Id = ((word)1<<8)|a->Id; sendf(appl,_CONNECT_R|CONFIRM,Id,Number,"w",0); sendf(appl, _DISCONNECT_I, Id, 0, "w", _L1_ERROR); - return false; + return FALSE; } Info = _OUT_OF_PLCI; if((i=get_plci(a))) @@ -1330,7 +1330,7 @@ byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, plci->command = _CONNECT_R; plci->number = Number; /* x.31 or D-ch free SAPI in LinkLayer? */ - if(ch==1 && LinkLayer!=3 && LinkLayer!=12) noCh = true; + if(ch==1 && LinkLayer!=3 && LinkLayer!=12) noCh = TRUE; if((ch==0 || ch==2 || noCh || ch==3 || ch==4) && !Info) { /* B-channel used for B3 connections (ch==0), or no B channel */ @@ -1381,7 +1381,7 @@ byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, plci->command = 0; dbug(1,dprintf("Spoof")); send_req(plci); - return false; + return FALSE; } if(ch==4)add_p(plci,CHI,p_chi); add_s(plci,CPN,&parms[1]); @@ -1395,11 +1395,11 @@ byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, plci->appl = appl; sig_req(plci,LISTEN_REQ,0); send_req(plci); - return false; + return FALSE; } } send_req(plci); - return false; + return FALSE; } plci->Id = 0; } @@ -1571,7 +1571,7 @@ byte connect_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, byte connect_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) { dbug(1,dprintf("connect_a_res")); - return false; + return FALSE; } byte disconnect_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) @@ -1624,9 +1624,9 @@ byte disconnect_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc } } - if(!appl) return false; + if(!appl) return FALSE; sendf(appl, _DISCONNECT_R|CONFIRM, Id, Number, "w",Info); - return false; + return FALSE; } byte disconnect_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) @@ -1702,7 +1702,7 @@ byte listen_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, A "w",Info); if (a) listen_check(a); - return false; + return FALSE; } byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) @@ -1739,7 +1739,7 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APP add_s(plci,KEY,&ai_parms[1]); sig_req(plci,INFO_REQ,0); send_req(plci); - return false; + return FALSE; } if(plci->State && ai_parms[2].length) @@ -1769,7 +1769,7 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APP if((i=get_plci(a))) { rc_plci = &a->plci[i-1]; - appl->NullCREnable = true; + appl->NullCREnable = TRUE; rc_plci->internal_command = C_NCR_FAC_REQ; rc_plci->appl = appl; add_p(rc_plci,CAI,"\x01\x80"); @@ -1788,7 +1788,7 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APP add_ai(rc_plci, &msg[1]); sig_req(rc_plci,NCR_FACILITY,0); send_req(rc_plci); - return false; + return FALSE; /* for application controlled supplementary services */ } } @@ -1811,13 +1811,13 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APP Number, "w",Info); } - return false; + return FALSE; } byte info_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) { dbug(1,dprintf("info_res")); - return false; + return FALSE; } byte alert_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) @@ -1828,7 +1828,7 @@ byte alert_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, AP dbug(1,dprintf("alert_req")); Info = _WRONG_IDENTIFIER; - ret = false; + ret = FALSE; if(plci) { Info = _ALERT_IGNORED; if(plci->State!=INC_CON_ALERT) { @@ -1922,7 +1922,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, rplci->appl = appl; sig_req(rplci,S_SUPPORTED,0); send_req(rplci); - return false; + return FALSE; break; case S_LISTEN: @@ -1972,7 +1972,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, add_s(plci,CAI,&ss_parms[1]); sig_req(plci,CALL_HOLD,0); send_req(plci); - return false; + return FALSE; } else Info = 0x3010; /* wrong state */ break; @@ -1997,13 +1997,13 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, plci->internal_command = BLOCK_PLCI; plci->command = 0; dbug(1,dprintf("Spoof")); - return false; + return FALSE; } else { sig_req(plci,CALL_RETRIEVE,0); send_req(plci); - return false; + return FALSE; } } else Info = 0x3010; /* wrong state */ @@ -2123,7 +2123,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, add_p(plci,CAI,cai); sig_req(plci,S_SERVICE,0); send_req(plci); - return false; + return FALSE; } else Info = 0x3010; /* wrong state */ break; @@ -2265,7 +2265,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, add_p(rplci,CAI,cai); sig_req(rplci,S_SERVICE,0); send_req(rplci); - return false; + return FALSE; } else { @@ -2291,14 +2291,14 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, ss_parms[3].info[3] = (byte)GET_WORD(&(ss_parms[2].info[0])); plci->command = 0; plci->internal_command = CD_REQ_PEND; - appl->CDEnable = true; + appl->CDEnable = TRUE; cai[0] = 1; cai[1] = CALL_DEFLECTION; add_p(plci,CAI,cai); add_p(plci,CPN,ss_parms[3].info); sig_req(plci,S_SERVICE,0); send_req(plci); - return false; + return FALSE; break; case S_CALL_FORWARDING_START: @@ -2337,7 +2337,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, add_p(rplci,CPN,ss_parms[6].info); sig_req(rplci,S_SERVICE,0); send_req(rplci); - return false; + return FALSE; break; case S_INTERROGATE_DIVERSION: @@ -2456,7 +2456,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, sig_req(rplci,S_SERVICE,0); send_req(rplci); - return false; + return FALSE; break; case S_MWI_ACTIVATE: @@ -2472,7 +2472,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, { rplci = &a->plci[i-1]; rplci->appl = appl; - rplci->cr_enquiry=true; + rplci->cr_enquiry=TRUE; add_p(rplci,CAI,"\x01\x80"); add_p(rplci,UID,"\x06\x43\x61\x70\x69\x32\x30"); sig_req(rplci,ASSIGN,DSIG_ID); @@ -2487,7 +2487,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, else { rplci = plci; - rplci->cr_enquiry=false; + rplci->cr_enquiry=FALSE; } rplci->command = 0; @@ -2509,7 +2509,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, add_p(rplci,UID,ss_parms[10].info); /* Time */ sig_req(rplci,S_SERVICE,0); send_req(rplci); - return false; + return FALSE; case S_MWI_DEACTIVATE: if(api_parse(&parms->info[1],(word)parms->length,"wbwwss",ss_parms)) @@ -2524,7 +2524,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, { rplci = &a->plci[i-1]; rplci->appl = appl; - rplci->cr_enquiry=true; + rplci->cr_enquiry=TRUE; add_p(rplci,CAI,"\x01\x80"); add_p(rplci,UID,"\x06\x43\x61\x70\x69\x32\x30"); sig_req(rplci,ASSIGN,DSIG_ID); @@ -2539,7 +2539,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, else { rplci = plci; - rplci->cr_enquiry=false; + rplci->cr_enquiry=FALSE; } rplci->command = 0; @@ -2556,7 +2556,7 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, add_p(rplci,OAD,ss_parms[5].info); /* Controlling User Number */ sig_req(rplci,S_SERVICE,0); send_req(rplci); - return false; + return FALSE; default: Info = 0x300E; /* not supported */ @@ -2597,13 +2597,13 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, Id, Number, "wws",Info,selector,SSparms); - return false; + return FALSE; } byte facility_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) { dbug(1,dprintf("facility_res")); - return false; + return FALSE; } byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -2649,7 +2649,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc Id, Number, "w",Info); - return false; + return FALSE; } plci->requested_options_conn = 0; @@ -2684,7 +2684,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc || (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS)) { len = (byte)(&(((T30_INFO *) 0)->universal_6)); - fax_info_change = false; + fax_info_change = FALSE; if (ncpi->length >= 4) { w = GET_WORD(&ncpi->info[3]); @@ -2693,7 +2693,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc ((T30_INFO *)(plci->fax_connect_info_buffer))->resolution = (byte)((((T30_INFO *)(plci->fax_connect_info_buffer))->resolution & ~T30_RESOLUTION_R8_0770_OR_200) | ((w & 0x0001) ? T30_RESOLUTION_R8_0770_OR_200 : 0)); - fax_info_change = true; + fax_info_change = TRUE; } fax_control_bits &= ~(T30_CONTROL_BIT_REQUEST_POLLING | T30_CONTROL_BIT_MORE_DOCUMENTS); if (w & 0x0002) /* Fax-polling request */ @@ -2709,7 +2709,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc if (((byte) w) != ((T30_INFO *)(plci->fax_connect_info_buffer))->data_format) { ((T30_INFO *)(plci->fax_connect_info_buffer))->data_format = (byte) w; - fax_info_change = true; + fax_info_change = TRUE; } if ((a->man_profile.private_options & (1L << PRIVATE_FAX_SUB_SEP_PWD)) @@ -2781,13 +2781,13 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc { len = (byte)(&(((T30_INFO *) 0)->universal_6)); } - fax_info_change = true; + fax_info_change = TRUE; } if (fax_control_bits != GET_WORD(&((T30_INFO *)plci->fax_connect_info_buffer)->control_bits_low)) { PUT_WORD (&((T30_INFO *)plci->fax_connect_info_buffer)->control_bits_low, fax_control_bits); - fax_info_change = true; + fax_info_change = TRUE; } } if (Info == GOOD) @@ -2798,12 +2798,12 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc if (fax_feature_bits & T30_FEATURE_BIT_MORE_DOCUMENTS) { start_internal_command (Id, plci, fax_connect_info_command); - return false; + return FALSE; } else { start_internal_command (Id, plci, fax_adjust_b23_command); - return false; + return FALSE; } } } @@ -2820,7 +2820,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc for (w = 0; w < ncpi->length; w++) plci->internal_req_buffer[2+w] = ncpi->info[1+w]; start_internal_command (Id, plci, rtp_connect_b3_req_command); - return false; + return FALSE; } if(!Info) @@ -2837,7 +2837,7 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc Id, Number, "w",Info); - return false; + return FALSE; } byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -2909,7 +2909,7 @@ byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc plci->fax_connect_info_length = len; ((T30_INFO *)(plci->fax_connect_info_buffer))->code = 0; start_internal_command (Id, plci, fax_connect_ack_command); - return false; + return FALSE; } } @@ -2932,7 +2932,7 @@ byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc for (w = 0; w < ncpi->length; w++) plci->internal_req_buffer[2+w] = ncpi->info[1+w]; start_internal_command (Id, plci, rtp_connect_b3_res_command); - return false; + return FALSE; } else @@ -2945,14 +2945,14 @@ byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc sendf(appl,_CONNECT_B3_ACTIVE_I,Id,0,"s",""); if (plci->adjust_b_restore) { - plci->adjust_b_restore = false; + plci->adjust_b_restore = FALSE; start_internal_command (Id, plci, adjust_b_restore); } } return 1; } } - return false; + return FALSE; } byte connect_b3_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -2972,7 +2972,7 @@ byte connect_b3_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * p channel_xmit_xon (plci); } } - return false; + return FALSE; } byte disconnect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -3004,7 +3004,7 @@ byte disconnect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * { plci->send_disc = (byte)ncci; plci->command = 0; - return false; + return FALSE; } else { @@ -3028,7 +3028,7 @@ byte disconnect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * Id, Number, "w",Info); - return false; + return FALSE; } byte disconnect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -3084,7 +3084,7 @@ byte disconnect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * } } } - return false; + return FALSE; } byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -3140,7 +3140,7 @@ byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, } send_data(plci); - return false; + return FALSE; } } if (appl) @@ -3161,7 +3161,7 @@ byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, Number, "ww",GET_WORD(parms[2].info),Info); } - return false; + return FALSE; } byte data_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -3194,7 +3194,7 @@ byte data_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, } } } - return false; + return FALSE; } byte reset_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -3235,7 +3235,7 @@ byte reset_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, Id, Number, "w",Info); - return false; + return FALSE; } byte reset_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -3254,12 +3254,12 @@ byte reset_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, { a->ncci_state[ncci] = CONNECTED; nl_req_ncci(plci,N_RESET_ACK,(byte)ncci); - return true; + return TRUE; } break; } } - return false; + return FALSE; } byte connect_b3_t90_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -3292,7 +3292,7 @@ byte connect_b3_t90_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI return 1; } } - return false; + return FALSE; } @@ -3378,7 +3378,7 @@ byte select_b_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, plci->internal_command = BLOCK_PLCI; /* lock other commands */ plci->command = 0; dbug(1,dprintf("continue if codec loaded")); - return false; + return FALSE; } } } @@ -3407,12 +3407,12 @@ byte select_b_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, else if (plci->call_dir & CALL_DIR_IN) plci->call_dir = CALL_DIR_IN | CALL_DIR_ANSWER; start_internal_command (Id, plci, select_b_command); - return false; + return FALSE; } } } sendf(appl, _SELECT_B_REQ|CONFIRM, Id, Number, "w", Info); - return false; + return FALSE; } byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) @@ -3489,7 +3489,7 @@ byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * p } plci->State = LOCAL_CONNECT; - plci->manufacturer = true; + plci->manufacturer = TRUE; plci->command = _MANUFACTURER_R; plci->m_command = command; plci->number = Number; @@ -3520,7 +3520,7 @@ byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * p plci->internal_command = BLOCK_PLCI; /* reject other req meanwhile */ plci->command = 0; send_req(plci); - return false; + return FALSE; } if(dir==1) { sig_req(plci,CALL_REQ,0); @@ -3573,7 +3573,7 @@ byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * p } else if(req==LAW_REQ) { - plci->cr_enquiry = true; + plci->cr_enquiry = TRUE; } add_ss(plci,FTY,&m_parms[1]); sig_req(plci,req,0); @@ -3739,7 +3739,7 @@ byte manufacturer_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * p Id, Number, "dww",_DI_MANU_ID,command,Info); - return false; + return FALSE; } @@ -3760,7 +3760,7 @@ byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * p || (msg[1].length == 0) || (GET_DWORD(msg[0].info)!=_DI_MANU_ID)) { - return false; + return FALSE; } indication = GET_WORD(msg[1].info); switch (indication) @@ -3811,7 +3811,7 @@ byte manufacturer_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * p break; } - return false; + return FALSE; } /*------------------------------------------------------------------*/ @@ -3908,14 +3908,14 @@ void callback(ENTITY * e) plci->nl_req = 0; } if (plci->nl_req) - control_rc (plci, 0, rc, ch, 0, true); + control_rc (plci, 0, rc, ch, 0, TRUE); else { if (req == N_XON) { channel_x_on (plci, ch); if (plci->internal_command) - control_rc (plci, req, rc, ch, 0, true); + control_rc (plci, req, rc, ch, 0, TRUE); } else { @@ -3931,21 +3931,21 @@ void callback(ENTITY * e) } } channel_xmit_xon (plci); - control_rc (plci, 0, rc, ch, global_req, true); + control_rc (plci, 0, rc, ch, global_req, TRUE); } else if (plci->data_sent) { channel_xmit_xon (plci); - plci->data_sent = false; + plci->data_sent = FALSE; plci->NL.XNum = 1; data_rc (plci, ch); if (plci->internal_command) - control_rc (plci, req, rc, ch, 0, true); + control_rc (plci, req, rc, ch, 0, TRUE); } else { channel_xmit_xon (plci); - control_rc (plci, req, rc, ch, 0, true); + control_rc (plci, req, rc, ch, 0, TRUE); } } } @@ -3974,12 +3974,12 @@ void callback(ENTITY * e) if (rc != ASSIGN_OK) e->Id = 0; channel_xmit_xon (plci); - control_rc (plci, 0, rc, ch, global_req, false); + control_rc (plci, 0, rc, ch, global_req, FALSE); } else { channel_xmit_xon (plci); - control_rc (plci, req, rc, ch, 0, false); + control_rc (plci, req, rc, ch, 0, FALSE); } } /* @@ -4065,8 +4065,8 @@ void callback(ENTITY * e) if (plci->li_notify_update) { - plci->li_notify_update = false; - mixer_notify_update (plci, false); + plci->li_notify_update = FALSE; + mixer_notify_update (plci, FALSE); } } @@ -4428,7 +4428,7 @@ void control_rc(PLCI * plci, byte req, byte rc, byte ch, byte global_req, byte else { sendf(appl,_INFO_R|CONFIRM,Id&0xf,Number,"w",_WRONG_STATE); - appl->NullCREnable = false; + appl->NullCREnable = FALSE; plci_remove(plci); } } @@ -4441,7 +4441,7 @@ void control_rc(PLCI * plci, byte req, byte rc, byte ch, byte global_req, byte else { sendf(appl,_INFO_R|CONFIRM,Id&0xf,Number,"w",_WRONG_STATE); - appl->NullCREnable = false; + appl->NullCREnable = FALSE; } plci_remove(plci); } @@ -4862,7 +4862,7 @@ void sig_ind(PLCI * plci) byte CF_Ind[] = "\x09\x02\x00\x06\x00\x00\x00\x00\x00\x00"; byte Interr_Err_Ind[] = "\x0a\x02\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; byte CONF_Ind[] = "\x09\x16\x00\x06\x00\x00\0x00\0x00\0x00\0x00"; - byte force_mt_info = false; + byte force_mt_info = FALSE; byte dir; dword d; word w; @@ -4933,7 +4933,7 @@ void sig_ind(PLCI * plci) { if(plci->cr_enquiry && plci->appl) { - plci->cr_enquiry = false; + plci->cr_enquiry = FALSE; /* d = MANU_ID */ /* w = m_command */ /* b = total length */ @@ -5158,7 +5158,7 @@ void sig_ind(PLCI * plci) if(application[i].CDEnable) { if(application[i].Id) sendf(&application[i],_FACILITY_I,Id,0,"ws",3, SS_Ind); - application[i].CDEnable = false; + application[i].CDEnable = FALSE; } } break; @@ -5375,7 +5375,7 @@ void sig_ind(PLCI * plci) if(application[i].CDEnable) { if(application[i].Id) sendf(&application[i],_FACILITY_I,Id,0,"ws",3, SS_Ind); - application[i].CDEnable = false; + application[i].CDEnable = FALSE; } } break; @@ -5730,7 +5730,7 @@ void sig_ind(PLCI * plci) plci, Id, parms, - SendMultiIE(plci,Id,multi_pi_parms, PI, 0x210, true)); + SendMultiIE(plci,Id,multi_pi_parms, PI, 0x210, TRUE)); } } clear_c_ind_mask_bit (plci, MAX_APPL); @@ -6117,38 +6117,38 @@ static void SendSetupInfo(APPL * appl, PLCI * plci, dword Id, byte * * par dbug(1,dprintf("CPN ")); Info_Number = 0x0070; Info_Mask = 0x80; - Info_Sent_Flag = true; + Info_Sent_Flag = TRUE; break; case 8: /* display */ dbug(1,dprintf("display(%d)",i)); Info_Number = 0x0028; Info_Mask = 0x04; - Info_Sent_Flag = true; + Info_Sent_Flag = TRUE; break; case 16: /* Channel Id */ dbug(1,dprintf("CHI")); Info_Number = 0x0018; Info_Mask = 0x100; - Info_Sent_Flag = true; + Info_Sent_Flag = TRUE; mixer_set_bchannel_id (plci, Info_Element); break; case 19: /* Redirected Number */ dbug(1,dprintf("RDN")); Info_Number = 0x0074; Info_Mask = 0x400; - Info_Sent_Flag = true; + Info_Sent_Flag = TRUE; break; case 20: /* Redirected Number extended */ dbug(1,dprintf("RDX")); Info_Number = 0x0073; Info_Mask = 0x400; - Info_Sent_Flag = true; + Info_Sent_Flag = TRUE; break; case 22: /* Redirecing Number */ dbug(1,dprintf("RIN")); Info_Number = 0x0076; Info_Mask = 0x400; - Info_Sent_Flag = true; + Info_Sent_Flag = TRUE; break; default: Info_Number = 0; @@ -6312,7 +6312,7 @@ void SendInfo(PLCI * plci, dword Id, byte * * parms, byte iesent) && plci->adapter->Info_Mask[appl->Id-1] &Info_Mask) { dbug(1,dprintf("NCR_Ind")); - iesent=true; + iesent=TRUE; sendf(&application[j],_INFO_I,Id&0x0f,0,"wS",Info_Number,Info_Element); } } @@ -6330,7 +6330,7 @@ void SendInfo(PLCI * plci, dword Id, byte * * parms, byte iesent) if(test_c_ind_mask_bit (plci, j)) { dbug(1,dprintf("Ovl_Ind")); - iesent=true; + iesent=TRUE; sendf(&application[j],_INFO_I,Id,0,"wS",Info_Number,Info_Element); } } @@ -6340,7 +6340,7 @@ void SendInfo(PLCI * plci, dword Id, byte * * parms, byte iesent) && plci->adapter->Info_Mask[plci->appl->Id-1] &Info_Mask) { dbug(1,dprintf("Std_Ind")); - iesent=true; + iesent=TRUE; sendf(plci->appl,_INFO_I,Id,0,"wS",Info_Number,Info_Element); } } @@ -6391,7 +6391,7 @@ byte SendMultiIE(PLCI * plci, dword Id, byte * * parms, byte ie_type, dword && appl->Id && plci->adapter->Info_Mask[appl->Id-1] &Info_Mask) { - iesent = true; + iesent = TRUE; dbug(1,dprintf("Mlt_NCR_Ind")); sendf(&application[j],_INFO_I,Id&0x0f,0,"wS",Info_Number,Info_Element); } @@ -6403,7 +6403,7 @@ byte SendMultiIE(PLCI * plci, dword Id, byte * * parms, byte ie_type, dword { if(test_c_ind_mask_bit (plci, j)) { - iesent = true; + iesent = TRUE; dbug(1,dprintf("Mlt_Ovl_Ind")); sendf(&application[j],_INFO_I,Id,0,"wS",Info_Number,Info_Element); } @@ -6412,7 +6412,7 @@ byte SendMultiIE(PLCI * plci, dword Id, byte * * parms, byte ie_type, dword else if(Info_Number && plci->adapter->Info_Mask[plci->appl->Id-1] &Info_Mask) { - iesent = true; + iesent = TRUE; dbug(1,dprintf("Mlt_Std_Ind")); sendf(plci->appl,_INFO_I,Id,0,"wS",Info_Number,Info_Element); } @@ -6812,7 +6812,7 @@ void nl_ind(PLCI * plci) } if (((plci->NL.Ind & 0x0f) == N_DISC) || ((plci->NL.Ind & 0x0f) == N_DISC_ACK)) { - if (((T30_INFO *)plci->NL.RBuffer->P)->code < ARRAY_SIZE(fax_info)) + if (((T30_INFO *)plci->NL.RBuffer->P)->code < sizeof(fax_info) / sizeof(fax_info[0])) info = fax_info[((T30_INFO *)plci->NL.RBuffer->P)->code]; else info = _FAX_PROTOCOL_ERROR; @@ -6887,7 +6887,7 @@ void nl_ind(PLCI * plci) (byte)(plci->ncpi_buffer[0] + 1), plci->ncpi_buffer); plci->ncpi_state |= NCPI_NEGOTIATE_B3_SENT; if (plci->nsf_control_bits & T30_NSF_CONTROL_BIT_NEGOTIATE_RESP) - fax_send_edata_ack = false; + fax_send_edata_ack = FALSE; } if (a->manufacturer_features & MANUFACTURER_FEATURE_FAX_PAPER_FORMATS) @@ -6928,7 +6928,7 @@ void nl_ind(PLCI * plci) sendf(plci->appl,_DISCONNECT_B3_I,Id,0,"wS",GOOD,plci->ncpi_buffer); a->ncci_state[ncci] = INC_DIS_PENDING; plci->ncpi_state = 0; - fax_send_edata_ack = false; + fax_send_edata_ack = FALSE; } break; } @@ -7025,7 +7025,7 @@ void nl_ind(PLCI * plci) } if (plci->adjust_b_restore) { - plci->adjust_b_restore = false; + plci->adjust_b_restore = FALSE; start_internal_command (Id, plci, adjust_b_restore); } break; @@ -7041,7 +7041,7 @@ void nl_ind(PLCI * plci) next_internal_command (Id, plci); } ncci_state = a->ncci_state[ncci]; - ncci_remove (plci, ncci, false); + ncci_remove (plci, ncci, FALSE); /* with N_DISC or N_DISC_ACK the IDI frees the respective */ /* channel, so we cannot store the state in ncci_state! The */ @@ -7288,18 +7288,18 @@ word get_plci(DIVA_CAPI_ADAPTER * a) plci->msg_in_read_pos = MSG_IN_QUEUE_SIZE; plci->msg_in_wrap_pos = MSG_IN_QUEUE_SIZE; - plci->data_sent = false; + plci->data_sent = FALSE; plci->send_disc = 0; plci->sig_global_req = 0; plci->sig_remove_id = 0; plci->nl_global_req = 0; plci->nl_remove_id = 0; plci->adv_nl = 0; - plci->manufacturer = false; + plci->manufacturer = FALSE; plci->call_dir = CALL_DIR_OUT | CALL_DIR_ORIGINATE; plci->spoofed_msg = 0; plci->ptyState = 0; - plci->cr_enquiry = false; + plci->cr_enquiry = FALSE; plci->hangup_flow_ctrl_timer = 0; plci->ncci_ring_list = 0; @@ -7972,7 +7972,7 @@ word add_b23(PLCI * plci, API_PARSE * bp) if(!bp->length && plci->tel) { - plci->adv_nl = true; + plci->adv_nl = TRUE; dbug(1,dprintf("Default adv.Nl")); add_p(plci,LLI,lli); plci->B2_prot = 1 /*XPARENT*/; @@ -8022,7 +8022,7 @@ word add_b23(PLCI * plci, API_PARSE * bp) { if(GET_WORD(bp_parms[1].info)!=1 || GET_WORD(bp_parms[2].info)!=0) return _B2_NOT_SUPPORTED; - plci->adv_nl = true; + plci->adv_nl = TRUE; } else if(plci->tel) return _B2_NOT_SUPPORTED; @@ -8840,7 +8840,7 @@ void send_data(PLCI * plci) plci->NL.X = plci->NData; plci->NL.ReqCh = a->ncci_ch[ncci]; dbug(1,dprintf("%x:DREQ(%x:%x)",a->Id,plci->NL.Id,plci->NL.Req)); - plci->data_sent = true; + plci->data_sent = TRUE; plci->data_sent_ptr = data->P; a->request(&plci->NL); } @@ -8995,10 +8995,10 @@ void IndParse(PLCI * plci, word * parms_id, byte ** parms, byte multiIEsize) byte ie_compare(byte * ie1, byte * ie2) { word i; - if(!ie1 || ! ie2) return false; - if(!ie1[0]) return false; - for(i=0;i<(word)(ie1[0]+1);i++) if(ie1[i]!=ie2[i]) return false; - return true; + if(!ie1 || ! ie2) return FALSE; + if(!ie1[0]) return FALSE; + for(i=0;i<(word)(ie1[0]+1);i++) if(ie1[i]!=ie2[i]) return FALSE; + return TRUE; } word find_cip(DIVA_CAPI_ADAPTER * a, byte * bc, byte * hlc) @@ -9151,7 +9151,7 @@ word AdvCodecSupport(DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, byte ho plci->tel=ADV_VOICE; } a->AdvSignalAppl = appl; - a->AdvCodecFLAG = true; + a->AdvCodecFLAG = TRUE; a->AdvCodecPLCI = splci; add_p(splci,CAI,"\x01\x15"); add_p(splci,LLI,"\x01\x00"); @@ -9183,7 +9183,7 @@ word AdvCodecSupport(DIVA_CAPI_ADAPTER *a, PLCI *plci, APPL *appl, byte ho add_p(splci,UID,"\x06\x43\x61\x70\x69\x32\x30"); sig_req(splci,ASSIGN,0xC0); /* 0xc0 is the TEL_ID */ send_req(splci); - a->scom_appl_disable = true; + a->scom_appl_disable = TRUE; } else{ return 0x2001; /* wrong state, no more plcis */ @@ -9411,7 +9411,7 @@ word CapiRelease(word Id) } if(a->AdvSignalAppl==this) { - this->NullCREnable = false; + this->NullCREnable = FALSE; if (a->AdvCodecPLCI) { plci_remove(a->AdvCodecPLCI); @@ -9433,7 +9433,7 @@ word CapiRelease(word Id) static word plci_remove_check(PLCI *plci) { - if(!plci) return true; + if(!plci) return TRUE; if(!plci->NL.Id && c_ind_mask_empty (plci)) { if(plci->Sig.Id == 0xff) @@ -9446,7 +9446,7 @@ static word plci_remove_check(PLCI *plci) { CodecIdCheck(plci->adapter, plci); clear_b1_config (plci); - ncci_remove (plci, 0, false); + ncci_remove (plci, 0, FALSE); plci_free_msg_in_queue (plci); channel_flow_control_remove (plci); plci->Id = 0; @@ -9456,10 +9456,10 @@ static word plci_remove_check(PLCI *plci) plci->notifiedcall = 0; } listen_check(plci->adapter); - return true; + return TRUE; } } - return false; + return FALSE; } @@ -9564,7 +9564,7 @@ static struct }; -#define DTMF_DIGIT_MAP_ENTRIES ARRAY_SIZE(dtmf_digit_map) +#define DTMF_DIGIT_MAP_ENTRIES (sizeof(dtmf_digit_map) / sizeof(dtmf_digit_map[0])) static void dtmf_enable_receiver (PLCI *plci, byte enable_mask) @@ -9815,7 +9815,7 @@ static void dtmf_command (dword Id, PLCI *plci, byte Rc) } plci->dtmf_rec_active &= ~mask; plci->internal_command = DTMF_COMMAND_2; - dtmf_enable_receiver (plci, false); + dtmf_enable_receiver (plci, FALSE); return; } Rc = OK; @@ -10020,7 +10020,7 @@ static byte dtmf_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI } } start_internal_command (Id, plci, dtmf_command); - return (false); + return (FALSE); case DTMF_SEND_TONE: @@ -10069,7 +10069,8 @@ static byte dtmf_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI PUT_WORD (&result[1], DTMF_INCORRECT_DIGIT); break; } - if (plci->dtmf_send_requests >= ARRAY_SIZE(plci->dtmf_msg_number_queue)) + if (plci->dtmf_send_requests >= + sizeof(plci->dtmf_msg_number_queue) / sizeof(plci->dtmf_msg_number_queue[0])) { dbug (1, dprintf ("[%06lx] %s,%d: DTMF request overrun", UnMapId (Id), (char *)(FILE_), __LINE__)); @@ -10078,7 +10079,7 @@ static byte dtmf_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI } api_save_msg (dtmf_parms, "wwws", &plci->saved_msg); start_internal_command (Id, plci, dtmf_command); - return (false); + return (FALSE); default: dbug (1, dprintf ("[%06lx] %s,%d: DTMF unknown request %04x", @@ -10089,7 +10090,7 @@ static byte dtmf_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI } sendf (appl, _FACILITY_R | CONFIRM, Id & 0xffffL, Number, "wws", Info, SELECTOR_DTMF, result); - return (false); + return (FALSE); } @@ -10841,10 +10842,10 @@ static struct byte to_pc; } xconnect_write_prog[] = { - { LI_COEF_CH_CH, false, false }, - { LI_COEF_CH_PC, false, true }, - { LI_COEF_PC_CH, true, false }, - { LI_COEF_PC_PC, true, true } + { LI_COEF_CH_CH, FALSE, FALSE }, + { LI_COEF_CH_PC, FALSE, TRUE }, + { LI_COEF_PC_CH, TRUE, FALSE }, + { LI_COEF_PC_PC, TRUE, TRUE } }; @@ -10915,7 +10916,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) { dbug (1, dprintf ("[%06x] %s,%d: Channel id wiped out", UnMapId (Id), (char *)(FILE_), __LINE__)); - return (true); + return (TRUE); } i = a->li_base + (plci->li_bchannel_id - 1); j = plci->li_write_channel; @@ -10926,7 +10927,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) { dbug (1, dprintf ("[%06lx] %s,%d: LI write coefs failed %02x", UnMapId (Id), (char *)(FILE_), __LINE__, Rc)); - return (false); + return (FALSE); } } if (li_config_table[i].adapter->manufacturer_features & MANUFACTURER_FEATURE_XCONNECT) @@ -10968,7 +10969,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) { plci->internal_command = plci->li_write_command; if (plci_nl_busy (plci)) - return (true); + return (TRUE); to_ch = (a->li_pri) ? plci->li_bchannel_id - 1 : 0; *(p++) = UDATA_REQUEST_XCONNECT_TO; do @@ -11017,9 +11018,9 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) li_config_table[i].coef_table[j] ^= xconnect_write_prog[n].mask << 4; } n++; - } while ((n < ARRAY_SIZE(xconnect_write_prog)) + } while ((n < sizeof(xconnect_write_prog) / sizeof(xconnect_write_prog[0])) && ((p - plci->internal_req_buffer) + 16 < INTERNAL_REQ_BUFFER_SIZE)); - if (n == ARRAY_SIZE(xconnect_write_prog)) + if (n == sizeof(xconnect_write_prog) / sizeof(xconnect_write_prog[0])) { do { @@ -11049,7 +11050,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) { plci->internal_command = plci->li_write_command; if (plci_nl_busy (plci)) - return (true); + return (TRUE); if (a->li_pri) { *(p++) = UDATA_REQUEST_SET_MIXER_COEFS_PRI_SYNC; @@ -11089,7 +11090,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) ch_map[j+1] = (byte)(j+1); } } - for (n = 0; n < ARRAY_SIZE(mixer_write_prog_bri); n++) + for (n = 0; n < sizeof(mixer_write_prog_bri) / sizeof(mixer_write_prog_bri[0]); n++) { i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch]; j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch]; @@ -11126,7 +11127,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) { plci->internal_command = plci->li_write_command; if (plci_nl_busy (plci)) - return (true); + return (TRUE); if (j < a->li_base) j = a->li_base; if (a->li_pri) @@ -11139,7 +11140,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) w |= MIXER_FEATURE_ENABLE_RX_DATA; *(p++) = (byte) w; *(p++) = (byte)(w >> 8); - for (n = 0; n < ARRAY_SIZE(mixer_write_prog_pri); n++) + for (n = 0; n < sizeof(mixer_write_prog_pri) / sizeof(mixer_write_prog_pri[0]); n++) { *(p++) = (byte)((plci->li_bchannel_id - 1) | mixer_write_prog_pri[n].line_flags); for (j = a->li_base; j < a->li_base + MIXER_CHANNELS_PRI; j++) @@ -11195,7 +11196,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) ch_map[j+1] = (byte)(j+1); } } - for (n = 0; n < ARRAY_SIZE(mixer_write_prog_bri); n++) + for (n = 0; n < sizeof(mixer_write_prog_bri) / sizeof(mixer_write_prog_bri[0]); n++) { i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch]; j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch]; @@ -11231,7 +11232,7 @@ static byte xconnect_write_coefs_process (dword Id, PLCI *plci, byte Rc) plci->NL.Req = plci->nl_req = (byte) N_UDATA; plci->adapter->request (&plci->NL); } - return (true); + return (TRUE); } @@ -11250,7 +11251,7 @@ static void mixer_notify_update (PLCI *plci, byte others) if (a->profile.Global_Options & GL_LINE_INTERCONNECT_SUPPORTED) { if (others) - plci->li_notify_update = true; + plci->li_notify_update = TRUE; i = 0; do { @@ -11276,7 +11277,7 @@ static void mixer_notify_update (PLCI *plci, byte others) && (notify_plci->State) && notify_plci->NL.Id && !notify_plci->nl_remove_id) { - notify_plci->li_notify_update = true; + notify_plci->li_notify_update = TRUE; ((CAPI_MSG *) msg)->header.length = 18; ((CAPI_MSG *) msg)->header.appl_id = notify_plci->appl->Id; ((CAPI_MSG *) msg)->header.command = _FACILITY_R; @@ -11298,12 +11299,12 @@ static void mixer_notify_update (PLCI *plci, byte others) (char *)(FILE_), __LINE__, (dword)((notify_plci->Id << 8) | UnMapController (notify_plci->adapter->Id)), w)); } - notify_plci->li_notify_update = false; + notify_plci->li_notify_update = FALSE; } } } while (others && (notify_plci != NULL)); if (others) - plci->li_notify_update = false; + plci->li_notify_update = FALSE; } } @@ -11317,7 +11318,7 @@ static void mixer_clear_config (PLCI *plci) (dword)((plci->Id << 8) | UnMapController (plci->adapter->Id)), (char *)(FILE_), __LINE__)); - plci->li_notify_update = false; + plci->li_notify_update = FALSE; plci->li_plci_b_write_pos = 0; plci->li_plci_b_read_pos = 0; plci->li_plci_b_req_pos = 0; @@ -12158,7 +12159,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI plci_b = li_check_plci_b (Id, plci, plci_b_id, plci_b_write_pos, &result[8]); if (plci_b == NULL) break; - li_update_connect (Id, a, plci, plci_b_id, true, li_flags); + li_update_connect (Id, a, plci, plci_b_id, TRUE, li_flags); plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_LAST_FLAG; plci_b_write_pos = (plci_b_write_pos == LI_PLCI_B_QUEUE_ENTRIES-1) ? 0 : plci_b_write_pos + 1; plci->li_plci_b_write_pos = plci_b_write_pos; @@ -12187,7 +12188,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI plci_b_write_pos = plci->li_plci_b_write_pos; participant_parms_pos = 0; result_pos = 7; - li2_update_connect (Id, a, plci, UnMapId (Id), true, li_flags); + li2_update_connect (Id, a, plci, UnMapId (Id), TRUE, li_flags); while (participant_parms_pos < li_req_parms[1].length) { result[result_pos] = 6; @@ -12223,7 +12224,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI plci_b = li2_check_plci_b (Id, plci, plci_b_id, plci_b_write_pos, &result[result_pos - 2]); if (plci_b != NULL) { - li2_update_connect (Id, a, plci, plci_b_id, true, li_flags); + li2_update_connect (Id, a, plci, plci_b_id, TRUE, li_flags); plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | ((li_flags & (LI2_FLAG_INTERCONNECT_A_B | LI2_FLAG_INTERCONNECT_B_A | LI2_FLAG_PCCONNECT_A_B | LI2_FLAG_PCCONNECT_B_A)) ? 0 : LI_PLCI_B_DISC_FLAG); @@ -12248,13 +12249,13 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI } mixer_calculate_coefs (a); plci->li_channel_bits = li_config_table[a->li_base + (plci->li_bchannel_id - 1)].channel; - mixer_notify_update (plci, true); + mixer_notify_update (plci, TRUE); sendf (appl, _FACILITY_R | CONFIRM, Id & 0xffffL, Number, "wwS", Info, SELECTOR_LINE_INTERCONNECT, result); plci->command = 0; plci->li_cmd = GET_WORD (li_parms[0].info); start_internal_command (Id, plci, mixer_command); - return (false); + return (FALSE); case LI_REQ_DISCONNECT: if (li_parms[1].length == 4) @@ -12282,7 +12283,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI plci_b = li_check_plci_b (Id, plci, plci_b_id, plci_b_write_pos, &result[8]); if (plci_b == NULL) break; - li_update_connect (Id, a, plci, plci_b_id, false, 0); + li_update_connect (Id, a, plci, plci_b_id, FALSE, 0); plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_DISC_FLAG | LI_PLCI_B_LAST_FLAG; plci_b_write_pos = (plci_b_write_pos == LI_PLCI_B_QUEUE_ENTRIES-1) ? 0 : plci_b_write_pos + 1; plci->li_plci_b_write_pos = plci_b_write_pos; @@ -12344,7 +12345,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI plci_b = li2_check_plci_b (Id, plci, plci_b_id, plci_b_write_pos, &result[result_pos - 2]); if (plci_b != NULL) { - li2_update_connect (Id, a, plci, plci_b_id, false, 0); + li2_update_connect (Id, a, plci, plci_b_id, FALSE, 0); plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_DISC_FLAG; plci_b_write_pos = (plci_b_write_pos == LI_PLCI_B_QUEUE_ENTRIES-1) ? 0 : plci_b_write_pos + 1; } @@ -12367,13 +12368,13 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI } mixer_calculate_coefs (a); plci->li_channel_bits = li_config_table[a->li_base + (plci->li_bchannel_id - 1)].channel; - mixer_notify_update (plci, true); + mixer_notify_update (plci, TRUE); sendf (appl, _FACILITY_R | CONFIRM, Id & 0xffffL, Number, "wwS", Info, SELECTOR_LINE_INTERCONNECT, result); plci->command = 0; plci->li_cmd = GET_WORD (li_parms[0].info); start_internal_command (Id, plci, mixer_command); - return (false); + return (FALSE); case LI_REQ_SILENT_UPDATE: if (!plci || !plci->State @@ -12383,7 +12384,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI { dbug (1, dprintf ("[%06lx] %s,%d: Wrong state", UnMapId (Id), (char *)(FILE_), __LINE__)); - return (false); + return (FALSE); } plci_b_write_pos = plci->li_plci_b_write_pos; if (((plci->li_plci_b_read_pos > plci_b_write_pos) ? plci->li_plci_b_read_pos : @@ -12391,7 +12392,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI { dbug (1, dprintf ("[%06lx] %s,%d: LI request overrun", UnMapId (Id), (char *)(FILE_), __LINE__)); - return (false); + return (FALSE); } i = (plci_b_write_pos == 0) ? LI_PLCI_B_QUEUE_ENTRIES-1 : plci_b_write_pos - 1; if ((plci_b_write_pos == plci->li_plci_b_read_pos) @@ -12407,7 +12408,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI plci->command = 0; plci->li_cmd = GET_WORD (li_parms[0].info); start_internal_command (Id, plci, mixer_command); - return (false); + return (FALSE); default: dbug (1, dprintf ("[%06lx] %s,%d: LI unknown request %04x", @@ -12417,7 +12418,7 @@ static byte mixer_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI } sendf (appl, _FACILITY_R | CONFIRM, Id & 0xffffL, Number, "wwS", Info, SELECTOR_LINE_INTERCONNECT, result); - return (false); + return (FALSE); } @@ -12522,7 +12523,7 @@ static void mixer_indication_xconnect_from (dword Id, PLCI *plci, byte *msg, if (!plci->internal_command) next_internal_command (Id, plci); } - mixer_notify_update (plci, true); + mixer_notify_update (plci, TRUE); } @@ -12546,12 +12547,12 @@ static byte mixer_notify_source_removed (PLCI *plci, dword plci_b_id) dbug (1, dprintf ("[%06lx] %s,%d: LI request overrun", (dword)((plci->Id << 8) | UnMapController (plci->adapter->Id)), (char *)(FILE_), __LINE__)); - return (false); + return (FALSE); } plci->li_plci_b_queue[plci_b_write_pos] = plci_b_id | LI_PLCI_B_DISC_FLAG; plci_b_write_pos = (plci_b_write_pos == LI_PLCI_B_QUEUE_ENTRIES-1) ? 0 : plci_b_write_pos + 1; plci->li_plci_b_write_pos = plci_b_write_pos; - return (true); + return (TRUE); } @@ -12595,7 +12596,7 @@ static void mixer_remove (PLCI *plci) } mixer_clear_config (plci); mixer_calculate_coefs (a); - mixer_notify_update (plci, true); + mixer_notify_update (plci, TRUE); } li_config_table[i].plci = NULL; plci->li_bchannel_id = 0; @@ -12882,29 +12883,29 @@ static byte ec_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *p case EC_ENABLE_OPERATION: plci->ec_idi_options &= ~LEC_FREEZE_COEFFICIENTS; start_internal_command (Id, plci, ec_command); - return (false); + return (FALSE); case EC_DISABLE_OPERATION: plci->ec_idi_options = LEC_ENABLE_ECHO_CANCELLER | LEC_MANUAL_DISABLE | LEC_ENABLE_NONLINEAR_PROCESSING | LEC_RESET_COEFFICIENTS; start_internal_command (Id, plci, ec_command); - return (false); + return (FALSE); case EC_FREEZE_COEFFICIENTS: plci->ec_idi_options |= LEC_FREEZE_COEFFICIENTS; start_internal_command (Id, plci, ec_command); - return (false); + return (FALSE); case EC_RESUME_COEFFICIENT_UPDATE: plci->ec_idi_options &= ~LEC_FREEZE_COEFFICIENTS; start_internal_command (Id, plci, ec_command); - return (false); + return (FALSE); case EC_RESET_COEFFICIENTS: plci->ec_idi_options |= LEC_RESET_COEFFICIENTS; start_internal_command (Id, plci, ec_command); - return (false); + return (FALSE); default: dbug (1, dprintf ("[%06lx] %s,%d: EC unknown request %04x", @@ -12977,14 +12978,14 @@ static byte ec_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *p case EC_ENABLE_OPERATION: plci->ec_idi_options &= ~LEC_FREEZE_COEFFICIENTS; start_internal_command (Id, plci, ec_command); - return (false); + return (FALSE); case EC_DISABLE_OPERATION: plci->ec_idi_options = LEC_ENABLE_ECHO_CANCELLER | LEC_MANUAL_DISABLE | LEC_ENABLE_NONLINEAR_PROCESSING | LEC_RESET_COEFFICIENTS; start_internal_command (Id, plci, ec_command); - return (false); + return (FALSE); default: dbug (1, dprintf ("[%06lx] %s,%d: EC unknown request %04x", @@ -12998,7 +12999,7 @@ static byte ec_request (dword Id, word Number, DIVA_CAPI_ADAPTER *a, PLCI *p sendf (appl, _FACILITY_R | CONFIRM, Id & 0xffffL, Number, "wws", Info, (appl->appl_flags & APPL_FLAG_PRIV_EC_SPEC) ? PRIV_SELECTOR_ECHO_CANCELLER : SELECTOR_ECHO_CANCELLER, result); - return (false); + return (FALSE); } @@ -13177,7 +13178,7 @@ static void adv_voice_write_coefs (PLCI *plci, word write_command) ch_map[j] = (byte)(j + (plci->li_bchannel_id - 1)); ch_map[j+1] = (byte)(j + (2 - plci->li_bchannel_id)); } - for (n = 0; n < ARRAY_SIZE(mixer_write_prog_bri); n++) + for (n = 0; n < sizeof(mixer_write_prog_bri) / sizeof(mixer_write_prog_bri[0]); n++) { i = a->li_base + ch_map[mixer_write_prog_bri[n].to_ch]; j = a->li_base + ch_map[mixer_write_prog_bri[n].from_ch]; @@ -13562,7 +13563,7 @@ static void adjust_b_clear (PLCI *plci) (dword)((plci->Id << 8) | UnMapController (plci->adapter->Id)), (char *)(FILE_), __LINE__)); - plci->adjust_b_restore = false; + plci->adjust_b_restore = FALSE; } @@ -13831,7 +13832,7 @@ static word adjust_b_process (dword Id, PLCI *plci, byte Rc) } if (plci->adjust_b_mode & ADJUST_B_MODE_USER_CONNECT) { - plci->adjust_b_restore = true; + plci->adjust_b_restore = TRUE; break; } plci->adjust_b_state = ADJUST_B_CONNECT_1; @@ -14602,7 +14603,7 @@ static void channel_request_xon (PLCI * plci, byte ch) { static void channel_xmit_extended_xon (PLCI * plci) { DIVA_CAPI_ADAPTER * a; - int max_ch = ARRAY_SIZE(a->ch_flow_control); + int max_ch = sizeof(a->ch_flow_control)/sizeof(a->ch_flow_control[0]); int i, one_requested = 0; if ((!plci) || (!plci->Id) || ((a = plci->adapter) == 0)) { @@ -14627,7 +14628,7 @@ static void channel_xmit_extended_xon (PLCI * plci) { Try to xmit next X_ON */ static int find_channel_with_pending_x_on (DIVA_CAPI_ADAPTER * a, PLCI * plci) { - int max_ch = ARRAY_SIZE(a->ch_flow_control); + int max_ch = sizeof(a->ch_flow_control)/sizeof(a->ch_flow_control[0]); int i; if (!(plci->adapter->manufacturer_features & MANUFACTURER_FEATURE_XONOFF_FLOW_CONTROL)) { @@ -14767,19 +14768,19 @@ static void group_optimization(DIVA_CAPI_ADAPTER * a, PLCI * plci) { if(application[i].Id && a->CIP_Mask[i] ) { - for(k=0,busy=false; kmax_plci; k++) + for(k=0,busy=FALSE; kmax_plci; k++) { if(a->plci[k].Id) { auxplci = &a->plci[k]; if(auxplci->appl == &application[i]) /* application has a busy PLCI */ { - busy = true; + busy = TRUE; dbug(1,dprintf("Appl 0x%x is busy",i+1)); } else if(test_c_ind_mask_bit (auxplci, i)) /* application has an incoming call pending */ { - busy = true; + busy = TRUE; dbug(1,dprintf("Appl 0x%x has inc. call pending",i+1)); } } @@ -14790,13 +14791,13 @@ static void group_optimization(DIVA_CAPI_ADAPTER * a, PLCI * plci) if(j==MAX_CIP_TYPES) /* all groups are in use but group still not found */ { /* the MAX_CIP_TYPES group enables all calls because of field overflow */ appl_number_group_type[i] = MAX_CIP_TYPES; - group_found=true; + group_found=TRUE; dbug(1,dprintf("Field overflow appl 0x%x",i+1)); } else if( (info_mask_group[j]==a->CIP_Mask[i]) && (cip_mask_group[j]==a->Info_Mask[i]) ) { /* is group already present ? */ appl_number_group_type[i] = j|0x80; /* store the group number for each application */ - group_found=true; + group_found=TRUE; dbug(1,dprintf("Group 0x%x found with appl 0x%x, CIP=0x%lx",appl_number_group_type[i],i+1,info_mask_group[j])); } else if(!info_mask_group[j]) @@ -14804,7 +14805,7 @@ static void group_optimization(DIVA_CAPI_ADAPTER * a, PLCI * plci) appl_number_group_type[i] = j|0x80; /* store the group number for each application */ info_mask_group[j] = a->CIP_Mask[i]; /* store the new CIP mask for the new group */ cip_mask_group[j] = a->Info_Mask[i]; /* store the new Info_Mask for this new group */ - group_found=true; + group_found=TRUE; dbug(1,dprintf("New Group 0x%x established with appl 0x%x, CIP=0x%lx",appl_number_group_type[i],i+1,info_mask_group[j])); } } @@ -14859,7 +14860,7 @@ word CapiRegister(word id) } } - if(appls_found) return true; + if(appls_found) return TRUE; for(i=0; iInitialized = true; + IoAdapter->Initialized = TRUE; /* Check Interrupt @@ -504,7 +504,7 @@ diva_pri_start_adapter(PISDN_ADAPTER IoAdapter, if (!IoAdapter->IrqCount) { DBG_ERR(("A: A(%d) interrupt test failed", IoAdapter->ANum)) - IoAdapter->Initialized = false; + IoAdapter->Initialized = FALSE; IoAdapter->stop(IoAdapter); return (-1); } diff --git a/trunk/drivers/isdn/hardware/eicon/platform.h b/trunk/drivers/isdn/hardware/eicon/platform.h index ff09f07f440a..2444811e0b38 100644 --- a/trunk/drivers/isdn/hardware/eicon/platform.h +++ b/trunk/drivers/isdn/hardware/eicon/platform.h @@ -71,6 +71,14 @@ #define qword u64 #endif +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + #ifndef NULL #define NULL ((void *) 0) #endif @@ -123,6 +131,10 @@ #define DIVA_OS_MEM_DETACH_CONFIG(a, x) do { } while(0) #define DIVA_OS_MEM_DETACH_CONTROL(a, x) do { } while(0) +#if !defined(DIM) +#define DIM(array) (sizeof (array)/sizeof ((array)[0])) +#endif + #define DIVA_INVALID_FILE_HANDLE ((dword)(-1)) #define DIVAS_CONTAINING_RECORD(address, type, field) \ diff --git a/trunk/drivers/isdn/hisax/Kconfig b/trunk/drivers/isdn/hisax/Kconfig index 12d91fb9f8cb..34ab5f7dcabc 100644 --- a/trunk/drivers/isdn/hisax/Kconfig +++ b/trunk/drivers/isdn/hisax/Kconfig @@ -340,6 +340,8 @@ config HISAX_HFC_SX This enables HiSax support for the HFC-S+, HFC-SP and HFC-PCMCIA cards. This code is not finished yet. +# bool ' TESTEMULATOR (EXPERIMENTAL)' CONFIG_HISAX_TESTEMU + config HISAX_ENTERNOW_PCI bool "Formula-n enter:now PCI card" depends on HISAX_NETJET && PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS && !CPU_LITTLE_ENDIAN) || FRV)) diff --git a/trunk/drivers/isdn/hisax/Makefile b/trunk/drivers/isdn/hisax/Makefile index c7a3794bdae4..293e27789d54 100644 --- a/trunk/drivers/isdn/hisax/Makefile +++ b/trunk/drivers/isdn/hisax/Makefile @@ -60,4 +60,5 @@ hisax-$(CONFIG_HISAX_SCT_QUADRO) += bkm_a8.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_GAZEL) += gazel.o isac.o arcofi.o hscx.o hisax-$(CONFIG_HISAX_W6692) += w6692.o hisax-$(CONFIG_HISAX_ENTERNOW_PCI) += enternow_pci.o amd7930_fn.o +#hisax-$(CONFIG_HISAX_TESTEMU) += testemu.o diff --git a/trunk/drivers/isdn/hisax/config.c b/trunk/drivers/isdn/hisax/config.c index da4196f21e0f..17ec0b70ba1d 100644 --- a/trunk/drivers/isdn/hisax/config.c +++ b/trunk/drivers/isdn/hisax/config.c @@ -549,6 +549,10 @@ extern int setup_isurf(struct IsdnCard *card); extern int setup_saphir(struct IsdnCard *card); #endif +#if CARD_TESTEMU +extern int setup_testemu(struct IsdnCard *card); +#endif + #if CARD_BKM_A4T extern int setup_bkm_a4t(struct IsdnCard *card); #endif @@ -1057,6 +1061,11 @@ static int checkcard(int cardnr, char *id, int *busy_flag, struct module *lockow ret = setup_saphir(card); break; #endif +#if CARD_TESTEMU + case ISDN_CTYPE_TESTEMU: + ret = setup_testemu(card); + break; +#endif #if CARD_BKM_A4T case ISDN_CTYPE_BKM_A4T: ret = setup_bkm_a4t(card); @@ -1872,7 +1881,7 @@ static struct pci_device_id hisax_pci_tbl[] __devinitdata = { {PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_DJINN_ITOO, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_OLITEC, PCI_ANY_ID, PCI_ANY_ID}, #endif -#ifdef CONFIG_HISAX_SCT_QUADRO +#ifdef CONFIG_HISAX_QUADRO {PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_ANY_ID, PCI_ANY_ID}, #endif #ifdef CONFIG_HISAX_NICCY diff --git a/trunk/drivers/isdn/hisax/elsa_ser.c b/trunk/drivers/isdn/hisax/elsa_ser.c index ae377e812775..0279fb323cb1 100644 --- a/trunk/drivers/isdn/hisax/elsa_ser.c +++ b/trunk/drivers/isdn/hisax/elsa_ser.c @@ -58,7 +58,7 @@ static inline unsigned int serial_in(struct IsdnCardState *cs, int offset) static inline unsigned int serial_inp(struct IsdnCardState *cs, int offset) { #ifdef SERIAL_DEBUG_REG -#ifdef ELSA_SERIAL_NOPAUSE_IO +#ifdef CONFIG_SERIAL_NOPAUSE_IO u_int val = inb(cs->hw.elsa.base + 8 + offset); debugl1(cs,"inp %s %02x",ModemIn[offset], val); #else @@ -67,7 +67,7 @@ static inline unsigned int serial_inp(struct IsdnCardState *cs, int offset) #endif return(val); #else -#ifdef ELSA_SERIAL_NOPAUSE_IO +#ifdef CONFIG_SERIAL_NOPAUSE_IO return inb(cs->hw.elsa.base + 8 + offset); #else return inb_p(cs->hw.elsa.base + 8 + offset); @@ -87,13 +87,13 @@ static inline void serial_outp(struct IsdnCardState *cs, int offset, int value) { #ifdef SERIAL_DEBUG_REG -#ifdef ELSA_SERIAL_NOPAUSE_IO +#ifdef CONFIG_SERIAL_NOPAUSE_IO debugl1(cs,"outp %s %02x",ModemOut[offset], value); #else debugl1(cs,"outP %s %02x",ModemOut[offset], value); #endif #endif -#ifdef ELSA_SERIAL_NOPAUSE_IO +#ifdef CONFIG_SERIAL_NOPAUSE_IO outb(value, cs->hw.elsa.base + 8 + offset); #else outb_p(value, cs->hw.elsa.base + 8 + offset); diff --git a/trunk/drivers/isdn/hisax/hfc4s8s_l1.c b/trunk/drivers/isdn/hisax/hfc4s8s_l1.c index ab98e135bcbb..a2fa4ecb8c88 100644 --- a/trunk/drivers/isdn/hisax/hfc4s8s_l1.c +++ b/trunk/drivers/isdn/hisax/hfc4s8s_l1.c @@ -199,7 +199,7 @@ typedef struct _hfc4s8s_hw { /***************************/ /* inline function defines */ /***************************/ -#ifdef HISAX_HFC4S8S_PCIMEM /* inline functions memory mapped */ +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM /* inline functions mempry mapped */ /* memory write and dummy IO read to avoid PCI byte merge problems */ #define Write_hfc8(a,b,c) {(*((volatile u_char *)(a->membase+b)) = c); inb(a->iobase+4);} @@ -305,7 +305,7 @@ wait_busy(hfc4s8s_hw * a) #define PCI_ENA_REGIO 0x01 -#endif /* HISAX_HFC4S8S_PCIMEM */ +#endif /* CONFIG_HISAX_HFC4S8S_PCIMEM */ /******************************************************/ /* function to read critical counter registers that */ @@ -724,12 +724,12 @@ rx_d_frame(struct hfc4s8s_l1 *l1p, int ech) } else { /* read errornous D frame */ -#ifndef HISAX_HFC4S8S_PCIMEM +#ifndef CONFIG_HISAX_HFC4S8S_PCIMEM SetRegAddr(l1p->hw, A_FIFO_DATA0); #endif while (z1 >= 4) { -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM Read_hfc32(l1p->hw, A_FIFO_DATA0); #else fRead_hfc32(l1p->hw); @@ -738,7 +738,7 @@ rx_d_frame(struct hfc4s8s_l1 *l1p, int ech) } while (z1--) -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM Read_hfc8(l1p->hw, A_FIFO_DATA0); #else fRead_hfc8(l1p->hw); @@ -752,12 +752,12 @@ rx_d_frame(struct hfc4s8s_l1 *l1p, int ech) cp = skb->data; -#ifndef HISAX_HFC4S8S_PCIMEM +#ifndef CONFIG_HISAX_HFC4S8S_PCIMEM SetRegAddr(l1p->hw, A_FIFO_DATA0); #endif while (z1 >= 4) { -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM *((unsigned long *) cp) = Read_hfc32(l1p->hw, A_FIFO_DATA0); #else @@ -768,7 +768,7 @@ rx_d_frame(struct hfc4s8s_l1 *l1p, int ech) } while (z1--) -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM *cp++ = Read_hfc8(l1p->hw, A_FIFO_DATA0); #else *cp++ = fRead_hfc8(l1p->hw); @@ -858,12 +858,12 @@ rx_b_frame(struct hfc4s8s_btype *bch) wait_busy(l1->hw); return; } -#ifndef HISAX_HFC4S8S_PCIMEM +#ifndef CONFIG_HISAX_HFC4S8S_PCIMEM SetRegAddr(l1->hw, A_FIFO_DATA0); #endif while (z1 >= 4) { -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM *((unsigned long *) bch->rx_ptr) = Read_hfc32(l1->hw, A_FIFO_DATA0); #else @@ -875,7 +875,7 @@ rx_b_frame(struct hfc4s8s_btype *bch) } while (z1--) -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM *(bch->rx_ptr++) = Read_hfc8(l1->hw, A_FIFO_DATA0); #else *(bch->rx_ptr++) = fRead_hfc8(l1->hw); @@ -939,12 +939,12 @@ tx_d_frame(struct hfc4s8s_l1 *l1p) if ((skb = skb_dequeue(&l1p->d_tx_queue))) { cp = skb->data; cnt = skb->len; -#ifndef HISAX_HFC4S8S_PCIMEM +#ifndef CONFIG_HISAX_HFC4S8S_PCIMEM SetRegAddr(l1p->hw, A_FIFO_DATA0); #endif while (cnt >= 4) { -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM fWrite_hfc32(l1p->hw, A_FIFO_DATA0, *(unsigned long *) cp); #else @@ -955,7 +955,7 @@ tx_d_frame(struct hfc4s8s_l1 *l1p) cnt -= 4; } -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM while (cnt--) fWrite_hfc8(l1p->hw, A_FIFO_DATA0, *cp++); #else @@ -1036,11 +1036,11 @@ tx_b_frame(struct hfc4s8s_btype *bch) cp = skb->data + bch->tx_cnt; bch->tx_cnt += cnt; -#ifndef HISAX_HFC4S8S_PCIMEM +#ifndef CONFIG_HISAX_HFC4S8S_PCIMEM SetRegAddr(l1->hw, A_FIFO_DATA0); #endif while (cnt >= 4) { -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM fWrite_hfc32(l1->hw, A_FIFO_DATA0, *(unsigned long *) cp); #else @@ -1051,7 +1051,7 @@ tx_b_frame(struct hfc4s8s_btype *bch) } while (cnt--) -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM fWrite_hfc8(l1->hw, A_FIFO_DATA0, *cp++); #else fWrite_hfc8(l1->hw, *cp++); @@ -1280,7 +1280,7 @@ hfc4s8s_interrupt(int intno, void *dev_id) if (!hw || !(hw->mr.r_irq_ctrl & M_GLOB_IRQ_EN)) return IRQ_NONE; -#ifndef HISAX_HFC4S8S_PCIMEM +#ifndef CONFIG_HISAX_HFC4S8S_PCIMEM /* read current selected regsister */ old_ioreg = GetRegAddr(hw); #endif @@ -1291,7 +1291,7 @@ hfc4s8s_interrupt(int intno, void *dev_id) if (! (b = (Read_hfc8(hw, R_STATUS) & (M_MISC_IRQSTA | M_FR_IRQSTA))) && !hw->mr.r_irq_statech) { -#ifndef HISAX_HFC4S8S_PCIMEM +#ifndef CONFIG_HISAX_HFC4S8S_PCIMEM SetRegAddr(hw, old_ioreg); #endif return IRQ_NONE; @@ -1321,7 +1321,7 @@ hfc4s8s_interrupt(int intno, void *dev_id) /* queue the request to allow other cards to interrupt */ schedule_work(&hw->tqueue); -#ifndef HISAX_HFC4S8S_PCIMEM +#ifndef CONFIG_HISAX_HFC4S8S_PCIMEM SetRegAddr(hw, old_ioreg); #endif return IRQ_HANDLED; @@ -1470,7 +1470,7 @@ static void release_pci_ports(hfc4s8s_hw * hw) { pci_write_config_word(hw->pdev, PCI_COMMAND, 0); -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM if (hw->membase) iounmap((void *) hw->membase); #else @@ -1485,7 +1485,7 @@ release_pci_ports(hfc4s8s_hw * hw) static void enable_pci_ports(hfc4s8s_hw * hw) { -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM pci_write_config_word(hw->pdev, PCI_COMMAND, PCI_ENA_MEMIO); #else pci_write_config_word(hw->pdev, PCI_COMMAND, PCI_ENA_REGIO); @@ -1560,7 +1560,7 @@ setup_instance(hfc4s8s_hw * hw) hw->irq); goto out; } -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM printk(KERN_INFO "HFC-4S/8S: found PCI card at membase 0x%p, irq %d\n", hw->hw_membase, hw->irq); @@ -1613,7 +1613,7 @@ hfc4s8s_probe(struct pci_dev *pdev, const struct pci_device_id *ent) hw->irq = pdev->irq; hw->iobase = pci_resource_start(pdev, 0); -#ifdef HISAX_HFC4S8S_PCIMEM +#ifdef CONFIG_HISAX_HFC4S8S_PCIMEM hw->hw_membase = (u_char *) pci_resource_start(pdev, 1); hw->membase = ioremap((ulong) hw->hw_membase, 256); #else diff --git a/trunk/drivers/isdn/hisax/hfc_usb.c b/trunk/drivers/isdn/hisax/hfc_usb.c index 42bbae2a646c..5a6989f23fcf 100644 --- a/trunk/drivers/isdn/hisax/hfc_usb.c +++ b/trunk/drivers/isdn/hisax/hfc_usb.c @@ -183,7 +183,7 @@ typedef struct hfcusb_data { int vend_idx; /* vendor found */ int b_mode[2]; /* B-channel mode */ int l1_activated; /* layer 1 activated */ - int disc_flag; /* 'true' if device was disonnected to avoid some USB actions */ + int disc_flag; /* TRUE if device was disonnected to avoid some USB actions */ int packet_size, iso_packet_size; /* control pipe background handling */ @@ -392,7 +392,7 @@ l1_timer_expire_t3(hfcusb_data * hfc) DBG(ISDN_DBG, "HFC-S USB: PH_DEACTIVATE | INDICATION sent (T3 expire)"); #endif - hfc->l1_activated = false; + hfc->l1_activated = FALSE; handle_led(hfc, LED_S0_OFF); /* deactivate : */ queue_control_request(hfc, HFCUSB_STATES, 0x10, 1); @@ -411,7 +411,7 @@ l1_timer_expire_t4(hfcusb_data * hfc) DBG(ISDN_DBG, "HFC-S USB: PH_DEACTIVATE | INDICATION sent (T4 expire)"); #endif - hfc->l1_activated = false; + hfc->l1_activated = FALSE; handle_led(hfc, LED_S0_OFF); } @@ -452,7 +452,7 @@ state_handler(hfcusb_data * hfc, __u8 state) #ifdef CONFIG_HISAX_DEBUG DBG(ISDN_DBG, "HFC-S USB: PH_ACTIVATE | INDICATION sent"); #endif - hfc->l1_activated = true; + hfc->l1_activated = TRUE; handle_led(hfc, LED_S0_ON); } else if (state <= 3 /* && activated */ ) { if (old_state == 7 || old_state == 8) { @@ -472,7 +472,7 @@ state_handler(hfcusb_data * hfc, __u8 state) DBG(ISDN_DBG, "HFC-S USB: PH_DEACTIVATE | INDICATION sent"); #endif - hfc->l1_activated = false; + hfc->l1_activated = FALSE; handle_led(hfc, LED_S0_OFF); } } @@ -622,7 +622,7 @@ tx_iso_complete(struct urb *urb) if (fifo->active && !status) { transp_mode = 0; if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS) - transp_mode = true; + transp_mode = TRUE; /* is FifoFull-threshold set for our channel? */ threshbit = threshtable[fifon] & hfc->threshold_mask; @@ -640,7 +640,7 @@ tx_iso_complete(struct urb *urb) tx_iso_complete, urb->context); memset(context_iso_urb->buffer, 0, sizeof(context_iso_urb->buffer)); - frame_complete = false; + frame_complete = FALSE; /* Generate next Iso Packets */ for (k = 0; k < num_isoc_packets; ++k) { if (fifo->skbuff) { @@ -666,7 +666,7 @@ tx_iso_complete(struct urb *urb) /* add 2 byte flags and 16bit CRC at end of ISDN frame */ fifo->bit_line += 32; } - frame_complete = true; + frame_complete = TRUE; } memcpy(context_iso_urb->buffer + @@ -693,7 +693,7 @@ tx_iso_complete(struct urb *urb) } if (frame_complete) { - fifo->delete_flg = true; + fifo->delete_flg = TRUE; fifo->hif->l1l2(fifo->hif, PH_DATA | CONFIRM, (void *) (unsigned long) fifo->skbuff-> @@ -701,9 +701,9 @@ tx_iso_complete(struct urb *urb) if (fifo->skbuff && fifo->delete_flg) { dev_kfree_skb_any(fifo->skbuff); fifo->skbuff = NULL; - fifo->delete_flg = false; + fifo->delete_flg = FALSE; } - frame_complete = false; + frame_complete = FALSE; } } errcode = usb_submit_urb(urb, GFP_ATOMIC); @@ -837,7 +837,7 @@ collect_rx_frame(usb_fifo * fifo, __u8 * data, int len, int finish) fifon = fifo->fifonum; transp_mode = 0; if (fifon < 4 && hfc->b_mode[fifon / 2] == L1_MODE_TRANS) - transp_mode = true; + transp_mode = TRUE; if (!fifo->skbuff) { fifo->skbuff = dev_alloc_skb(fifo->max_size + 3); @@ -1176,7 +1176,7 @@ hfc_usb_l2l1(struct hisax_if *my_hisax_if, int pr, void *arg) if (fifo->skbuff && fifo->delete_flg) { dev_kfree_skb_any(fifo->skbuff); fifo->skbuff = NULL; - fifo->delete_flg = false; + fifo->delete_flg = FALSE; } fifo->skbuff = arg; /* we have a new buffer */ break; @@ -1262,8 +1262,8 @@ usb_init(hfcusb_data * hfc) hfc->b_mode[0] = L1_MODE_NULL; hfc->b_mode[1] = L1_MODE_NULL; - hfc->l1_activated = false; - hfc->disc_flag = false; + hfc->l1_activated = FALSE; + hfc->disc_flag = FALSE; hfc->led_state = 0; hfc->led_new_data = 0; hfc->old_led_state = 0; @@ -1404,7 +1404,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) /* check for config EOL element */ while (validconf[cfg_used][0]) { - cfg_found = true; + cfg_found = TRUE; vcf = validconf[cfg_used]; /* first endpoint descriptor */ ep = iface->endpoint; @@ -1426,7 +1426,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) idx++; attr = ep->desc.bmAttributes; if (cmptbl[idx] == EP_NUL) { - cfg_found = false; + cfg_found = FALSE; } if (attr == USB_ENDPOINT_XFER_INT && cmptbl[idx] == EP_INT) @@ -1448,7 +1448,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) "HFC-S USB: Interrupt Endpoint interval < %d found - skipping config", vcf[17]); #endif - cfg_found = false; + cfg_found = FALSE; } ep++; } @@ -1456,7 +1456,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) /* all entries must be EP_NOP or EP_NUL for a valid config */ if (cmptbl[i] != EP_NOP && cmptbl[i] != EP_NUL) - cfg_found = false; + cfg_found = FALSE; } if (cfg_found) { if (cfg_used < small_match) { @@ -1656,7 +1656,7 @@ hfc_usb_disconnect(struct usb_interface hfcusb_data *context = usb_get_intfdata(intf); int i; printk(KERN_INFO "HFC-S USB: device disconnect\n"); - context->disc_flag = true; + context->disc_flag = TRUE; usb_set_intfdata(intf, NULL); if (!context) return; diff --git a/trunk/drivers/isdn/hisax/hfc_usb.h b/trunk/drivers/isdn/hisax/hfc_usb.h index 471f2354dfde..6349367ed480 100644 --- a/trunk/drivers/isdn/hisax/hfc_usb.h +++ b/trunk/drivers/isdn/hisax/hfc_usb.h @@ -12,6 +12,9 @@ #define VERBOSE_USB_DEBUG +#define TRUE 1 +#define FALSE 0 + /***********/ /* defines */ diff --git a/trunk/drivers/isdn/hisax/hisax.h b/trunk/drivers/isdn/hisax/hisax.h index 3cd8d5ba239b..3f1137e34678 100644 --- a/trunk/drivers/isdn/hisax/hisax.h +++ b/trunk/drivers/isdn/hisax/hisax.h @@ -795,6 +795,19 @@ struct w6692_hw { struct timer_list timer; }; +#ifdef CONFIG_HISAX_TESTEMU +struct te_hw { + unsigned char *sfifo; + unsigned char *sfifo_w; + unsigned char *sfifo_r; + unsigned char *sfifo_e; + int sfifo_cnt; + unsigned int stat; + wait_queue_head_t rwaitq; + wait_queue_head_t swaitq; +}; +#endif + struct arcofi_msg { struct arcofi_msg *next; u_char receive; @@ -903,6 +916,9 @@ struct IsdnCardState { struct ix1_hw niccy; struct isurf_hw isurf; struct saphir_hw saphir; +#ifdef CONFIG_HISAX_TESTEMU + struct te_hw te; +#endif struct bkm_hw ax; struct gazel_hw gazel; struct w6692_hw w6692; @@ -1159,6 +1175,15 @@ struct IsdnCardState { #define CARD_HSTSAPHIR 0 #endif +#ifdef CONFIG_HISAX_TESTEMU +#define CARD_TESTEMU 1 +#define ISDN_CTYPE_TESTEMU 99 +#undef ISDN_CTYPE_COUNT +#define ISDN_CTYPE_COUNT ISDN_CTYPE_TESTEMU +#else +#define CARD_TESTEMU 0 +#endif + #ifdef CONFIG_HISAX_BKM_A4T #define CARD_BKM_A4T 1 #ifndef ISDN_CHIP_ISAC diff --git a/trunk/drivers/isdn/hisax/isar.c b/trunk/drivers/isdn/hisax/isar.c index 9df9e3548cf1..6f1a6583b17d 100644 --- a/trunk/drivers/isdn/hisax/isar.c +++ b/trunk/drivers/isdn/hisax/isar.c @@ -431,6 +431,7 @@ isar_load_firmware(struct IsdnCardState *cs, u_char __user *buf) return(ret); } +extern void BChannel_bh(struct BCState *); #define B_LL_NOCARRIER 8 #define B_LL_CONNECT 9 #define B_LL_OK 10 diff --git a/trunk/drivers/isdn/hisax/isdnl1.h b/trunk/drivers/isdn/hisax/isdnl1.h index 172ad4c8c961..0e88cfabdf10 100644 --- a/trunk/drivers/isdn/hisax/isdnl1.h +++ b/trunk/drivers/isdn/hisax/isdnl1.h @@ -21,11 +21,12 @@ #define B_XMTBUFREADY 1 #define B_ACKPENDING 2 -void debugl1(struct IsdnCardState *cs, char *fmt, ...); -void DChannel_proc_xmt(struct IsdnCardState *cs); -void DChannel_proc_rcv(struct IsdnCardState *cs); -void l1_msg(struct IsdnCardState *cs, int pr, void *arg); -void l1_msg_b(struct PStack *st, int pr, void *arg); -void Logl2Frame(struct IsdnCardState *cs, struct sk_buff *skb, char *buf, - int dir); -void BChannel_bh(struct work_struct *work); +extern void debugl1(struct IsdnCardState *cs, char *fmt, ...); +extern void DChannel_proc_xmt(struct IsdnCardState *cs); +extern void DChannel_proc_rcv(struct IsdnCardState *cs); +extern void l1_msg(struct IsdnCardState *cs, int pr, void *arg); +extern void l1_msg_b(struct PStack *st, int pr, void *arg); + +#ifdef L2FRAME_DEBUG +extern void Logl2Frame(struct IsdnCardState *cs, struct sk_buff *skb, char *buf, int dir); +#endif diff --git a/trunk/drivers/isdn/hisax/isdnl3.c b/trunk/drivers/isdn/hisax/isdnl3.c index 935f23356fae..281fa27d9f00 100644 --- a/trunk/drivers/isdn/hisax/isdnl3.c +++ b/trunk/drivers/isdn/hisax/isdnl3.c @@ -231,6 +231,18 @@ no_l3_proto_spec(struct PStack *st, isdn_ctrl *ic) return(-1); } +#ifdef CONFIG_HISAX_EURO +extern void setstack_dss1(struct PStack *st); +#endif + +#ifdef CONFIG_HISAX_NI1 +extern void setstack_ni1(struct PStack *st); +#endif + +#ifdef CONFIG_HISAX_1TR6 +extern void setstack_1tr6(struct PStack *st); +#endif + struct l3_process *getl3proc(struct PStack *st, int cr) { diff --git a/trunk/drivers/isdn/hisax/isdnl3.h b/trunk/drivers/isdn/hisax/isdnl3.h index 749498fe6c4b..1dbe0297a506 100644 --- a/trunk/drivers/isdn/hisax/isdnl3.h +++ b/trunk/drivers/isdn/hisax/isdnl3.h @@ -25,19 +25,13 @@ struct stateentry { #define l3_debug(st, fmt, args...) HiSax_putstatus(st->l1.hardware, "l3 ", fmt, ## args) -struct PStack; - -void newl3state(struct l3_process *pc, int state); -void L3InitTimer(struct l3_process *pc, struct L3Timer *t); -void L3DelTimer(struct L3Timer *t); -int L3AddTimer(struct L3Timer *t, int millisec, int event); -void StopAllL3Timer(struct l3_process *pc); -struct sk_buff *l3_alloc_skb(int len); -struct l3_process *new_l3_process(struct PStack *st, int cr); -void release_l3_process(struct l3_process *p); -struct l3_process *getl3proc(struct PStack *st, int cr); -void l3_msg(struct PStack *st, int pr, void *arg); -void setstack_dss1(struct PStack *st); -void setstack_ni1(struct PStack *st); -void setstack_1tr6(struct PStack *st); - +extern void newl3state(struct l3_process *pc, int state); +extern void L3InitTimer(struct l3_process *pc, struct L3Timer *t); +extern void L3DelTimer(struct L3Timer *t); +extern int L3AddTimer(struct L3Timer *t, int millisec, int event); +extern void StopAllL3Timer(struct l3_process *pc); +extern struct sk_buff *l3_alloc_skb(int len); +extern struct l3_process *new_l3_process(struct PStack *st, int cr); +extern void release_l3_process(struct l3_process *p); +extern struct l3_process *getl3proc(struct PStack *st, int cr); +extern void l3_msg(struct PStack *st, int pr, void *arg); diff --git a/trunk/drivers/isdn/hysdn/hysdn_procconf.c b/trunk/drivers/isdn/hysdn/hysdn_procconf.c index dc477e0aab0e..94a935089119 100644 --- a/trunk/drivers/isdn/hysdn/hysdn_procconf.c +++ b/trunk/drivers/isdn/hysdn/hysdn_procconf.c @@ -367,7 +367,7 @@ hysdn_conf_close(struct inode *ino, struct file *filep) /******************************************************/ /* table for conf filesystem functions defined above. */ /******************************************************/ -static const struct file_operations conf_fops = +static struct file_operations conf_fops = { .llseek = no_llseek, .read = hysdn_conf_read, diff --git a/trunk/drivers/isdn/hysdn/hysdn_proclog.c b/trunk/drivers/isdn/hysdn/hysdn_proclog.c index f7e83a86f444..375d956884d7 100644 --- a/trunk/drivers/isdn/hysdn/hysdn_proclog.c +++ b/trunk/drivers/isdn/hysdn/hysdn_proclog.c @@ -383,7 +383,7 @@ hysdn_log_poll(struct file *file, poll_table * wait) /**************************************************/ /* table for log filesystem functions defined above. */ /**************************************************/ -static const struct file_operations log_fops = +static struct file_operations log_fops = { .llseek = no_llseek, .read = hysdn_log_read, diff --git a/trunk/drivers/isdn/i4l/isdn_common.c b/trunk/drivers/isdn/i4l/isdn_common.c index 9c926e41b114..6a2ef0a87ed9 100644 --- a/trunk/drivers/isdn/i4l/isdn_common.c +++ b/trunk/drivers/isdn/i4l/isdn_common.c @@ -1822,7 +1822,7 @@ isdn_close(struct inode *ino, struct file *filep) return 0; } -static const struct file_operations isdn_fops = +static struct file_operations isdn_fops = { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/isdn/pcbit/drv.c b/trunk/drivers/isdn/pcbit/drv.c index 386c5ce64844..11c1b0b6e390 100644 --- a/trunk/drivers/isdn/pcbit/drv.c +++ b/trunk/drivers/isdn/pcbit/drv.c @@ -774,6 +774,10 @@ static void pcbit_logstat(struct pcbit_dev *dev, char *str) dev->dev_if->statcallb(&ictl); } +extern char * isdn_state_table[]; +extern char * strisdnevent(unsigned short); + + void pcbit_state_change(struct pcbit_dev * dev, struct pcbit_chan * chan, unsigned short i, unsigned short ev, unsigned short f) { diff --git a/trunk/drivers/isdn/pcbit/edss1.c b/trunk/drivers/isdn/pcbit/edss1.c index 1ad8b07efd8b..93ca7de5670b 100644 --- a/trunk/drivers/isdn/pcbit/edss1.c +++ b/trunk/drivers/isdn/pcbit/edss1.c @@ -35,6 +35,12 @@ #include "callbacks.h" +extern void pcbit_state_change(struct pcbit_dev *, struct pcbit_chan *, + unsigned short i, unsigned short ev, + unsigned short f); + +extern struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS]; + char * isdn_state_table[] = { "Closed", "Call initiated", diff --git a/trunk/drivers/isdn/pcbit/edss1.h b/trunk/drivers/isdn/pcbit/edss1.h index 0b64f97015d8..6bb587005b86 100644 --- a/trunk/drivers/isdn/pcbit/edss1.h +++ b/trunk/drivers/isdn/pcbit/edss1.h @@ -90,12 +90,9 @@ struct fsm_timer_entry { unsigned long timeout; /* in seconds */ }; -extern char * isdn_state_table[]; - -void pcbit_fsm_event(struct pcbit_dev *, struct pcbit_chan *, - unsigned short event, struct callb_data *); -char * strisdnevent(ushort ev); +extern void pcbit_fsm_event(struct pcbit_dev *, struct pcbit_chan *, + unsigned short event, struct callb_data *); #endif diff --git a/trunk/drivers/isdn/pcbit/layer2.c b/trunk/drivers/isdn/pcbit/layer2.c index 58eee50c8e26..eafcce5e656a 100644 --- a/trunk/drivers/isdn/pcbit/layer2.c +++ b/trunk/drivers/isdn/pcbit/layer2.c @@ -47,6 +47,22 @@ #undef DEBUG_FRAG + +/* + * task queue struct + */ + + + +/* + * Layer 3 packet demultiplexer + * drv.c + */ + +extern void pcbit_l3_receive(struct pcbit_dev *dev, ulong msg, + struct sk_buff *skb, + ushort hdr_len, ushort refnum); + /* * Prototypes */ diff --git a/trunk/drivers/isdn/pcbit/module.c b/trunk/drivers/isdn/pcbit/module.c index 7b7b1777f09b..282073a35d6a 100644 --- a/trunk/drivers/isdn/pcbit/module.c +++ b/trunk/drivers/isdn/pcbit/module.c @@ -32,6 +32,9 @@ module_param_array(irq, int, NULL, 0); static int num_boards; struct pcbit_dev * dev_pcbit[MAX_PCBIT_CARDS]; +extern void pcbit_terminate(int board); +extern int pcbit_init_dev(int board, int mem_base, int irq); + static int __init pcbit_init(void) { int board; diff --git a/trunk/drivers/isdn/pcbit/pcbit.h b/trunk/drivers/isdn/pcbit/pcbit.h index d76fffc88b82..19c18e88ff16 100644 --- a/trunk/drivers/isdn/pcbit/pcbit.h +++ b/trunk/drivers/isdn/pcbit/pcbit.h @@ -166,12 +166,6 @@ struct pcbit_ioctl { #define L2_RUNNING 5 #define L2_ERROR 6 -void pcbit_deliver(struct work_struct *work); -int pcbit_init_dev(int board, int mem_base, int irq); -void pcbit_terminate(int board); -void pcbit_l3_receive(struct pcbit_dev * dev, ulong msg, struct sk_buff * skb, - ushort hdr_len, ushort refnum); -void pcbit_state_change(struct pcbit_dev * dev, struct pcbit_chan * chan, - unsigned short i, unsigned short ev, unsigned short f); +extern void pcbit_deliver(struct work_struct *work); #endif diff --git a/trunk/drivers/isdn/sc/card.h b/trunk/drivers/isdn/sc/card.h index 4fbfa825c3a2..8e44928cdf1c 100644 --- a/trunk/drivers/isdn/sc/card.h +++ b/trunk/drivers/isdn/sc/card.h @@ -26,9 +26,7 @@ #include #include #include -#include #include "message.h" -#include "scioc.h" /* * Amount of time to wait for a reset to complete @@ -100,32 +98,4 @@ typedef struct { spinlock_t lock; /* local lock */ } board; - -extern board *sc_adapter[]; -extern int cinst; - -void memcpy_toshmem(int card, void *dest, const void *src, size_t n); -void memcpy_fromshmem(int card, void *dest, const void *src, size_t n); -int get_card_from_id(int driver); -int indicate_status(int card, int event, ulong Channel, char *Data); -irqreturn_t interrupt_handler(int interrupt, void *cardptr); -int sndpkt(int devId, int channel, struct sk_buff *data); -void rcvpkt(int card, RspMessage *rcvmsg); -int command(isdn_ctrl *cmd); -int reset(int card); -int startproc(int card); -int send_and_receive(int card, unsigned int procid, unsigned char type, - unsigned char class, unsigned char code, - unsigned char link, unsigned char data_len, - unsigned char *data, RspMessage *mesgdata, int timeout); -void flushreadfifo (int card); -int sendmessage(int card, unsigned int procid, unsigned int type, - unsigned int class, unsigned int code, unsigned int link, - unsigned int data_len, unsigned int *data); -int receivemessage(int card, RspMessage *rspmsg); -int sc_ioctl(int card, scs_ioctl *data); -int setup_buffers(int card, int c); -void check_reset(unsigned long data); -void check_phystat(unsigned long data); - #endif /* CARD_H */ diff --git a/trunk/drivers/isdn/sc/command.c b/trunk/drivers/isdn/sc/command.c index b7bb7cbcf503..04b8a58f03b5 100644 --- a/trunk/drivers/isdn/sc/command.c +++ b/trunk/drivers/isdn/sc/command.c @@ -31,6 +31,19 @@ static int setl2(int card, unsigned long arg); static int setl3(int card, unsigned long arg); static int acceptb(int card, unsigned long channel); +extern int cinst; +extern board *sc_adapter[]; + +extern int sc_ioctl(int, scs_ioctl *); +extern int setup_buffers(int, int, unsigned int); +extern int indicate_status(int, int,ulong,char*); +extern void check_reset(unsigned long); +extern int send_and_receive(int, unsigned int, unsigned char, unsigned char, + unsigned char, unsigned char, unsigned char, unsigned char *, + RspMessage *, int); +extern int sendmessage(int, unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int, unsigned int, unsigned int *); + #ifdef DEBUG /* * Translate command codes to strings @@ -195,7 +208,7 @@ static int answer(int card, unsigned long channel) return -ENODEV; } - if(setup_buffers(card, channel+1)) { + if(setup_buffers(card, channel+1, BUFFER_SIZE)) { hangup(card, channel+1); return -ENOBUFS; } @@ -284,7 +297,7 @@ static int acceptb(int card, unsigned long channel) return -ENODEV; } - if(setup_buffers(card, channel+1)) + if(setup_buffers(card, channel+1, BUFFER_SIZE)) { hangup(card, channel+1); return -ENOBUFS; diff --git a/trunk/drivers/isdn/sc/event.c b/trunk/drivers/isdn/sc/event.c index 498f4039ece2..57367325ef04 100644 --- a/trunk/drivers/isdn/sc/event.c +++ b/trunk/drivers/isdn/sc/event.c @@ -20,6 +20,9 @@ #include "message.h" #include "card.h" +extern int cinst; +extern board *sc_adapter[]; + #ifdef DEBUG static char *events[] = { "ISDN_STAT_STAVAIL", "ISDN_STAT_ICALL", diff --git a/trunk/drivers/isdn/sc/init.c b/trunk/drivers/isdn/sc/init.c index 0bf76344a0d5..150759a5cddf 100644 --- a/trunk/drivers/isdn/sc/init.c +++ b/trunk/drivers/isdn/sc/init.c @@ -35,6 +35,12 @@ module_param_array(irq, int, NULL, 0); module_param_array(ram, int, NULL, 0); module_param(do_reset, bool, 0); +extern irqreturn_t interrupt_handler(int, void *); +extern int sndpkt(int, int, int, struct sk_buff *); +extern int command(isdn_ctrl *); +extern int indicate_status(int, int, ulong, char*); +extern int reset(int); + static int identify_board(unsigned long, unsigned int); static int __init sc_init(void) diff --git a/trunk/drivers/isdn/sc/interrupt.c b/trunk/drivers/isdn/sc/interrupt.c index bef7963cdd02..cd17de18cb76 100644 --- a/trunk/drivers/isdn/sc/interrupt.c +++ b/trunk/drivers/isdn/sc/interrupt.c @@ -21,6 +21,16 @@ #include "card.h" #include +extern int indicate_status(int, int, ulong, char *); +extern void check_phystat(unsigned long); +extern int receivemessage(int, RspMessage *); +extern int sendmessage(int, unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int, unsigned int, unsigned int *); +extern void rcvpkt(int, RspMessage *); + +extern int cinst; +extern board *sc_adapter[]; + static int get_card_from_irq(int irq) { int i; diff --git a/trunk/drivers/isdn/sc/ioctl.c b/trunk/drivers/isdn/sc/ioctl.c index 7817d2244921..57c4ab96d136 100644 --- a/trunk/drivers/isdn/sc/ioctl.c +++ b/trunk/drivers/isdn/sc/ioctl.c @@ -12,6 +12,16 @@ #include "card.h" #include "scioc.h" +extern int indicate_status(int, int, unsigned long, char *); +extern int startproc(int); +extern int reset(int); +extern int send_and_receive(int, unsigned int, unsigned char,unsigned char, + unsigned char,unsigned char, + unsigned char, unsigned char *, RspMessage *, int); + +extern board *sc_adapter[]; + + static int GetStatus(int card, boardInfo *); /* diff --git a/trunk/drivers/isdn/sc/message.c b/trunk/drivers/isdn/sc/message.c index c5a307e3c496..0a0fe6b8039b 100644 --- a/trunk/drivers/isdn/sc/message.c +++ b/trunk/drivers/isdn/sc/message.c @@ -22,6 +22,16 @@ #include "message.h" #include "card.h" +extern board *sc_adapter[]; +extern unsigned int cinst; + +/* + * Obligatory function prototypes + */ +extern int indicate_status(int,ulong,char*); +extern int scm_command(isdn_ctrl *); + + /* * receive a message from the board */ diff --git a/trunk/drivers/isdn/sc/packet.c b/trunk/drivers/isdn/sc/packet.c index 92016a2608e9..1e04676b016b 100644 --- a/trunk/drivers/isdn/sc/packet.c +++ b/trunk/drivers/isdn/sc/packet.c @@ -20,6 +20,16 @@ #include "message.h" #include "card.h" +extern board *sc_adapter[]; +extern unsigned int cinst; + +extern int get_card_from_id(int); +extern int indicate_status(int, int,ulong, char*); +extern void memcpy_toshmem(int, void *, const void *, size_t); +extern void memcpy_fromshmem(int, void *, const void *, size_t); +extern int sendmessage(int, unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int, unsigned int, unsigned int *); + int sndpkt(int devId, int channel, struct sk_buff *data) { LLData ReqLnkWrite; diff --git a/trunk/drivers/isdn/sc/scioc.h b/trunk/drivers/isdn/sc/scioc.h index dfb107a6de44..d08e650c7b6a 100644 --- a/trunk/drivers/isdn/sc/scioc.h +++ b/trunk/drivers/isdn/sc/scioc.h @@ -1,6 +1,3 @@ -#ifndef __ISDN_SC_SCIOC_H__ -#define __ISDN_SC_SCIOC_H__ - /* * This software may be used and distributed according to the terms * of the GNU General Public License, incorporated herein by reference. @@ -106,6 +103,3 @@ typedef struct { POTInfo potsinfo; } info; } boardInfo; - -#endif /* __ISDN_SC_SCIOC_H__ */ - diff --git a/trunk/drivers/isdn/sc/shmem.c b/trunk/drivers/isdn/sc/shmem.c index 034d41a61ae1..6f58862992db 100644 --- a/trunk/drivers/isdn/sc/shmem.c +++ b/trunk/drivers/isdn/sc/shmem.c @@ -21,6 +21,12 @@ #include "hardware.h" #include "card.h" +/* + * Main adapter array + */ +extern board *sc_adapter[]; +extern int cinst; + /* * */ diff --git a/trunk/drivers/isdn/sc/timer.c b/trunk/drivers/isdn/sc/timer.c index cc1b8861be2a..f43282be0ada 100644 --- a/trunk/drivers/isdn/sc/timer.c +++ b/trunk/drivers/isdn/sc/timer.c @@ -20,6 +20,14 @@ #include "message.h" #include "card.h" +extern board *sc_adapter[]; + +extern void flushreadfifo(int); +extern int startproc(int); +extern int indicate_status(int, int, unsigned long, char *); +extern int sendmessage(int, unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int, unsigned int, unsigned int *); + /* * Write the proper values into the I/O ports following a reset diff --git a/trunk/drivers/kvm/kvm.h b/trunk/drivers/kvm/kvm.h index 04574a9d4430..2db1ca4c6800 100644 --- a/trunk/drivers/kvm/kvm.h +++ b/trunk/drivers/kvm/kvm.h @@ -304,7 +304,6 @@ struct kvm { int memory_config_version; int busy; unsigned long rmap_overflow; - struct list_head vm_list; }; struct kvm_stat { @@ -341,7 +340,6 @@ struct kvm_arch_ops { struct kvm_vcpu *(*vcpu_load)(struct kvm_vcpu *vcpu); void (*vcpu_put)(struct kvm_vcpu *vcpu); - void (*vcpu_decache)(struct kvm_vcpu *vcpu); int (*set_guest_debug)(struct kvm_vcpu *vcpu, struct kvm_debug_guest *dbg); @@ -560,7 +558,7 @@ static inline void load_gs(u16 sel) #ifndef load_ldt static inline void load_ldt(u16 sel) { - asm ("lldt %0" : : "rm"(sel)); + asm ("lldt %0" : : "g"(sel)); } #endif diff --git a/trunk/drivers/kvm/kvm_main.c b/trunk/drivers/kvm/kvm_main.c index af866147ff25..099f0afd394d 100644 --- a/trunk/drivers/kvm/kvm_main.c +++ b/trunk/drivers/kvm/kvm_main.c @@ -34,8 +34,6 @@ #include #include #include -#include -#include #include "x86_emulate.h" #include "segment_descriptor.h" @@ -43,9 +41,6 @@ MODULE_AUTHOR("Qumranet"); MODULE_LICENSE("GPL"); -static DEFINE_SPINLOCK(kvm_lock); -static LIST_HEAD(vm_list); - struct kvm_arch_ops *kvm_arch_ops; struct kvm_stat kvm_stat; EXPORT_SYMBOL_GPL(kvm_stat); @@ -235,13 +230,9 @@ static int kvm_dev_open(struct inode *inode, struct file *filp) struct kvm_vcpu *vcpu = &kvm->vcpus[i]; mutex_init(&vcpu->mutex); - vcpu->cpu = -1; vcpu->kvm = kvm; vcpu->mmu.root_hpa = INVALID_PAGE; INIT_LIST_HEAD(&vcpu->free_pages); - spin_lock(&kvm_lock); - list_add(&kvm->vm_list, &vm_list); - spin_unlock(&kvm_lock); } filp->private_data = kvm; return 0; @@ -281,9 +272,7 @@ static void kvm_free_physmem(struct kvm *kvm) static void kvm_free_vcpu(struct kvm_vcpu *vcpu) { - if (!vcpu_load(vcpu->kvm, vcpu_slot(vcpu))) - return; - + vcpu_load(vcpu->kvm, vcpu_slot(vcpu)); kvm_mmu_destroy(vcpu); vcpu_put(vcpu); kvm_arch_ops->vcpu_free(vcpu); @@ -301,9 +290,6 @@ static int kvm_dev_release(struct inode *inode, struct file *filp) { struct kvm *kvm = filp->private_data; - spin_lock(&kvm_lock); - list_del(&kvm->vm_list); - spin_unlock(&kvm_lock); kvm_free_vcpus(kvm); kvm_free_physmem(kvm); kfree(kvm); @@ -558,6 +544,7 @@ static int kvm_dev_ioctl_create_vcpu(struct kvm *kvm, int n) FX_IMAGE_ALIGN); vcpu->guest_fx_image = vcpu->host_fx_image + FX_IMAGE_SIZE; + vcpu->cpu = -1; /* First load will set up TR */ r = kvm_arch_ops->vcpu_create(vcpu); if (r < 0) goto out_free_vcpus; @@ -1373,9 +1360,6 @@ static int kvm_dev_ioctl_run(struct kvm *kvm, struct kvm_run *kvm_run) if (!vcpu) return -ENOENT; - /* re-sync apic's tpr */ - vcpu->cr8 = kvm_run->cr8; - if (kvm_run->emulated) { kvm_arch_ops->skip_emulated_instruction(vcpu); kvm_run->emulated = 0; @@ -2041,64 +2025,6 @@ static struct notifier_block kvm_reboot_notifier = { .priority = 0, }; -/* - * Make sure that a cpu that is being hot-unplugged does not have any vcpus - * cached on it. - */ -static void decache_vcpus_on_cpu(int cpu) -{ - struct kvm *vm; - struct kvm_vcpu *vcpu; - int i; - - spin_lock(&kvm_lock); - list_for_each_entry(vm, &vm_list, vm_list) - for (i = 0; i < KVM_MAX_VCPUS; ++i) { - vcpu = &vm->vcpus[i]; - /* - * If the vcpu is locked, then it is running on some - * other cpu and therefore it is not cached on the - * cpu in question. - * - * If it's not locked, check the last cpu it executed - * on. - */ - if (mutex_trylock(&vcpu->mutex)) { - if (vcpu->cpu == cpu) { - kvm_arch_ops->vcpu_decache(vcpu); - vcpu->cpu = -1; - } - mutex_unlock(&vcpu->mutex); - } - } - spin_unlock(&kvm_lock); -} - -static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val, - void *v) -{ - int cpu = (long)v; - - switch (val) { - case CPU_DEAD: - case CPU_UP_CANCELED: - decache_vcpus_on_cpu(cpu); - smp_call_function_single(cpu, kvm_arch_ops->hardware_disable, - NULL, 0, 1); - break; - case CPU_UP_PREPARE: - smp_call_function_single(cpu, kvm_arch_ops->hardware_enable, - NULL, 0, 1); - break; - } - return NOTIFY_OK; -} - -static struct notifier_block kvm_cpu_notifier = { - .notifier_call = kvm_cpu_hotplug, - .priority = 20, /* must be > scheduler priority */ -}; - static __init void kvm_init_debug(void) { struct kvm_stats_debugfs_item *p; @@ -2118,30 +2044,6 @@ static void kvm_exit_debug(void) debugfs_remove(debugfs_dir); } -static int kvm_suspend(struct sys_device *dev, pm_message_t state) -{ - decache_vcpus_on_cpu(raw_smp_processor_id()); - on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); - return 0; -} - -static int kvm_resume(struct sys_device *dev) -{ - on_each_cpu(kvm_arch_ops->hardware_enable, 0, 0, 1); - return 0; -} - -static struct sysdev_class kvm_sysdev_class = { - set_kset_name("kvm"), - .suspend = kvm_suspend, - .resume = kvm_resume, -}; - -static struct sys_device kvm_sysdev = { - .id = 0, - .cls = &kvm_sysdev_class, -}; - hpa_t bad_page_address; int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module) @@ -2169,19 +2071,8 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module) return r; on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1); - r = register_cpu_notifier(&kvm_cpu_notifier); - if (r) - goto out_free_1; register_reboot_notifier(&kvm_reboot_notifier); - r = sysdev_class_register(&kvm_sysdev_class); - if (r) - goto out_free_2; - - r = sysdev_register(&kvm_sysdev); - if (r) - goto out_free_3; - kvm_chardev_ops.owner = module; r = misc_register(&kvm_dev); @@ -2193,13 +2084,7 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module) return r; out_free: - sysdev_unregister(&kvm_sysdev); -out_free_3: - sysdev_class_unregister(&kvm_sysdev_class); -out_free_2: unregister_reboot_notifier(&kvm_reboot_notifier); - unregister_cpu_notifier(&kvm_cpu_notifier); -out_free_1: on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1); kvm_arch_ops->hardware_unsetup(); return r; @@ -2208,10 +2093,8 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module) void kvm_exit_arch(void) { misc_deregister(&kvm_dev); - sysdev_unregister(&kvm_sysdev); - sysdev_class_unregister(&kvm_sysdev_class); + unregister_reboot_notifier(&kvm_reboot_notifier); - unregister_cpu_notifier(&kvm_cpu_notifier); on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1); kvm_arch_ops->hardware_unsetup(); kvm_arch_ops = NULL; diff --git a/trunk/drivers/kvm/paging_tmpl.h b/trunk/drivers/kvm/paging_tmpl.h index b6b90e9e1301..149fa45fd9a5 100644 --- a/trunk/drivers/kvm/paging_tmpl.h +++ b/trunk/drivers/kvm/paging_tmpl.h @@ -443,17 +443,31 @@ static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr) { struct guest_walker walker; - gpa_t gpa = UNMAPPED_GVA; - int r; + pt_element_t guest_pte; + gpa_t gpa; + + FNAME(walk_addr)(&walker, vcpu, vaddr, 0, 0, 0); + guest_pte = *walker.ptep; + FNAME(release_walker)(&walker); - r = FNAME(walk_addr)(&walker, vcpu, vaddr, 0, 0, 0); + if (!is_present_pte(guest_pte)) + return UNMAPPED_GVA; - if (r) { - gpa = (gpa_t)walker.gfn << PAGE_SHIFT; - gpa |= vaddr & ~PAGE_MASK; + if (walker.level == PT_DIRECTORY_LEVEL) { + ASSERT((guest_pte & PT_PAGE_SIZE_MASK)); + ASSERT(PTTYPE == 64 || is_pse(vcpu)); + + gpa = (guest_pte & PT_DIR_BASE_ADDR_MASK) | (vaddr & + (PT_LEVEL_MASK(PT_PAGE_TABLE_LEVEL) | ~PAGE_MASK)); + + if (PTTYPE == 32 && is_cpuid_PSE36()) + gpa |= (guest_pte & PT32_DIR_PSE36_MASK) << + (32 - PT32_DIR_PSE36_SHIFT); + } else { + gpa = (guest_pte & PT_BASE_ADDR_MASK); + gpa |= (vaddr & ~PAGE_MASK); } - FNAME(release_walker)(&walker); return gpa; } diff --git a/trunk/drivers/kvm/svm.c b/trunk/drivers/kvm/svm.c index 83da4ea150a3..85f61dd1e936 100644 --- a/trunk/drivers/kvm/svm.c +++ b/trunk/drivers/kvm/svm.c @@ -528,13 +528,7 @@ static void init_vmcb(struct vmcb *vmcb) save->cs.attrib = SVM_SELECTOR_READ_MASK | SVM_SELECTOR_P_MASK | SVM_SELECTOR_S_MASK | SVM_SELECTOR_CODE_MASK; save->cs.limit = 0xffff; - /* - * cs.base should really be 0xffff0000, but vmx can't handle that, so - * be consistent with it. - * - * Replace when we have real mode working for vmx. - */ - save->cs.base = 0xf0000; + save->cs.base = 0xffff0000; save->gdtr.limit = 0xffff; save->idtr.limit = 0xffff; @@ -609,10 +603,6 @@ static void svm_vcpu_put(struct kvm_vcpu *vcpu) put_cpu(); } -static void svm_vcpu_decache(struct kvm_vcpu *vcpu) -{ -} - static void svm_cache_regs(struct kvm_vcpu *vcpu) { vcpu->regs[VCPU_REGS_RAX] = vcpu->svm->vmcb->save.rax; @@ -733,7 +723,7 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) } #endif vcpu->svm->cr0 = cr0; - vcpu->svm->vmcb->save.cr0 = cr0 | CR0_PG_MASK | CR0_WP_MASK; + vcpu->svm->vmcb->save.cr0 = cr0 | CR0_PG_MASK; vcpu->cr0 = cr0; } @@ -1681,7 +1671,6 @@ static struct kvm_arch_ops svm_arch_ops = { .vcpu_load = svm_vcpu_load, .vcpu_put = svm_vcpu_put, - .vcpu_decache = svm_vcpu_decache, .set_guest_debug = svm_guest_debug, .get_msr = svm_get_msr, diff --git a/trunk/drivers/kvm/vmx.c b/trunk/drivers/kvm/vmx.c index 1e640b899175..27e05a77e21a 100644 --- a/trunk/drivers/kvm/vmx.c +++ b/trunk/drivers/kvm/vmx.c @@ -125,15 +125,6 @@ static void __vcpu_clear(void *arg) per_cpu(current_vmcs, cpu) = NULL; } -static void vcpu_clear(struct kvm_vcpu *vcpu) -{ - if (vcpu->cpu != raw_smp_processor_id() && vcpu->cpu != -1) - smp_call_function_single(vcpu->cpu, __vcpu_clear, vcpu, 0, 1); - else - __vcpu_clear(vcpu); - vcpu->launched = 0; -} - static unsigned long vmcs_readl(unsigned long field) { unsigned long value; @@ -211,8 +202,10 @@ static struct kvm_vcpu *vmx_vcpu_load(struct kvm_vcpu *vcpu) cpu = get_cpu(); - if (vcpu->cpu != cpu) - vcpu_clear(vcpu); + if (vcpu->cpu != cpu) { + smp_call_function(__vcpu_clear, vcpu, 0, 1); + vcpu->launched = 0; + } if (per_cpu(current_vmcs, cpu) != vcpu->vmcs) { u8 error; @@ -250,11 +243,6 @@ static void vmx_vcpu_put(struct kvm_vcpu *vcpu) put_cpu(); } -static void vmx_vcpu_decache(struct kvm_vcpu *vcpu) -{ - vcpu_clear(vcpu); -} - static unsigned long vmx_get_rflags(struct kvm_vcpu *vcpu) { return vmcs_readl(GUEST_RFLAGS); @@ -514,7 +502,7 @@ static __init int vmx_disabled_by_bios(void) return (msr & 5) == 1; /* locked but not enabled */ } -static void hardware_enable(void *garbage) +static __init void hardware_enable(void *garbage) { int cpu = raw_smp_processor_id(); u64 phys_addr = __pa(per_cpu(vmxarea, cpu)); @@ -1387,11 +1375,6 @@ static int handle_external_interrupt(struct kvm_vcpu *vcpu, return 1; } -static int handle_triple_fault(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -{ - kvm_run->exit_reason = KVM_EXIT_SHUTDOWN; - return 0; -} static int get_io_count(struct kvm_vcpu *vcpu, u64 *count) { @@ -1652,7 +1635,6 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) = { [EXIT_REASON_EXCEPTION_NMI] = handle_exception, [EXIT_REASON_EXTERNAL_INTERRUPT] = handle_external_interrupt, - [EXIT_REASON_TRIPLE_FAULT] = handle_triple_fault, [EXIT_REASON_IO_INSTRUCTION] = handle_io, [EXIT_REASON_CR_ACCESS] = handle_cr, [EXIT_REASON_DR_ACCESS] = handle_dr, @@ -1804,10 +1786,10 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) "kvm_vmx_return: " /* Save guest registers, load host registers, keep flags */ #ifdef CONFIG_X86_64 - "xchg %3, (%%rsp) \n\t" + "xchg %3, 0(%%rsp) \n\t" "mov %%rax, %c[rax](%3) \n\t" "mov %%rbx, %c[rbx](%3) \n\t" - "pushq (%%rsp); popq %c[rcx](%3) \n\t" + "pushq 0(%%rsp); popq %c[rcx](%3) \n\t" "mov %%rdx, %c[rdx](%3) \n\t" "mov %%rsi, %c[rsi](%3) \n\t" "mov %%rdi, %c[rdi](%3) \n\t" @@ -1822,24 +1804,24 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) "mov %%r15, %c[r15](%3) \n\t" "mov %%cr2, %%rax \n\t" "mov %%rax, %c[cr2](%3) \n\t" - "mov (%%rsp), %3 \n\t" + "mov 0(%%rsp), %3 \n\t" "pop %%rcx; pop %%r15; pop %%r14; pop %%r13; pop %%r12;" "pop %%r11; pop %%r10; pop %%r9; pop %%r8;" "pop %%rbp; pop %%rdi; pop %%rsi;" "pop %%rdx; pop %%rbx; pop %%rax \n\t" #else - "xchg %3, (%%esp) \n\t" + "xchg %3, 0(%%esp) \n\t" "mov %%eax, %c[rax](%3) \n\t" "mov %%ebx, %c[rbx](%3) \n\t" - "pushl (%%esp); popl %c[rcx](%3) \n\t" + "pushl 0(%%esp); popl %c[rcx](%3) \n\t" "mov %%edx, %c[rdx](%3) \n\t" "mov %%esi, %c[rsi](%3) \n\t" "mov %%edi, %c[rdi](%3) \n\t" "mov %%ebp, %c[rbp](%3) \n\t" "mov %%cr2, %%eax \n\t" "mov %%eax, %c[cr2](%3) \n\t" - "mov (%%esp), %3 \n\t" + "mov 0(%%esp), %3 \n\t" "pop %%ecx; popa \n\t" #endif @@ -1877,7 +1859,9 @@ static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) fx_restore(vcpu->host_fx_image); vcpu->interrupt_window_open = (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & 3) == 0; +#ifndef CONFIG_X86_64 asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); +#endif /* * Profile KVM exit RIPs: @@ -2028,7 +2012,6 @@ static struct kvm_arch_ops vmx_arch_ops = { .vcpu_load = vmx_vcpu_load, .vcpu_put = vmx_vcpu_put, - .vcpu_decache = vmx_vcpu_decache, .set_guest_debug = set_guest_debug, .get_msr = vmx_get_msr, diff --git a/trunk/drivers/kvm/vmx.h b/trunk/drivers/kvm/vmx.h index d0dc93df411b..4c0ab151836a 100644 --- a/trunk/drivers/kvm/vmx.h +++ b/trunk/drivers/kvm/vmx.h @@ -180,7 +180,6 @@ enum vmcs_field { #define EXIT_REASON_EXCEPTION_NMI 0 #define EXIT_REASON_EXTERNAL_INTERRUPT 1 -#define EXIT_REASON_TRIPLE_FAULT 2 #define EXIT_REASON_PENDING_INTERRUPT 7 diff --git a/trunk/drivers/macintosh/adb.c b/trunk/drivers/macintosh/adb.c index f729eebf771f..7cec6de5e2b0 100644 --- a/trunk/drivers/macintosh/adb.c +++ b/trunk/drivers/macintosh/adb.c @@ -885,7 +885,7 @@ static ssize_t adb_write(struct file *file, const char __user *buf, return ret; } -static const struct file_operations adb_fops = { +static struct file_operations adb_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = adb_read, diff --git a/trunk/drivers/macintosh/ans-lcd.c b/trunk/drivers/macintosh/ans-lcd.c index cdd5a0f72e3c..2b8a6e821d44 100644 --- a/trunk/drivers/macintosh/ans-lcd.c +++ b/trunk/drivers/macintosh/ans-lcd.c @@ -121,7 +121,7 @@ anslcd_open( struct inode * inode, struct file * file ) return 0; } -const struct file_operations anslcd_fops = { +struct file_operations anslcd_fops = { .write = anslcd_write, .ioctl = anslcd_ioctl, .open = anslcd_open, diff --git a/trunk/drivers/macintosh/apm_emu.c b/trunk/drivers/macintosh/apm_emu.c index a6d50f4fabd7..4300c628f8af 100644 --- a/trunk/drivers/macintosh/apm_emu.c +++ b/trunk/drivers/macintosh/apm_emu.c @@ -501,7 +501,7 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length) return p - buf; } -static const struct file_operations apm_bios_fops = { +static struct file_operations apm_bios_fops = { .owner = THIS_MODULE, .read = do_read, .poll = do_poll, diff --git a/trunk/drivers/macintosh/nvram.c b/trunk/drivers/macintosh/nvram.c index b195d753d2ed..30791875fc97 100644 --- a/trunk/drivers/macintosh/nvram.c +++ b/trunk/drivers/macintosh/nvram.c @@ -100,7 +100,7 @@ static int nvram_ioctl(struct inode *inode, struct file *file, return 0; } -const struct file_operations nvram_fops = { +struct file_operations nvram_fops = { .owner = THIS_MODULE, .llseek = nvram_llseek, .read = read_nvram, diff --git a/trunk/drivers/macintosh/smu.c b/trunk/drivers/macintosh/smu.c index 3096836d8bd3..6f30459b9385 100644 --- a/trunk/drivers/macintosh/smu.c +++ b/trunk/drivers/macintosh/smu.c @@ -1277,7 +1277,7 @@ static int smu_release(struct inode *inode, struct file *file) } -static const struct file_operations smu_device_fops = { +static struct file_operations smu_device_fops = { .llseek = no_llseek, .read = smu_read, .write = smu_write, diff --git a/trunk/drivers/macintosh/via-pmu.c b/trunk/drivers/macintosh/via-pmu.c index 96bea4b62c43..eb6653f69ce4 100644 --- a/trunk/drivers/macintosh/via-pmu.c +++ b/trunk/drivers/macintosh/via-pmu.c @@ -2672,7 +2672,7 @@ pmu_ioctl(struct inode * inode, struct file *filp, return error; } -static const struct file_operations pmu_device_fops = { +static struct file_operations pmu_device_fops = { .read = pmu_read, .write = pmu_write, .poll = pmu_fpoll, diff --git a/trunk/drivers/macintosh/via-pmu68k.c b/trunk/drivers/macintosh/via-pmu68k.c index 4f5b6fa196c5..93e6ef9233f9 100644 --- a/trunk/drivers/macintosh/via-pmu68k.c +++ b/trunk/drivers/macintosh/via-pmu68k.c @@ -1040,7 +1040,7 @@ static int pmu_ioctl(struct inode * inode, struct file *filp, return -EINVAL; } -static const struct file_operations pmu_device_fops = { +static struct file_operations pmu_device_fops = { .read = pmu_read, .write = pmu_write, .ioctl = pmu_ioctl, diff --git a/trunk/drivers/md/dm-ioctl.c b/trunk/drivers/md/dm-ioctl.c index b441d82c338a..cd6a184536a1 100644 --- a/trunk/drivers/md/dm-ioctl.c +++ b/trunk/drivers/md/dm-ioctl.c @@ -1473,7 +1473,7 @@ static int ctl_ioctl(struct inode *inode, struct file *file, return r; } -static const struct file_operations _ctl_fops = { +static struct file_operations _ctl_fops = { .ioctl = ctl_ioctl, .owner = THIS_MODULE, }; diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index e85fa75a7912..e8807ea5377d 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -4920,7 +4920,7 @@ static unsigned int mdstat_poll(struct file *filp, poll_table *wait) return mask; } -static const struct file_operations md_seq_fops = { +static struct file_operations md_seq_fops = { .owner = THIS_MODULE, .open = md_seq_open, .read = seq_read, diff --git a/trunk/drivers/media/common/saa7146_fops.c b/trunk/drivers/media/common/saa7146_fops.c index b8dcfa165266..d867a6a9e430 100644 --- a/trunk/drivers/media/common/saa7146_fops.c +++ b/trunk/drivers/media/common/saa7146_fops.c @@ -416,7 +416,7 @@ static ssize_t fops_write(struct file *file, const char __user *data, size_t cou } } -static const struct file_operations video_fops = +static struct file_operations video_fops = { .owner = THIS_MODULE, .open = fops_open, diff --git a/trunk/drivers/media/radio/dsbr100.c b/trunk/drivers/media/radio/dsbr100.c index df8d0520d1d1..db865a0667e5 100644 --- a/trunk/drivers/media/radio/dsbr100.c +++ b/trunk/drivers/media/radio/dsbr100.c @@ -144,7 +144,7 @@ struct dsbr100_device { /* File system interface */ -static const struct file_operations usb_dsbr100_fops = { +static struct file_operations usb_dsbr100_fops = { .owner = THIS_MODULE, .open = usb_dsbr100_open, .release = usb_dsbr100_close, diff --git a/trunk/drivers/media/radio/miropcm20-radio.c b/trunk/drivers/media/radio/miropcm20-radio.c index c7c9d1dc0690..c4312fa0e2f5 100644 --- a/trunk/drivers/media/radio/miropcm20-radio.c +++ b/trunk/drivers/media/radio/miropcm20-radio.c @@ -216,7 +216,7 @@ static struct pcm20_device pcm20_unit = { .muted = 1, }; -static const struct file_operations pcm20_fops = { +static struct file_operations pcm20_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/miropcm20-rds.c b/trunk/drivers/media/radio/miropcm20-rds.c index c93490ec96bb..c1b1db65e668 100644 --- a/trunk/drivers/media/radio/miropcm20-rds.c +++ b/trunk/drivers/media/radio/miropcm20-rds.c @@ -105,7 +105,7 @@ static ssize_t rds_f_read(struct file *file, char __user *buffer, size_t length, } } -static const struct file_operations rds_fops = { +static struct file_operations rds_fops = { .owner = THIS_MODULE, .read = rds_f_read, .open = rds_f_open, diff --git a/trunk/drivers/media/radio/radio-aimslab.c b/trunk/drivers/media/radio/radio-aimslab.c index b2e88ad28977..3368a89bfadb 100644 --- a/trunk/drivers/media/radio/radio-aimslab.c +++ b/trunk/drivers/media/radio/radio-aimslab.c @@ -358,7 +358,7 @@ static int rt_ioctl(struct inode *inode, struct file *file, static struct rt_device rtrack_unit; -static const struct file_operations rtrack_fops = { +static struct file_operations rtrack_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-aztech.c b/trunk/drivers/media/radio/radio-aztech.c index 19d45cc940b5..3ba5fa8cf7e6 100644 --- a/trunk/drivers/media/radio/radio-aztech.c +++ b/trunk/drivers/media/radio/radio-aztech.c @@ -314,7 +314,7 @@ static int az_ioctl(struct inode *inode, struct file *file, static struct az_device aztech_unit; -static const struct file_operations aztech_fops = { +static struct file_operations aztech_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-cadet.c b/trunk/drivers/media/radio/radio-cadet.c index 8fbf0d8bd278..69d4b7919c5a 100644 --- a/trunk/drivers/media/radio/radio-cadet.c +++ b/trunk/drivers/media/radio/radio-cadet.c @@ -507,7 +507,7 @@ cadet_poll(struct file *file, struct poll_table_struct *wait) } -static const struct file_operations cadet_fops = { +static struct file_operations cadet_fops = { .owner = THIS_MODULE, .open = cadet_open, .release = cadet_release, diff --git a/trunk/drivers/media/radio/radio-gemtek-pci.c b/trunk/drivers/media/radio/radio-gemtek-pci.c index 05e5aa77025f..eb14106f66fa 100644 --- a/trunk/drivers/media/radio/radio-gemtek-pci.c +++ b/trunk/drivers/media/radio/radio-gemtek-pci.c @@ -346,7 +346,7 @@ MODULE_DEVICE_TABLE( pci, gemtek_pci_id ); static int mx = 1; -static const struct file_operations gemtek_pci_fops = { +static struct file_operations gemtek_pci_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-gemtek.c b/trunk/drivers/media/radio/radio-gemtek.c index 36c4be6622c7..730fe16126cb 100644 --- a/trunk/drivers/media/radio/radio-gemtek.c +++ b/trunk/drivers/media/radio/radio-gemtek.c @@ -296,7 +296,7 @@ static int gemtek_ioctl(struct inode *inode, struct file *file, static struct gemtek_device gemtek_unit; -static const struct file_operations gemtek_fops = { +static struct file_operations gemtek_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-maestro.c b/trunk/drivers/media/radio/radio-maestro.c index 9bba6eb10925..e8ce5f75cf12 100644 --- a/trunk/drivers/media/radio/radio-maestro.c +++ b/trunk/drivers/media/radio/radio-maestro.c @@ -99,7 +99,7 @@ static struct pci_driver maestro_r_driver = { .remove = __devexit_p(maestro_remove), }; -static const struct file_operations maestro_fops = { +static struct file_operations maestro_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-maxiradio.c b/trunk/drivers/media/radio/radio-maxiradio.c index 00a2f31d2af3..c2eeae7a10d0 100644 --- a/trunk/drivers/media/radio/radio-maxiradio.c +++ b/trunk/drivers/media/radio/radio-maxiradio.c @@ -91,7 +91,7 @@ module_param(radio_nr, int, 0); static int radio_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static const struct file_operations maxiradio_fops = { +static struct file_operations maxiradio_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-rtrack2.c b/trunk/drivers/media/radio/radio-rtrack2.c index f6683872251e..b9e98483e58d 100644 --- a/trunk/drivers/media/radio/radio-rtrack2.c +++ b/trunk/drivers/media/radio/radio-rtrack2.c @@ -262,7 +262,7 @@ static int rt_ioctl(struct inode *inode, struct file *file, static struct rt_device rtrack2_unit; -static const struct file_operations rtrack2_fops = { +static struct file_operations rtrack2_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-sf16fmi.c b/trunk/drivers/media/radio/radio-sf16fmi.c index f4619e4dda4f..ecc854b4ba38 100644 --- a/trunk/drivers/media/radio/radio-sf16fmi.c +++ b/trunk/drivers/media/radio/radio-sf16fmi.c @@ -265,7 +265,7 @@ static int fmi_ioctl(struct inode *inode, struct file *file, static struct fmi_device fmi_unit; -static const struct file_operations fmi_fops = { +static struct file_operations fmi_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-sf16fmr2.c b/trunk/drivers/media/radio/radio-sf16fmr2.c index b96fafe1f9da..4444dce864a9 100644 --- a/trunk/drivers/media/radio/radio-sf16fmr2.c +++ b/trunk/drivers/media/radio/radio-sf16fmr2.c @@ -410,7 +410,7 @@ static int fmr2_ioctl(struct inode *inode, struct file *file, static struct fmr2_device fmr2_unit; -static const struct file_operations fmr2_fops = { +static struct file_operations fmr2_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-terratec.c b/trunk/drivers/media/radio/radio-terratec.c index d59a27accb84..f539491a0d76 100644 --- a/trunk/drivers/media/radio/radio-terratec.c +++ b/trunk/drivers/media/radio/radio-terratec.c @@ -338,7 +338,7 @@ static int tt_ioctl(struct inode *inode, struct file *file, static struct tt_device terratec_unit; -static const struct file_operations terratec_fops = { +static struct file_operations terratec_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-trust.c b/trunk/drivers/media/radio/radio-trust.c index 6d7f1e7116ea..bb03ad5a2033 100644 --- a/trunk/drivers/media/radio/radio-trust.c +++ b/trunk/drivers/media/radio/radio-trust.c @@ -325,7 +325,7 @@ static int tr_ioctl(struct inode *inode, struct file *file, return video_usercopy(inode, file, cmd, arg, tr_do_ioctl); } -static const struct file_operations trust_fops = { +static struct file_operations trust_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-typhoon.c b/trunk/drivers/media/radio/radio-typhoon.c index 3031fef178cb..4a72b4d4e62a 100644 --- a/trunk/drivers/media/radio/radio-typhoon.c +++ b/trunk/drivers/media/radio/radio-typhoon.c @@ -318,7 +318,7 @@ static struct typhoon_device typhoon_unit = .mutefreq = CONFIG_RADIO_TYPHOON_MUTEFREQ, }; -static const struct file_operations typhoon_fops = { +static struct file_operations typhoon_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/radio/radio-zoltrix.c b/trunk/drivers/media/radio/radio-zoltrix.c index ec08491fb7c5..671fe1b1e5bc 100644 --- a/trunk/drivers/media/radio/radio-zoltrix.c +++ b/trunk/drivers/media/radio/radio-zoltrix.c @@ -373,7 +373,7 @@ static int zol_ioctl(struct inode *inode, struct file *file, static struct zol_device zoltrix_unit; -static const struct file_operations zoltrix_fops = +static struct file_operations zoltrix_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, diff --git a/trunk/drivers/media/video/arv.c b/trunk/drivers/media/video/arv.c index 649f52f9ad27..4861799eb430 100644 --- a/trunk/drivers/media/video/arv.c +++ b/trunk/drivers/media/video/arv.c @@ -742,7 +742,7 @@ void ar_release(struct video_device *vfd) * Video4Linux Module functions * ****************************************************************************/ -static const struct file_operations ar_fops = { +static struct file_operations ar_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/video/bt8xx/bttv-driver.c b/trunk/drivers/media/video/bt8xx/bttv-driver.c index 41fd09d7d11e..ab8f970760f2 100644 --- a/trunk/drivers/media/video/bt8xx/bttv-driver.c +++ b/trunk/drivers/media/video/bt8xx/bttv-driver.c @@ -3174,7 +3174,7 @@ bttv_mmap(struct file *file, struct vm_area_struct *vma) return videobuf_mmap_mapper(bttv_queue(fh),vma); } -static const struct file_operations bttv_fops = +static struct file_operations bttv_fops = { .owner = THIS_MODULE, .open = bttv_open, @@ -3332,7 +3332,7 @@ static unsigned int radio_poll(struct file *file, poll_table *wait) return cmd.result; } -static const struct file_operations radio_fops = +static struct file_operations radio_fops = { .owner = THIS_MODULE, .open = radio_open, diff --git a/trunk/drivers/media/video/bw-qcam.c b/trunk/drivers/media/video/bw-qcam.c index 7d47cbe6ad25..7d0b6e59c6e2 100644 --- a/trunk/drivers/media/video/bw-qcam.c +++ b/trunk/drivers/media/video/bw-qcam.c @@ -871,7 +871,7 @@ static ssize_t qcam_read(struct file *file, char __user *buf, return len; } -static const struct file_operations qcam_fops = { +static struct file_operations qcam_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/video/c-qcam.c b/trunk/drivers/media/video/c-qcam.c index 925ff17efbbc..a3989bd2f81b 100644 --- a/trunk/drivers/media/video/c-qcam.c +++ b/trunk/drivers/media/video/c-qcam.c @@ -684,7 +684,7 @@ static ssize_t qcam_read(struct file *file, char __user *buf, } /* video device template */ -static const struct file_operations qcam_fops = { +static struct file_operations qcam_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/video/cafe_ccic.c b/trunk/drivers/media/video/cafe_ccic.c index fb1410c6f864..3083c8075d13 100644 --- a/trunk/drivers/media/video/cafe_ccic.c +++ b/trunk/drivers/media/video/cafe_ccic.c @@ -1715,7 +1715,7 @@ static void cafe_v4l_dev_release(struct video_device *vd) * clone it for specific real devices. */ -static const struct file_operations cafe_v4l_fops = { +static struct file_operations cafe_v4l_fops = { .owner = THIS_MODULE, .open = cafe_v4l_open, .release = cafe_v4l_release, @@ -1969,7 +1969,7 @@ static ssize_t cafe_dfs_read_regs(struct file *file, s - cafe_debug_buf); } -static const struct file_operations cafe_dfs_reg_ops = { +static struct file_operations cafe_dfs_reg_ops = { .owner = THIS_MODULE, .read = cafe_dfs_read_regs, .open = cafe_dfs_open @@ -1995,7 +1995,7 @@ static ssize_t cafe_dfs_read_cam(struct file *file, s - cafe_debug_buf); } -static const struct file_operations cafe_dfs_cam_ops = { +static struct file_operations cafe_dfs_cam_ops = { .owner = THIS_MODULE, .read = cafe_dfs_read_cam, .open = cafe_dfs_open diff --git a/trunk/drivers/media/video/cpia.c b/trunk/drivers/media/video/cpia.c index 7e8d5ef58b61..3b31a0dd2f0c 100644 --- a/trunk/drivers/media/video/cpia.c +++ b/trunk/drivers/media/video/cpia.c @@ -3791,7 +3791,7 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -static const struct file_operations cpia_fops = { +static struct file_operations cpia_fops = { .owner = THIS_MODULE, .open = cpia_open, .release = cpia_close, diff --git a/trunk/drivers/media/video/cpia2/cpia2_v4l.c b/trunk/drivers/media/video/cpia2/cpia2_v4l.c index 1bda7ad9de11..d09f49950f2a 100644 --- a/trunk/drivers/media/video/cpia2/cpia2_v4l.c +++ b/trunk/drivers/media/video/cpia2/cpia2_v4l.c @@ -1924,7 +1924,7 @@ static void reset_camera_struct_v4l(struct camera_data *cam) /*** * The v4l video device structure initialized for this device ***/ -static const struct file_operations fops_template = { +static struct file_operations fops_template = { .owner = THIS_MODULE, .open = cpia2_open, .release = cpia2_close, diff --git a/trunk/drivers/media/video/cx88/cx88-blackbird.c b/trunk/drivers/media/video/cx88/cx88-blackbird.c index 9a7a2996f20f..0cf0360588e6 100644 --- a/trunk/drivers/media/video/cx88/cx88-blackbird.c +++ b/trunk/drivers/media/video/cx88/cx88-blackbird.c @@ -1051,7 +1051,7 @@ mpeg_mmap(struct file *file, struct vm_area_struct * vma) return videobuf_mmap_mapper(&fh->mpegq, vma); } -static const struct file_operations mpeg_fops = +static struct file_operations mpeg_fops = { .owner = THIS_MODULE, .open = mpeg_open, diff --git a/trunk/drivers/media/video/cx88/cx88-video.c b/trunk/drivers/media/video/cx88/cx88-video.c index c86a7e06235b..8613378428fd 100644 --- a/trunk/drivers/media/video/cx88/cx88-video.c +++ b/trunk/drivers/media/video/cx88/cx88-video.c @@ -1808,7 +1808,7 @@ static irqreturn_t cx8800_irq(int irq, void *dev_id) /* ----------------------------------------------------------- */ /* exported stuff */ -static const struct file_operations video_fops = +static struct file_operations video_fops = { .owner = THIS_MODULE, .open = video_open, @@ -1839,7 +1839,7 @@ static struct video_device cx8800_vbi_template = .minor = -1, }; -static const struct file_operations radio_fops = +static struct file_operations radio_fops = { .owner = THIS_MODULE, .open = video_open, diff --git a/trunk/drivers/media/video/dabusb.c b/trunk/drivers/media/video/dabusb.c index ff4b238090ac..917021fc2993 100644 --- a/trunk/drivers/media/video/dabusb.c +++ b/trunk/drivers/media/video/dabusb.c @@ -696,7 +696,7 @@ static int dabusb_ioctl (struct inode *inode, struct file *file, unsigned int cm return ret; } -static const struct file_operations dabusb_fops = +static struct file_operations dabusb_fops = { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/media/video/em28xx/em28xx-video.c b/trunk/drivers/media/video/em28xx/em28xx-video.c index bec67609500f..36e72c207a8f 100644 --- a/trunk/drivers/media/video/em28xx/em28xx-video.c +++ b/trunk/drivers/media/video/em28xx/em28xx-video.c @@ -1480,7 +1480,7 @@ static int em28xx_v4l2_ioctl(struct inode *inode, struct file *filp, return ret; } -static const struct file_operations em28xx_v4l_fops = { +static struct file_operations em28xx_v4l_fops = { .owner = THIS_MODULE, .open = em28xx_v4l2_open, .release = em28xx_v4l2_close, diff --git a/trunk/drivers/media/video/et61x251/et61x251_core.c b/trunk/drivers/media/video/et61x251/et61x251_core.c index 49792ae8c61c..86e353b26b53 100644 --- a/trunk/drivers/media/video/et61x251/et61x251_core.c +++ b/trunk/drivers/media/video/et61x251/et61x251_core.c @@ -2454,7 +2454,7 @@ static int et61x251_ioctl(struct inode* inode, struct file* filp, } -static const struct file_operations et61x251_fops = { +static struct file_operations et61x251_fops = { .owner = THIS_MODULE, .open = et61x251_open, .release = et61x251_release, diff --git a/trunk/drivers/media/video/meye.c b/trunk/drivers/media/video/meye.c index 9528e10c2828..616a35da191d 100644 --- a/trunk/drivers/media/video/meye.c +++ b/trunk/drivers/media/video/meye.c @@ -1748,7 +1748,7 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -static const struct file_operations meye_fops = { +static struct file_operations meye_fops = { .owner = THIS_MODULE, .open = meye_open, .release = meye_release, diff --git a/trunk/drivers/media/video/ov511.c b/trunk/drivers/media/video/ov511.c index e5edff1059a2..b4db2cbb5a84 100644 --- a/trunk/drivers/media/video/ov511.c +++ b/trunk/drivers/media/video/ov511.c @@ -4653,7 +4653,7 @@ ov51x_v4l1_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -static const struct file_operations ov511_fops = { +static struct file_operations ov511_fops = { .owner = THIS_MODULE, .open = ov51x_v4l1_open, .release = ov51x_v4l1_close, diff --git a/trunk/drivers/media/video/pms.c b/trunk/drivers/media/video/pms.c index d38d3dc4a012..5d681fa8bcb1 100644 --- a/trunk/drivers/media/video/pms.c +++ b/trunk/drivers/media/video/pms.c @@ -881,7 +881,7 @@ static ssize_t pms_read(struct file *file, char __user *buf, return len; } -static const struct file_operations pms_fops = { +static struct file_operations pms_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 6cf17080eb49..bb40e9085977 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -986,7 +986,7 @@ static unsigned int pvr2_v4l2_poll(struct file *file, poll_table *wait) } -static const struct file_operations vdev_fops = { +static struct file_operations vdev_fops = { .owner = THIS_MODULE, .open = pvr2_v4l2_open, .release = pvr2_v4l2_release, diff --git a/trunk/drivers/media/video/pwc/pwc-if.c b/trunk/drivers/media/video/pwc/pwc-if.c index 9825fd348108..a996aad79276 100644 --- a/trunk/drivers/media/video/pwc/pwc-if.c +++ b/trunk/drivers/media/video/pwc/pwc-if.c @@ -152,7 +152,7 @@ static int pwc_video_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsigned long arg); static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma); -static const struct file_operations pwc_fops = { +static struct file_operations pwc_fops = { .owner = THIS_MODULE, .open = pwc_video_open, .release = pwc_video_close, diff --git a/trunk/drivers/media/video/saa5246a.c b/trunk/drivers/media/video/saa5246a.c index 0b5d159895bf..77bb940a1a4f 100644 --- a/trunk/drivers/media/video/saa5246a.c +++ b/trunk/drivers/media/video/saa5246a.c @@ -817,7 +817,7 @@ static void __exit cleanup_saa_5246a (void) module_init(init_saa_5246a); module_exit(cleanup_saa_5246a); -static const struct file_operations saa_fops = { +static struct file_operations saa_fops = { .owner = THIS_MODULE, .open = saa5246a_open, .release = saa5246a_release, diff --git a/trunk/drivers/media/video/saa5249.c b/trunk/drivers/media/video/saa5249.c index 3e84737878a8..bb3fb4387f65 100644 --- a/trunk/drivers/media/video/saa5249.c +++ b/trunk/drivers/media/video/saa5249.c @@ -699,7 +699,7 @@ static void __exit cleanup_saa_5249 (void) module_init(init_saa_5249); module_exit(cleanup_saa_5249); -static const struct file_operations saa_fops = { +static struct file_operations saa_fops = { .owner = THIS_MODULE, .open = saa5249_open, .release = saa5249_release, diff --git a/trunk/drivers/media/video/saa7134/saa7134-empress.c b/trunk/drivers/media/video/saa7134/saa7134-empress.c index f521603482ca..daaae870a2c4 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-empress.c +++ b/trunk/drivers/media/video/saa7134/saa7134-empress.c @@ -319,7 +319,7 @@ static int ts_ioctl(struct inode *inode, struct file *file, return video_usercopy(inode, file, cmd, arg, ts_do_ioctl); } -static const struct file_operations ts_fops = +static struct file_operations ts_fops = { .owner = THIS_MODULE, .open = ts_open, diff --git a/trunk/drivers/media/video/saa7134/saa7134-oss.c b/trunk/drivers/media/video/saa7134/saa7134-oss.c index 72444f039e3d..bfcb860d14cc 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-oss.c +++ b/trunk/drivers/media/video/saa7134/saa7134-oss.c @@ -563,7 +563,7 @@ static unsigned int dsp_poll(struct file *file, struct poll_table_struct *wait) return mask; } -const struct file_operations saa7134_dsp_fops = { +struct file_operations saa7134_dsp_fops = { .owner = THIS_MODULE, .open = dsp_open, .release = dsp_release, @@ -804,7 +804,7 @@ static int mixer_ioctl(struct inode *inode, struct file *file, } } -const struct file_operations saa7134_mixer_fops = { +struct file_operations saa7134_mixer_fops = { .owner = THIS_MODULE, .open = mixer_open, .release = mixer_release, diff --git a/trunk/drivers/media/video/saa7134/saa7134-video.c b/trunk/drivers/media/video/saa7134/saa7134-video.c index f2cb63053041..830617ea81cc 100644 --- a/trunk/drivers/media/video/saa7134/saa7134-video.c +++ b/trunk/drivers/media/video/saa7134/saa7134-video.c @@ -2336,7 +2336,7 @@ static int radio_ioctl(struct inode *inode, struct file *file, return video_usercopy(inode, file, cmd, arg, radio_do_ioctl); } -static const struct file_operations video_fops = +static struct file_operations video_fops = { .owner = THIS_MODULE, .open = video_open, @@ -2349,7 +2349,7 @@ static const struct file_operations video_fops = .llseek = no_llseek, }; -static const struct file_operations radio_fops = +static struct file_operations radio_fops = { .owner = THIS_MODULE, .open = video_open, diff --git a/trunk/drivers/media/video/saa7134/saa7134.h b/trunk/drivers/media/video/saa7134/saa7134.h index 88cd1297df13..e88ad7b40c47 100644 --- a/trunk/drivers/media/video/saa7134/saa7134.h +++ b/trunk/drivers/media/video/saa7134/saa7134.h @@ -683,8 +683,8 @@ int saa_dsp_writel(struct saa7134_dev *dev, int reg, u32 value); /* ----------------------------------------------------------- */ /* saa7134-oss.c */ -extern const struct file_operations saa7134_dsp_fops; -extern const struct file_operations saa7134_mixer_fops; +extern struct file_operations saa7134_dsp_fops; +extern struct file_operations saa7134_mixer_fops; int saa7134_oss_init1(struct saa7134_dev *dev); int saa7134_oss_fini(struct saa7134_dev *dev); diff --git a/trunk/drivers/media/video/se401.c b/trunk/drivers/media/video/se401.c index 038448f5a978..7aeec574d7ce 100644 --- a/trunk/drivers/media/video/se401.c +++ b/trunk/drivers/media/video/se401.c @@ -1185,7 +1185,7 @@ static int se401_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -static const struct file_operations se401_fops = { +static struct file_operations se401_fops = { .owner = THIS_MODULE, .open = se401_open, .release = se401_close, diff --git a/trunk/drivers/media/video/sn9c102/sn9c102_core.c b/trunk/drivers/media/video/sn9c102/sn9c102_core.c index 04d4c8f28b89..18458d46c0ff 100644 --- a/trunk/drivers/media/video/sn9c102/sn9c102_core.c +++ b/trunk/drivers/media/video/sn9c102/sn9c102_core.c @@ -2736,7 +2736,7 @@ static int sn9c102_ioctl(struct inode* inode, struct file* filp, /*****************************************************************************/ -static const struct file_operations sn9c102_fops = { +static struct file_operations sn9c102_fops = { .owner = THIS_MODULE, .open = sn9c102_open, .release = sn9c102_release, diff --git a/trunk/drivers/media/video/stradis.c b/trunk/drivers/media/video/stradis.c index 3e736be5de84..525d81288d55 100644 --- a/trunk/drivers/media/video/stradis.c +++ b/trunk/drivers/media/video/stradis.c @@ -1901,7 +1901,7 @@ static int saa_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations saa_fops = { +static struct file_operations saa_fops = { .owner = THIS_MODULE, .open = saa_open, .release = saa_release, diff --git a/trunk/drivers/media/video/stv680.c b/trunk/drivers/media/video/stv680.c index bf3aa8d2d57e..a1ec3aca3f91 100644 --- a/trunk/drivers/media/video/stv680.c +++ b/trunk/drivers/media/video/stv680.c @@ -1380,7 +1380,7 @@ static ssize_t stv680_read (struct file *file, char __user *buf, return realcount; } /* stv680_read */ -static const struct file_operations stv680_fops = { +static struct file_operations stv680_fops = { .owner = THIS_MODULE, .open = stv_open, .release = stv_close, diff --git a/trunk/drivers/media/video/tvmixer.c b/trunk/drivers/media/video/tvmixer.c index e2747bd373fd..1654576de10e 100644 --- a/trunk/drivers/media/video/tvmixer.c +++ b/trunk/drivers/media/video/tvmixer.c @@ -228,7 +228,7 @@ static struct i2c_driver driver = { .detach_client = tvmixer_clients, }; -static const struct file_operations tvmixer_fops = { +static struct file_operations tvmixer_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = tvmixer_ioctl, diff --git a/trunk/drivers/media/video/usbvideo/usbvideo.c b/trunk/drivers/media/video/usbvideo/usbvideo.c index d34d8c8b7376..b560c9d7c516 100644 --- a/trunk/drivers/media/video/usbvideo/usbvideo.c +++ b/trunk/drivers/media/video/usbvideo/usbvideo.c @@ -945,7 +945,7 @@ static int usbvideo_find_struct(struct usbvideo *cams) return rv; } -static const struct file_operations usbvideo_fops = { +static struct file_operations usbvideo_fops = { .owner = THIS_MODULE, .open = usbvideo_v4l_open, .release =usbvideo_v4l_close, diff --git a/trunk/drivers/media/video/usbvideo/vicam.c b/trunk/drivers/media/video/usbvideo/vicam.c index 876fd2768242..08f9559a6bfa 100644 --- a/trunk/drivers/media/video/usbvideo/vicam.c +++ b/trunk/drivers/media/video/usbvideo/vicam.c @@ -1234,7 +1234,7 @@ static inline void vicam_create_proc_entry(struct vicam_camera *cam) { } static inline void vicam_destroy_proc_entry(void *ptr) { } #endif -static const struct file_operations vicam_fops = { +static struct file_operations vicam_fops = { .owner = THIS_MODULE, .open = vicam_open, .release = vicam_close, diff --git a/trunk/drivers/media/video/usbvision/usbvision-video.c b/trunk/drivers/media/video/usbvision/usbvision-video.c index 4eb7330b96f8..bdd6301d2a47 100644 --- a/trunk/drivers/media/video/usbvision/usbvision-video.c +++ b/trunk/drivers/media/video/usbvision/usbvision-video.c @@ -1475,7 +1475,7 @@ static int usbvision_vbi_ioctl(struct inode *inode, struct file *file, // // Video template -static const struct file_operations usbvision_fops = { +static struct file_operations usbvision_fops = { .owner = THIS_MODULE, .open = usbvision_v4l2_open, .release = usbvision_v4l2_close, @@ -1496,7 +1496,7 @@ static struct video_device usbvision_video_template = { // Radio template -static const struct file_operations usbvision_radio_fops = { +static struct file_operations usbvision_radio_fops = { .owner = THIS_MODULE, .open = usbvision_radio_open, .release = usbvision_radio_close, @@ -1517,7 +1517,7 @@ static struct video_device usbvision_radio_template= // vbi template -static const struct file_operations usbvision_vbi_fops = { +static struct file_operations usbvision_vbi_fops = { .owner = THIS_MODULE, .open = usbvision_vbi_open, .release = usbvision_vbi_close, diff --git a/trunk/drivers/media/video/videodev.c b/trunk/drivers/media/video/videodev.c index 30c3822692fb..6a0e8ca72948 100644 --- a/trunk/drivers/media/video/videodev.c +++ b/trunk/drivers/media/video/videodev.c @@ -1561,7 +1561,7 @@ int video_ioctl2 (struct inode *inode, struct file *file, } -static const struct file_operations video_fops; +static struct file_operations video_fops; /** * video_register_device - register video4linux devices @@ -1709,7 +1709,7 @@ void video_unregister_device(struct video_device *vfd) /* * Video fs operations */ -static const struct file_operations video_fops= +static struct file_operations video_fops= { .owner = THIS_MODULE, .llseek = no_llseek, diff --git a/trunk/drivers/media/video/vino.c b/trunk/drivers/media/video/vino.c index 0c658b74f2c4..a373c142e742 100644 --- a/trunk/drivers/media/video/vino.c +++ b/trunk/drivers/media/video/vino.c @@ -4390,7 +4390,7 @@ static int vino_ioctl(struct inode *inode, struct file *file, // __initdata static int vino_init_stage = 0; -static const struct file_operations vino_fops = { +static struct file_operations vino_fops = { .owner = THIS_MODULE, .open = vino_open, .release = vino_close, diff --git a/trunk/drivers/media/video/vivi.c b/trunk/drivers/media/video/vivi.c index cfb6b1f0402c..d4cf55666731 100644 --- a/trunk/drivers/media/video/vivi.c +++ b/trunk/drivers/media/video/vivi.c @@ -1292,7 +1292,7 @@ vivi_mmap(struct file *file, struct vm_area_struct * vma) return ret; } -static const struct file_operations vivi_fops = { +static struct file_operations vivi_fops = { .owner = THIS_MODULE, .open = vivi_open, .release = vivi_release, diff --git a/trunk/drivers/media/video/w9966.c b/trunk/drivers/media/video/w9966.c index 47366408637c..8d14f308f171 100644 --- a/trunk/drivers/media/video/w9966.c +++ b/trunk/drivers/media/video/w9966.c @@ -183,7 +183,7 @@ static int w9966_v4l_ioctl(struct inode *inode, struct file *file, static ssize_t w9966_v4l_read(struct file *file, char __user *buf, size_t count, loff_t *ppos); -static const struct file_operations w9966_fops = { +static struct file_operations w9966_fops = { .owner = THIS_MODULE, .open = video_exclusive_open, .release = video_exclusive_release, diff --git a/trunk/drivers/media/video/w9968cf.c b/trunk/drivers/media/video/w9968cf.c index 6e64af293be5..9f403af7b040 100644 --- a/trunk/drivers/media/video/w9968cf.c +++ b/trunk/drivers/media/video/w9968cf.c @@ -399,7 +399,7 @@ MODULE_PARM_DESC(specific_debug, ****************************************************************************/ /* Video4linux interface */ -static const struct file_operations w9968cf_fops; +static struct file_operations w9968cf_fops; static int w9968cf_open(struct inode*, struct file*); static int w9968cf_release(struct inode*, struct file*); static int w9968cf_mmap(struct file*, struct vm_area_struct*); @@ -3466,7 +3466,7 @@ static int w9968cf_v4l_ioctl(struct inode* inode, struct file* filp, } -static const struct file_operations w9968cf_fops = { +static struct file_operations w9968cf_fops = { .owner = THIS_MODULE, .open = w9968cf_open, .release = w9968cf_release, diff --git a/trunk/drivers/media/video/zc0301/zc0301_core.c b/trunk/drivers/media/video/zc0301/zc0301_core.c index 8da7f15f6290..52d0f759ee00 100644 --- a/trunk/drivers/media/video/zc0301/zc0301_core.c +++ b/trunk/drivers/media/video/zc0301/zc0301_core.c @@ -1871,7 +1871,7 @@ static int zc0301_ioctl(struct inode* inode, struct file* filp, } -static const struct file_operations zc0301_fops = { +static struct file_operations zc0301_fops = { .owner = THIS_MODULE, .open = zc0301_open, .release = zc0301_release, diff --git a/trunk/drivers/media/video/zoran_driver.c b/trunk/drivers/media/video/zoran_driver.c index 074323733352..e10a9ee25fc5 100644 --- a/trunk/drivers/media/video/zoran_driver.c +++ b/trunk/drivers/media/video/zoran_driver.c @@ -4679,7 +4679,7 @@ zoran_mmap (struct file *file, return 0; } -static const struct file_operations zoran_fops = { +static struct file_operations zoran_fops = { .owner = THIS_MODULE, .open = zoran_open, .release = zoran_close, diff --git a/trunk/drivers/media/video/zoran_procfs.c b/trunk/drivers/media/video/zoran_procfs.c index 446ae8d5c3df..c374c76b3753 100644 --- a/trunk/drivers/media/video/zoran_procfs.c +++ b/trunk/drivers/media/video/zoran_procfs.c @@ -186,7 +186,7 @@ static ssize_t zoran_write(struct file *file, const char __user *buffer, return count; } -static const struct file_operations zoran_operations = { +static struct file_operations zoran_operations = { .open = zoran_open, .read = seq_read, .write = zoran_write, diff --git a/trunk/drivers/message/fusion/mptctl.c b/trunk/drivers/message/fusion/mptctl.c index 9d0f30478e46..b0b80428d110 100644 --- a/trunk/drivers/message/fusion/mptctl.c +++ b/trunk/drivers/message/fusion/mptctl.c @@ -2662,7 +2662,7 @@ mptctl_hp_targetinfo(unsigned long arg) /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -static const struct file_operations mptctl_fops = { +static struct file_operations mptctl_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .release = mptctl_release, diff --git a/trunk/drivers/message/i2o/i2o_config.c b/trunk/drivers/message/i2o/i2o_config.c index 8ba275a12773..e33d446e7493 100644 --- a/trunk/drivers/message/i2o/i2o_config.c +++ b/trunk/drivers/message/i2o/i2o_config.c @@ -1111,7 +1111,7 @@ static int cfg_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations config_fops = { +static struct file_operations config_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = i2o_cfg_ioctl, diff --git a/trunk/drivers/message/i2o/i2o_proc.c b/trunk/drivers/message/i2o/i2o_proc.c index 06892ac2286e..a61cb17c5c12 100644 --- a/trunk/drivers/message/i2o/i2o_proc.c +++ b/trunk/drivers/message/i2o/i2o_proc.c @@ -1703,133 +1703,133 @@ static int i2o_seq_open_dev_name(struct inode *inode, struct file *file) return single_open(file, i2o_seq_show_dev_name, PDE(inode)->data); }; -static const struct file_operations i2o_seq_fops_lct = { +static struct file_operations i2o_seq_fops_lct = { .open = i2o_seq_open_lct, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_hrt = { +static struct file_operations i2o_seq_fops_hrt = { .open = i2o_seq_open_hrt, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_status = { +static struct file_operations i2o_seq_fops_status = { .open = i2o_seq_open_status, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_hw = { +static struct file_operations i2o_seq_fops_hw = { .open = i2o_seq_open_hw, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_ddm_table = { +static struct file_operations i2o_seq_fops_ddm_table = { .open = i2o_seq_open_ddm_table, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_driver_store = { +static struct file_operations i2o_seq_fops_driver_store = { .open = i2o_seq_open_driver_store, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_drivers_stored = { +static struct file_operations i2o_seq_fops_drivers_stored = { .open = i2o_seq_open_drivers_stored, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_groups = { +static struct file_operations i2o_seq_fops_groups = { .open = i2o_seq_open_groups, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_phys_device = { +static struct file_operations i2o_seq_fops_phys_device = { .open = i2o_seq_open_phys_device, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_claimed = { +static struct file_operations i2o_seq_fops_claimed = { .open = i2o_seq_open_claimed, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_users = { +static struct file_operations i2o_seq_fops_users = { .open = i2o_seq_open_users, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_priv_msgs = { +static struct file_operations i2o_seq_fops_priv_msgs = { .open = i2o_seq_open_priv_msgs, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_authorized_users = { +static struct file_operations i2o_seq_fops_authorized_users = { .open = i2o_seq_open_authorized_users, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_dev_name = { +static struct file_operations i2o_seq_fops_dev_name = { .open = i2o_seq_open_dev_name, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_dev_identity = { +static struct file_operations i2o_seq_fops_dev_identity = { .open = i2o_seq_open_dev_identity, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_ddm_identity = { +static struct file_operations i2o_seq_fops_ddm_identity = { .open = i2o_seq_open_ddm_identity, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_uinfo = { +static struct file_operations i2o_seq_fops_uinfo = { .open = i2o_seq_open_uinfo, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_sgl_limits = { +static struct file_operations i2o_seq_fops_sgl_limits = { .open = i2o_seq_open_sgl_limits, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const struct file_operations i2o_seq_fops_sensors = { +static struct file_operations i2o_seq_fops_sensors = { .open = i2o_seq_open_sensors, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/misc/hdpuftrs/hdpu_cpustate.c b/trunk/drivers/misc/hdpuftrs/hdpu_cpustate.c index ca86f113f36a..11a801be71c8 100644 --- a/trunk/drivers/misc/hdpuftrs/hdpu_cpustate.c +++ b/trunk/drivers/misc/hdpuftrs/hdpu_cpustate.c @@ -169,7 +169,7 @@ static struct platform_driver hdpu_cpustate_driver = { /* * The various file operations we support. */ -static const struct file_operations cpustate_fops = { +static struct file_operations cpustate_fops = { owner:THIS_MODULE, open:cpustate_open, release:cpustate_release, diff --git a/trunk/drivers/misc/ibmasm/ibmasmfs.c b/trunk/drivers/misc/ibmasm/ibmasmfs.c index c436d3de8b8b..b99dc507de2e 100644 --- a/trunk/drivers/misc/ibmasm/ibmasmfs.c +++ b/trunk/drivers/misc/ibmasm/ibmasmfs.c @@ -156,7 +156,7 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode) static struct dentry *ibmasmfs_create_file (struct super_block *sb, struct dentry *parent, const char *name, - const struct file_operations *fops, + struct file_operations *fops, void *data, int mode) { @@ -581,28 +581,28 @@ static ssize_t remote_settings_file_write(struct file *file, const char __user * return count; } -static const struct file_operations command_fops = { +static struct file_operations command_fops = { .open = command_file_open, .release = command_file_close, .read = command_file_read, .write = command_file_write, }; -static const struct file_operations event_fops = { +static struct file_operations event_fops = { .open = event_file_open, .release = event_file_close, .read = event_file_read, .write = event_file_write, }; -static const struct file_operations r_heartbeat_fops = { +static struct file_operations r_heartbeat_fops = { .open = r_heartbeat_file_open, .release = r_heartbeat_file_close, .read = r_heartbeat_file_read, .write = r_heartbeat_file_write, }; -static const struct file_operations remote_settings_fops = { +static struct file_operations remote_settings_fops = { .open = remote_settings_file_open, .release = remote_settings_file_close, .read = remote_settings_file_read, diff --git a/trunk/drivers/mtd/mtdchar.c b/trunk/drivers/mtd/mtdchar.c index 61a994ea8af1..3013d0883b97 100644 --- a/trunk/drivers/mtd/mtdchar.c +++ b/trunk/drivers/mtd/mtdchar.c @@ -759,7 +759,7 @@ static int mtd_ioctl(struct inode *inode, struct file *file, return ret; } /* memory_ioctl */ -static const struct file_operations mtd_fops = { +static struct file_operations mtd_fops = { .owner = THIS_MODULE, .llseek = mtd_lseek, .read = mtd_read, diff --git a/trunk/drivers/net/arcnet/com20020.c b/trunk/drivers/net/arcnet/com20020.c index 4218075c8aa3..aa9dd8f11269 100644 --- a/trunk/drivers/net/arcnet/com20020.c +++ b/trunk/drivers/net/arcnet/com20020.c @@ -338,8 +338,7 @@ static void com20020_set_mc_list(struct net_device *dev) } #if defined(CONFIG_ARCNET_COM20020_PCI_MODULE) || \ - defined(CONFIG_ARCNET_COM20020_ISA_MODULE) || \ - defined(CONFIG_ARCNET_COM20020_CS_MODULE) + defined(CONFIG_ARCNET_COM20020_ISA_MODULE) EXPORT_SYMBOL(com20020_check); EXPORT_SYMBOL(com20020_found); #endif diff --git a/trunk/drivers/net/bonding/bond_main.c b/trunk/drivers/net/bonding/bond_main.c index 61a6fa465d71..8ce8fec615ba 100644 --- a/trunk/drivers/net/bonding/bond_main.c +++ b/trunk/drivers/net/bonding/bond_main.c @@ -3120,7 +3120,7 @@ static int bond_info_open(struct inode *inode, struct file *file) return res; } -static const struct file_operations bond_info_fops = { +static struct file_operations bond_info_fops = { .owner = THIS_MODULE, .open = bond_info_open, .read = seq_read, diff --git a/trunk/drivers/net/hamradio/bpqether.c b/trunk/drivers/net/hamradio/bpqether.c index d2542697e298..5b788d84011f 100644 --- a/trunk/drivers/net/hamradio/bpqether.c +++ b/trunk/drivers/net/hamradio/bpqether.c @@ -459,7 +459,7 @@ static int bpq_info_open(struct inode *inode, struct file *file) return seq_open(file, &bpq_seqops); } -static const struct file_operations bpq_info_fops = { +static struct file_operations bpq_info_fops = { .owner = THIS_MODULE, .open = bpq_info_open, .read = seq_read, diff --git a/trunk/drivers/net/hamradio/scc.c b/trunk/drivers/net/hamradio/scc.c index 6fdaad5a4577..2ce047e9d262 100644 --- a/trunk/drivers/net/hamradio/scc.c +++ b/trunk/drivers/net/hamradio/scc.c @@ -2083,7 +2083,7 @@ static int scc_net_seq_open(struct inode *inode, struct file *file) return seq_open(file, &scc_net_seq_ops); } -static const struct file_operations scc_net_seq_fops = { +static struct file_operations scc_net_seq_fops = { .owner = THIS_MODULE, .open = scc_net_seq_open, .read = seq_read, diff --git a/trunk/drivers/net/hamradio/yam.c b/trunk/drivers/net/hamradio/yam.c index 08f27119a807..6d74f08720d5 100644 --- a/trunk/drivers/net/hamradio/yam.c +++ b/trunk/drivers/net/hamradio/yam.c @@ -804,7 +804,7 @@ static int yam_info_open(struct inode *inode, struct file *file) return seq_open(file, &yam_seqops); } -static const struct file_operations yam_info_fops = { +static struct file_operations yam_info_fops = { .owner = THIS_MODULE, .open = yam_info_open, .read = seq_read, diff --git a/trunk/drivers/net/ibmveth.c b/trunk/drivers/net/ibmveth.c index 458db0538a9a..99343b5836b8 100644 --- a/trunk/drivers/net/ibmveth.c +++ b/trunk/drivers/net/ibmveth.c @@ -1156,7 +1156,7 @@ static int ibmveth_proc_open(struct inode *inode, struct file *file) return rc; } -static const struct file_operations ibmveth_proc_fops = { +static struct file_operations ibmveth_proc_fops = { .owner = THIS_MODULE, .open = ibmveth_proc_open, .read = seq_read, diff --git a/trunk/drivers/net/irda/vlsi_ir.c b/trunk/drivers/net/irda/vlsi_ir.c index 3457e9d8b667..e2b1af618450 100644 --- a/trunk/drivers/net/irda/vlsi_ir.c +++ b/trunk/drivers/net/irda/vlsi_ir.c @@ -385,7 +385,7 @@ static int vlsi_seq_open(struct inode *inode, struct file *file) return single_open(file, vlsi_seq_show, PDE(inode)->data); } -static const struct file_operations vlsi_proc_fops = { +static struct file_operations vlsi_proc_fops = { .owner = THIS_MODULE, .open = vlsi_seq_open, .read = seq_read, diff --git a/trunk/drivers/net/ppp_generic.c b/trunk/drivers/net/ppp_generic.c index 11b575f89856..0986f6c843e6 100644 --- a/trunk/drivers/net/ppp_generic.c +++ b/trunk/drivers/net/ppp_generic.c @@ -834,7 +834,7 @@ static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file, return err; } -static const struct file_operations ppp_device_fops = { +static struct file_operations ppp_device_fops = { .owner = THIS_MODULE, .read = ppp_read, .write = ppp_write, diff --git a/trunk/drivers/net/pppoe.c b/trunk/drivers/net/pppoe.c index 860bb0f60f68..315d5c3fc66a 100644 --- a/trunk/drivers/net/pppoe.c +++ b/trunk/drivers/net/pppoe.c @@ -1043,7 +1043,7 @@ static int pppoe_seq_open(struct inode *inode, struct file *file) return seq_open(file, &pppoe_seq_ops); } -static const struct file_operations pppoe_seq_fops = { +static struct file_operations pppoe_seq_fops = { .owner = THIS_MODULE, .open = pppoe_seq_open, .read = seq_read, diff --git a/trunk/drivers/net/tun.c b/trunk/drivers/net/tun.c index 5643d1e84ed6..151a2e10e4f3 100644 --- a/trunk/drivers/net/tun.c +++ b/trunk/drivers/net/tun.c @@ -744,7 +744,7 @@ static int tun_chr_close(struct inode *inode, struct file *file) return 0; } -static const struct file_operations tun_fops = { +static struct file_operations tun_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = do_sync_read, diff --git a/trunk/drivers/net/wan/cosa.c b/trunk/drivers/net/wan/cosa.c index e91b5a84a20a..6c7dfb50143f 100644 --- a/trunk/drivers/net/wan/cosa.c +++ b/trunk/drivers/net/wan/cosa.c @@ -311,7 +311,7 @@ static int cosa_chardev_ioctl(struct inode *inode, struct file *file, static int cosa_fasync(struct inode *inode, struct file *file, int on); #endif -static const struct file_operations cosa_fops = { +static struct file_operations cosa_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = cosa_read, diff --git a/trunk/drivers/net/wireless/airo.c b/trunk/drivers/net/wireless/airo.c index b08055abe83a..44a22701da97 100644 --- a/trunk/drivers/net/wireless/airo.c +++ b/trunk/drivers/net/wireless/airo.c @@ -4430,53 +4430,53 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ); static int proc_config_open( struct inode *inode, struct file *file ); static int proc_wepkey_open( struct inode *inode, struct file *file ); -static const struct file_operations proc_statsdelta_ops = { +static struct file_operations proc_statsdelta_ops = { .read = proc_read, .open = proc_statsdelta_open, .release = proc_close }; -static const struct file_operations proc_stats_ops = { +static struct file_operations proc_stats_ops = { .read = proc_read, .open = proc_stats_open, .release = proc_close }; -static const struct file_operations proc_status_ops = { +static struct file_operations proc_status_ops = { .read = proc_read, .open = proc_status_open, .release = proc_close }; -static const struct file_operations proc_SSID_ops = { +static struct file_operations proc_SSID_ops = { .read = proc_read, .write = proc_write, .open = proc_SSID_open, .release = proc_close }; -static const struct file_operations proc_BSSList_ops = { +static struct file_operations proc_BSSList_ops = { .read = proc_read, .write = proc_write, .open = proc_BSSList_open, .release = proc_close }; -static const struct file_operations proc_APList_ops = { +static struct file_operations proc_APList_ops = { .read = proc_read, .write = proc_write, .open = proc_APList_open, .release = proc_close }; -static const struct file_operations proc_config_ops = { +static struct file_operations proc_config_ops = { .read = proc_read, .write = proc_write, .open = proc_config_open, .release = proc_close }; -static const struct file_operations proc_wepkey_ops = { +static struct file_operations proc_wepkey_ops = { .read = proc_read, .write = proc_write, .open = proc_wepkey_open, diff --git a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c index 35dbe4554513..b9df06a06ea9 100644 --- a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c +++ b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_debugfs.c @@ -355,37 +355,37 @@ static ssize_t restart_write_file(struct file *file, const char __user *user_buf #undef fappend -static const struct file_operations devinfo_fops = { +static struct file_operations devinfo_fops = { .read = devinfo_read_file, .write = write_file_dummy, .open = open_file_generic, }; -static const struct file_operations spromdump_fops = { +static struct file_operations spromdump_fops = { .read = spromdump_read_file, .write = write_file_dummy, .open = open_file_generic, }; -static const struct file_operations drvinfo_fops = { +static struct file_operations drvinfo_fops = { .read = drvinfo_read_file, .write = write_file_dummy, .open = open_file_generic, }; -static const struct file_operations tsf_fops = { +static struct file_operations tsf_fops = { .read = tsf_read_file, .write = tsf_write_file, .open = open_file_generic, }; -static const struct file_operations txstat_fops = { +static struct file_operations txstat_fops = { .read = txstat_read_file, .write = write_file_dummy, .open = open_file_generic, }; -static const struct file_operations restart_fops = { +static struct file_operations restart_fops = { .write = restart_write_file, .open = open_file_generic, }; diff --git a/trunk/drivers/net/wireless/strip.c b/trunk/drivers/net/wireless/strip.c index f5ce1c6063d8..ce3a8bac66ff 100644 --- a/trunk/drivers/net/wireless/strip.c +++ b/trunk/drivers/net/wireless/strip.c @@ -1160,7 +1160,7 @@ static int strip_seq_open(struct inode *inode, struct file *file) return seq_open(file, &strip_seq_ops); } -static const struct file_operations strip_seq_fops = { +static struct file_operations strip_seq_fops = { .owner = THIS_MODULE, .open = strip_seq_open, .read = seq_read, diff --git a/trunk/drivers/oprofile/event_buffer.c b/trunk/drivers/oprofile/event_buffer.c index 00e937e9240e..04d641714d34 100644 --- a/trunk/drivers/oprofile/event_buffer.c +++ b/trunk/drivers/oprofile/event_buffer.c @@ -181,7 +181,7 @@ static ssize_t event_buffer_read(struct file * file, char __user * buf, return retval; } -const struct file_operations event_buffer_fops = { +struct file_operations event_buffer_fops = { .open = event_buffer_open, .release = event_buffer_release, .read = event_buffer_read, diff --git a/trunk/drivers/oprofile/event_buffer.h b/trunk/drivers/oprofile/event_buffer.h index 9b6a4ebd03e3..92416276e577 100644 --- a/trunk/drivers/oprofile/event_buffer.h +++ b/trunk/drivers/oprofile/event_buffer.h @@ -41,7 +41,7 @@ void wake_up_buffer_waiter(void); /* add data to the event buffer */ void add_event_entry(unsigned long data); -extern const struct file_operations event_buffer_fops; +extern struct file_operations event_buffer_fops; /* mutex between sync_cpu_buffers() and the * file reading code. diff --git a/trunk/drivers/oprofile/oprofile_files.c b/trunk/drivers/oprofile/oprofile_files.c index ef953ba5ab6b..a72006c08f2b 100644 --- a/trunk/drivers/oprofile/oprofile_files.c +++ b/trunk/drivers/oprofile/oprofile_files.c @@ -44,7 +44,7 @@ static ssize_t depth_write(struct file * file, char const __user * buf, size_t c } -static const struct file_operations depth_fops = { +static struct file_operations depth_fops = { .read = depth_read, .write = depth_write }; @@ -56,7 +56,7 @@ static ssize_t pointer_size_read(struct file * file, char __user * buf, size_t c } -static const struct file_operations pointer_size_fops = { +static struct file_operations pointer_size_fops = { .read = pointer_size_read, }; @@ -67,7 +67,7 @@ static ssize_t cpu_type_read(struct file * file, char __user * buf, size_t count } -static const struct file_operations cpu_type_fops = { +static struct file_operations cpu_type_fops = { .read = cpu_type_read, }; @@ -101,7 +101,7 @@ static ssize_t enable_write(struct file * file, char const __user * buf, size_t } -static const struct file_operations enable_fops = { +static struct file_operations enable_fops = { .read = enable_read, .write = enable_write, }; @@ -114,7 +114,7 @@ static ssize_t dump_write(struct file * file, char const __user * buf, size_t co } -static const struct file_operations dump_fops = { +static struct file_operations dump_fops = { .write = dump_write, }; diff --git a/trunk/drivers/oprofile/oprofilefs.c b/trunk/drivers/oprofile/oprofilefs.c index 6e67b42ca46d..5756401fb15b 100644 --- a/trunk/drivers/oprofile/oprofilefs.c +++ b/trunk/drivers/oprofile/oprofilefs.c @@ -115,14 +115,14 @@ static int default_open(struct inode * inode, struct file * filp) } -static const struct file_operations ulong_fops = { +static struct file_operations ulong_fops = { .read = ulong_read_file, .write = ulong_write_file, .open = default_open, }; -static const struct file_operations ulong_ro_fops = { +static struct file_operations ulong_ro_fops = { .read = ulong_read_file, .open = default_open, }; @@ -182,7 +182,7 @@ static ssize_t atomic_read_file(struct file * file, char __user * buf, size_t co } -static const struct file_operations atomic_ro_fops = { +static struct file_operations atomic_ro_fops = { .read = atomic_read_file, .open = default_open, }; diff --git a/trunk/drivers/parisc/ccio-dma.c b/trunk/drivers/parisc/ccio-dma.c index 894fdb9d44c0..fe3f5f5365c5 100644 --- a/trunk/drivers/parisc/ccio-dma.c +++ b/trunk/drivers/parisc/ccio-dma.c @@ -1091,7 +1091,7 @@ static int ccio_proc_info_open(struct inode *inode, struct file *file) return single_open(file, &ccio_proc_info, NULL); } -static const struct file_operations ccio_proc_info_fops = { +static struct file_operations ccio_proc_info_fops = { .owner = THIS_MODULE, .open = ccio_proc_info_open, .read = seq_read, @@ -1127,7 +1127,7 @@ static int ccio_proc_bitmap_open(struct inode *inode, struct file *file) return single_open(file, &ccio_proc_bitmap_info, NULL); } -static const struct file_operations ccio_proc_bitmap_fops = { +static struct file_operations ccio_proc_bitmap_fops = { .owner = THIS_MODULE, .open = ccio_proc_bitmap_open, .read = seq_read, diff --git a/trunk/drivers/parisc/eisa_eeprom.c b/trunk/drivers/parisc/eisa_eeprom.c index 86e9c84a965e..e13aafa70bf5 100644 --- a/trunk/drivers/parisc/eisa_eeprom.c +++ b/trunk/drivers/parisc/eisa_eeprom.c @@ -97,7 +97,7 @@ static int eisa_eeprom_release(struct inode *inode, struct file *file) /* * The various file operations we support. */ -static const struct file_operations eisa_eeprom_fops = { +static struct file_operations eisa_eeprom_fops = { .owner = THIS_MODULE, .llseek = eisa_eeprom_llseek, .read = eisa_eeprom_read, diff --git a/trunk/drivers/parisc/sba_iommu.c b/trunk/drivers/parisc/sba_iommu.c index 76a29dadd519..f1e7ccd5475b 100644 --- a/trunk/drivers/parisc/sba_iommu.c +++ b/trunk/drivers/parisc/sba_iommu.c @@ -1799,7 +1799,7 @@ sba_proc_open(struct inode *i, struct file *f) return single_open(f, &sba_proc_info, NULL); } -static const struct file_operations sba_proc_fops = { +static struct file_operations sba_proc_fops = { .owner = THIS_MODULE, .open = sba_proc_open, .read = seq_read, @@ -1831,7 +1831,7 @@ sba_proc_bitmap_open(struct inode *i, struct file *f) return single_open(f, &sba_proc_bitmap_info, NULL); } -static const struct file_operations sba_proc_bitmap_fops = { +static struct file_operations sba_proc_bitmap_fops = { .owner = THIS_MODULE, .open = sba_proc_bitmap_open, .read = seq_read, diff --git a/trunk/drivers/pci/hotplug/cpqphp_sysfs.c b/trunk/drivers/pci/hotplug/cpqphp_sysfs.c index a13abf55d784..634f74d919d3 100644 --- a/trunk/drivers/pci/hotplug/cpqphp_sysfs.c +++ b/trunk/drivers/pci/hotplug/cpqphp_sysfs.c @@ -202,7 +202,7 @@ static int release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations debug_ops = { +static struct file_operations debug_ops = { .owner = THIS_MODULE, .open = open, .llseek = lseek, diff --git a/trunk/drivers/pci/proc.c b/trunk/drivers/pci/proc.c index ed87aa59f0b1..4a6760a3b31f 100644 --- a/trunk/drivers/pci/proc.c +++ b/trunk/drivers/pci/proc.c @@ -287,7 +287,7 @@ static int proc_bus_pci_release(struct inode *inode, struct file *file) } #endif /* HAVE_PCI_MMAP */ -static const struct file_operations proc_bus_pci_operations = { +static struct file_operations proc_bus_pci_operations = { .llseek = proc_bus_pci_lseek, .read = proc_bus_pci_read, .write = proc_bus_pci_write, @@ -456,7 +456,7 @@ static int proc_bus_pci_dev_open(struct inode *inode, struct file *file) { return seq_open(file, &proc_bus_pci_devices_op); } -static const struct file_operations proc_bus_pci_dev_operations = { +static struct file_operations proc_bus_pci_dev_operations = { .open = proc_bus_pci_dev_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/pcmcia/pcmcia_ioctl.c b/trunk/drivers/pcmcia/pcmcia_ioctl.c index 27523c5f4dad..88494149e910 100644 --- a/trunk/drivers/pcmcia/pcmcia_ioctl.c +++ b/trunk/drivers/pcmcia/pcmcia_ioctl.c @@ -765,7 +765,7 @@ static int ds_ioctl(struct inode * inode, struct file * file, /*====================================================================*/ -static const struct file_operations ds_fops = { +static struct file_operations ds_fops = { .owner = THIS_MODULE, .open = ds_open, .release = ds_release, diff --git a/trunk/drivers/pnp/isapnp/proc.c b/trunk/drivers/pnp/isapnp/proc.c index 40b724ebe23b..d21f3c1e72fc 100644 --- a/trunk/drivers/pnp/isapnp/proc.c +++ b/trunk/drivers/pnp/isapnp/proc.c @@ -85,7 +85,7 @@ static ssize_t isapnp_proc_bus_read(struct file *file, char __user *buf, size_t return nbytes; } -static const struct file_operations isapnp_proc_bus_file_operations = +static struct file_operations isapnp_proc_bus_file_operations = { .llseek = isapnp_proc_bus_lseek, .read = isapnp_proc_bus_read, diff --git a/trunk/drivers/ps3/Makefile b/trunk/drivers/ps3/Makefile index 96958c03cf61..d547cf50ca9d 100644 --- a/trunk/drivers/ps3/Makefile +++ b/trunk/drivers/ps3/Makefile @@ -1,2 +1 @@ obj-$(CONFIG_PS3_VUART) += vuart.o -obj-$(CONFIG_PS3_PS3AV) += ps3av.o ps3av_cmd.o diff --git a/trunk/drivers/ps3/ps3av.c b/trunk/drivers/ps3/ps3av.c deleted file mode 100644 index 1926b4d3e1f4..000000000000 --- a/trunk/drivers/ps3/ps3av.c +++ /dev/null @@ -1,974 +0,0 @@ -/* - * Copyright (C) 2006 Sony Computer Entertainment Inc. - * Copyright 2006, 2007 Sony Corporation - * - * AV backend support for PS3 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published - * by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "vuart.h" - -#define BUFSIZE 4096 /* vuart buf size */ -#define PS3AV_BUF_SIZE 512 /* max packet size */ - -static int timeout = 5000; /* in msec ( 5 sec ) */ -module_param(timeout, int, 0644); - -static struct ps3av ps3av; - -static struct ps3_vuart_port_device ps3av_dev = { - .match_id = PS3_MATCH_ID_AV_SETTINGS -}; - -/* color space */ -#define YUV444 PS3AV_CMD_VIDEO_CS_YUV444_8 -#define RGB8 PS3AV_CMD_VIDEO_CS_RGB_8 -/* format */ -#define XRGB PS3AV_CMD_VIDEO_FMT_X8R8G8B8 -/* aspect */ -#define A_N PS3AV_CMD_AV_ASPECT_4_3 -#define A_W PS3AV_CMD_AV_ASPECT_16_9 -static const struct avset_video_mode { - u32 cs; - u32 fmt; - u32 vid; - u32 aspect; - u32 x; - u32 y; - u32 interlace; - u32 freq; -} video_mode_table[] = { - { 0, }, /* auto */ - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_480I, A_N, 720, 480, 1, 60}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_480P, A_N, 720, 480, 0, 60}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_720P_60HZ, A_N, 1280, 720, 0, 60}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080I_60HZ, A_W, 1920, 1080, 1, 60}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080P_60HZ, A_W, 1920, 1080, 0, 60}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_576I, A_N, 720, 576, 1, 50}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_576P, A_N, 720, 576, 0, 50}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_720P_50HZ, A_N, 1280, 720, 0, 50}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080I_50HZ, A_W, 1920, 1080, 1, 50}, - {YUV444, XRGB, PS3AV_CMD_VIDEO_VID_1080P_50HZ, A_W, 1920, 1080, 0, 50}, - { RGB8, XRGB, PS3AV_CMD_VIDEO_VID_WXGA, A_W, 1280, 768, 0, 60}, - { RGB8, XRGB, PS3AV_CMD_VIDEO_VID_SXGA, A_N, 1280, 1024, 0, 60}, - { RGB8, XRGB, PS3AV_CMD_VIDEO_VID_WUXGA, A_W, 1920, 1200, 0, 60}, -}; - -/* supported CIDs */ -static u32 cmd_table[] = { - /* init */ - PS3AV_CID_AV_INIT, - PS3AV_CID_AV_FIN, - PS3AV_CID_VIDEO_INIT, - PS3AV_CID_AUDIO_INIT, - - /* set */ - PS3AV_CID_AV_ENABLE_EVENT, - PS3AV_CID_AV_DISABLE_EVENT, - - PS3AV_CID_AV_VIDEO_CS, - PS3AV_CID_AV_VIDEO_MUTE, - PS3AV_CID_AV_VIDEO_DISABLE_SIG, - PS3AV_CID_AV_AUDIO_PARAM, - PS3AV_CID_AV_AUDIO_MUTE, - PS3AV_CID_AV_HDMI_MODE, - PS3AV_CID_AV_TV_MUTE, - - PS3AV_CID_VIDEO_MODE, - PS3AV_CID_VIDEO_FORMAT, - PS3AV_CID_VIDEO_PITCH, - - PS3AV_CID_AUDIO_MODE, - PS3AV_CID_AUDIO_MUTE, - PS3AV_CID_AUDIO_ACTIVE, - PS3AV_CID_AUDIO_INACTIVE, - PS3AV_CID_AVB_PARAM, - - /* get */ - PS3AV_CID_AV_GET_HW_CONF, - PS3AV_CID_AV_GET_MONITOR_INFO, - - /* event */ - PS3AV_CID_EVENT_UNPLUGGED, - PS3AV_CID_EVENT_PLUGGED, - PS3AV_CID_EVENT_HDCP_DONE, - PS3AV_CID_EVENT_HDCP_FAIL, - PS3AV_CID_EVENT_HDCP_AUTH, - PS3AV_CID_EVENT_HDCP_ERROR, - - 0 -}; - -#define PS3AV_EVENT_CMD_MASK 0x10000000 -#define PS3AV_EVENT_ID_MASK 0x0000ffff -#define PS3AV_CID_MASK 0xffffffff -#define PS3AV_REPLY_BIT 0x80000000 - -#define ps3av_event_get_port_id(cid) ((cid >> 16) & 0xff) - -static u32 *ps3av_search_cmd_table(u32 cid, u32 mask) -{ - u32 *table; - int i; - - table = cmd_table; - for (i = 0;; table++, i++) { - if ((*table & mask) == (cid & mask)) - break; - if (*table == 0) - return NULL; - } - return table; -} - -static int ps3av_parse_event_packet(const struct ps3av_reply_hdr *hdr) -{ - u32 *table; - - if (hdr->cid & PS3AV_EVENT_CMD_MASK) { - table = ps3av_search_cmd_table(hdr->cid, PS3AV_EVENT_CMD_MASK); - if (table) - dev_dbg(&ps3av_dev.core, - "recv event packet cid:%08x port:0x%x size:%d\n", - hdr->cid, ps3av_event_get_port_id(hdr->cid), - hdr->size); - else - printk(KERN_ERR - "%s: failed event packet, cid:%08x size:%d\n", - __FUNCTION__, hdr->cid, hdr->size); - return 1; /* receive event packet */ - } - return 0; -} - -static int ps3av_send_cmd_pkt(const struct ps3av_send_hdr *send_buf, - struct ps3av_reply_hdr *recv_buf, int write_len, - int read_len) -{ - int res; - u32 cmd; - int event; - - if (!ps3av.available) - return -ENODEV; - - /* send pkt */ - res = ps3av_vuart_write(ps3av.dev, send_buf, write_len); - if (res < 0) { - dev_dbg(&ps3av_dev.core, - "%s: ps3av_vuart_write() failed (result=%d)\n", - __FUNCTION__, res); - return res; - } - - /* recv pkt */ - cmd = send_buf->cid; - do { - /* read header */ - res = ps3av_vuart_read(ps3av.dev, recv_buf, PS3AV_HDR_SIZE, - timeout); - if (res != PS3AV_HDR_SIZE) { - dev_dbg(&ps3av_dev.core, - "%s: ps3av_vuart_read() failed (result=%d)\n", - __FUNCTION__, res); - return res; - } - - /* read body */ - res = ps3av_vuart_read(ps3av.dev, &recv_buf->cid, - recv_buf->size, timeout); - if (res < 0) { - dev_dbg(&ps3av_dev.core, - "%s: ps3av_vuart_read() failed (result=%d)\n", - __FUNCTION__, res); - return res; - } - res += PS3AV_HDR_SIZE; /* total len */ - event = ps3av_parse_event_packet(recv_buf); - /* ret > 0 event packet */ - } while (event); - - if ((cmd | PS3AV_REPLY_BIT) != recv_buf->cid) { - dev_dbg(&ps3av_dev.core, "%s: reply err (result=%x)\n", - __FUNCTION__, recv_buf->cid); - return -EINVAL; - } - - return 0; -} - -static int ps3av_process_reply_packet(struct ps3av_send_hdr *cmd_buf, - const struct ps3av_reply_hdr *recv_buf, - int user_buf_size) -{ - int return_len; - - if (recv_buf->version != PS3AV_VERSION) { - dev_dbg(&ps3av_dev.core, "reply_packet invalid version:%x\n", - recv_buf->version); - return -EFAULT; - } - return_len = recv_buf->size + PS3AV_HDR_SIZE; - if (return_len > user_buf_size) - return_len = user_buf_size; - memcpy(cmd_buf, recv_buf, return_len); - return 0; /* success */ -} - -void ps3av_set_hdr(u32 cid, u16 size, struct ps3av_send_hdr *hdr) -{ - hdr->version = PS3AV_VERSION; - hdr->size = size - PS3AV_HDR_SIZE; - hdr->cid = cid; -} - -int ps3av_do_pkt(u32 cid, u16 send_len, size_t usr_buf_size, - struct ps3av_send_hdr *buf) -{ - int res = 0; - union { - struct ps3av_reply_hdr reply_hdr; - u8 raw[PS3AV_BUF_SIZE]; - } recv_buf; - - u32 *table; - - BUG_ON(!ps3av.available); - - if (down_interruptible(&ps3av.sem)) - return -ERESTARTSYS; - - table = ps3av_search_cmd_table(cid, PS3AV_CID_MASK); - BUG_ON(!table); - BUG_ON(send_len < PS3AV_HDR_SIZE); - BUG_ON(usr_buf_size < send_len); - BUG_ON(usr_buf_size > PS3AV_BUF_SIZE); - - /* create header */ - ps3av_set_hdr(cid, send_len, buf); - - /* send packet via vuart */ - res = ps3av_send_cmd_pkt(buf, &recv_buf.reply_hdr, send_len, - usr_buf_size); - if (res < 0) { - printk(KERN_ERR - "%s: ps3av_send_cmd_pkt() failed (result=%d)\n", - __FUNCTION__, res); - goto err; - } - - /* process reply packet */ - res = ps3av_process_reply_packet(buf, &recv_buf.reply_hdr, - usr_buf_size); - if (res < 0) { - printk(KERN_ERR "%s: put_return_status() failed (result=%d)\n", - __FUNCTION__, res); - goto err; - } - - up(&ps3av.sem); - return 0; - - err: - up(&ps3av.sem); - printk(KERN_ERR "%s: failed cid:%x res:%d\n", __FUNCTION__, cid, res); - return res; -} - -static int ps3av_set_av_video_mute(u32 mute) -{ - int i, num_of_av_port, res; - - num_of_av_port = ps3av.av_hw_conf.num_of_hdmi + - ps3av.av_hw_conf.num_of_avmulti; - /* video mute on */ - for (i = 0; i < num_of_av_port; i++) { - res = ps3av_cmd_av_video_mute(1, &ps3av.av_port[i], mute); - if (res < 0) - return -1; - } - - return 0; -} - -static int ps3av_set_video_disable_sig(void) -{ - int i, num_of_hdmi_port, num_of_av_port, res; - - num_of_hdmi_port = ps3av.av_hw_conf.num_of_hdmi; - num_of_av_port = ps3av.av_hw_conf.num_of_hdmi + - ps3av.av_hw_conf.num_of_avmulti; - - /* tv mute */ - for (i = 0; i < num_of_hdmi_port; i++) { - res = ps3av_cmd_av_tv_mute(ps3av.av_port[i], - PS3AV_CMD_MUTE_ON); - if (res < 0) - return -1; - } - msleep(100); - - /* video mute on */ - for (i = 0; i < num_of_av_port; i++) { - res = ps3av_cmd_av_video_disable_sig(ps3av.av_port[i]); - if (res < 0) - return -1; - if (i < num_of_hdmi_port) { - res = ps3av_cmd_av_tv_mute(ps3av.av_port[i], - PS3AV_CMD_MUTE_OFF); - if (res < 0) - return -1; - } - } - msleep(300); - - return 0; -} - -static int ps3av_set_audio_mute(u32 mute) -{ - int i, num_of_av_port, num_of_opt_port, res; - - num_of_av_port = ps3av.av_hw_conf.num_of_hdmi + - ps3av.av_hw_conf.num_of_avmulti; - num_of_opt_port = ps3av.av_hw_conf.num_of_spdif; - - for (i = 0; i < num_of_av_port; i++) { - res = ps3av_cmd_av_audio_mute(1, &ps3av.av_port[i], mute); - if (res < 0) - return -1; - } - for (i = 0; i < num_of_opt_port; i++) { - res = ps3av_cmd_audio_mute(1, &ps3av.opt_port[i], mute); - if (res < 0) - return -1; - } - - return 0; -} - -int ps3av_set_audio_mode(u32 ch, u32 fs, u32 word_bits, u32 format, u32 source) -{ - struct ps3av_pkt_avb_param avb_param; - int i, num_of_audio, vid, res; - struct ps3av_pkt_audio_mode audio_mode; - u32 len = 0; - - num_of_audio = ps3av.av_hw_conf.num_of_hdmi + - ps3av.av_hw_conf.num_of_avmulti + - ps3av.av_hw_conf.num_of_spdif; - - avb_param.num_of_video_pkt = 0; - avb_param.num_of_audio_pkt = PS3AV_AVB_NUM_AUDIO; /* always 0 */ - avb_param.num_of_av_video_pkt = 0; - avb_param.num_of_av_audio_pkt = ps3av.av_hw_conf.num_of_hdmi; - - vid = video_mode_table[ps3av.ps3av_mode].vid; - - /* audio mute */ - ps3av_set_audio_mute(PS3AV_CMD_MUTE_ON); - - /* audio inactive */ - res = ps3av_cmd_audio_active(0, ps3av.audio_port); - if (res < 0) - dev_dbg(&ps3av_dev.core, - "ps3av_cmd_audio_active OFF failed\n"); - - /* audio_pkt */ - for (i = 0; i < num_of_audio; i++) { - ps3av_cmd_set_audio_mode(&audio_mode, ps3av.av_port[i], ch, fs, - word_bits, format, source); - if (i < ps3av.av_hw_conf.num_of_hdmi) { - /* hdmi only */ - len += ps3av_cmd_set_av_audio_param(&avb_param.buf[len], - ps3av.av_port[i], - &audio_mode, vid); - } - /* audio_mode pkt should be sent separately */ - res = ps3av_cmd_audio_mode(&audio_mode); - if (res < 0) - dev_dbg(&ps3av_dev.core, - "ps3av_cmd_audio_mode failed, port:%x\n", i); - } - - /* send command using avb pkt */ - len += offsetof(struct ps3av_pkt_avb_param, buf); - res = ps3av_cmd_avb_param(&avb_param, len); - if (res < 0) - dev_dbg(&ps3av_dev.core, "ps3av_cmd_avb_param failed\n"); - - /* audio mute */ - ps3av_set_audio_mute(PS3AV_CMD_MUTE_OFF); - - /* audio active */ - res = ps3av_cmd_audio_active(1, ps3av.audio_port); - if (res < 0) - dev_dbg(&ps3av_dev.core, "ps3av_cmd_audio_active ON failed\n"); - - return 0; -} - -EXPORT_SYMBOL_GPL(ps3av_set_audio_mode); - -static int ps3av_set_videomode(void) -{ - /* av video mute */ - ps3av_set_av_video_mute(PS3AV_CMD_MUTE_ON); - - /* wake up ps3avd to do the actual video mode setting */ - up(&ps3av.ping); - - return 0; -} - -static void ps3av_set_videomode_cont(u32 id, u32 old_id) -{ - struct ps3av_pkt_avb_param avb_param; - int i; - u32 len = 0, av_video_cs; - const struct avset_video_mode *video_mode; - int res; - - video_mode = &video_mode_table[id & PS3AV_MODE_MASK]; - - avb_param.num_of_video_pkt = PS3AV_AVB_NUM_VIDEO; /* num of head */ - avb_param.num_of_audio_pkt = 0; - avb_param.num_of_av_video_pkt = ps3av.av_hw_conf.num_of_hdmi + - ps3av.av_hw_conf.num_of_avmulti; - avb_param.num_of_av_audio_pkt = 0; - - /* video signal off */ - ps3av_set_video_disable_sig(); - - /* Retail PS3 product doesn't support this */ - if (id & PS3AV_MODE_HDCP_OFF) { - res = ps3av_cmd_av_hdmi_mode(PS3AV_CMD_AV_HDMI_HDCP_OFF); - if (res == PS3AV_STATUS_UNSUPPORTED_HDMI_MODE) - dev_dbg(&ps3av_dev.core, "Not supported\n"); - else if (res) - dev_dbg(&ps3av_dev.core, - "ps3av_cmd_av_hdmi_mode failed\n"); - } else if (old_id & PS3AV_MODE_HDCP_OFF) { - res = ps3av_cmd_av_hdmi_mode(PS3AV_CMD_AV_HDMI_MODE_NORMAL); - if (res < 0 && res != PS3AV_STATUS_UNSUPPORTED_HDMI_MODE) - dev_dbg(&ps3av_dev.core, - "ps3av_cmd_av_hdmi_mode failed\n"); - } - - /* video_pkt */ - for (i = 0; i < avb_param.num_of_video_pkt; i++) - len += ps3av_cmd_set_video_mode(&avb_param.buf[len], - ps3av.head[i], video_mode->vid, - video_mode->fmt, id); - /* av_video_pkt */ - for (i = 0; i < avb_param.num_of_av_video_pkt; i++) { - if (id & PS3AV_MODE_DVI || id & PS3AV_MODE_RGB) - av_video_cs = RGB8; - else - av_video_cs = video_mode->cs; -#ifndef PS3AV_HDMI_YUV - if (ps3av.av_port[i] == PS3AV_CMD_AVPORT_HDMI_0 || - ps3av.av_port[i] == PS3AV_CMD_AVPORT_HDMI_1) - av_video_cs = RGB8; /* use RGB for HDMI */ -#endif - len += ps3av_cmd_set_av_video_cs(&avb_param.buf[len], - ps3av.av_port[i], - video_mode->vid, av_video_cs, - video_mode->aspect, id); - } - /* send command using avb pkt */ - len += offsetof(struct ps3av_pkt_avb_param, buf); - res = ps3av_cmd_avb_param(&avb_param, len); - if (res == PS3AV_STATUS_NO_SYNC_HEAD) - printk(KERN_WARNING - "%s: Command failed. Please try your request again. \n", - __FUNCTION__); - else if (res) - dev_dbg(&ps3av_dev.core, "ps3av_cmd_avb_param failed\n"); - - msleep(1500); - /* av video mute */ - ps3av_set_av_video_mute(PS3AV_CMD_MUTE_OFF); -} - -static int ps3avd(void *p) -{ - struct ps3av *info = p; - - daemonize("ps3avd"); - while (1) { - down(&info->ping); - ps3av_set_videomode_cont(info->ps3av_mode, - info->ps3av_mode_old); - up(&info->pong); - } - return 0; -} - -static int ps3av_vid2table_id(int vid) -{ - int i; - - for (i = 1; i < ARRAY_SIZE(video_mode_table); i++) - if (video_mode_table[i].vid == vid) - return i; - return -1; -} - -static int ps3av_resbit2vid(u32 res_50, u32 res_60) -{ - int vid = -1; - - if (res_50 > res_60) { /* if res_50 == res_60, res_60 will be used */ - if (res_50 & PS3AV_RESBIT_1920x1080P) - vid = PS3AV_CMD_VIDEO_VID_1080P_50HZ; - else if (res_50 & PS3AV_RESBIT_1920x1080I) - vid = PS3AV_CMD_VIDEO_VID_1080I_50HZ; - else if (res_50 & PS3AV_RESBIT_1280x720P) - vid = PS3AV_CMD_VIDEO_VID_720P_50HZ; - else if (res_50 & PS3AV_RESBIT_720x576P) - vid = PS3AV_CMD_VIDEO_VID_576P; - else - vid = -1; - } else { - if (res_60 & PS3AV_RESBIT_1920x1080P) - vid = PS3AV_CMD_VIDEO_VID_1080P_60HZ; - else if (res_60 & PS3AV_RESBIT_1920x1080I) - vid = PS3AV_CMD_VIDEO_VID_1080I_60HZ; - else if (res_60 & PS3AV_RESBIT_1280x720P) - vid = PS3AV_CMD_VIDEO_VID_720P_60HZ; - else if (res_60 & PS3AV_RESBIT_720x480P) - vid = PS3AV_CMD_VIDEO_VID_480P; - else - vid = -1; - } - return vid; -} - -static int ps3av_hdmi_get_vid(struct ps3av_info_monitor *info) -{ - u32 res_50, res_60; - int vid = -1; - - if (info->monitor_type != PS3AV_MONITOR_TYPE_HDMI) - return -1; - - /* check native resolution */ - res_50 = info->res_50.native & PS3AV_RES_MASK_50; - res_60 = info->res_60.native & PS3AV_RES_MASK_60; - if (res_50 || res_60) { - vid = ps3av_resbit2vid(res_50, res_60); - return vid; - } - - /* check resolution */ - res_50 = info->res_50.res_bits & PS3AV_RES_MASK_50; - res_60 = info->res_60.res_bits & PS3AV_RES_MASK_60; - if (res_50 || res_60) { - vid = ps3av_resbit2vid(res_50, res_60); - return vid; - } - - if (ps3av.region & PS3AV_REGION_60) - vid = PS3AV_DEFAULT_HDMI_VID_REG_60; - else - vid = PS3AV_DEFAULT_HDMI_VID_REG_50; - return vid; -} - -static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf, - int boot) -{ - int i, res, vid = -1, dvi = 0, rgb = 0; - struct ps3av_pkt_av_get_monitor_info monitor_info; - struct ps3av_info_monitor *info; - - /* get vid for hdmi */ - for (i = 0; i < av_hw_conf->num_of_hdmi; i++) { - res = ps3av_cmd_video_get_monitor_info(&monitor_info, - PS3AV_CMD_AVPORT_HDMI_0 + - i); - if (res < 0) - return -1; - - ps3av_cmd_av_monitor_info_dump(&monitor_info); - info = &monitor_info.info; - /* check DVI */ - if (info->monitor_type == PS3AV_MONITOR_TYPE_DVI) { - dvi = PS3AV_MODE_DVI; - break; - } - /* check HDMI */ - vid = ps3av_hdmi_get_vid(info); - if (vid != -1) { - /* got valid vid */ - break; - } - } - - if (dvi) { - /* DVI mode */ - vid = PS3AV_DEFAULT_DVI_VID; - } else if (vid == -1) { - /* no HDMI interface or HDMI is off */ - if (ps3av.region & PS3AV_REGION_60) - vid = PS3AV_DEFAULT_AVMULTI_VID_REG_60; - else - vid = PS3AV_DEFAULT_AVMULTI_VID_REG_50; - if (ps3av.region & PS3AV_REGION_RGB) - rgb = PS3AV_MODE_RGB; - } else if (boot) { - /* HDMI: using DEFAULT HDMI_VID while booting up */ - info = &monitor_info.info; - if (ps3av.region & PS3AV_REGION_60) { - if (info->res_60.res_bits & PS3AV_RESBIT_720x480P) - vid = PS3AV_DEFAULT_HDMI_VID_REG_60; - else if (info->res_50.res_bits & PS3AV_RESBIT_720x576P) - vid = PS3AV_DEFAULT_HDMI_VID_REG_50; - else { - /* default */ - vid = PS3AV_DEFAULT_HDMI_VID_REG_60; - } - } else { - if (info->res_50.res_bits & PS3AV_RESBIT_720x576P) - vid = PS3AV_DEFAULT_HDMI_VID_REG_50; - else if (info->res_60.res_bits & PS3AV_RESBIT_720x480P) - vid = PS3AV_DEFAULT_HDMI_VID_REG_60; - else { - /* default */ - vid = PS3AV_DEFAULT_HDMI_VID_REG_50; - } - } - } - - return (ps3av_vid2table_id(vid) | dvi | rgb); -} - -static int ps3av_get_hw_conf(struct ps3av *ps3av) -{ - int i, j, k, res; - - /* get av_hw_conf */ - res = ps3av_cmd_av_get_hw_conf(&ps3av->av_hw_conf); - if (res < 0) - return -1; - - ps3av_cmd_av_hw_conf_dump(&ps3av->av_hw_conf); - - for (i = 0; i < PS3AV_HEAD_MAX; i++) - ps3av->head[i] = PS3AV_CMD_VIDEO_HEAD_A + i; - for (i = 0; i < PS3AV_OPT_PORT_MAX; i++) - ps3av->opt_port[i] = PS3AV_CMD_AVPORT_SPDIF_0 + i; - for (i = 0; i < ps3av->av_hw_conf.num_of_hdmi; i++) - ps3av->av_port[i] = PS3AV_CMD_AVPORT_HDMI_0 + i; - for (j = 0; j < ps3av->av_hw_conf.num_of_avmulti; j++) - ps3av->av_port[i + j] = PS3AV_CMD_AVPORT_AVMULTI_0 + j; - for (k = 0; k < ps3av->av_hw_conf.num_of_spdif; k++) - ps3av->av_port[i + j + k] = PS3AV_CMD_AVPORT_SPDIF_0 + k; - - /* set all audio port */ - ps3av->audio_port = PS3AV_CMD_AUDIO_PORT_HDMI_0 - | PS3AV_CMD_AUDIO_PORT_HDMI_1 - | PS3AV_CMD_AUDIO_PORT_AVMULTI_0 - | PS3AV_CMD_AUDIO_PORT_SPDIF_0 | PS3AV_CMD_AUDIO_PORT_SPDIF_1; - - return 0; -} - -/* set mode using id */ -int ps3av_set_video_mode(u32 id, int boot) -{ - int size; - u32 option; - - size = ARRAY_SIZE(video_mode_table); - if ((id & PS3AV_MODE_MASK) > size - 1 || id < 0) { - dev_dbg(&ps3av_dev.core, "%s: error id :%d\n", __FUNCTION__, - id); - return -EINVAL; - } - - /* auto mode */ - option = id & ~PS3AV_MODE_MASK; - if ((id & PS3AV_MODE_MASK) == 0) { - id = ps3av_auto_videomode(&ps3av.av_hw_conf, boot); - if (id < 1) { - printk(KERN_ERR "%s: invalid id :%d\n", __FUNCTION__, - id); - return -EINVAL; - } - id |= option; - } - - /* set videomode */ - down(&ps3av.pong); - ps3av.ps3av_mode_old = ps3av.ps3av_mode; - ps3av.ps3av_mode = id; - if (ps3av_set_videomode()) - ps3av.ps3av_mode = ps3av.ps3av_mode_old; - - return 0; -} - -EXPORT_SYMBOL_GPL(ps3av_set_video_mode); - -int ps3av_set_mode(u32 id, int boot) -{ - int res; - - res = ps3av_set_video_mode(id, boot); - if (res) - return res; - - res = ps3av_set_audio_mode(PS3AV_CMD_AUDIO_NUM_OF_CH_2, - PS3AV_CMD_AUDIO_FS_48K, - PS3AV_CMD_AUDIO_WORD_BITS_16, - PS3AV_CMD_AUDIO_FORMAT_PCM, - PS3AV_CMD_AUDIO_SOURCE_SERIAL); - if (res) - return res; - - return 0; -} - -EXPORT_SYMBOL_GPL(ps3av_set_mode); - -int ps3av_get_mode(void) -{ - return ps3av.ps3av_mode; -} - -EXPORT_SYMBOL_GPL(ps3av_get_mode); - -int ps3av_get_scanmode(int id) -{ - int size; - - id = id & PS3AV_MODE_MASK; - size = ARRAY_SIZE(video_mode_table); - if (id > size - 1 || id < 0) { - printk(KERN_ERR "%s: invalid mode %d\n", __FUNCTION__, id); - return -EINVAL; - } - return video_mode_table[id].interlace; -} - -EXPORT_SYMBOL_GPL(ps3av_get_scanmode); - -int ps3av_get_refresh_rate(int id) -{ - int size; - - id = id & PS3AV_MODE_MASK; - size = ARRAY_SIZE(video_mode_table); - if (id > size - 1 || id < 0) { - printk(KERN_ERR "%s: invalid mode %d\n", __FUNCTION__, id); - return -EINVAL; - } - return video_mode_table[id].freq; -} - -EXPORT_SYMBOL_GPL(ps3av_get_refresh_rate); - -/* get resolution by video_mode */ -int ps3av_video_mode2res(u32 id, u32 *xres, u32 *yres) -{ - int size; - - id = id & PS3AV_MODE_MASK; - size = ARRAY_SIZE(video_mode_table); - if (id > size - 1 || id < 0) { - printk(KERN_ERR "%s: invalid mode %d\n", __FUNCTION__, id); - return -EINVAL; - } - *xres = video_mode_table[id].x; - *yres = video_mode_table[id].y; - return 0; -} - -EXPORT_SYMBOL_GPL(ps3av_video_mode2res); - -/* mute */ -int ps3av_video_mute(int mute) -{ - return ps3av_set_av_video_mute(mute ? PS3AV_CMD_MUTE_ON - : PS3AV_CMD_MUTE_OFF); -} - -EXPORT_SYMBOL_GPL(ps3av_video_mute); - -int ps3av_audio_mute(int mute) -{ - return ps3av_set_audio_mute(mute ? PS3AV_CMD_MUTE_ON - : PS3AV_CMD_MUTE_OFF); -} - -EXPORT_SYMBOL_GPL(ps3av_audio_mute); - -int ps3av_dev_open(void) -{ - int status = 0; - - mutex_lock(&ps3av.mutex); - if (!ps3av.open_count++) { - status = lv1_gpu_open(0); - if (status) { - printk(KERN_ERR "%s: lv1_gpu_open failed %d\n", - __FUNCTION__, status); - ps3av.open_count--; - } - } - mutex_unlock(&ps3av.mutex); - - return status; -} - -EXPORT_SYMBOL_GPL(ps3av_dev_open); - -int ps3av_dev_close(void) -{ - int status = 0; - - mutex_lock(&ps3av.mutex); - if (ps3av.open_count <= 0) { - printk(KERN_ERR "%s: GPU already closed\n", __FUNCTION__); - status = -1; - } else if (!--ps3av.open_count) { - status = lv1_gpu_close(); - if (status) - printk(KERN_WARNING "%s: lv1_gpu_close failed %d\n", - __FUNCTION__, status); - } - mutex_unlock(&ps3av.mutex); - - return status; -} - -EXPORT_SYMBOL_GPL(ps3av_dev_close); - -static int ps3av_probe(struct ps3_vuart_port_device *dev) -{ - int res; - u32 id; - - dev_dbg(&ps3av_dev.core, "init ...\n"); - dev_dbg(&ps3av_dev.core, " timeout=%d\n", timeout); - - memset(&ps3av, 0, sizeof(ps3av)); - - init_MUTEX(&ps3av.sem); - init_MUTEX_LOCKED(&ps3av.ping); - init_MUTEX(&ps3av.pong); - mutex_init(&ps3av.mutex); - ps3av.ps3av_mode = 0; - ps3av.dev = dev; - kernel_thread(ps3avd, &ps3av, CLONE_KERNEL); - - ps3av.available = 1; - switch (ps3_os_area_get_av_multi_out()) { - case PS3_PARAM_AV_MULTI_OUT_NTSC: - ps3av.region = PS3AV_REGION_60; - break; - case PS3_PARAM_AV_MULTI_OUT_PAL_YCBCR: - case PS3_PARAM_AV_MULTI_OUT_SECAM: - ps3av.region = PS3AV_REGION_50; - break; - case PS3_PARAM_AV_MULTI_OUT_PAL_RGB: - ps3av.region = PS3AV_REGION_50 | PS3AV_REGION_RGB; - break; - default: - ps3av.region = PS3AV_REGION_60; - break; - } - - /* init avsetting modules */ - res = ps3av_cmd_init(); - if (res < 0) - printk(KERN_ERR "%s: ps3av_cmd_init failed %d\n", __FUNCTION__, - res); - - ps3av_get_hw_conf(&ps3av); - id = ps3av_auto_videomode(&ps3av.av_hw_conf, 1); - mutex_lock(&ps3av.mutex); - ps3av.ps3av_mode = id; - mutex_unlock(&ps3av.mutex); - - dev_dbg(&ps3av_dev.core, "init...done\n"); - - return 0; -} - -static int ps3av_remove(struct ps3_vuart_port_device *dev) -{ - if (ps3av.available) { - ps3av_cmd_fin(); - ps3av.available = 0; - } - - return 0; -} - -static void ps3av_shutdown(struct ps3_vuart_port_device *dev) -{ - ps3av_remove(dev); -} - -static struct ps3_vuart_port_driver ps3av_driver = { - .match_id = PS3_MATCH_ID_AV_SETTINGS, - .core = { - .name = "ps3_av", - }, - .probe = ps3av_probe, - .remove = ps3av_remove, - .shutdown = ps3av_shutdown, -}; - -static int ps3av_module_init(void) -{ - int error = ps3_vuart_port_driver_register(&ps3av_driver); - if (error) { - printk(KERN_ERR - "%s: ps3_vuart_port_driver_register failed %d\n", - __FUNCTION__, error); - return error; - } - - error = ps3_vuart_port_device_register(&ps3av_dev); - if (error) - printk(KERN_ERR - "%s: ps3_vuart_port_device_register failed %d\n", - __FUNCTION__, error); - - return error; -} - -static void __exit ps3av_module_exit(void) -{ - device_unregister(&ps3av_dev.core); - ps3_vuart_port_driver_unregister(&ps3av_driver); -} - -subsys_initcall(ps3av_module_init); -module_exit(ps3av_module_exit); diff --git a/trunk/drivers/ps3/ps3av_cmd.c b/trunk/drivers/ps3/ps3av_cmd.c deleted file mode 100644 index 21c97c80aa2e..000000000000 --- a/trunk/drivers/ps3/ps3av_cmd.c +++ /dev/null @@ -1,1020 +0,0 @@ -/* - * Copyright (C) 2006 Sony Computer Entertainment Inc. - * Copyright 2006, 2007 Sony Corporation - * - * AV backend support for PS3 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published - * by the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include -#include -#include - -#include "vuart.h" - -static const struct video_fmt { - u32 format; - u32 order; -} ps3av_video_fmt_table[] = { - { PS3AV_CMD_VIDEO_FORMAT_ARGB_8BIT, PS3AV_CMD_VIDEO_ORDER_RGB }, - { PS3AV_CMD_VIDEO_FORMAT_ARGB_8BIT, PS3AV_CMD_VIDEO_ORDER_BGR }, -}; - -static const struct { - int cs; - u32 av; - u32 bl; -} ps3av_cs_video2av_table[] = { - { - .cs = PS3AV_CMD_VIDEO_CS_RGB_8, - .av = PS3AV_CMD_AV_CS_RGB_8, - .bl = PS3AV_CMD_AV_CS_8 - }, { - .cs = PS3AV_CMD_VIDEO_CS_RGB_10, - .av = PS3AV_CMD_AV_CS_RGB_8, - .bl = PS3AV_CMD_AV_CS_8 - }, { - .cs = PS3AV_CMD_VIDEO_CS_RGB_12, - .av = PS3AV_CMD_AV_CS_RGB_8, - .bl = PS3AV_CMD_AV_CS_8 - }, { - .cs = PS3AV_CMD_VIDEO_CS_YUV444_8, - .av = PS3AV_CMD_AV_CS_YUV444_8, - .bl = PS3AV_CMD_AV_CS_8 - }, { - .cs = PS3AV_CMD_VIDEO_CS_YUV444_10, - .av = PS3AV_CMD_AV_CS_YUV444_8, - .bl = PS3AV_CMD_AV_CS_10 - }, { - .cs = PS3AV_CMD_VIDEO_CS_YUV444_12, - .av = PS3AV_CMD_AV_CS_YUV444_8, - .bl = PS3AV_CMD_AV_CS_10 - }, { - .cs = PS3AV_CMD_VIDEO_CS_YUV422_8, - .av = PS3AV_CMD_AV_CS_YUV422_8, - .bl = PS3AV_CMD_AV_CS_10 - }, { - .cs = PS3AV_CMD_VIDEO_CS_YUV422_10, - .av = PS3AV_CMD_AV_CS_YUV422_8, - .bl = PS3AV_CMD_AV_CS_10 - }, { - .cs = PS3AV_CMD_VIDEO_CS_YUV422_12, - .av = PS3AV_CMD_AV_CS_YUV422_8, - .bl = PS3AV_CMD_AV_CS_12 - }, { - .cs = PS3AV_CMD_VIDEO_CS_XVYCC_8, - .av = PS3AV_CMD_AV_CS_XVYCC_8, - .bl = PS3AV_CMD_AV_CS_12 - }, { - .cs = PS3AV_CMD_VIDEO_CS_XVYCC_10, - .av = PS3AV_CMD_AV_CS_XVYCC_8, - .bl = PS3AV_CMD_AV_CS_12 - }, { - .cs = PS3AV_CMD_VIDEO_CS_XVYCC_12, - .av = PS3AV_CMD_AV_CS_XVYCC_8, - .bl = PS3AV_CMD_AV_CS_12 - } -}; - -static u32 ps3av_cs_video2av(int cs) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(ps3av_cs_video2av_table); i++) - if (ps3av_cs_video2av_table[i].cs == cs) - return ps3av_cs_video2av_table[i].av; - - return PS3AV_CMD_AV_CS_RGB_8; -} - -static u32 ps3av_cs_video2av_bitlen(int cs) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(ps3av_cs_video2av_table); i++) - if (ps3av_cs_video2av_table[i].cs == cs) - return ps3av_cs_video2av_table[i].bl; - - return PS3AV_CMD_AV_CS_8; -} - -static const struct { - int vid; - u32 av; -} ps3av_vid_video2av_table[] = { - { PS3AV_CMD_VIDEO_VID_480I, PS3AV_CMD_AV_VID_480I }, - { PS3AV_CMD_VIDEO_VID_480P, PS3AV_CMD_AV_VID_480P }, - { PS3AV_CMD_VIDEO_VID_576I, PS3AV_CMD_AV_VID_576I }, - { PS3AV_CMD_VIDEO_VID_576P, PS3AV_CMD_AV_VID_576P }, - { PS3AV_CMD_VIDEO_VID_1080I_60HZ, PS3AV_CMD_AV_VID_1080I_60HZ }, - { PS3AV_CMD_VIDEO_VID_720P_60HZ, PS3AV_CMD_AV_VID_720P_60HZ }, - { PS3AV_CMD_VIDEO_VID_1080P_60HZ, PS3AV_CMD_AV_VID_1080P_60HZ }, - { PS3AV_CMD_VIDEO_VID_1080I_50HZ, PS3AV_CMD_AV_VID_1080I_50HZ }, - { PS3AV_CMD_VIDEO_VID_720P_50HZ, PS3AV_CMD_AV_VID_720P_50HZ }, - { PS3AV_CMD_VIDEO_VID_1080P_50HZ, PS3AV_CMD_AV_VID_1080P_50HZ }, - { PS3AV_CMD_VIDEO_VID_WXGA, PS3AV_CMD_AV_VID_WXGA }, - { PS3AV_CMD_VIDEO_VID_SXGA, PS3AV_CMD_AV_VID_SXGA }, - { PS3AV_CMD_VIDEO_VID_WUXGA, PS3AV_CMD_AV_VID_WUXGA } -}; - -static u32 ps3av_vid_video2av(int vid) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(ps3av_vid_video2av_table); i++) - if (ps3av_vid_video2av_table[i].vid == vid) - return ps3av_vid_video2av_table[i].av; - - return PS3AV_CMD_AV_VID_480P; -} - -int ps3av_cmd_init(void) -{ - int res; - struct ps3av_pkt_av_init av_init; - struct ps3av_pkt_video_init video_init; - struct ps3av_pkt_audio_init audio_init; - - /* video init */ - memset(&video_init, 0, sizeof(video_init)); - - res = ps3av_do_pkt(PS3AV_CID_VIDEO_INIT, sizeof(video_init.send_hdr), - sizeof(video_init), &video_init.send_hdr); - if (res < 0) - return res; - - res = get_status(&video_init); - if (res) { - printk(KERN_ERR "PS3AV_CID_VIDEO_INIT: failed %x\n", res); - return res; - } - - /* audio init */ - memset(&audio_init, 0, sizeof(audio_init)); - - res = ps3av_do_pkt(PS3AV_CID_AUDIO_INIT, sizeof(audio_init.send_hdr), - sizeof(audio_init), &audio_init.send_hdr); - if (res < 0) - return res; - - res = get_status(&audio_init); - if (res) { - printk(KERN_ERR "PS3AV_CID_AUDIO_INIT: failed %x\n", res); - return res; - } - - /* av init */ - memset(&av_init, 0, sizeof(av_init)); - av_init.event_bit = 0; - - res = ps3av_do_pkt(PS3AV_CID_AV_INIT, sizeof(av_init), sizeof(av_init), - &av_init.send_hdr); - if (res < 0) - return res; - - res = get_status(&av_init); - if (res) - printk(KERN_ERR "PS3AV_CID_AV_INIT: failed %x\n", res); - - return res; -} - -int ps3av_cmd_fin(void) -{ - int res; - struct ps3av_pkt_av_fin av_fin; - - memset(&av_fin, 0, sizeof(av_fin)); - - res = ps3av_do_pkt(PS3AV_CID_AV_FIN, sizeof(av_fin.send_hdr), - sizeof(av_fin), &av_fin.send_hdr); - if (res < 0) - return res; - - res = get_status(&av_fin); - if (res) - printk(KERN_ERR "PS3AV_CID_AV_FIN: failed %x\n", res); - - return res; -} - -int ps3av_cmd_av_video_mute(int num_of_port, u32 *port, u32 mute) -{ - int i, send_len, res; - struct ps3av_pkt_av_video_mute av_video_mute; - - if (num_of_port > PS3AV_MUTE_PORT_MAX) - return -EINVAL; - - memset(&av_video_mute, 0, sizeof(av_video_mute)); - for (i = 0; i < num_of_port; i++) { - av_video_mute.mute[i].avport = port[i]; - av_video_mute.mute[i].mute = mute; - } - - send_len = sizeof(av_video_mute.send_hdr) + - sizeof(struct ps3av_av_mute) * num_of_port; - res = ps3av_do_pkt(PS3AV_CID_AV_VIDEO_MUTE, send_len, - sizeof(av_video_mute), &av_video_mute.send_hdr); - if (res < 0) - return res; - - res = get_status(&av_video_mute); - if (res) - printk(KERN_ERR "PS3AV_CID_AV_VIDEO_MUTE: failed %x\n", res); - - return res; -} - -int ps3av_cmd_av_video_disable_sig(u32 port) -{ - int res; - struct ps3av_pkt_av_video_disable_sig av_video_sig; - - memset(&av_video_sig, 0, sizeof(av_video_sig)); - av_video_sig.avport = port; - - res = ps3av_do_pkt(PS3AV_CID_AV_VIDEO_DISABLE_SIG, - sizeof(av_video_sig), sizeof(av_video_sig), - &av_video_sig.send_hdr); - if (res < 0) - return res; - - res = get_status(&av_video_sig); - if (res) - printk(KERN_ERR - "PS3AV_CID_AV_VIDEO_DISABLE_SIG: failed %x port:%x\n", - res, port); - - return res; -} - -int ps3av_cmd_av_tv_mute(u32 avport, u32 mute) -{ - int res; - struct ps3av_pkt_av_tv_mute tv_mute; - - memset(&tv_mute, 0, sizeof(tv_mute)); - tv_mute.avport = avport; - tv_mute.mute = mute; - - res = ps3av_do_pkt(PS3AV_CID_AV_TV_MUTE, sizeof(tv_mute), - sizeof(tv_mute), &tv_mute.send_hdr); - if (res < 0) - return res; - - res = get_status(&tv_mute); - if (res) - printk(KERN_ERR "PS3AV_CID_AV_TV_MUTE: failed %x port:%x\n", - res, avport); - - return res; -} - -int ps3av_cmd_enable_event(void) -{ - int res; - struct ps3av_pkt_av_event av_event; - - memset(&av_event, 0, sizeof(av_event)); - av_event.event_bit = PS3AV_CMD_EVENT_BIT_UNPLUGGED | - PS3AV_CMD_EVENT_BIT_PLUGGED | PS3AV_CMD_EVENT_BIT_HDCP_DONE; - - res = ps3av_do_pkt(PS3AV_CID_AV_ENABLE_EVENT, sizeof(av_event), - sizeof(av_event), &av_event.send_hdr); - if (res < 0) - return res; - - res = get_status(&av_event); - if (res) - printk(KERN_ERR "PS3AV_CID_AV_ENABLE_EVENT: failed %x\n", res); - - return res; -} - -int ps3av_cmd_av_hdmi_mode(u8 mode) -{ - int res; - struct ps3av_pkt_av_hdmi_mode hdmi_mode; - - memset(&hdmi_mode, 0, sizeof(hdmi_mode)); - hdmi_mode.mode = mode; - - res = ps3av_do_pkt(PS3AV_CID_AV_HDMI_MODE, sizeof(hdmi_mode), - sizeof(hdmi_mode), &hdmi_mode.send_hdr); - if (res < 0) - return res; - - res = get_status(&hdmi_mode); - if (res && res != PS3AV_STATUS_UNSUPPORTED_HDMI_MODE) - printk(KERN_ERR "PS3AV_CID_AV_HDMI_MODE: failed %x\n", res); - - return res; -} - -u32 ps3av_cmd_set_av_video_cs(void *p, u32 avport, int video_vid, int cs_out, - int aspect, u32 id) -{ - struct ps3av_pkt_av_video_cs *av_video_cs; - - av_video_cs = (struct ps3av_pkt_av_video_cs *)p; - if (video_vid == -1) - video_vid = PS3AV_CMD_VIDEO_VID_720P_60HZ; - if (cs_out == -1) - cs_out = PS3AV_CMD_VIDEO_CS_YUV444_8; - if (aspect == -1) - aspect = 0; - - memset(av_video_cs, 0, sizeof(*av_video_cs)); - ps3av_set_hdr(PS3AV_CID_AV_VIDEO_CS, sizeof(*av_video_cs), - &av_video_cs->send_hdr); - av_video_cs->avport = avport; - /* should be same as video_mode.resolution */ - av_video_cs->av_vid = ps3av_vid_video2av(video_vid); - av_video_cs->av_cs_out = ps3av_cs_video2av(cs_out); - /* should be same as video_mode.video_cs_out */ - av_video_cs->av_cs_in = ps3av_cs_video2av(PS3AV_CMD_VIDEO_CS_RGB_8); - av_video_cs->bitlen_out = ps3av_cs_video2av_bitlen(cs_out); - av_video_cs->aspect = aspect; - if (id & PS3AV_MODE_DITHER) { - av_video_cs->dither = PS3AV_CMD_AV_DITHER_ON - | PS3AV_CMD_AV_DITHER_8BIT; - } else { - /* default off */ - av_video_cs->dither = PS3AV_CMD_AV_DITHER_OFF; - } - - return sizeof(*av_video_cs); -} - -u32 ps3av_cmd_set_video_mode(void *p, u32 head, int video_vid, int video_fmt, - u32 id) -{ - struct ps3av_pkt_video_mode *video_mode; - u32 x, y; - - video_mode = (struct ps3av_pkt_video_mode *)p; - if (video_vid == -1) - video_vid = PS3AV_CMD_VIDEO_VID_720P_60HZ; - if (video_fmt == -1) - video_fmt = PS3AV_CMD_VIDEO_FMT_X8R8G8B8; - - if (ps3av_video_mode2res(id, &x, &y)) - return 0; - - /* video mode */ - memset(video_mode, 0, sizeof(*video_mode)); - ps3av_set_hdr(PS3AV_CID_VIDEO_MODE, sizeof(*video_mode), - &video_mode->send_hdr); - video_mode->video_head = head; - if (video_vid == PS3AV_CMD_VIDEO_VID_480I - && head == PS3AV_CMD_VIDEO_HEAD_B) - video_mode->video_vid = PS3AV_CMD_VIDEO_VID_480I_A; - else - video_mode->video_vid = video_vid; - video_mode->width = (u16) x; - video_mode->height = (u16) y; - video_mode->pitch = video_mode->width * 4; /* line_length */ - video_mode->video_out_format = PS3AV_CMD_VIDEO_OUT_FORMAT_RGB_12BIT; - video_mode->video_format = ps3av_video_fmt_table[video_fmt].format; - video_mode->video_order = ps3av_video_fmt_table[video_fmt].order; - - pr_debug("%s: video_mode:vid:%x width:%d height:%d pitch:%d out_format:%d format:%x order:%x\n", - __FUNCTION__, video_vid, video_mode->width, video_mode->height, - video_mode->pitch, video_mode->video_out_format, - video_mode->video_format, video_mode->video_order); - return sizeof(*video_mode); -} - -int ps3av_cmd_video_format_black(u32 head, u32 video_fmt, u32 mute) -{ - int res; - struct ps3av_pkt_video_format video_format; - - memset(&video_format, 0, sizeof(video_format)); - video_format.video_head = head; - if (mute != PS3AV_CMD_MUTE_OFF) - video_format.video_format = PS3AV_CMD_VIDEO_FORMAT_BLACK; - else - video_format.video_format = - ps3av_video_fmt_table[video_fmt].format; - video_format.video_order = ps3av_video_fmt_table[video_fmt].order; - - res = ps3av_do_pkt(PS3AV_CID_VIDEO_FORMAT, sizeof(video_format), - sizeof(video_format), &video_format.send_hdr); - if (res < 0) - return res; - - res = get_status(&video_format); - if (res) - printk(KERN_ERR "PS3AV_CID_VIDEO_FORMAT: failed %x\n", res); - - return res; -} - - -int ps3av_cmd_av_audio_mute(int num_of_port, u32 *port, u32 mute) -{ - int i, res; - struct ps3av_pkt_av_audio_mute av_audio_mute; - - if (num_of_port > PS3AV_MUTE_PORT_MAX) - return -EINVAL; - - /* audio mute */ - memset(&av_audio_mute, 0, sizeof(av_audio_mute)); - for (i = 0; i < num_of_port; i++) { - av_audio_mute.mute[i].avport = port[i]; - av_audio_mute.mute[i].mute = mute; - } - - res = ps3av_do_pkt(PS3AV_CID_AV_AUDIO_MUTE, - sizeof(av_audio_mute.send_hdr) + - sizeof(struct ps3av_av_mute) * num_of_port, - sizeof(av_audio_mute), &av_audio_mute.send_hdr); - if (res < 0) - return res; - - res = get_status(&av_audio_mute); - if (res) - printk(KERN_ERR "PS3AV_CID_AV_AUDIO_MUTE: failed %x\n", res); - - return res; -} - -static const struct { - u32 fs; - u8 mclk; -} ps3av_cnv_mclk_table[] = { - { PS3AV_CMD_AUDIO_FS_44K, PS3AV_CMD_AV_MCLK_512 }, - { PS3AV_CMD_AUDIO_FS_48K, PS3AV_CMD_AV_MCLK_512 }, - { PS3AV_CMD_AUDIO_FS_88K, PS3AV_CMD_AV_MCLK_256 }, - { PS3AV_CMD_AUDIO_FS_96K, PS3AV_CMD_AV_MCLK_256 }, - { PS3AV_CMD_AUDIO_FS_176K, PS3AV_CMD_AV_MCLK_128 }, - { PS3AV_CMD_AUDIO_FS_192K, PS3AV_CMD_AV_MCLK_128 } -}; - -static u8 ps3av_cnv_mclk(u32 fs) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(ps3av_cnv_mclk_table); i++) - if (ps3av_cnv_mclk_table[i].fs == fs) - return ps3av_cnv_mclk_table[i].mclk; - - printk(KERN_ERR "%s failed, fs:%x\n", __FUNCTION__, fs); - return 0; -} - -#define BASE PS3AV_CMD_AUDIO_FS_44K - -static const u32 ps3av_ns_table[][5] = { - /* D1, D2, D3, D4, D5 */ - [PS3AV_CMD_AUDIO_FS_44K-BASE] { 6272, 6272, 17836, 17836, 8918 }, - [PS3AV_CMD_AUDIO_FS_48K-BASE] { 6144, 6144, 11648, 11648, 5824 }, - [PS3AV_CMD_AUDIO_FS_88K-BASE] { 12544, 12544, 35672, 35672, 17836 }, - [PS3AV_CMD_AUDIO_FS_96K-BASE] { 12288, 12288, 23296, 23296, 11648 }, - [PS3AV_CMD_AUDIO_FS_176K-BASE] { 25088, 25088, 71344, 71344, 35672 }, - [PS3AV_CMD_AUDIO_FS_192K-BASE] { 24576, 24576, 46592, 46592, 23296 } -}; - -static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) -{ - u32 av_vid, ns_val; - u8 *p = ns; - int d; - - d = ns_val = 0; - av_vid = ps3av_vid_video2av(video_vid); - switch (av_vid) { - case PS3AV_CMD_AV_VID_480I: - case PS3AV_CMD_AV_VID_576I: - d = 0; - break; - case PS3AV_CMD_AV_VID_480P: - case PS3AV_CMD_AV_VID_576P: - d = 1; - break; - case PS3AV_CMD_AV_VID_1080I_60HZ: - case PS3AV_CMD_AV_VID_1080I_50HZ: - d = 2; - break; - case PS3AV_CMD_AV_VID_720P_60HZ: - case PS3AV_CMD_AV_VID_720P_50HZ: - d = 3; - break; - case PS3AV_CMD_AV_VID_1080P_60HZ: - case PS3AV_CMD_AV_VID_1080P_50HZ: - case PS3AV_CMD_AV_VID_WXGA: - case PS3AV_CMD_AV_VID_SXGA: - case PS3AV_CMD_AV_VID_WUXGA: - d = 4; - break; - default: - printk(KERN_ERR "%s failed, vid:%x\n", __FUNCTION__, - video_vid); - break; - } - - if (fs < PS3AV_CMD_AUDIO_FS_44K || fs > PS3AV_CMD_AUDIO_FS_192K) - printk(KERN_ERR "%s failed, fs:%x\n", __FUNCTION__, fs); - else - ns_val = ps3av_ns_table[PS3AV_CMD_AUDIO_FS_44K-BASE][d]; - - *p++ = ns_val & 0x000000FF; - *p++ = (ns_val & 0x0000FF00) >> 8; - *p = (ns_val & 0x00FF0000) >> 16; -} - -#undef BASE - -static u8 ps3av_cnv_enable(u32 source, u8 *enable) -{ - u8 *p, ret = 0; - - if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { - ret = 0x03; - } else if (source == PS3AV_CMD_AUDIO_SOURCE_SERIAL) { - p = enable; - ret = ((p[0] << 4) + (p[1] << 5) + (p[2] << 6) + (p[3] << 7)) | - 0x01; - } else - printk(KERN_ERR "%s failed, source:%x\n", __FUNCTION__, - source); - return ret; -} - -static u8 ps3av_cnv_fifomap(u8 *map) -{ - u8 *p, ret = 0; - - p = map; - ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6); - return ret; -} - -static u8 ps3av_cnv_inputlen(u32 word_bits) -{ - u8 ret = 0; - - switch (word_bits) { - case PS3AV_CMD_AUDIO_WORD_BITS_16: - ret = PS3AV_CMD_AV_INPUTLEN_16; - break; - case PS3AV_CMD_AUDIO_WORD_BITS_20: - ret = PS3AV_CMD_AV_INPUTLEN_20; - break; - case PS3AV_CMD_AUDIO_WORD_BITS_24: - ret = PS3AV_CMD_AV_INPUTLEN_24; - break; - default: - printk(KERN_ERR "%s failed, word_bits:%x\n", __FUNCTION__, - word_bits); - break; - } - return ret; -} - -static u8 ps3av_cnv_layout(u32 num_of_ch) -{ - if (num_of_ch > PS3AV_CMD_AUDIO_NUM_OF_CH_8) { - printk(KERN_ERR "%s failed, num_of_ch:%x\n", __FUNCTION__, - num_of_ch); - return 0; - } - - return num_of_ch == PS3AV_CMD_AUDIO_NUM_OF_CH_2 ? 0x0 : 0x1; -} - -static void ps3av_cnv_info(struct ps3av_audio_info_frame *info, - const struct ps3av_pkt_audio_mode *mode) -{ - info->pb1.cc = mode->audio_num_of_ch + 1; /* CH2:0x01 --- CH8:0x07 */ - info->pb1.ct = 0; - info->pb2.sf = 0; - info->pb2.ss = 0; - - info->pb3 = 0; /* check mode->audio_format ?? */ - info->pb4 = mode->audio_layout; - info->pb5.dm = mode->audio_downmix; - info->pb5.lsv = mode->audio_downmix_level; -} - -static void ps3av_cnv_chstat(u8 *chstat, u8 *cs_info) -{ - memcpy(chstat, cs_info, 5); -} - -u32 ps3av_cmd_set_av_audio_param(void *p, u32 port, - const struct ps3av_pkt_audio_mode *audio_mode, - u32 video_vid) -{ - struct ps3av_pkt_av_audio_param *param; - - param = (struct ps3av_pkt_av_audio_param *)p; - - memset(param, 0, sizeof(*param)); - ps3av_set_hdr(PS3AV_CID_AV_AUDIO_PARAM, sizeof(*param), - ¶m->send_hdr); - - param->avport = port; - param->mclk = ps3av_cnv_mclk(audio_mode->audio_fs) | 0x80; - ps3av_cnv_ns(param->ns, audio_mode->audio_fs, video_vid); - param->enable = ps3av_cnv_enable(audio_mode->audio_source, - audio_mode->audio_enable); - param->swaplr = 0x09; - param->fifomap = ps3av_cnv_fifomap(audio_mode->audio_map); - param->inputctrl = 0x49; - param->inputlen = ps3av_cnv_inputlen(audio_mode->audio_word_bits); - param->layout = ps3av_cnv_layout(audio_mode->audio_num_of_ch); - ps3av_cnv_info(¶m->info, audio_mode); - ps3av_cnv_chstat(param->chstat, audio_mode->audio_cs_info); - - return sizeof(*param); -} - -/* default cs val */ -static const u8 ps3av_mode_cs_info[] = { - 0x00, 0x09, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00 -}; - -#define CS_44 0x00 -#define CS_48 0x02 -#define CS_88 0x08 -#define CS_96 0x0a -#define CS_176 0x0c -#define CS_192 0x0e -#define CS_MASK 0x0f -#define CS_BIT 0x40 - -void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *audio, u32 avport, - u32 ch, u32 fs, u32 word_bits, u32 format, - u32 source) -{ - int spdif_through, spdif_bitstream; - int i; - - if (!(ch | fs | format | word_bits | source)) { - ch = PS3AV_CMD_AUDIO_NUM_OF_CH_2; - fs = PS3AV_CMD_AUDIO_FS_48K; - word_bits = PS3AV_CMD_AUDIO_WORD_BITS_16; - format = PS3AV_CMD_AUDIO_FORMAT_PCM; - source = PS3AV_CMD_AUDIO_SOURCE_SERIAL; - } - spdif_through = spdif_bitstream = 0; /* XXX not supported */ - - /* audio mode */ - memset(audio, 0, sizeof(*audio)); - ps3av_set_hdr(PS3AV_CID_AUDIO_MODE, sizeof(*audio), &audio->send_hdr); - - audio->avport = (u8) avport; - audio->mask = 0x0FFF; /* XXX set all */ - audio->audio_num_of_ch = ch; - audio->audio_fs = fs; - audio->audio_word_bits = word_bits; - audio->audio_format = format; - audio->audio_source = source; - - switch (ch) { - case PS3AV_CMD_AUDIO_NUM_OF_CH_8: - audio->audio_enable[3] = 1; - /* fall through */ - case PS3AV_CMD_AUDIO_NUM_OF_CH_6: - audio->audio_enable[2] = 1; - audio->audio_enable[1] = 1; - /* fall through */ - case PS3AV_CMD_AUDIO_NUM_OF_CH_2: - default: - audio->audio_enable[0] = 1; - } - - /* audio swap L/R */ - for (i = 0; i < 4; i++) - audio->audio_swap[i] = PS3AV_CMD_AUDIO_SWAP_0; /* no swap */ - - /* audio serial input mapping */ - audio->audio_map[0] = PS3AV_CMD_AUDIO_MAP_OUTPUT_0; - audio->audio_map[1] = PS3AV_CMD_AUDIO_MAP_OUTPUT_1; - audio->audio_map[2] = PS3AV_CMD_AUDIO_MAP_OUTPUT_2; - audio->audio_map[3] = PS3AV_CMD_AUDIO_MAP_OUTPUT_3; - - /* audio speaker layout */ - if (avport == PS3AV_CMD_AVPORT_HDMI_0 || - avport == PS3AV_CMD_AVPORT_HDMI_1) { - switch (ch) { - case PS3AV_CMD_AUDIO_NUM_OF_CH_8: - audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_8CH; - break; - case PS3AV_CMD_AUDIO_NUM_OF_CH_6: - audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_6CH; - break; - case PS3AV_CMD_AUDIO_NUM_OF_CH_2: - default: - audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_2CH; - break; - } - } else { - audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_2CH; - } - - /* audio downmix permission */ - audio->audio_downmix = PS3AV_CMD_AUDIO_DOWNMIX_PERMITTED; - /* audio downmix level shift (0:0dB to 15:15dB) */ - audio->audio_downmix_level = 0; /* 0dB */ - - /* set ch status */ - for (i = 0; i < 8; i++) - audio->audio_cs_info[i] = ps3av_mode_cs_info[i]; - - switch (fs) { - case PS3AV_CMD_AUDIO_FS_44K: - audio->audio_cs_info[3] &= ~CS_MASK; - audio->audio_cs_info[3] |= CS_44; - break; - case PS3AV_CMD_AUDIO_FS_88K: - audio->audio_cs_info[3] &= ~CS_MASK; - audio->audio_cs_info[3] |= CS_88; - break; - case PS3AV_CMD_AUDIO_FS_96K: - audio->audio_cs_info[3] &= ~CS_MASK; - audio->audio_cs_info[3] |= CS_96; - break; - case PS3AV_CMD_AUDIO_FS_176K: - audio->audio_cs_info[3] &= ~CS_MASK; - audio->audio_cs_info[3] |= CS_176; - break; - case PS3AV_CMD_AUDIO_FS_192K: - audio->audio_cs_info[3] &= ~CS_MASK; - audio->audio_cs_info[3] |= CS_192; - break; - default: - break; - } - - /* pass through setting */ - if (spdif_through && - (avport == PS3AV_CMD_AVPORT_SPDIF_0 || - avport == PS3AV_CMD_AVPORT_SPDIF_1)) { - audio->audio_word_bits = PS3AV_CMD_AUDIO_WORD_BITS_16; - audio->audio_source = PS3AV_CMD_AUDIO_SOURCE_SPDIF; - if (spdif_bitstream) { - audio->audio_format = PS3AV_CMD_AUDIO_FORMAT_BITSTREAM; - audio->audio_cs_info[0] |= CS_BIT; - } - } -} - -int ps3av_cmd_audio_mode(struct ps3av_pkt_audio_mode *audio_mode) -{ - int res; - - res = ps3av_do_pkt(PS3AV_CID_AUDIO_MODE, sizeof(*audio_mode), - sizeof(*audio_mode), &audio_mode->send_hdr); - if (res < 0) - return res; - - res = get_status(audio_mode); - if (res) - printk(KERN_ERR "PS3AV_CID_AUDIO_MODE: failed %x\n", res); - - return res; -} - -int ps3av_cmd_audio_mute(int num_of_port, u32 *port, u32 mute) -{ - int i, res; - struct ps3av_pkt_audio_mute audio_mute; - - if (num_of_port > PS3AV_OPT_PORT_MAX) - return -EINVAL; - - /* audio mute */ - memset(&audio_mute, 0, sizeof(audio_mute)); - for (i = 0; i < num_of_port; i++) { - audio_mute.mute[i].avport = port[i]; - audio_mute.mute[i].mute = mute; - } - - res = ps3av_do_pkt(PS3AV_CID_AUDIO_MUTE, - sizeof(audio_mute.send_hdr) + - sizeof(struct ps3av_audio_mute) * num_of_port, - sizeof(audio_mute), &audio_mute.send_hdr); - if (res < 0) - return res; - - res = get_status(&audio_mute); - if (res) - printk(KERN_ERR "PS3AV_CID_AUDIO_MUTE: failed %x\n", res); - - return res; -} - -int ps3av_cmd_audio_active(int active, u32 port) -{ - int res; - struct ps3av_pkt_audio_active audio_active; - u32 cid; - - /* audio active */ - memset(&audio_active, 0, sizeof(audio_active)); - audio_active.audio_port = port; - cid = active ? PS3AV_CID_AUDIO_ACTIVE : PS3AV_CID_AUDIO_INACTIVE; - - res = ps3av_do_pkt(cid, sizeof(audio_active), sizeof(audio_active), - &audio_active.send_hdr); - if (res < 0) - return res; - - res = get_status(&audio_active); - if (res) - printk(KERN_ERR "PS3AV_CID_AUDIO_ACTIVE:%x failed %x\n", cid, - res); - - return res; -} - -int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *avb, u32 send_len) -{ - int res; - - ps3fb_flip_ctl(0); /* flip off */ - - /* avb packet */ - res = ps3av_do_pkt(PS3AV_CID_AVB_PARAM, send_len, sizeof(*avb), - &avb->send_hdr); - if (res < 0) - goto out; - - res = get_status(avb); - if (res) - pr_debug("%s: PS3AV_CID_AVB_PARAM: failed %x\n", __FUNCTION__, - res); - - out: - ps3fb_flip_ctl(1); /* flip on */ - return res; -} - -int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *hw_conf) -{ - int res; - - memset(hw_conf, 0, sizeof(*hw_conf)); - - res = ps3av_do_pkt(PS3AV_CID_AV_GET_HW_CONF, sizeof(hw_conf->send_hdr), - sizeof(*hw_conf), &hw_conf->send_hdr); - if (res < 0) - return res; - - res = get_status(hw_conf); - if (res) - printk(KERN_ERR "PS3AV_CID_AV_GET_HW_CONF: failed %x\n", res); - - return res; -} - -int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *info, - u32 avport) -{ - int res; - - memset(info, 0, sizeof(*info)); - info->avport = avport; - - res = ps3av_do_pkt(PS3AV_CID_AV_GET_MONITOR_INFO, - sizeof(info->send_hdr) + sizeof(info->avport) + - sizeof(info->reserved), - sizeof(*info), &info->send_hdr); - if (res < 0) - return res; - - res = get_status(info); - if (res) - printk(KERN_ERR "PS3AV_CID_AV_GET_MONITOR_INFO: failed %x\n", - res); - - return res; -} - -#ifdef PS3AV_DEBUG -void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *hw_conf) -{ - printk("av_h_conf:num of hdmi:%d\n", hw_conf->num_of_hdmi); - printk("av_h_conf:num of avmulti:%d\n", hw_conf->num_of_avmulti); - printk("av_h_conf:num of spdif:%d\n", hw_conf->num_of_spdif); -} - -void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info) -{ - const struct ps3av_info_monitor *info = &monitor_info->info; - const struct ps3av_info_audio *audio = info->audio; - int i; - - printk("Monitor Info: size%d\n", monitor_info->send_hdr.size); - - printk("avport:%02x\n", info->avport); - printk("monitor_id:"); - for (i = 0; i < 10; i++) - printk("%02x ", info->monitor_id[i]); - printk("\nmonitor_type:%02x\n", info->monitor_type); - printk("monitor_name:"); - for (i = 0; i < 16; i++) - printk("%c", info->monitor_name[i]); - - /* resolution */ - printk("\nresolution_60: bits:%08x native:%08x\n", - info->res_60.res_bits, info->res_60.native); - printk("resolution_50: bits:%08x native:%08x\n", - info->res_50.res_bits, info->res_50.native); - printk("resolution_other: bits:%08x native:%08x\n", - info->res_other.res_bits, info->res_other.native); - printk("resolution_vesa: bits:%08x native:%08x\n", - info->res_vesa.res_bits, info->res_vesa.native); - - /* color space */ - printk("color space rgb:%02x\n", info->cs.rgb); - printk("color space yuv444:%02x\n", info->cs.yuv444); - printk("color space yuv422:%02x\n", info->cs.yuv422); - - /* color info */ - printk("color info red:X %04x Y %04x\n", - info->color.red_x, info->color.red_y); - printk("color info green:X %04x Y %04x\n", - info->color.green_x, info->color.green_y); - printk("color info blue:X %04x Y %04x\n", - info->color.blue_x, info->color.blue_y); - printk("color info white:X %04x Y %04x\n", - info->color.white_x, info->color.white_y); - printk("color info gamma: %08x\n", info->color.gamma); - - /* other info */ - printk("supported_AI:%02x\n", info->supported_ai); - printk("speaker_info:%02x\n", info->speaker_info); - printk("num of audio:%02x\n", info->num_of_audio_block); - - /* audio block */ - for (i = 0; i < info->num_of_audio_block; i++) { - printk("audio[%d] type:%02x max_ch:%02x fs:%02x sbit:%02x\n", - i, audio->type, audio->max_num_of_ch, audio->fs, - audio->sbit); - audio++; - } -} -#endif /* PS3AV_DEBUG */ - -#define PS3AV_AV_LAYOUT_0 (PS3AV_CMD_AV_LAYOUT_32 \ - | PS3AV_CMD_AV_LAYOUT_44 \ - | PS3AV_CMD_AV_LAYOUT_48) - -#define PS3AV_AV_LAYOUT_1 (PS3AV_AV_LAYOUT_0 \ - | PS3AV_CMD_AV_LAYOUT_88 \ - | PS3AV_CMD_AV_LAYOUT_96 \ - | PS3AV_CMD_AV_LAYOUT_176 \ - | PS3AV_CMD_AV_LAYOUT_192) - -/************************* vuart ***************************/ - -#define POLLING_INTERVAL 25 /* in msec */ - -int ps3av_vuart_write(struct ps3_vuart_port_device *dev, const void *buf, - unsigned long size) -{ - int error = ps3_vuart_write(dev, buf, size); - return error ? error : size; -} - -int ps3av_vuart_read(struct ps3_vuart_port_device *dev, void *buf, - unsigned long size, int timeout) -{ - int error; - int loopcnt = 0; - - timeout = (timeout + POLLING_INTERVAL - 1) / POLLING_INTERVAL; - while (loopcnt++ <= timeout) { - error = ps3_vuart_read(dev, buf, size); - if (!error) - return size; - if (error != -EAGAIN) { - printk(KERN_ERR "%s: ps3_vuart_read failed %d\n", - __FUNCTION__, error); - return error; - } - msleep(POLLING_INTERVAL); - } - return -EWOULDBLOCK; -} diff --git a/trunk/drivers/ps3/vuart.c b/trunk/drivers/ps3/vuart.c index ef8fd4c30875..a72da8f651f8 100644 --- a/trunk/drivers/ps3/vuart.c +++ b/trunk/drivers/ps3/vuart.c @@ -867,22 +867,6 @@ static int ps3_vuart_remove(struct device *_dev) return 0; } -static void ps3_vuart_shutdown(struct device *_dev) -{ - struct ps3_vuart_port_device *dev = to_ps3_vuart_port_device(_dev); - struct ps3_vuart_port_driver *drv = - to_ps3_vuart_port_driver(_dev->driver); - - dev_dbg(&dev->core, "%s:%d: %s\n", __func__, __LINE__, - dev->core.bus_id); - - if (drv->shutdown) - drv->shutdown(dev); - else - dev_dbg(&dev->core, "%s:%d: %s no shutdown method\n", __func__, - __LINE__, dev->core.bus_id); -} - /** * ps3_vuart - The vuart instance. * @@ -894,7 +878,6 @@ struct bus_type ps3_vuart = { .match = ps3_vuart_match, .probe = ps3_vuart_probe, .remove = ps3_vuart_remove, - .shutdown = ps3_vuart_shutdown, }; int __init ps3_vuart_init(void) diff --git a/trunk/drivers/ps3/vuart.h b/trunk/drivers/ps3/vuart.h index 2cbf728a3a0b..11c421cf7a03 100644 --- a/trunk/drivers/ps3/vuart.h +++ b/trunk/drivers/ps3/vuart.h @@ -30,7 +30,6 @@ struct ps3_vuart_port_driver { struct device_driver core; int (*probe)(struct ps3_vuart_port_device *); int (*remove)(struct ps3_vuart_port_device *); - void (*shutdown)(struct ps3_vuart_port_device *); int (*tx_event)(struct ps3_vuart_port_device *dev); int (*rx_event)(struct ps3_vuart_port_device *dev); int (*disconnect_event)(struct ps3_vuart_port_device *dev); diff --git a/trunk/drivers/rtc/rtc-dev.c b/trunk/drivers/rtc/rtc-dev.c index 137330b8636b..82f2ac87ccd4 100644 --- a/trunk/drivers/rtc/rtc-dev.c +++ b/trunk/drivers/rtc/rtc-dev.c @@ -384,7 +384,7 @@ static int rtc_dev_fasync(int fd, struct file *file, int on) return fasync_helper(fd, file, on, &rtc->async_queue); } -static const struct file_operations rtc_dev_fops = { +static struct file_operations rtc_dev_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .read = rtc_dev_read, diff --git a/trunk/drivers/rtc/rtc-ds1553.c b/trunk/drivers/rtc/rtc-ds1553.c index e27176c0e18f..001eb1123a65 100644 --- a/trunk/drivers/rtc/rtc-ds1553.c +++ b/trunk/drivers/rtc/rtc-ds1553.c @@ -297,7 +297,7 @@ static struct bin_attribute ds1553_nvram_attr = { .write = ds1553_nvram_write, }; -static int __devinit ds1553_rtc_probe(struct platform_device *pdev) +static int __init ds1553_rtc_probe(struct platform_device *pdev) { struct rtc_device *rtc; struct resource *res; diff --git a/trunk/drivers/rtc/rtc-ds1742.c b/trunk/drivers/rtc/rtc-ds1742.c index d68288b389dc..17633bfa8480 100644 --- a/trunk/drivers/rtc/rtc-ds1742.c +++ b/trunk/drivers/rtc/rtc-ds1742.c @@ -165,7 +165,7 @@ static struct bin_attribute ds1742_nvram_attr = { .write = ds1742_nvram_write, }; -static int __devinit ds1742_rtc_probe(struct platform_device *pdev) +static int __init ds1742_rtc_probe(struct platform_device *pdev) { struct rtc_device *rtc; struct resource *res; diff --git a/trunk/drivers/rtc/rtc-proc.c b/trunk/drivers/rtc/rtc-proc.c index 1bd624fc685c..c272afd62173 100644 --- a/trunk/drivers/rtc/rtc-proc.c +++ b/trunk/drivers/rtc/rtc-proc.c @@ -96,7 +96,7 @@ static int rtc_proc_release(struct inode *inode, struct file *file) return res; } -static const struct file_operations rtc_proc_fops = { +static struct file_operations rtc_proc_fops = { .open = rtc_proc_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/rtc/rtc-sysfs.c b/trunk/drivers/rtc/rtc-sysfs.c index 899ab8c514fa..2ddd0cf07140 100644 --- a/trunk/drivers/rtc/rtc-sysfs.c +++ b/trunk/drivers/rtc/rtc-sysfs.c @@ -78,92 +78,6 @@ static struct attribute_group rtc_attr_group = { .attrs = rtc_attrs, }; - -static ssize_t -rtc_sysfs_show_wakealarm(struct class_device *dev, char *buf) -{ - ssize_t retval; - unsigned long alarm; - struct rtc_wkalrm alm; - - /* Don't show disabled alarms; but the RTC could leave the - * alarm enabled after it's already triggered. Alarms are - * conceptually one-shot, even though some common hardware - * (PCs) doesn't actually work that way. - * - * REVISIT maybe we should require RTC implementations to - * disable the RTC alarm after it triggers, for uniformity. - */ - retval = rtc_read_alarm(dev, &alm); - if (retval == 0 && alm.enabled) { - rtc_tm_to_time(&alm.time, &alarm); - retval = sprintf(buf, "%lu\n", alarm); - } - - return retval; -} - -static ssize_t -rtc_sysfs_set_wakealarm(struct class_device *dev, const char *buf, size_t n) -{ - ssize_t retval; - unsigned long now, alarm; - struct rtc_wkalrm alm; - - /* Only request alarms that trigger in the future. Disable them - * by writing another time, e.g. 0 meaning Jan 1 1970 UTC. - */ - retval = rtc_read_time(dev, &alm.time); - if (retval < 0) - return retval; - rtc_tm_to_time(&alm.time, &now); - - alarm = simple_strtoul(buf, NULL, 0); - if (alarm > now) { - /* Avoid accidentally clobbering active alarms; we can't - * entirely prevent that here, without even the minimal - * locking from the /dev/rtcN api. - */ - retval = rtc_read_alarm(dev, &alm); - if (retval < 0) - return retval; - if (alm.enabled) - return -EBUSY; - - alm.enabled = 1; - } else { - alm.enabled = 0; - - /* Provide a valid future alarm time. Linux isn't EFI, - * this time won't be ignored when disabling the alarm. - */ - alarm = now + 300; - } - rtc_time_to_tm(alarm, &alm.time); - - retval = rtc_set_alarm(dev, &alm); - return (retval < 0) ? retval : n; -} -static const CLASS_DEVICE_ATTR(wakealarm, S_IRUGO | S_IWUSR, - rtc_sysfs_show_wakealarm, rtc_sysfs_set_wakealarm); - - -/* The reason to trigger an alarm with no process watching it (via sysfs) - * is its side effect: waking from a system state like suspend-to-RAM or - * suspend-to-disk. So: no attribute unless that side effect is possible. - * (Userspace may disable that mechanism later.) - */ -static inline int rtc_does_wakealarm(struct class_device *class_dev) -{ - struct rtc_device *rtc; - - if (!device_can_wakeup(class_dev->dev)) - return 0; - rtc = to_rtc_device(class_dev); - return rtc->ops->set_alarm != NULL; -} - - static int rtc_sysfs_add_device(struct class_device *class_dev, struct class_interface *class_intf) { @@ -173,18 +87,8 @@ static int rtc_sysfs_add_device(struct class_device *class_dev, err = sysfs_create_group(&class_dev->kobj, &rtc_attr_group); if (err) - dev_err(class_dev->dev, "failed to create %s\n", - "sysfs attributes"); - else if (rtc_does_wakealarm(class_dev)) { - /* not all RTCs support both alarms and wakeup */ - err = class_device_create_file(class_dev, - &class_device_attr_wakealarm); - if (err) { - dev_err(class_dev->dev, "failed to create %s\n", - "alarm attribute"); - sysfs_remove_group(&class_dev->kobj, &rtc_attr_group); - } - } + dev_err(class_dev->dev, + "failed to create sysfs attributes\n"); return err; } @@ -192,9 +96,6 @@ static int rtc_sysfs_add_device(struct class_device *class_dev, static void rtc_sysfs_remove_device(struct class_device *class_dev, struct class_interface *class_intf) { - if (rtc_does_wakealarm(class_dev)) - class_device_remove_file(class_dev, - &class_device_attr_wakealarm); sysfs_remove_group(&class_dev->kobj, &rtc_attr_group); } diff --git a/trunk/drivers/s390/block/dasd_eer.c b/trunk/drivers/s390/block/dasd_eer.c index 4b8a95fba1e5..6cedc914077e 100644 --- a/trunk/drivers/s390/block/dasd_eer.c +++ b/trunk/drivers/s390/block/dasd_eer.c @@ -650,7 +650,7 @@ static unsigned int dasd_eer_poll(struct file *filp, poll_table *ptable) return mask; } -static const struct file_operations dasd_eer_fops = { +static struct file_operations dasd_eer_fops = { .open = &dasd_eer_open, .release = &dasd_eer_close, .read = &dasd_eer_read, diff --git a/trunk/drivers/s390/block/dasd_proc.c b/trunk/drivers/s390/block/dasd_proc.c index 8b3b0f4a157c..8b7e11815d70 100644 --- a/trunk/drivers/s390/block/dasd_proc.c +++ b/trunk/drivers/s390/block/dasd_proc.c @@ -147,7 +147,7 @@ static int dasd_devices_open(struct inode *inode, struct file *file) return seq_open(file, &dasd_devices_seq_ops); } -static const struct file_operations dasd_devices_file_ops = { +static struct file_operations dasd_devices_file_ops = { .open = dasd_devices_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/s390/char/fs3270.c b/trunk/drivers/s390/char/fs3270.c index ef36f2132aa4..e1a746269c4c 100644 --- a/trunk/drivers/s390/char/fs3270.c +++ b/trunk/drivers/s390/char/fs3270.c @@ -493,7 +493,7 @@ fs3270_close(struct inode *inode, struct file *filp) return 0; } -static const struct file_operations fs3270_fops = { +static struct file_operations fs3270_fops = { .owner = THIS_MODULE, /* owner */ .read = fs3270_read, /* read */ .write = fs3270_write, /* write */ diff --git a/trunk/drivers/s390/char/monreader.c b/trunk/drivers/s390/char/monreader.c index 8df7b1323c05..3a1a958fb5f2 100644 --- a/trunk/drivers/s390/char/monreader.c +++ b/trunk/drivers/s390/char/monreader.c @@ -547,7 +547,7 @@ static unsigned int mon_poll(struct file *filp, struct poll_table_struct *p) return 0; } -static const struct file_operations mon_fops = { +static struct file_operations mon_fops = { .owner = THIS_MODULE, .open = &mon_open, .release = &mon_close, diff --git a/trunk/drivers/s390/char/monwriter.c b/trunk/drivers/s390/char/monwriter.c index 268598ef3efe..9e451acc6491 100644 --- a/trunk/drivers/s390/char/monwriter.c +++ b/trunk/drivers/s390/char/monwriter.c @@ -255,7 +255,7 @@ static ssize_t monwrite_write(struct file *filp, const char __user *data, return rc; } -static const struct file_operations monwrite_fops = { +static struct file_operations monwrite_fops = { .owner = THIS_MODULE, .open = &monwrite_open, .release = &monwrite_close, diff --git a/trunk/drivers/s390/char/tape_char.c b/trunk/drivers/s390/char/tape_char.c index b830a8cbef78..9faea04e11e9 100644 --- a/trunk/drivers/s390/char/tape_char.c +++ b/trunk/drivers/s390/char/tape_char.c @@ -39,7 +39,7 @@ static int tapechar_ioctl(struct inode *, struct file *, unsigned int, static long tapechar_compat_ioctl(struct file *, unsigned int, unsigned long); -static const struct file_operations tape_fops = +static struct file_operations tape_fops = { .owner = THIS_MODULE, .read = tapechar_read, diff --git a/trunk/drivers/s390/char/tape_class.c b/trunk/drivers/s390/char/tape_class.c index 2e0d29730b67..56b87618b100 100644 --- a/trunk/drivers/s390/char/tape_class.c +++ b/trunk/drivers/s390/char/tape_class.c @@ -36,7 +36,7 @@ static struct class *tape_class; struct tape_class_device *register_tape_dev( struct device * device, dev_t dev, - const struct file_operations *fops, + struct file_operations *fops, char * device_name, char * mode_name) { diff --git a/trunk/drivers/s390/char/tape_class.h b/trunk/drivers/s390/char/tape_class.h index a8bd9b47fad6..3d0ca054cdee 100644 --- a/trunk/drivers/s390/char/tape_class.h +++ b/trunk/drivers/s390/char/tape_class.h @@ -52,7 +52,7 @@ struct tape_class_device { struct tape_class_device *register_tape_dev( struct device * device, dev_t dev, - const struct file_operations *fops, + struct file_operations *fops, char * device_name, char * node_name ); diff --git a/trunk/drivers/s390/char/tape_proc.c b/trunk/drivers/s390/char/tape_proc.c index cea49f001f89..655d375ab22b 100644 --- a/trunk/drivers/s390/char/tape_proc.c +++ b/trunk/drivers/s390/char/tape_proc.c @@ -109,7 +109,7 @@ static int tape_proc_open(struct inode *inode, struct file *file) return seq_open(file, &tape_proc_seq); } -static const struct file_operations tape_proc_ops = +static struct file_operations tape_proc_ops = { .open = tape_proc_open, .read = seq_read, diff --git a/trunk/drivers/s390/char/vmcp.c b/trunk/drivers/s390/char/vmcp.c index fce3dac5cb3e..a420cd099041 100644 --- a/trunk/drivers/s390/char/vmcp.c +++ b/trunk/drivers/s390/char/vmcp.c @@ -173,7 +173,7 @@ static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } } -static const struct file_operations vmcp_fops = { +static struct file_operations vmcp_fops = { .owner = THIS_MODULE, .open = &vmcp_open, .release = &vmcp_release, diff --git a/trunk/drivers/s390/char/vmlogrdr.c b/trunk/drivers/s390/char/vmlogrdr.c index b87d3b019936..8432a76b961e 100644 --- a/trunk/drivers/s390/char/vmlogrdr.c +++ b/trunk/drivers/s390/char/vmlogrdr.c @@ -88,7 +88,7 @@ static int vmlogrdr_release(struct inode *, struct file *); static ssize_t vmlogrdr_read (struct file *filp, char __user *data, size_t count, loff_t * ppos); -static const struct file_operations vmlogrdr_fops = { +static struct file_operations vmlogrdr_fops = { .owner = THIS_MODULE, .open = vmlogrdr_open, .release = vmlogrdr_release, diff --git a/trunk/drivers/s390/char/vmwatchdog.c b/trunk/drivers/s390/char/vmwatchdog.c index 680b9b58b80e..4b868f72fe89 100644 --- a/trunk/drivers/s390/char/vmwatchdog.c +++ b/trunk/drivers/s390/char/vmwatchdog.c @@ -228,7 +228,7 @@ static ssize_t vmwdt_write(struct file *f, const char __user *buf, return count; } -static const struct file_operations vmwdt_fops = { +static struct file_operations vmwdt_fops = { .open = &vmwdt_open, .release = &vmwdt_close, .ioctl = &vmwdt_ioctl, diff --git a/trunk/drivers/s390/cio/blacklist.c b/trunk/drivers/s390/cio/blacklist.c index ec0404874fad..aa65df4dfced 100644 --- a/trunk/drivers/s390/cio/blacklist.c +++ b/trunk/drivers/s390/cio/blacklist.c @@ -364,7 +364,7 @@ cio_ignore_proc_open(struct inode *inode, struct file *file) return seq_open(file, &cio_ignore_proc_seq_ops); } -static const struct file_operations cio_ignore_proc_fops = { +static struct file_operations cio_ignore_proc_fops = { .open = cio_ignore_proc_open, .read = seq_read, .llseek = seq_lseek, diff --git a/trunk/drivers/s390/cio/device_id.c b/trunk/drivers/s390/cio/device_id.c index 997f46874537..f17275917fe5 100644 --- a/trunk/drivers/s390/cio/device_id.c +++ b/trunk/drivers/s390/cio/device_id.c @@ -11,7 +11,6 @@ #include #include -#include #include #include @@ -139,7 +138,7 @@ VM_virtual_device_info (__u16 devno, struct senseid *ps) ps->cu_model = 0x60; return; } - for (i = 0; i < ARRAY_SIZE(vm_devices); i++) + for (i = 0; i < sizeof(vm_devices) / sizeof(vm_devices[0]); i++) if (diag_data.vrdcvcla == vm_devices[i].vrdcvcla && diag_data.vrdcvtyp == vm_devices[i].vrdcvtyp) { ps->cu_type = vm_devices[i].cu_type; diff --git a/trunk/drivers/s390/cio/device_ops.c b/trunk/drivers/s390/cio/device_ops.c index 7c7775aae38a..d7b25b8f71d2 100644 --- a/trunk/drivers/s390/cio/device_ops.c +++ b/trunk/drivers/s390/cio/device_ops.c @@ -23,7 +23,8 @@ #include "chsc.h" #include "device.h" -int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags) +int +ccw_device_set_options(struct ccw_device *cdev, unsigned long flags) { /* * The flag usage is mutal exclusive ... @@ -38,33 +39,6 @@ int ccw_device_set_options_mask(struct ccw_device *cdev, unsigned long flags) return 0; } -int ccw_device_set_options(struct ccw_device *cdev, unsigned long flags) -{ - /* - * The flag usage is mutal exclusive ... - */ - if (((flags & CCWDEV_EARLY_NOTIFICATION) && - (flags & CCWDEV_REPORT_ALL)) || - ((flags & CCWDEV_EARLY_NOTIFICATION) && - cdev->private->options.repall) || - ((flags & CCWDEV_REPORT_ALL) && - cdev->private->options.fast)) - return -EINVAL; - cdev->private->options.fast |= (flags & CCWDEV_EARLY_NOTIFICATION) != 0; - cdev->private->options.repall |= (flags & CCWDEV_REPORT_ALL) != 0; - cdev->private->options.pgroup |= (flags & CCWDEV_DO_PATHGROUP) != 0; - cdev->private->options.force |= (flags & CCWDEV_ALLOW_FORCE) != 0; - return 0; -} - -void ccw_device_clear_options(struct ccw_device *cdev, unsigned long flags) -{ - cdev->private->options.fast &= (flags & CCWDEV_EARLY_NOTIFICATION) == 0; - cdev->private->options.repall &= (flags & CCWDEV_REPORT_ALL) == 0; - cdev->private->options.pgroup &= (flags & CCWDEV_DO_PATHGROUP) == 0; - cdev->private->options.force &= (flags & CCWDEV_ALLOW_FORCE) == 0; -} - int ccw_device_clear(struct ccw_device *cdev, unsigned long intparm) { @@ -627,9 +601,7 @@ _ccw_device_get_device_number(struct ccw_device *cdev) MODULE_LICENSE("GPL"); -EXPORT_SYMBOL(ccw_device_set_options_mask); EXPORT_SYMBOL(ccw_device_set_options); -EXPORT_SYMBOL(ccw_device_clear_options); EXPORT_SYMBOL(ccw_device_clear); EXPORT_SYMBOL(ccw_device_halt); EXPORT_SYMBOL(ccw_device_resume); diff --git a/trunk/drivers/s390/cio/qdio.c b/trunk/drivers/s390/cio/qdio.c index 5b1e3ff26c0b..d726cd5777de 100644 --- a/trunk/drivers/s390/cio/qdio.c +++ b/trunk/drivers/s390/cio/qdio.c @@ -3194,7 +3194,7 @@ qdio_establish(struct qdio_initialize *init_data) spin_lock_irqsave(get_ccwdev_lock(cdev),saveflags); - ccw_device_set_options_mask(cdev, 0); + ccw_device_set_options(cdev, 0); result=ccw_device_start_timeout(cdev,&irq_ptr->ccw, QDIO_DOING_ESTABLISH,0, 0, QDIO_ESTABLISH_TIMEOUT); diff --git a/trunk/drivers/s390/crypto/zcrypt_api.c b/trunk/drivers/s390/crypto/zcrypt_api.c index 99761391f340..2c785148d21e 100644 --- a/trunk/drivers/s390/crypto/zcrypt_api.c +++ b/trunk/drivers/s390/crypto/zcrypt_api.c @@ -807,7 +807,7 @@ static long zcrypt_compat_ioctl(struct file *filp, unsigned int cmd, /** * Misc device file operations. */ -static const struct file_operations zcrypt_fops = { +static struct file_operations zcrypt_fops = { .owner = THIS_MODULE, .read = zcrypt_read, .write = zcrypt_write, diff --git a/trunk/drivers/s390/net/qeth_proc.c b/trunk/drivers/s390/net/qeth_proc.c index 81f805cc5ee7..faa768e59257 100644 --- a/trunk/drivers/s390/net/qeth_proc.c +++ b/trunk/drivers/s390/net/qeth_proc.c @@ -161,7 +161,7 @@ qeth_procfile_open(struct inode *inode, struct file *file) return seq_open(file, &qeth_procfile_seq_ops); } -static const struct file_operations qeth_procfile_fops = { +static struct file_operations qeth_procfile_fops = { .owner = THIS_MODULE, .open = qeth_procfile_open, .read = seq_read, @@ -273,7 +273,7 @@ qeth_perf_procfile_open(struct inode *inode, struct file *file) return seq_open(file, &qeth_perf_procfile_seq_ops); } -static const struct file_operations qeth_perf_procfile_fops = { +static struct file_operations qeth_perf_procfile_fops = { .owner = THIS_MODULE, .open = qeth_perf_procfile_open, .read = seq_read, diff --git a/trunk/drivers/s390/scsi/zfcp_aux.c b/trunk/drivers/s390/scsi/zfcp_aux.c index 1f9554e08013..39a885266790 100644 --- a/trunk/drivers/s390/scsi/zfcp_aux.c +++ b/trunk/drivers/s390/scsi/zfcp_aux.c @@ -60,7 +60,7 @@ static long zfcp_cfdc_dev_ioctl(struct file *, unsigned int, unsigned long); _IOWR(ZFCP_CFDC_IOC_MAGIC, 0, struct zfcp_cfdc_sense_data) -static const struct file_operations zfcp_cfdc_fops = { +static struct file_operations zfcp_cfdc_fops = { .unlocked_ioctl = zfcp_cfdc_dev_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = zfcp_cfdc_dev_ioctl diff --git a/trunk/drivers/sbus/char/bpp.c b/trunk/drivers/sbus/char/bpp.c index a39ee80c9715..ac7d1258efee 100644 --- a/trunk/drivers/sbus/char/bpp.c +++ b/trunk/drivers/sbus/char/bpp.c @@ -846,7 +846,7 @@ static int bpp_ioctl(struct inode *inode, struct file *f, unsigned int cmd, return errno; } -static const struct file_operations bpp_fops = { +static struct file_operations bpp_fops = { .owner = THIS_MODULE, .read = bpp_read, .write = bpp_write, diff --git a/trunk/drivers/sbus/char/cpwatchdog.c b/trunk/drivers/sbus/char/cpwatchdog.c index 0cfd1e4c032c..ad1c7db96cb4 100644 --- a/trunk/drivers/sbus/char/cpwatchdog.c +++ b/trunk/drivers/sbus/char/cpwatchdog.c @@ -459,7 +459,7 @@ static irqreturn_t wd_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static const struct file_operations wd_fops = { +static struct file_operations wd_fops = { .owner = THIS_MODULE, .ioctl = wd_ioctl, .compat_ioctl = wd_compat_ioctl, diff --git a/trunk/drivers/sbus/char/display7seg.c b/trunk/drivers/sbus/char/display7seg.c index 2d14a29effe4..a4909e0c7f83 100644 --- a/trunk/drivers/sbus/char/display7seg.c +++ b/trunk/drivers/sbus/char/display7seg.c @@ -166,7 +166,7 @@ static long d7s_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return error; } -static const struct file_operations d7s_fops = { +static struct file_operations d7s_fops = { .owner = THIS_MODULE, .unlocked_ioctl = d7s_ioctl, .compat_ioctl = d7s_ioctl, diff --git a/trunk/drivers/sbus/char/envctrl.c b/trunk/drivers/sbus/char/envctrl.c index 2cea4f5d2084..fff4660cdf96 100644 --- a/trunk/drivers/sbus/char/envctrl.c +++ b/trunk/drivers/sbus/char/envctrl.c @@ -705,7 +705,7 @@ envctrl_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations envctrl_fops = { +static struct file_operations envctrl_fops = { .owner = THIS_MODULE, .read = envctrl_read, .unlocked_ioctl = envctrl_ioctl, diff --git a/trunk/drivers/sbus/char/flash.c b/trunk/drivers/sbus/char/flash.c index 6e99507aeb12..fa2418f7ad39 100644 --- a/trunk/drivers/sbus/char/flash.c +++ b/trunk/drivers/sbus/char/flash.c @@ -142,7 +142,7 @@ flash_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations flash_fops = { +static struct file_operations flash_fops = { /* no write to the Flash, use mmap * and play flash dependent tricks. */ diff --git a/trunk/drivers/sbus/char/jsflash.c b/trunk/drivers/sbus/char/jsflash.c index 512857a23169..14631ac11bc7 100644 --- a/trunk/drivers/sbus/char/jsflash.c +++ b/trunk/drivers/sbus/char/jsflash.c @@ -431,7 +431,7 @@ static int jsf_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations jsf_fops = { +static struct file_operations jsf_fops = { .owner = THIS_MODULE, .llseek = jsf_lseek, .read = jsf_read, diff --git a/trunk/drivers/sbus/char/openprom.c b/trunk/drivers/sbus/char/openprom.c index e8776230782b..4e2a0e2dcc2e 100644 --- a/trunk/drivers/sbus/char/openprom.c +++ b/trunk/drivers/sbus/char/openprom.c @@ -704,7 +704,7 @@ static int openprom_release(struct inode * inode, struct file * file) return 0; } -static const struct file_operations openprom_fops = { +static struct file_operations openprom_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = openprom_ioctl, diff --git a/trunk/drivers/sbus/char/riowatchdog.c b/trunk/drivers/sbus/char/riowatchdog.c index a2fc6b8c1334..2a9cc8204429 100644 --- a/trunk/drivers/sbus/char/riowatchdog.c +++ b/trunk/drivers/sbus/char/riowatchdog.c @@ -193,7 +193,7 @@ static ssize_t riowd_write(struct file *file, const char __user *buf, size_t cou return 0; } -static const struct file_operations riowd_fops = { +static struct file_operations riowd_fops = { .owner = THIS_MODULE, .ioctl = riowd_ioctl, .open = riowd_open, diff --git a/trunk/drivers/sbus/char/rtc.c b/trunk/drivers/sbus/char/rtc.c index 94d185829119..9b988baf0b51 100644 --- a/trunk/drivers/sbus/char/rtc.c +++ b/trunk/drivers/sbus/char/rtc.c @@ -233,7 +233,7 @@ static int rtc_release(struct inode *inode, struct file *file) return 0; } -static const struct file_operations rtc_fops = { +static struct file_operations rtc_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = rtc_ioctl, diff --git a/trunk/drivers/sbus/char/uctrl.c b/trunk/drivers/sbus/char/uctrl.c index 4d1a505e9e74..b30372f17f1c 100644 --- a/trunk/drivers/sbus/char/uctrl.c +++ b/trunk/drivers/sbus/char/uctrl.c @@ -224,7 +224,7 @@ static irqreturn_t uctrl_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static const struct file_operations uctrl_fops = { +static struct file_operations uctrl_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = uctrl_ioctl, diff --git a/trunk/drivers/sbus/char/vfc_dev.c b/trunk/drivers/sbus/char/vfc_dev.c index 37a04a0cecfa..386e7de0b7e3 100644 --- a/trunk/drivers/sbus/char/vfc_dev.c +++ b/trunk/drivers/sbus/char/vfc_dev.c @@ -44,7 +44,7 @@ #include "vfc.h" #include -static const struct file_operations vfc_fops; +static struct file_operations vfc_fops; struct vfc_dev **vfc_dev_lst; static char vfcstr[]="vfc"; static unsigned char saa9051_init_array[VFC_SAA9051_NR] = { @@ -633,7 +633,7 @@ static int vfc_mmap(struct file *file, struct vm_area_struct *vma) } -static const struct file_operations vfc_fops = { +static struct file_operations vfc_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = vfc_ioctl, diff --git a/trunk/drivers/scsi/3w-9xxx.c b/trunk/drivers/scsi/3w-9xxx.c index eb766c3af1c8..b091a0fc4eb0 100644 --- a/trunk/drivers/scsi/3w-9xxx.c +++ b/trunk/drivers/scsi/3w-9xxx.c @@ -197,7 +197,7 @@ static struct class_device_attribute *twa_host_attrs[] = { }; /* File operations struct for character device */ -static const struct file_operations twa_fops = { +static struct file_operations twa_fops = { .owner = THIS_MODULE, .ioctl = twa_chrdev_ioctl, .open = twa_chrdev_open, diff --git a/trunk/drivers/scsi/3w-xxxx.c b/trunk/drivers/scsi/3w-xxxx.c index bf5d63e1beee..e1b44d6c0c32 100644 --- a/trunk/drivers/scsi/3w-xxxx.c +++ b/trunk/drivers/scsi/3w-xxxx.c @@ -1040,7 +1040,7 @@ static int tw_chrdev_open(struct inode *inode, struct file *file) } /* End tw_chrdev_open() */ /* File operations struct for character device */ -static const struct file_operations tw_fops = { +static struct file_operations tw_fops = { .owner = THIS_MODULE, .ioctl = tw_chrdev_ioctl, .open = tw_chrdev_open, diff --git a/trunk/drivers/scsi/aacraid/linit.c b/trunk/drivers/scsi/aacraid/linit.c index 0f948c2fb609..a9734e08fe28 100644 --- a/trunk/drivers/scsi/aacraid/linit.c +++ b/trunk/drivers/scsi/aacraid/linit.c @@ -774,7 +774,7 @@ static struct class_device_attribute *aac_attrs[] = { }; -static const struct file_operations aac_cfg_fops = { +static struct file_operations aac_cfg_fops = { .owner = THIS_MODULE, .ioctl = aac_cfg_ioctl, #ifdef CONFIG_COMPAT diff --git a/trunk/drivers/scsi/ch.c b/trunk/drivers/scsi/ch.c index d02759f13469..f6caa4307768 100644 --- a/trunk/drivers/scsi/ch.c +++ b/trunk/drivers/scsi/ch.c @@ -129,7 +129,7 @@ static struct scsi_driver ch_template = }, }; -static const struct file_operations changer_fops = +static struct file_operations changer_fops = { .owner = THIS_MODULE, .open = ch_open, diff --git a/trunk/drivers/scsi/dpt_i2o.c b/trunk/drivers/scsi/dpt_i2o.c index cd36e81b2d93..365db537a28d 100644 --- a/trunk/drivers/scsi/dpt_i2o.c +++ b/trunk/drivers/scsi/dpt_i2o.c @@ -116,7 +116,7 @@ static int sys_tbl_len = 0; static adpt_hba* hba_chain = NULL; static int hba_count = 0; -static const struct file_operations adpt_fops = { +static struct file_operations adpt_fops = { .ioctl = adpt_ioctl, .open = adpt_open, .release = adpt_close diff --git a/trunk/drivers/scsi/gdth.c b/trunk/drivers/scsi/gdth.c index a1992928e671..4c698a71f66f 100644 --- a/trunk/drivers/scsi/gdth.c +++ b/trunk/drivers/scsi/gdth.c @@ -687,7 +687,7 @@ MODULE_AUTHOR("Achim Leubner"); MODULE_LICENSE("GPL"); /* ioctl interface */ -static const struct file_operations gdth_fops = { +static struct file_operations gdth_fops = { .ioctl = gdth_ioctl, .open = gdth_open, .release = gdth_close, diff --git a/trunk/drivers/scsi/megaraid.c b/trunk/drivers/scsi/megaraid.c index 808a1b8c4043..77d9d3804ccf 100644 --- a/trunk/drivers/scsi/megaraid.c +++ b/trunk/drivers/scsi/megaraid.c @@ -92,7 +92,7 @@ static struct mega_hbas mega_hbas[MAX_CONTROLLERS]; /* * The File Operations structure for the serial/ioctl interface of the driver */ -static const struct file_operations megadev_fops = { +static struct file_operations megadev_fops = { .owner = THIS_MODULE, .ioctl = megadev_ioctl, .open = megadev_open, diff --git a/trunk/drivers/scsi/megaraid/megaraid_mm.c b/trunk/drivers/scsi/megaraid/megaraid_mm.c index f33a678f0897..c1ff20c4747d 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_mm.c +++ b/trunk/drivers/scsi/megaraid/megaraid_mm.c @@ -67,7 +67,7 @@ static struct list_head adapters_list_g; static wait_queue_head_t wait_q; -static const struct file_operations lsi_fops = { +static struct file_operations lsi_fops = { .open = mraid_mm_open, .ioctl = mraid_mm_ioctl, #ifdef CONFIG_COMPAT diff --git a/trunk/drivers/scsi/megaraid/megaraid_sas.c b/trunk/drivers/scsi/megaraid/megaraid_sas.c index 15e24fcc84f3..b5bdd0d7a8bf 100644 --- a/trunk/drivers/scsi/megaraid/megaraid_sas.c +++ b/trunk/drivers/scsi/megaraid/megaraid_sas.c @@ -2913,7 +2913,7 @@ megasas_mgmt_compat_ioctl(struct file *file, unsigned int cmd, /* * File operations structure for management interface */ -static const struct file_operations megasas_mgmt_fops = { +static struct file_operations megasas_mgmt_fops = { .owner = THIS_MODULE, .open = megasas_mgmt_open, .release = megasas_mgmt_release, diff --git a/trunk/drivers/scsi/osst.c b/trunk/drivers/scsi/osst.c index 9668b73872c7..bd6bbf61adb8 100644 --- a/trunk/drivers/scsi/osst.c +++ b/trunk/drivers/scsi/osst.c @@ -5522,7 +5522,7 @@ __setup("osst=", osst_setup); #endif -static const struct file_operations osst_fops = { +static struct file_operations osst_fops = { .owner = THIS_MODULE, .read = osst_read, .write = osst_write, diff --git a/trunk/drivers/scsi/scsi_proc.c b/trunk/drivers/scsi/scsi_proc.c index 69d6e9b198c4..524a5f7a5193 100644 --- a/trunk/drivers/scsi/scsi_proc.c +++ b/trunk/drivers/scsi/scsi_proc.c @@ -308,7 +308,7 @@ static int proc_scsi_open(struct inode *inode, struct file *file) return single_open(file, proc_scsi_show, NULL); } -static const struct file_operations proc_scsi_operations = { +static struct file_operations proc_scsi_operations = { .open = proc_scsi_open, .read = seq_read, .write = proc_scsi_write, diff --git a/trunk/drivers/scsi/scsi_tgt_if.c b/trunk/drivers/scsi/scsi_tgt_if.c index f2344ab8deff..37bbfbdb870f 100644 --- a/trunk/drivers/scsi/scsi_tgt_if.c +++ b/trunk/drivers/scsi/scsi_tgt_if.c @@ -280,7 +280,7 @@ static int tgt_open(struct inode *inode, struct file *file) return 0; } -static const struct file_operations tgt_fops = { +static struct file_operations tgt_fops = { .owner = THIS_MODULE, .open = tgt_open, .poll = tgt_poll, diff --git a/trunk/drivers/scsi/st.c b/trunk/drivers/scsi/st.c index 3d2e02381e92..16e279be4a3e 100644 --- a/trunk/drivers/scsi/st.c +++ b/trunk/drivers/scsi/st.c @@ -3864,7 +3864,7 @@ __setup("st=", st_setup); #endif -static const struct file_operations st_fops = +static struct file_operations st_fops = { .owner = THIS_MODULE, .read = st_read, diff --git a/trunk/drivers/serial/atmel_serial.c b/trunk/drivers/serial/atmel_serial.c index df45a7ac773f..881f886b91c6 100644 --- a/trunk/drivers/serial/atmel_serial.c +++ b/trunk/drivers/serial/atmel_serial.c @@ -73,35 +73,35 @@ #define ATMEL_ISR_PASS_LIMIT 256 -#define UART_PUT_CR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_CR) -#define UART_GET_MR(port) __raw_readl((port)->membase + ATMEL_US_MR) -#define UART_PUT_MR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_MR) -#define UART_PUT_IER(port,v) __raw_writel(v, (port)->membase + ATMEL_US_IER) -#define UART_PUT_IDR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_IDR) -#define UART_GET_IMR(port) __raw_readl((port)->membase + ATMEL_US_IMR) -#define UART_GET_CSR(port) __raw_readl((port)->membase + ATMEL_US_CSR) -#define UART_GET_CHAR(port) __raw_readl((port)->membase + ATMEL_US_RHR) -#define UART_PUT_CHAR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_THR) -#define UART_GET_BRGR(port) __raw_readl((port)->membase + ATMEL_US_BRGR) -#define UART_PUT_BRGR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_BRGR) -#define UART_PUT_RTOR(port,v) __raw_writel(v, (port)->membase + ATMEL_US_RTOR) - -// #define UART_GET_CR(port) __raw_readl((port)->membase + ATMEL_US_CR) // is write-only +#define UART_PUT_CR(port,v) writel(v, (port)->membase + ATMEL_US_CR) +#define UART_GET_MR(port) readl((port)->membase + ATMEL_US_MR) +#define UART_PUT_MR(port,v) writel(v, (port)->membase + ATMEL_US_MR) +#define UART_PUT_IER(port,v) writel(v, (port)->membase + ATMEL_US_IER) +#define UART_PUT_IDR(port,v) writel(v, (port)->membase + ATMEL_US_IDR) +#define UART_GET_IMR(port) readl((port)->membase + ATMEL_US_IMR) +#define UART_GET_CSR(port) readl((port)->membase + ATMEL_US_CSR) +#define UART_GET_CHAR(port) readl((port)->membase + ATMEL_US_RHR) +#define UART_PUT_CHAR(port,v) writel(v, (port)->membase + ATMEL_US_THR) +#define UART_GET_BRGR(port) readl((port)->membase + ATMEL_US_BRGR) +#define UART_PUT_BRGR(port,v) writel(v, (port)->membase + ATMEL_US_BRGR) +#define UART_PUT_RTOR(port,v) writel(v, (port)->membase + ATMEL_US_RTOR) + +// #define UART_GET_CR(port) readl((port)->membase + ATMEL_US_CR) // is write-only /* PDC registers */ -#define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR) -#define UART_GET_PTSR(port) __raw_readl((port)->membase + ATMEL_PDC_PTSR) - -#define UART_PUT_RPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RPR) -#define UART_GET_RPR(port) __raw_readl((port)->membase + ATMEL_PDC_RPR) -#define UART_PUT_RCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RCR) -#define UART_PUT_RNPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RNPR) -#define UART_PUT_RNCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RNCR) - -#define UART_PUT_TPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TPR) -#define UART_PUT_TCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TCR) -//#define UART_PUT_TNPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TNPR) -//#define UART_PUT_TNCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TNCR) +#define UART_PUT_PTCR(port,v) writel(v, (port)->membase + ATMEL_PDC_PTCR) +#define UART_GET_PTSR(port) readl((port)->membase + ATMEL_PDC_PTSR) + +#define UART_PUT_RPR(port,v) writel(v, (port)->membase + ATMEL_PDC_RPR) +#define UART_GET_RPR(port) readl((port)->membase + ATMEL_PDC_RPR) +#define UART_PUT_RCR(port,v) writel(v, (port)->membase + ATMEL_PDC_RCR) +#define UART_PUT_RNPR(port,v) writel(v, (port)->membase + ATMEL_PDC_RNPR) +#define UART_PUT_RNCR(port,v) writel(v, (port)->membase + ATMEL_PDC_RNCR) + +#define UART_PUT_TPR(port,v) writel(v, (port)->membase + ATMEL_PDC_TPR) +#define UART_PUT_TCR(port,v) writel(v, (port)->membase + ATMEL_PDC_TCR) +//#define UART_PUT_TNPR(port,v) writel(v, (port)->membase + ATMEL_PDC_TNPR) +//#define UART_PUT_TNCR(port,v) writel(v, (port)->membase + ATMEL_PDC_TNCR) static int (*atmel_open_hook)(struct uart_port *); static void (*atmel_close_hook)(struct uart_port *); diff --git a/trunk/drivers/spi/Kconfig b/trunk/drivers/spi/Kconfig index 9052f4c3493b..d895a1adb428 100644 --- a/trunk/drivers/spi/Kconfig +++ b/trunk/drivers/spi/Kconfig @@ -75,13 +75,6 @@ config SPI_BUTTERFLY inexpensive battery powered microcontroller evaluation board. This same cable can be used to flash new firmware. -config SPI_IMX - tristate "Freescale iMX SPI controller" - depends on SPI_MASTER && ARCH_IMX && EXPERIMENTAL - help - This enables using the Freescale iMX SPI controller in master - mode. - config SPI_MPC83xx tristate "Freescale MPC83xx SPI controller" depends on SPI_MASTER && PPC_83xx && EXPERIMENTAL @@ -94,14 +87,6 @@ config SPI_MPC83xx family of PowerPC processors. The MPC83xx uses a simple set of shift registers for data (opposed to the CPM based descriptor model). -config SPI_OMAP_UWIRE - tristate "OMAP1 MicroWire" - depends on SPI_MASTER && ARCH_OMAP1 - select SPI_BITBANG - help - This hooks up to the MicroWire controller on OMAP1 chips. - - config SPI_PXA2XX tristate "PXA2xx SSP SPI master" depends on SPI_MASTER && ARCH_PXA && EXPERIMENTAL @@ -110,12 +95,6 @@ config SPI_PXA2XX The driver can be configured to use any SSP port and additional documentation can be found a Documentation/spi/pxa2xx. -config SPI_S3C24XX - tristate "Samsung S3C24XX series SPI" - depends on SPI_MASTER && ARCH_S3C2410 && EXPERIMENTAL - help - SPI driver for Samsung S3C24XX series ARM SoCs - config SPI_S3C24XX_GPIO tristate "Samsung S3C24XX series SPI by GPIO" depends on SPI_MASTER && ARCH_S3C2410 && SPI_BITBANG && EXPERIMENTAL @@ -128,6 +107,13 @@ config SPI_S3C24XX_GPIO # Add new SPI master controllers in alphabetical order above this line # + +config SPI_S3C24XX + tristate "Samsung S3C24XX series SPI" + depends on SPI_MASTER && ARCH_S3C2410 && EXPERIMENTAL + help + SPI driver for Samsung S3C24XX series ARM SoCs + # # There are lots of SPI device types, with sensors and memory # being probably the most widely used ones. @@ -135,16 +121,6 @@ config SPI_S3C24XX_GPIO comment "SPI Protocol Masters" depends on SPI_MASTER -config SPI_AT25 - tristate "SPI EEPROMs from most vendors" - depends on SPI_MASTER && SYSFS - help - Enable this driver to get read/write support to most SPI EEPROMs, - after you configure the board init code to know about each eeprom - on your target board. - - This driver can also be built as a module. If so, the module - will be called at25. # # Add new SPI protocol masters in alphabetical order above this line diff --git a/trunk/drivers/spi/Makefile b/trunk/drivers/spi/Makefile index bf271fe4e536..8f4cb67997b3 100644 --- a/trunk/drivers/spi/Makefile +++ b/trunk/drivers/spi/Makefile @@ -13,16 +13,13 @@ obj-$(CONFIG_SPI_MASTER) += spi.o # SPI master controller drivers (bus) obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o obj-$(CONFIG_SPI_BUTTERFLY) += spi_butterfly.o -obj-$(CONFIG_SPI_IMX) += spi_imx.o obj-$(CONFIG_SPI_PXA2XX) += pxa2xx_spi.o -obj-$(CONFIG_SPI_OMAP_UWIRE) += omap_uwire.o obj-$(CONFIG_SPI_MPC83xx) += spi_mpc83xx.o obj-$(CONFIG_SPI_S3C24XX_GPIO) += spi_s3c24xx_gpio.o obj-$(CONFIG_SPI_S3C24XX) += spi_s3c24xx.o # ... add above this line ... # SPI protocol drivers (device/link on bus) -obj-$(CONFIG_SPI_AT25) += at25.o # ... add above this line ... # SPI slave controller drivers (upstream link) diff --git a/trunk/drivers/spi/at25.c b/trunk/drivers/spi/at25.c deleted file mode 100644 index 48e4f48e779f..000000000000 --- a/trunk/drivers/spi/at25.c +++ /dev/null @@ -1,381 +0,0 @@ -/* - * at25.c -- support most SPI EEPROMs, such as Atmel AT25 models - * - * Copyright (C) 2006 David Brownell - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - - -struct at25_data { - struct spi_device *spi; - struct mutex lock; - struct spi_eeprom chip; - struct bin_attribute bin; - unsigned addrlen; -}; - -#define AT25_WREN 0x06 /* latch the write enable */ -#define AT25_WRDI 0x04 /* reset the write enable */ -#define AT25_RDSR 0x05 /* read status register */ -#define AT25_WRSR 0x01 /* write status register */ -#define AT25_READ 0x03 /* read byte(s) */ -#define AT25_WRITE 0x02 /* write byte(s)/sector */ - -#define AT25_SR_nRDY 0x01 /* nRDY = write-in-progress */ -#define AT25_SR_WEN 0x02 /* write enable (latched) */ -#define AT25_SR_BP0 0x04 /* BP for software writeprotect */ -#define AT25_SR_BP1 0x08 -#define AT25_SR_WPEN 0x80 /* writeprotect enable */ - - -#define EE_MAXADDRLEN 3 /* 24 bit addresses, up to 2 MBytes */ - -/* Specs often allow 5 msec for a page write, sometimes 20 msec; - * it's important to recover from write timeouts. - */ -#define EE_TIMEOUT 25 - -/*-------------------------------------------------------------------------*/ - -#define io_limit PAGE_SIZE /* bytes */ - -static ssize_t -at25_ee_read( - struct at25_data *at25, - char *buf, - unsigned offset, - size_t count -) -{ - u8 command[EE_MAXADDRLEN + 1]; - u8 *cp; - ssize_t status; - struct spi_transfer t[2]; - struct spi_message m; - - cp = command; - *cp++ = AT25_READ; - - /* 8/16/24-bit address is written MSB first */ - switch (at25->addrlen) { - default: /* case 3 */ - *cp++ = offset >> 16; - case 2: - *cp++ = offset >> 8; - case 1: - case 0: /* can't happen: for better codegen */ - *cp++ = offset >> 0; - } - - spi_message_init(&m); - memset(t, 0, sizeof t); - - t[0].tx_buf = command; - t[0].len = at25->addrlen + 1; - spi_message_add_tail(&t[0], &m); - - t[1].rx_buf = buf; - t[1].len = count; - spi_message_add_tail(&t[1], &m); - - mutex_lock(&at25->lock); - - /* Read it all at once. - * - * REVISIT that's potentially a problem with large chips, if - * other devices on the bus need to be accessed regularly or - * this chip is clocked very slowly - */ - status = spi_sync(at25->spi, &m); - dev_dbg(&at25->spi->dev, - "read %Zd bytes at %d --> %d\n", - count, offset, (int) status); - - mutex_unlock(&at25->lock); - return status ? status : count; -} - -static ssize_t -at25_bin_read(struct kobject *kobj, char *buf, loff_t off, size_t count) -{ - struct device *dev; - struct at25_data *at25; - - dev = container_of(kobj, struct device, kobj); - at25 = dev_get_drvdata(dev); - - if (unlikely(off >= at25->bin.size)) - return 0; - if ((off + count) > at25->bin.size) - count = at25->bin.size - off; - if (unlikely(!count)) - return count; - - return at25_ee_read(at25, buf, off, count); -} - - -static ssize_t -at25_ee_write(struct at25_data *at25, char *buf, loff_t off, size_t count) -{ - ssize_t status = 0; - unsigned written = 0; - unsigned buf_size; - u8 *bounce; - - /* Temp buffer starts with command and address */ - buf_size = at25->chip.page_size; - if (buf_size > io_limit) - buf_size = io_limit; - bounce = kmalloc(buf_size + at25->addrlen + 1, GFP_KERNEL); - if (!bounce) - return -ENOMEM; - - /* For write, rollover is within the page ... so we write at - * most one page, then manually roll over to the next page. - */ - bounce[0] = AT25_WRITE; - mutex_lock(&at25->lock); - do { - unsigned long timeout, retries; - unsigned segment; - unsigned offset = (unsigned) off; - u8 *cp = bounce + 1; - - *cp = AT25_WREN; - status = spi_write(at25->spi, cp, 1); - if (status < 0) { - dev_dbg(&at25->spi->dev, "WREN --> %d\n", - (int) status); - break; - } - - /* 8/16/24-bit address is written MSB first */ - switch (at25->addrlen) { - default: /* case 3 */ - *cp++ = offset >> 16; - case 2: - *cp++ = offset >> 8; - case 1: - case 0: /* can't happen: for better codegen */ - *cp++ = offset >> 0; - } - - /* Write as much of a page as we can */ - segment = buf_size - (offset % buf_size); - if (segment > count) - segment = count; - memcpy(cp, buf, segment); - status = spi_write(at25->spi, bounce, - segment + at25->addrlen + 1); - dev_dbg(&at25->spi->dev, - "write %u bytes at %u --> %d\n", - segment, offset, (int) status); - if (status < 0) - break; - - /* REVISIT this should detect (or prevent) failed writes - * to readonly sections of the EEPROM... - */ - - /* Wait for non-busy status */ - timeout = jiffies + msecs_to_jiffies(EE_TIMEOUT); - retries = 0; - do { - int sr; - - sr = spi_w8r8(at25->spi, AT25_RDSR); - if (sr < 0 || (sr & AT25_SR_nRDY)) { - dev_dbg(&at25->spi->dev, - "rdsr --> %d (%02x)\n", sr, sr); - /* at HZ=100, this is sloooow */ - msleep(1); - continue; - } - if (!(sr & AT25_SR_nRDY)) - break; - } while (retries++ < 3 || time_before_eq(jiffies, timeout)); - - if (time_after(jiffies, timeout)) { - dev_err(&at25->spi->dev, - "write %d bytes offset %d, " - "timeout after %u msecs\n", - segment, offset, - jiffies_to_msecs(jiffies - - (timeout - EE_TIMEOUT))); - status = -ETIMEDOUT; - break; - } - - off += segment; - buf += segment; - count -= segment; - written += segment; - - } while (count > 0); - - mutex_unlock(&at25->lock); - - kfree(bounce); - return written ? written : status; -} - -static ssize_t -at25_bin_write(struct kobject *kobj, char *buf, loff_t off, size_t count) -{ - struct device *dev; - struct at25_data *at25; - - dev = container_of(kobj, struct device, kobj); - at25 = dev_get_drvdata(dev); - - if (unlikely(off >= at25->bin.size)) - return -EFBIG; - if ((off + count) > at25->bin.size) - count = at25->bin.size - off; - if (unlikely(!count)) - return count; - - return at25_ee_write(at25, buf, off, count); -} - -/*-------------------------------------------------------------------------*/ - -static int at25_probe(struct spi_device *spi) -{ - struct at25_data *at25 = NULL; - const struct spi_eeprom *chip; - int err; - int sr; - int addrlen; - - /* Chip description */ - chip = spi->dev.platform_data; - if (!chip) { - dev_dbg(&spi->dev, "no chip description\n"); - err = -ENODEV; - goto fail; - } - - /* For now we only support 8/16/24 bit addressing */ - if (chip->flags & EE_ADDR1) - addrlen = 1; - else if (chip->flags & EE_ADDR2) - addrlen = 2; - else if (chip->flags & EE_ADDR3) - addrlen = 3; - else { - dev_dbg(&spi->dev, "unsupported address type\n"); - err = -EINVAL; - goto fail; - } - - /* Ping the chip ... the status register is pretty portable, - * unlike probing manufacturer IDs. We do expect that system - * firmware didn't write it in the past few milliseconds! - */ - sr = spi_w8r8(spi, AT25_RDSR); - if (sr < 0 || sr & AT25_SR_nRDY) { - dev_dbg(&at25->spi->dev, "rdsr --> %d (%02x)\n", sr, sr); - err = -ENXIO; - goto fail; - } - - if (!(at25 = kzalloc(sizeof *at25, GFP_KERNEL))) { - err = -ENOMEM; - goto fail; - } - - mutex_init(&at25->lock); - at25->chip = *chip; - at25->spi = spi_dev_get(spi); - dev_set_drvdata(&spi->dev, at25); - at25->addrlen = addrlen; - - /* Export the EEPROM bytes through sysfs, since that's convenient. - * Default to root-only access to the data; EEPROMs often hold data - * that's sensitive for read and/or write, like ethernet addresses, - * security codes, board-specific manufacturing calibrations, etc. - */ - at25->bin.attr.name = "eeprom"; - at25->bin.attr.mode = S_IRUSR; - at25->bin.attr.owner = THIS_MODULE; - at25->bin.read = at25_bin_read; - - at25->bin.size = at25->chip.byte_len; - if (!(chip->flags & EE_READONLY)) { - at25->bin.write = at25_bin_write; - at25->bin.attr.mode |= S_IWUSR; - } - - err = sysfs_create_bin_file(&spi->dev.kobj, &at25->bin); - if (err) - goto fail; - - dev_info(&spi->dev, "%Zd %s %s eeprom%s, pagesize %u\n", - (at25->bin.size < 1024) - ? at25->bin.size - : (at25->bin.size / 1024), - (at25->bin.size < 1024) ? "Byte" : "KByte", - at25->chip.name, - (chip->flags & EE_READONLY) ? " (readonly)" : "", - at25->chip.page_size); - return 0; -fail: - dev_dbg(&spi->dev, "probe err %d\n", err); - kfree(at25); - return err; -} - -static int __devexit at25_remove(struct spi_device *spi) -{ - struct at25_data *at25; - - at25 = dev_get_drvdata(&spi->dev); - sysfs_remove_bin_file(&spi->dev.kobj, &at25->bin); - kfree(at25); - return 0; -} - -/*-------------------------------------------------------------------------*/ - -static struct spi_driver at25_driver = { - .driver = { - .name = "at25", - .owner = THIS_MODULE, - }, - .probe = at25_probe, - .remove = __devexit_p(at25_remove), -}; - -static int __init at25_init(void) -{ - return spi_register_driver(&at25_driver); -} -module_init(at25_init); - -static void __exit at25_exit(void) -{ - spi_unregister_driver(&at25_driver); -} -module_exit(at25_exit); - -MODULE_DESCRIPTION("Driver for most SPI EEPROMs"); -MODULE_AUTHOR("David Brownell"); -MODULE_LICENSE("GPL"); - diff --git a/trunk/drivers/spi/omap_uwire.c b/trunk/drivers/spi/omap_uwire.c deleted file mode 100644 index 366af4959a0f..000000000000 --- a/trunk/drivers/spi/omap_uwire.c +++ /dev/null @@ -1,572 +0,0 @@ -/* - * omap_uwire.c -- MicroWire interface driver for OMAP - * - * Copyright 2003 MontaVista Software Inc. - * - * Ported to 2.6 OMAP uwire interface. - * Copyright (C) 2004 Texas Instruments. - * - * Generalization patches by Juha Yrjola - * - * Copyright (C) 2005 David Brownell (ported to 2.6 SPI interface) - * Copyright (C) 2006 Nokia - * - * Many updates by Imre Deak - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - */ -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include /* OMAP730_IO_CONF registers */ - - -/* FIXME address is now a platform device resource, - * and irqs should show there too... - */ -#define UWIRE_BASE_PHYS 0xFFFB3000 -#define UWIRE_BASE ((void *__iomem)IO_ADDRESS(UWIRE_BASE_PHYS)) - -/* uWire Registers: */ -#define UWIRE_IO_SIZE 0x20 -#define UWIRE_TDR 0x00 -#define UWIRE_RDR 0x00 -#define UWIRE_CSR 0x01 -#define UWIRE_SR1 0x02 -#define UWIRE_SR2 0x03 -#define UWIRE_SR3 0x04 -#define UWIRE_SR4 0x05 -#define UWIRE_SR5 0x06 - -/* CSR bits */ -#define RDRB (1 << 15) -#define CSRB (1 << 14) -#define START (1 << 13) -#define CS_CMD (1 << 12) - -/* SR1 or SR2 bits */ -#define UWIRE_READ_FALLING_EDGE 0x0001 -#define UWIRE_READ_RISING_EDGE 0x0000 -#define UWIRE_WRITE_FALLING_EDGE 0x0000 -#define UWIRE_WRITE_RISING_EDGE 0x0002 -#define UWIRE_CS_ACTIVE_LOW 0x0000 -#define UWIRE_CS_ACTIVE_HIGH 0x0004 -#define UWIRE_FREQ_DIV_2 0x0000 -#define UWIRE_FREQ_DIV_4 0x0008 -#define UWIRE_FREQ_DIV_8 0x0010 -#define UWIRE_CHK_READY 0x0020 -#define UWIRE_CLK_INVERTED 0x0040 - - -struct uwire_spi { - struct spi_bitbang bitbang; - struct clk *ck; -}; - -struct uwire_state { - unsigned bits_per_word; - unsigned div1_idx; -}; - -/* REVISIT compile time constant for idx_shift? */ -static unsigned int uwire_idx_shift; - -static inline void uwire_write_reg(int idx, u16 val) -{ - __raw_writew(val, UWIRE_BASE + (idx << uwire_idx_shift)); -} - -static inline u16 uwire_read_reg(int idx) -{ - return __raw_readw(UWIRE_BASE + (idx << uwire_idx_shift)); -} - -static inline void omap_uwire_configure_mode(u8 cs, unsigned long flags) -{ - u16 w, val = 0; - int shift, reg; - - if (flags & UWIRE_CLK_INVERTED) - val ^= 0x03; - val = flags & 0x3f; - if (cs & 1) - shift = 6; - else - shift = 0; - if (cs <= 1) - reg = UWIRE_SR1; - else - reg = UWIRE_SR2; - - w = uwire_read_reg(reg); - w &= ~(0x3f << shift); - w |= val << shift; - uwire_write_reg(reg, w); -} - -static int wait_uwire_csr_flag(u16 mask, u16 val, int might_not_catch) -{ - u16 w; - int c = 0; - unsigned long max_jiffies = jiffies + HZ; - - for (;;) { - w = uwire_read_reg(UWIRE_CSR); - if ((w & mask) == val) - break; - if (time_after(jiffies, max_jiffies)) { - printk(KERN_ERR "%s: timeout. reg=%#06x " - "mask=%#06x val=%#06x\n", - __FUNCTION__, w, mask, val); - return -1; - } - c++; - if (might_not_catch && c > 64) - break; - } - return 0; -} - -static void uwire_set_clk1_div(int div1_idx) -{ - u16 w; - - w = uwire_read_reg(UWIRE_SR3); - w &= ~(0x03 << 1); - w |= div1_idx << 1; - uwire_write_reg(UWIRE_SR3, w); -} - -static void uwire_chipselect(struct spi_device *spi, int value) -{ - struct uwire_state *ust = spi->controller_state; - u16 w; - int old_cs; - - - BUG_ON(wait_uwire_csr_flag(CSRB, 0, 0)); - - w = uwire_read_reg(UWIRE_CSR); - old_cs = (w >> 10) & 0x03; - if (value == BITBANG_CS_INACTIVE || old_cs != spi->chip_select) { - /* Deselect this CS, or the previous CS */ - w &= ~CS_CMD; - uwire_write_reg(UWIRE_CSR, w); - } - /* activate specfied chipselect */ - if (value == BITBANG_CS_ACTIVE) { - uwire_set_clk1_div(ust->div1_idx); - /* invert clock? */ - if (spi->mode & SPI_CPOL) - uwire_write_reg(UWIRE_SR4, 1); - else - uwire_write_reg(UWIRE_SR4, 0); - - w = spi->chip_select << 10; - w |= CS_CMD; - uwire_write_reg(UWIRE_CSR, w); - } -} - -static int uwire_txrx(struct spi_device *spi, struct spi_transfer *t) -{ - struct uwire_state *ust = spi->controller_state; - unsigned len = t->len; - unsigned bits = ust->bits_per_word; - unsigned bytes; - u16 val, w; - int status = 0;; - - if (!t->tx_buf && !t->rx_buf) - return 0; - - /* Microwire doesn't read and write concurrently */ - if (t->tx_buf && t->rx_buf) - return -EPERM; - - w = spi->chip_select << 10; - w |= CS_CMD; - - if (t->tx_buf) { - const u8 *buf = t->tx_buf; - - /* NOTE: DMA could be used for TX transfers */ - - /* write one or two bytes at a time */ - while (len >= 1) { - /* tx bit 15 is first sent; we byteswap multibyte words - * (msb-first) on the way out from memory. - */ - val = *buf++; - if (bits > 8) { - bytes = 2; - val |= *buf++ << 8; - } else - bytes = 1; - val <<= 16 - bits; - -#ifdef VERBOSE - pr_debug("%s: write-%d =%04x\n", - spi->dev.bus_id, bits, val); -#endif - if (wait_uwire_csr_flag(CSRB, 0, 0)) - goto eio; - - uwire_write_reg(UWIRE_TDR, val); - - /* start write */ - val = START | w | (bits << 5); - - uwire_write_reg(UWIRE_CSR, val); - len -= bytes; - - /* Wait till write actually starts. - * This is needed with MPU clock 60+ MHz. - * REVISIT: we may not have time to catch it... - */ - if (wait_uwire_csr_flag(CSRB, CSRB, 1)) - goto eio; - - status += bytes; - } - - /* REVISIT: save this for later to get more i/o overlap */ - if (wait_uwire_csr_flag(CSRB, 0, 0)) - goto eio; - - } else if (t->rx_buf) { - u8 *buf = t->rx_buf; - - /* read one or two bytes at a time */ - while (len) { - if (bits > 8) { - bytes = 2; - } else - bytes = 1; - - /* start read */ - val = START | w | (bits << 0); - uwire_write_reg(UWIRE_CSR, val); - len -= bytes; - - /* Wait till read actually starts */ - (void) wait_uwire_csr_flag(CSRB, CSRB, 1); - - if (wait_uwire_csr_flag(RDRB | CSRB, - RDRB, 0)) - goto eio; - - /* rx bit 0 is last received; multibyte words will - * be properly byteswapped on the way to memory. - */ - val = uwire_read_reg(UWIRE_RDR); - val &= (1 << bits) - 1; - *buf++ = (u8) val; - if (bytes == 2) - *buf++ = val >> 8; - status += bytes; -#ifdef VERBOSE - pr_debug("%s: read-%d =%04x\n", - spi->dev.bus_id, bits, val); -#endif - - } - } - return status; -eio: - return -EIO; -} - -static int uwire_setup_transfer(struct spi_device *spi, struct spi_transfer *t) -{ - struct uwire_state *ust = spi->controller_state; - struct uwire_spi *uwire; - unsigned flags = 0; - unsigned bits; - unsigned hz; - unsigned long rate; - int div1_idx; - int div1; - int div2; - int status; - - uwire = spi_master_get_devdata(spi->master); - - if (spi->chip_select > 3) { - pr_debug("%s: cs%d?\n", spi->dev.bus_id, spi->chip_select); - status = -ENODEV; - goto done; - } - - bits = spi->bits_per_word; - if (t != NULL && t->bits_per_word) - bits = t->bits_per_word; - if (!bits) - bits = 8; - - if (bits > 16) { - pr_debug("%s: wordsize %d?\n", spi->dev.bus_id, bits); - status = -ENODEV; - goto done; - } - ust->bits_per_word = bits; - - /* mode 0..3, clock inverted separately; - * standard nCS signaling; - * don't treat DI=high as "not ready" - */ - if (spi->mode & SPI_CS_HIGH) - flags |= UWIRE_CS_ACTIVE_HIGH; - - if (spi->mode & SPI_CPOL) - flags |= UWIRE_CLK_INVERTED; - - switch (spi->mode & (SPI_CPOL | SPI_CPHA)) { - case SPI_MODE_0: - case SPI_MODE_3: - flags |= UWIRE_WRITE_RISING_EDGE | UWIRE_READ_FALLING_EDGE; - break; - case SPI_MODE_1: - case SPI_MODE_2: - flags |= UWIRE_WRITE_FALLING_EDGE | UWIRE_READ_RISING_EDGE; - break; - } - - /* assume it's already enabled */ - rate = clk_get_rate(uwire->ck); - - hz = spi->max_speed_hz; - if (t != NULL && t->speed_hz) - hz = t->speed_hz; - - if (!hz) { - pr_debug("%s: zero speed?\n", spi->dev.bus_id); - status = -EINVAL; - goto done; - } - - /* F_INT = mpu_xor_clk / DIV1 */ - for (div1_idx = 0; div1_idx < 4; div1_idx++) { - switch (div1_idx) { - case 0: - div1 = 2; - break; - case 1: - div1 = 4; - break; - case 2: - div1 = 7; - break; - default: - case 3: - div1 = 10; - break; - } - div2 = (rate / div1 + hz - 1) / hz; - if (div2 <= 8) - break; - } - if (div1_idx == 4) { - pr_debug("%s: lowest clock %ld, need %d\n", - spi->dev.bus_id, rate / 10 / 8, hz); - status = -EDOM; - goto done; - } - - /* we have to cache this and reset in uwire_chipselect as this is a - * global parameter and another uwire device can change it under - * us */ - ust->div1_idx = div1_idx; - uwire_set_clk1_div(div1_idx); - - rate /= div1; - - switch (div2) { - case 0: - case 1: - case 2: - flags |= UWIRE_FREQ_DIV_2; - rate /= 2; - break; - case 3: - case 4: - flags |= UWIRE_FREQ_DIV_4; - rate /= 4; - break; - case 5: - case 6: - case 7: - case 8: - flags |= UWIRE_FREQ_DIV_8; - rate /= 8; - break; - } - omap_uwire_configure_mode(spi->chip_select, flags); - pr_debug("%s: uwire flags %02x, armxor %lu KHz, SCK %lu KHz\n", - __FUNCTION__, flags, - clk_get_rate(uwire->ck) / 1000, - rate / 1000); - status = 0; -done: - return status; -} - -static int uwire_setup(struct spi_device *spi) -{ - struct uwire_state *ust = spi->controller_state; - - if (ust == NULL) { - ust = kzalloc(sizeof(*ust), GFP_KERNEL); - if (ust == NULL) - return -ENOMEM; - spi->controller_state = ust; - } - - return uwire_setup_transfer(spi, NULL); -} - -static void uwire_cleanup(const struct spi_device *spi) -{ - kfree(spi->controller_state); -} - -static void uwire_off(struct uwire_spi *uwire) -{ - uwire_write_reg(UWIRE_SR3, 0); - clk_disable(uwire->ck); - clk_put(uwire->ck); - spi_master_put(uwire->bitbang.master); -} - -static int uwire_probe(struct platform_device *pdev) -{ - struct spi_master *master; - struct uwire_spi *uwire; - int status; - - master = spi_alloc_master(&pdev->dev, sizeof *uwire); - if (!master) - return -ENODEV; - - uwire = spi_master_get_devdata(master); - dev_set_drvdata(&pdev->dev, uwire); - - uwire->ck = clk_get(&pdev->dev, "armxor_ck"); - if (!uwire->ck || IS_ERR(uwire->ck)) { - dev_dbg(&pdev->dev, "no mpu_xor_clk ?\n"); - spi_master_put(master); - return -ENODEV; - } - clk_enable(uwire->ck); - - if (cpu_is_omap730()) - uwire_idx_shift = 1; - else - uwire_idx_shift = 2; - - uwire_write_reg(UWIRE_SR3, 1); - - master->bus_num = 2; /* "official" */ - master->num_chipselect = 4; - master->setup = uwire_setup; - master->cleanup = uwire_cleanup; - - uwire->bitbang.master = master; - uwire->bitbang.chipselect = uwire_chipselect; - uwire->bitbang.setup_transfer = uwire_setup_transfer; - uwire->bitbang.txrx_bufs = uwire_txrx; - - status = spi_bitbang_start(&uwire->bitbang); - if (status < 0) - uwire_off(uwire); - return status; -} - -static int uwire_remove(struct platform_device *pdev) -{ - struct uwire_spi *uwire = dev_get_drvdata(&pdev->dev); - int status; - - // FIXME remove all child devices, somewhere ... - - status = spi_bitbang_stop(&uwire->bitbang); - uwire_off(uwire); - return status; -} - -static struct platform_driver uwire_driver = { - .driver = { - .name = "omap_uwire", - .bus = &platform_bus_type, - .owner = THIS_MODULE, - }, - .probe = uwire_probe, - .remove = uwire_remove, - // suspend ... unuse ck - // resume ... use ck -}; - -static int __init omap_uwire_init(void) -{ - /* FIXME move these into the relevant board init code. also, include - * H3 support; it uses tsc2101 like H2 (on a different chipselect). - */ - - if (machine_is_omap_h2()) { - /* defaults: W21 SDO, U18 SDI, V19 SCL */ - omap_cfg_reg(N14_1610_UWIRE_CS0); - omap_cfg_reg(N15_1610_UWIRE_CS1); - } - if (machine_is_omap_perseus2()) { - /* configure pins: MPU_UW_nSCS1, MPU_UW_SDO, MPU_UW_SCLK */ - int val = omap_readl(OMAP730_IO_CONF_9) & ~0x00EEE000; - omap_writel(val | 0x00AAA000, OMAP730_IO_CONF_9); - } - - return platform_driver_register(&uwire_driver); -} - -static void __exit omap_uwire_exit(void) -{ - platform_driver_unregister(&uwire_driver); -} - -subsys_initcall(omap_uwire_init); -module_exit(omap_uwire_exit); - -MODULE_LICENSE("GPL"); - diff --git a/trunk/drivers/spi/pxa2xx_spi.c b/trunk/drivers/spi/pxa2xx_spi.c index 9f2c887ffa04..8b41f9cc2560 100644 --- a/trunk/drivers/spi/pxa2xx_spi.c +++ b/trunk/drivers/spi/pxa2xx_spi.c @@ -1214,9 +1214,9 @@ static int setup(struct spi_device *spi) return 0; } -static void cleanup(struct spi_device *spi) +static void cleanup(const struct spi_device *spi) { - struct chip_data *chip = spi_get_ctldata(spi); + struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi); kfree(chip); } diff --git a/trunk/drivers/spi/spi.c b/trunk/drivers/spi/spi.c index 2328128728be..6307428d2c94 100644 --- a/trunk/drivers/spi/spi.c +++ b/trunk/drivers/spi/spi.c @@ -32,7 +32,7 @@ */ static void spidev_release(struct device *dev) { - struct spi_device *spi = to_spi_device(dev); + const struct spi_device *spi = to_spi_device(dev); /* spi masters may cleanup for released devices */ if (spi->master->cleanup) diff --git a/trunk/drivers/spi/spi_bitbang.c b/trunk/drivers/spi/spi_bitbang.c index 24a330d82395..57289b61d0be 100644 --- a/trunk/drivers/spi/spi_bitbang.c +++ b/trunk/drivers/spi/spi_bitbang.c @@ -210,7 +210,7 @@ int spi_bitbang_setup(struct spi_device *spi) if (!cs->txrx_word) return -EINVAL; - retval = bitbang->setup_transfer(spi, NULL); + retval = spi_bitbang_setup_transfer(spi, NULL); if (retval < 0) return retval; @@ -238,7 +238,7 @@ EXPORT_SYMBOL_GPL(spi_bitbang_setup); /** * spi_bitbang_cleanup - default cleanup for per-word I/O loops */ -void spi_bitbang_cleanup(struct spi_device *spi) +void spi_bitbang_cleanup(const struct spi_device *spi) { kfree(spi->controller_state); } @@ -442,10 +442,9 @@ EXPORT_SYMBOL_GPL(spi_bitbang_transfer); * hardware that basically exposes a shift register) or per-spi_transfer * (which takes better advantage of hardware like fifos or DMA engines). * - * Drivers using per-word I/O loops should use (or call) spi_bitbang_setup, - * spi_bitbang_cleanup and spi_bitbang_setup_transfer to handle those spi - * master methods. Those methods are the defaults if the bitbang->txrx_bufs - * routine isn't initialized. + * Drivers using per-word I/O loops should use (or call) spi_bitbang_setup and + * spi_bitbang_cleanup to handle those spi master methods. Those methods are + * the defaults if the bitbang->txrx_bufs routine isn't initialized. * * This routine registers the spi_master, which will process requests in a * dedicated task, keeping IRQs unblocked most of the time. To stop diff --git a/trunk/drivers/spi/spi_imx.c b/trunk/drivers/spi/spi_imx.c deleted file mode 100644 index 6ccf8a12a21d..000000000000 --- a/trunk/drivers/spi/spi_imx.c +++ /dev/null @@ -1,1769 +0,0 @@ -/* - * drivers/spi/spi_imx.c - * - * Copyright (C) 2006 SWAPP - * Andrea Paterniani - * - * Initial version inspired by: - * linux-2.6.17-rc3-mm1/drivers/spi/pxa2xx_spi.c - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -/*-------------------------------------------------------------------------*/ -/* SPI Registers offsets from peripheral base address */ -#define SPI_RXDATA (0x00) -#define SPI_TXDATA (0x04) -#define SPI_CONTROL (0x08) -#define SPI_INT_STATUS (0x0C) -#define SPI_TEST (0x10) -#define SPI_PERIOD (0x14) -#define SPI_DMA (0x18) -#define SPI_RESET (0x1C) - -/* SPI Control Register Bit Fields & Masks */ -#define SPI_CONTROL_BITCOUNT_MASK (0xF) /* Bit Count Mask */ -#define SPI_CONTROL_BITCOUNT(n) (((n) - 1) & SPI_CONTROL_BITCOUNT_MASK) -#define SPI_CONTROL_POL (0x1 << 4) /* Clock Polarity Mask */ -#define SPI_CONTROL_POL_ACT_HIGH (0x0 << 4) /* Active high pol. (0=idle) */ -#define SPI_CONTROL_POL_ACT_LOW (0x1 << 4) /* Active low pol. (1=idle) */ -#define SPI_CONTROL_PHA (0x1 << 5) /* Clock Phase Mask */ -#define SPI_CONTROL_PHA_0 (0x0 << 5) /* Clock Phase 0 */ -#define SPI_CONTROL_PHA_1 (0x1 << 5) /* Clock Phase 1 */ -#define SPI_CONTROL_SSCTL (0x1 << 6) /* /SS Waveform Select Mask */ -#define SPI_CONTROL_SSCTL_0 (0x0 << 6) /* Master: /SS stays low between SPI burst - Slave: RXFIFO advanced by BIT_COUNT */ -#define SPI_CONTROL_SSCTL_1 (0x1 << 6) /* Master: /SS insert pulse between SPI burst - Slave: RXFIFO advanced by /SS rising edge */ -#define SPI_CONTROL_SSPOL (0x1 << 7) /* /SS Polarity Select Mask */ -#define SPI_CONTROL_SSPOL_ACT_LOW (0x0 << 7) /* /SS Active low */ -#define SPI_CONTROL_SSPOL_ACT_HIGH (0x1 << 7) /* /SS Active high */ -#define SPI_CONTROL_XCH (0x1 << 8) /* Exchange */ -#define SPI_CONTROL_SPIEN (0x1 << 9) /* SPI Module Enable */ -#define SPI_CONTROL_MODE (0x1 << 10) /* SPI Mode Select Mask */ -#define SPI_CONTROL_MODE_SLAVE (0x0 << 10) /* SPI Mode Slave */ -#define SPI_CONTROL_MODE_MASTER (0x1 << 10) /* SPI Mode Master */ -#define SPI_CONTROL_DRCTL (0x3 << 11) /* /SPI_RDY Control Mask */ -#define SPI_CONTROL_DRCTL_0 (0x0 << 11) /* Ignore /SPI_RDY */ -#define SPI_CONTROL_DRCTL_1 (0x1 << 11) /* /SPI_RDY falling edge triggers input */ -#define SPI_CONTROL_DRCTL_2 (0x2 << 11) /* /SPI_RDY active low level triggers input */ -#define SPI_CONTROL_DATARATE (0x7 << 13) /* Data Rate Mask */ -#define SPI_PERCLK2_DIV_MIN (0) /* PERCLK2:4 */ -#define SPI_PERCLK2_DIV_MAX (7) /* PERCLK2:512 */ -#define SPI_CONTROL_DATARATE_MIN (SPI_PERCLK2_DIV_MAX << 13) -#define SPI_CONTROL_DATARATE_MAX (SPI_PERCLK2_DIV_MIN << 13) -#define SPI_CONTROL_DATARATE_BAD (SPI_CONTROL_DATARATE_MIN + 1) - -/* SPI Interrupt/Status Register Bit Fields & Masks */ -#define SPI_STATUS_TE (0x1 << 0) /* TXFIFO Empty Status */ -#define SPI_STATUS_TH (0x1 << 1) /* TXFIFO Half Status */ -#define SPI_STATUS_TF (0x1 << 2) /* TXFIFO Full Status */ -#define SPI_STATUS_RR (0x1 << 3) /* RXFIFO Data Ready Status */ -#define SPI_STATUS_RH (0x1 << 4) /* RXFIFO Half Status */ -#define SPI_STATUS_RF (0x1 << 5) /* RXFIFO Full Status */ -#define SPI_STATUS_RO (0x1 << 6) /* RXFIFO Overflow */ -#define SPI_STATUS_BO (0x1 << 7) /* Bit Count Overflow */ -#define SPI_STATUS (0xFF) /* SPI Status Mask */ -#define SPI_INTEN_TE (0x1 << 8) /* TXFIFO Empty Interrupt Enable */ -#define SPI_INTEN_TH (0x1 << 9) /* TXFIFO Half Interrupt Enable */ -#define SPI_INTEN_TF (0x1 << 10) /* TXFIFO Full Interrupt Enable */ -#define SPI_INTEN_RE (0x1 << 11) /* RXFIFO Data Ready Interrupt Enable */ -#define SPI_INTEN_RH (0x1 << 12) /* RXFIFO Half Interrupt Enable */ -#define SPI_INTEN_RF (0x1 << 13) /* RXFIFO Full Interrupt Enable */ -#define SPI_INTEN_RO (0x1 << 14) /* RXFIFO Overflow Interrupt Enable */ -#define SPI_INTEN_BO (0x1 << 15) /* Bit Count Overflow Interrupt Enable */ -#define SPI_INTEN (0xFF << 8) /* SPI Interrupt Enable Mask */ - -/* SPI Test Register Bit Fields & Masks */ -#define SPI_TEST_TXCNT (0xF << 0) /* TXFIFO Counter */ -#define SPI_TEST_RXCNT_LSB (4) /* RXFIFO Counter LSB */ -#define SPI_TEST_RXCNT (0xF << 4) /* RXFIFO Counter */ -#define SPI_TEST_SSTATUS (0xF << 8) /* State Machine Status */ -#define SPI_TEST_LBC (0x1 << 14) /* Loop Back Control */ - -/* SPI Period Register Bit Fields & Masks */ -#define SPI_PERIOD_WAIT (0x7FFF << 0) /* Wait Between Transactions */ -#define SPI_PERIOD_MAX_WAIT (0x7FFF) /* Max Wait Between - Transactions */ -#define SPI_PERIOD_CSRC (0x1 << 15) /* Period Clock Source Mask */ -#define SPI_PERIOD_CSRC_BCLK (0x0 << 15) /* Period Clock Source is - Bit Clock */ -#define SPI_PERIOD_CSRC_32768 (0x1 << 15) /* Period Clock Source is - 32.768 KHz Clock */ - -/* SPI DMA Register Bit Fields & Masks */ -#define SPI_DMA_RHDMA (0xF << 4) /* RXFIFO Half Status */ -#define SPI_DMA_RFDMA (0x1 << 5) /* RXFIFO Full Status */ -#define SPI_DMA_TEDMA (0x1 << 6) /* TXFIFO Empty Status */ -#define SPI_DMA_THDMA (0x1 << 7) /* TXFIFO Half Status */ -#define SPI_DMA_RHDEN (0x1 << 12) /* RXFIFO Half DMA Request Enable */ -#define SPI_DMA_RFDEN (0x1 << 13) /* RXFIFO Full DMA Request Enable */ -#define SPI_DMA_TEDEN (0x1 << 14) /* TXFIFO Empty DMA Request Enable */ -#define SPI_DMA_THDEN (0x1 << 15) /* TXFIFO Half DMA Request Enable */ - -/* SPI Soft Reset Register Bit Fields & Masks */ -#define SPI_RESET_START (0x1) /* Start */ - -/* Default SPI configuration values */ -#define SPI_DEFAULT_CONTROL \ -( \ - SPI_CONTROL_BITCOUNT(16) | \ - SPI_CONTROL_POL_ACT_HIGH | \ - SPI_CONTROL_PHA_0 | \ - SPI_CONTROL_SPIEN | \ - SPI_CONTROL_SSCTL_1 | \ - SPI_CONTROL_MODE_MASTER | \ - SPI_CONTROL_DRCTL_0 | \ - SPI_CONTROL_DATARATE_MIN \ -) -#define SPI_DEFAULT_ENABLE_LOOPBACK (0) -#define SPI_DEFAULT_ENABLE_DMA (0) -#define SPI_DEFAULT_PERIOD_WAIT (8) -/*-------------------------------------------------------------------------*/ - - -/*-------------------------------------------------------------------------*/ -/* TX/RX SPI FIFO size */ -#define SPI_FIFO_DEPTH (8) -#define SPI_FIFO_BYTE_WIDTH (2) -#define SPI_FIFO_OVERFLOW_MARGIN (2) - -/* DMA burst lenght for half full/empty request trigger */ -#define SPI_DMA_BLR (SPI_FIFO_DEPTH * SPI_FIFO_BYTE_WIDTH / 2) - -/* Dummy char output to achieve reads. - Choosing something different from all zeroes may help pattern recogition - for oscilloscope analysis, but may break some drivers. */ -#define SPI_DUMMY_u8 0 -#define SPI_DUMMY_u16 ((SPI_DUMMY_u8 << 8) | SPI_DUMMY_u8) -#define SPI_DUMMY_u32 ((SPI_DUMMY_u16 << 16) | SPI_DUMMY_u16) - -/** - * Macro to change a u32 field: - * @r : register to edit - * @m : bit mask - * @v : new value for the field correctly bit-alligned -*/ -#define u32_EDIT(r, m, v) r = (r & ~(m)) | (v) - -/* Message state */ -#define START_STATE ((void*)0) -#define RUNNING_STATE ((void*)1) -#define DONE_STATE ((void*)2) -#define ERROR_STATE ((void*)-1) - -/* Queue state */ -#define QUEUE_RUNNING (0) -#define QUEUE_STOPPED (1) - -#define IS_DMA_ALIGNED(x) (((u32)(x) & 0x03) == 0) -/*-------------------------------------------------------------------------*/ - - -/*-------------------------------------------------------------------------*/ -/* Driver data structs */ - -/* Context */ -struct driver_data { - /* Driver model hookup */ - struct platform_device *pdev; - - /* SPI framework hookup */ - struct spi_master *master; - - /* IMX hookup */ - struct spi_imx_master *master_info; - - /* Memory resources and SPI regs virtual address */ - struct resource *ioarea; - void __iomem *regs; - - /* SPI RX_DATA physical address */ - dma_addr_t rd_data_phys; - - /* Driver message queue */ - struct workqueue_struct *workqueue; - struct work_struct work; - spinlock_t lock; - struct list_head queue; - int busy; - int run; - - /* Message Transfer pump */ - struct tasklet_struct pump_transfers; - - /* Current message, transfer and state */ - struct spi_message *cur_msg; - struct spi_transfer *cur_transfer; - struct chip_data *cur_chip; - - /* Rd / Wr buffers pointers */ - size_t len; - void *tx; - void *tx_end; - void *rx; - void *rx_end; - - u8 rd_only; - u8 n_bytes; - int cs_change; - - /* Function pointers */ - irqreturn_t (*transfer_handler)(struct driver_data *drv_data); - void (*cs_control)(u32 command); - - /* DMA setup */ - int rx_channel; - int tx_channel; - dma_addr_t rx_dma; - dma_addr_t tx_dma; - int rx_dma_needs_unmap; - int tx_dma_needs_unmap; - size_t tx_map_len; - u32 dummy_dma_buf ____cacheline_aligned; -}; - -/* Runtime state */ -struct chip_data { - u32 control; - u32 period; - u32 test; - - u8 enable_dma:1; - u8 bits_per_word; - u8 n_bytes; - u32 max_speed_hz; - - void (*cs_control)(u32 command); -}; -/*-------------------------------------------------------------------------*/ - - -static void pump_messages(struct work_struct *work); - -static int flush(struct driver_data *drv_data) -{ - unsigned long limit = loops_per_jiffy << 1; - void __iomem *regs = drv_data->regs; - volatile u32 d; - - dev_dbg(&drv_data->pdev->dev, "flush\n"); - do { - while (readl(regs + SPI_INT_STATUS) & SPI_STATUS_RR) - d = readl(regs + SPI_RXDATA); - } while ((readl(regs + SPI_CONTROL) & SPI_CONTROL_XCH) && limit--); - - return limit; -} - -static void restore_state(struct driver_data *drv_data) -{ - void __iomem *regs = drv_data->regs; - struct chip_data *chip = drv_data->cur_chip; - - /* Load chip registers */ - dev_dbg(&drv_data->pdev->dev, - "restore_state\n" - " test = 0x%08X\n" - " control = 0x%08X\n", - chip->test, - chip->control); - writel(chip->test, regs + SPI_TEST); - writel(chip->period, regs + SPI_PERIOD); - writel(0, regs + SPI_INT_STATUS); - writel(chip->control, regs + SPI_CONTROL); -} - -static void null_cs_control(u32 command) -{ -} - -static inline u32 data_to_write(struct driver_data *drv_data) -{ - return ((u32)(drv_data->tx_end - drv_data->tx)) / drv_data->n_bytes; -} - -static inline u32 data_to_read(struct driver_data *drv_data) -{ - return ((u32)(drv_data->rx_end - drv_data->rx)) / drv_data->n_bytes; -} - -static int write(struct driver_data *drv_data) -{ - void __iomem *regs = drv_data->regs; - void *tx = drv_data->tx; - void *tx_end = drv_data->tx_end; - u8 n_bytes = drv_data->n_bytes; - u32 remaining_writes; - u32 fifo_avail_space; - u32 n; - u16 d; - - /* Compute how many fifo writes to do */ - remaining_writes = (u32)(tx_end - tx) / n_bytes; - fifo_avail_space = SPI_FIFO_DEPTH - - (readl(regs + SPI_TEST) & SPI_TEST_TXCNT); - if (drv_data->rx && (fifo_avail_space > SPI_FIFO_OVERFLOW_MARGIN)) - /* Fix misunderstood receive overflow */ - fifo_avail_space -= SPI_FIFO_OVERFLOW_MARGIN; - n = min(remaining_writes, fifo_avail_space); - - dev_dbg(&drv_data->pdev->dev, - "write type %s\n" - " remaining writes = %d\n" - " fifo avail space = %d\n" - " fifo writes = %d\n", - (n_bytes == 1) ? "u8" : "u16", - remaining_writes, - fifo_avail_space, - n); - - if (n > 0) { - /* Fill SPI TXFIFO */ - if (drv_data->rd_only) { - tx += n * n_bytes; - while (n--) - writel(SPI_DUMMY_u16, regs + SPI_TXDATA); - } else { - if (n_bytes == 1) { - while (n--) { - d = *(u8*)tx; - writel(d, regs + SPI_TXDATA); - tx += 1; - } - } else { - while (n--) { - d = *(u16*)tx; - writel(d, regs + SPI_TXDATA); - tx += 2; - } - } - } - - /* Trigger transfer */ - writel(readl(regs + SPI_CONTROL) | SPI_CONTROL_XCH, - regs + SPI_CONTROL); - - /* Update tx pointer */ - drv_data->tx = tx; - } - - return (tx >= tx_end); -} - -static int read(struct driver_data *drv_data) -{ - void __iomem *regs = drv_data->regs; - void *rx = drv_data->rx; - void *rx_end = drv_data->rx_end; - u8 n_bytes = drv_data->n_bytes; - u32 remaining_reads; - u32 fifo_rxcnt; - u32 n; - u16 d; - - /* Compute how many fifo reads to do */ - remaining_reads = (u32)(rx_end - rx) / n_bytes; - fifo_rxcnt = (readl(regs + SPI_TEST) & SPI_TEST_RXCNT) >> - SPI_TEST_RXCNT_LSB; - n = min(remaining_reads, fifo_rxcnt); - - dev_dbg(&drv_data->pdev->dev, - "read type %s\n" - " remaining reads = %d\n" - " fifo rx count = %d\n" - " fifo reads = %d\n", - (n_bytes == 1) ? "u8" : "u16", - remaining_reads, - fifo_rxcnt, - n); - - if (n > 0) { - /* Read SPI RXFIFO */ - if (n_bytes == 1) { - while (n--) { - d = readl(regs + SPI_RXDATA); - *((u8*)rx) = d; - rx += 1; - } - } else { - while (n--) { - d = readl(regs + SPI_RXDATA); - *((u16*)rx) = d; - rx += 2; - } - } - - /* Update rx pointer */ - drv_data->rx = rx; - } - - return (rx >= rx_end); -} - -static void *next_transfer(struct driver_data *drv_data) -{ - struct spi_message *msg = drv_data->cur_msg; - struct spi_transfer *trans = drv_data->cur_transfer; - - /* Move to next transfer */ - if (trans->transfer_list.next != &msg->transfers) { - drv_data->cur_transfer = - list_entry(trans->transfer_list.next, - struct spi_transfer, - transfer_list); - return RUNNING_STATE; - } - - return DONE_STATE; -} - -static int map_dma_buffers(struct driver_data *drv_data) -{ - struct spi_message *msg; - struct device *dev; - void *buf; - - drv_data->rx_dma_needs_unmap = 0; - drv_data->tx_dma_needs_unmap = 0; - - if (!drv_data->master_info->enable_dma || - !drv_data->cur_chip->enable_dma) - return -1; - - msg = drv_data->cur_msg; - dev = &msg->spi->dev; - if (msg->is_dma_mapped) { - if (drv_data->tx_dma) - /* The caller provided at least dma and cpu virtual - address for write; pump_transfers() will consider the - transfer as write only if cpu rx virtual address is - NULL */ - return 0; - - if (drv_data->rx_dma) { - /* The caller provided dma and cpu virtual address to - performe read only transfer --> - use drv_data->dummy_dma_buf for dummy writes to - achive reads */ - buf = &drv_data->dummy_dma_buf; - drv_data->tx_map_len = sizeof(drv_data->dummy_dma_buf); - drv_data->tx_dma = dma_map_single(dev, - buf, - drv_data->tx_map_len, - DMA_TO_DEVICE); - if (dma_mapping_error(drv_data->tx_dma)) - return -1; - - drv_data->tx_dma_needs_unmap = 1; - - /* Flags transfer as rd_only for pump_transfers() DMA - regs programming (should be redundant) */ - drv_data->tx = NULL; - - return 0; - } - } - - if (!IS_DMA_ALIGNED(drv_data->rx) || !IS_DMA_ALIGNED(drv_data->tx)) - return -1; - - /* NULL rx means write-only transfer and no map needed - since rx DMA will not be used */ - if (drv_data->rx) { - buf = drv_data->rx; - drv_data->rx_dma = dma_map_single( - dev, - buf, - drv_data->len, - DMA_FROM_DEVICE); - if (dma_mapping_error(drv_data->rx_dma)) - return -1; - drv_data->rx_dma_needs_unmap = 1; - } - - if (drv_data->tx == NULL) { - /* Read only message --> use drv_data->dummy_dma_buf for dummy - writes to achive reads */ - buf = &drv_data->dummy_dma_buf; - drv_data->tx_map_len = sizeof(drv_data->dummy_dma_buf); - } else { - buf = drv_data->tx; - drv_data->tx_map_len = drv_data->len; - } - drv_data->tx_dma = dma_map_single(dev, - buf, - drv_data->tx_map_len, - DMA_TO_DEVICE); - if (dma_mapping_error(drv_data->tx_dma)) { - if (drv_data->rx_dma) { - dma_unmap_single(dev, - drv_data->rx_dma, - drv_data->len, - DMA_FROM_DEVICE); - drv_data->rx_dma_needs_unmap = 0; - } - return -1; - } - drv_data->tx_dma_needs_unmap = 1; - - return 0; -} - -static void unmap_dma_buffers(struct driver_data *drv_data) -{ - struct spi_message *msg = drv_data->cur_msg; - struct device *dev = &msg->spi->dev; - - if (drv_data->rx_dma_needs_unmap) { - dma_unmap_single(dev, - drv_data->rx_dma, - drv_data->len, - DMA_FROM_DEVICE); - drv_data->rx_dma_needs_unmap = 0; - } - if (drv_data->tx_dma_needs_unmap) { - dma_unmap_single(dev, - drv_data->tx_dma, - drv_data->tx_map_len, - DMA_TO_DEVICE); - drv_data->tx_dma_needs_unmap = 0; - } -} - -/* Caller already set message->status (dma is already blocked) */ -static void giveback(struct spi_message *message, struct driver_data *drv_data) -{ - void __iomem *regs = drv_data->regs; - - /* Bring SPI to sleep; restore_state() and pump_transfer() - will do new setup */ - writel(0, regs + SPI_INT_STATUS); - writel(0, regs + SPI_DMA); - - drv_data->cs_control(SPI_CS_DEASSERT); - - message->state = NULL; - if (message->complete) - message->complete(message->context); - - drv_data->cur_msg = NULL; - drv_data->cur_transfer = NULL; - drv_data->cur_chip = NULL; - queue_work(drv_data->workqueue, &drv_data->work); -} - -static void dma_err_handler(int channel, void *data, int errcode) -{ - struct driver_data *drv_data = data; - struct spi_message *msg = drv_data->cur_msg; - - dev_dbg(&drv_data->pdev->dev, "dma_err_handler\n"); - - /* Disable both rx and tx dma channels */ - imx_dma_disable(drv_data->rx_channel); - imx_dma_disable(drv_data->tx_channel); - - if (flush(drv_data) == 0) - dev_err(&drv_data->pdev->dev, - "dma_err_handler - flush failed\n"); - - unmap_dma_buffers(drv_data); - - msg->state = ERROR_STATE; - tasklet_schedule(&drv_data->pump_transfers); -} - -static void dma_tx_handler(int channel, void *data) -{ - struct driver_data *drv_data = data; - - dev_dbg(&drv_data->pdev->dev, "dma_tx_handler\n"); - - imx_dma_disable(channel); - - /* Now waits for TX FIFO empty */ - writel(readl(drv_data->regs + SPI_INT_STATUS) | SPI_INTEN_TE, - drv_data->regs + SPI_INT_STATUS); -} - -static irqreturn_t dma_transfer(struct driver_data *drv_data) -{ - u32 status; - struct spi_message *msg = drv_data->cur_msg; - void __iomem *regs = drv_data->regs; - unsigned long limit; - - status = readl(regs + SPI_INT_STATUS); - - if ((status & SPI_INTEN_RO) && (status & SPI_STATUS_RO)) { - writel(status & ~SPI_INTEN, regs + SPI_INT_STATUS); - - imx_dma_disable(drv_data->rx_channel); - unmap_dma_buffers(drv_data); - - if (flush(drv_data) == 0) - dev_err(&drv_data->pdev->dev, - "dma_transfer - flush failed\n"); - - dev_warn(&drv_data->pdev->dev, - "dma_transfer - fifo overun\n"); - - msg->state = ERROR_STATE; - tasklet_schedule(&drv_data->pump_transfers); - - return IRQ_HANDLED; - } - - if (status & SPI_STATUS_TE) { - writel(status & ~SPI_INTEN_TE, regs + SPI_INT_STATUS); - - if (drv_data->rx) { - /* Wait end of transfer before read trailing data */ - limit = loops_per_jiffy << 1; - while ((readl(regs + SPI_CONTROL) & SPI_CONTROL_XCH) && - limit--); - - if (limit == 0) - dev_err(&drv_data->pdev->dev, - "dma_transfer - end of tx failed\n"); - else - dev_dbg(&drv_data->pdev->dev, - "dma_transfer - end of tx\n"); - - imx_dma_disable(drv_data->rx_channel); - unmap_dma_buffers(drv_data); - - /* Calculate number of trailing data and read them */ - dev_dbg(&drv_data->pdev->dev, - "dma_transfer - test = 0x%08X\n", - readl(regs + SPI_TEST)); - drv_data->rx = drv_data->rx_end - - ((readl(regs + SPI_TEST) & - SPI_TEST_RXCNT) >> - SPI_TEST_RXCNT_LSB)*drv_data->n_bytes; - read(drv_data); - } else { - /* Write only transfer */ - unmap_dma_buffers(drv_data); - - if (flush(drv_data) == 0) - dev_err(&drv_data->pdev->dev, - "dma_transfer - flush failed\n"); - } - - /* End of transfer, update total byte transfered */ - msg->actual_length += drv_data->len; - - /* Release chip select if requested, transfer delays are - handled in pump_transfers() */ - if (drv_data->cs_change) - drv_data->cs_control(SPI_CS_DEASSERT); - - /* Move to next transfer */ - msg->state = next_transfer(drv_data); - - /* Schedule transfer tasklet */ - tasklet_schedule(&drv_data->pump_transfers); - - return IRQ_HANDLED; - } - - /* Opps problem detected */ - return IRQ_NONE; -} - -static irqreturn_t interrupt_wronly_transfer(struct driver_data *drv_data) -{ - struct spi_message *msg = drv_data->cur_msg; - void __iomem *regs = drv_data->regs; - u32 status; - irqreturn_t handled = IRQ_NONE; - - status = readl(regs + SPI_INT_STATUS); - - while (status & SPI_STATUS_TH) { - dev_dbg(&drv_data->pdev->dev, - "interrupt_wronly_transfer - status = 0x%08X\n", status); - - /* Pump data */ - if (write(drv_data)) { - writel(readl(regs + SPI_INT_STATUS) & ~SPI_INTEN, - regs + SPI_INT_STATUS); - - dev_dbg(&drv_data->pdev->dev, - "interrupt_wronly_transfer - end of tx\n"); - - if (flush(drv_data) == 0) - dev_err(&drv_data->pdev->dev, - "interrupt_wronly_transfer - " - "flush failed\n"); - - /* End of transfer, update total byte transfered */ - msg->actual_length += drv_data->len; - - /* Release chip select if requested, transfer delays are - handled in pump_transfers */ - if (drv_data->cs_change) - drv_data->cs_control(SPI_CS_DEASSERT); - - /* Move to next transfer */ - msg->state = next_transfer(drv_data); - - /* Schedule transfer tasklet */ - tasklet_schedule(&drv_data->pump_transfers); - - return IRQ_HANDLED; - } - - status = readl(regs + SPI_INT_STATUS); - - /* We did something */ - handled = IRQ_HANDLED; - } - - return handled; -} - -static irqreturn_t interrupt_transfer(struct driver_data *drv_data) -{ - struct spi_message *msg = drv_data->cur_msg; - void __iomem *regs = drv_data->regs; - u32 status; - irqreturn_t handled = IRQ_NONE; - unsigned long limit; - - status = readl(regs + SPI_INT_STATUS); - - while (status & (SPI_STATUS_TH | SPI_STATUS_RO)) { - dev_dbg(&drv_data->pdev->dev, - "interrupt_transfer - status = 0x%08X\n", status); - - if (status & SPI_STATUS_RO) { - writel(readl(regs + SPI_INT_STATUS) & ~SPI_INTEN, - regs + SPI_INT_STATUS); - - dev_warn(&drv_data->pdev->dev, - "interrupt_transfer - fifo overun\n" - " data not yet written = %d\n" - " data not yet read = %d\n", - data_to_write(drv_data), - data_to_read(drv_data)); - - if (flush(drv_data) == 0) - dev_err(&drv_data->pdev->dev, - "interrupt_transfer - flush failed\n"); - - msg->state = ERROR_STATE; - tasklet_schedule(&drv_data->pump_transfers); - - return IRQ_HANDLED; - } - - /* Pump data */ - read(drv_data); - if (write(drv_data)) { - writel(readl(regs + SPI_INT_STATUS) & ~SPI_INTEN, - regs + SPI_INT_STATUS); - - dev_dbg(&drv_data->pdev->dev, - "interrupt_transfer - end of tx\n"); - - /* Read trailing bytes */ - limit = loops_per_jiffy << 1; - while ((read(drv_data) == 0) && limit--); - - if (limit == 0) - dev_err(&drv_data->pdev->dev, - "interrupt_transfer - " - "trailing byte read failed\n"); - else - dev_dbg(&drv_data->pdev->dev, - "interrupt_transfer - end of rx\n"); - - /* End of transfer, update total byte transfered */ - msg->actual_length += drv_data->len; - - /* Release chip select if requested, transfer delays are - handled in pump_transfers */ - if (drv_data->cs_change) - drv_data->cs_control(SPI_CS_DEASSERT); - - /* Move to next transfer */ - msg->state = next_transfer(drv_data); - - /* Schedule transfer tasklet */ - tasklet_schedule(&drv_data->pump_transfers); - - return IRQ_HANDLED; - } - - status = readl(regs + SPI_INT_STATUS); - - /* We did something */ - handled = IRQ_HANDLED; - } - - return handled; -} - -static irqreturn_t spi_int(int irq, void *dev_id) -{ - struct driver_data *drv_data = (struct driver_data *)dev_id; - - if (!drv_data->cur_msg) { - dev_err(&drv_data->pdev->dev, - "spi_int - bad message state\n"); - /* Never fail */ - return IRQ_HANDLED; - } - - return drv_data->transfer_handler(drv_data); -} - -static inline u32 spi_speed_hz(u32 data_rate) -{ - return imx_get_perclk2() / (4 << ((data_rate) >> 13)); -} - -static u32 spi_data_rate(u32 speed_hz) -{ - u32 div; - u32 quantized_hz = imx_get_perclk2() >> 2; - - for (div = SPI_PERCLK2_DIV_MIN; - div <= SPI_PERCLK2_DIV_MAX; - div++, quantized_hz >>= 1) { - if (quantized_hz <= speed_hz) - /* Max available speed LEQ required speed */ - return div << 13; - } - return SPI_CONTROL_DATARATE_BAD; -} - -static void pump_transfers(unsigned long data) -{ - struct driver_data *drv_data = (struct driver_data *)data; - struct spi_message *message; - struct spi_transfer *transfer, *previous; - struct chip_data *chip; - void __iomem *regs; - u32 tmp, control; - - dev_dbg(&drv_data->pdev->dev, "pump_transfer\n"); - - message = drv_data->cur_msg; - - /* Handle for abort */ - if (message->state == ERROR_STATE) { - message->status = -EIO; - giveback(message, drv_data); - return; - } - - /* Handle end of message */ - if (message->state == DONE_STATE) { - message->status = 0; - giveback(message, drv_data); - return; - } - - chip = drv_data->cur_chip; - - /* Delay if requested at end of transfer*/ - transfer = drv_data->cur_transfer; - if (message->state == RUNNING_STATE) { - previous = list_entry(transfer->transfer_list.prev, - struct spi_transfer, - transfer_list); - if (previous->delay_usecs) - udelay(previous->delay_usecs); - } else { - /* START_STATE */ - message->state = RUNNING_STATE; - drv_data->cs_control = chip->cs_control; - } - - transfer = drv_data->cur_transfer; - drv_data->tx = (void *)transfer->tx_buf; - drv_data->tx_end = drv_data->tx + transfer->len; - drv_data->rx = transfer->rx_buf; - drv_data->rx_end = drv_data->rx + transfer->len; - drv_data->rx_dma = transfer->rx_dma; - drv_data->tx_dma = transfer->tx_dma; - drv_data->len = transfer->len; - drv_data->cs_change = transfer->cs_change; - drv_data->rd_only = (drv_data->tx == NULL); - - regs = drv_data->regs; - control = readl(regs + SPI_CONTROL); - - /* Bits per word setup */ - tmp = transfer->bits_per_word; - if (tmp == 0) { - /* Use device setup */ - tmp = chip->bits_per_word; - drv_data->n_bytes = chip->n_bytes; - } else - /* Use per-transfer setup */ - drv_data->n_bytes = (tmp <= 8) ? 1 : 2; - u32_EDIT(control, SPI_CONTROL_BITCOUNT_MASK, tmp - 1); - - /* Speed setup (surely valid because already checked) */ - tmp = transfer->speed_hz; - if (tmp == 0) - tmp = chip->max_speed_hz; - tmp = spi_data_rate(tmp); - u32_EDIT(control, SPI_CONTROL_DATARATE, tmp); - - writel(control, regs + SPI_CONTROL); - - /* Assert device chip-select */ - drv_data->cs_control(SPI_CS_ASSERT); - - /* DMA cannot read/write SPI FIFOs other than 16 bits at a time; hence - if bits_per_word is less or equal 8 PIO transfers are performed. - Moreover DMA is convinient for transfer length bigger than FIFOs - byte size. */ - if ((drv_data->n_bytes == 2) && - (drv_data->len > SPI_FIFO_DEPTH*SPI_FIFO_BYTE_WIDTH) && - (map_dma_buffers(drv_data) == 0)) { - dev_dbg(&drv_data->pdev->dev, - "pump dma transfer\n" - " tx = %p\n" - " tx_dma = %08X\n" - " rx = %p\n" - " rx_dma = %08X\n" - " len = %d\n", - drv_data->tx, - (unsigned int)drv_data->tx_dma, - drv_data->rx, - (unsigned int)drv_data->rx_dma, - drv_data->len); - - /* Ensure we have the correct interrupt handler */ - drv_data->transfer_handler = dma_transfer; - - /* Trigger transfer */ - writel(readl(regs + SPI_CONTROL) | SPI_CONTROL_XCH, - regs + SPI_CONTROL); - - /* Setup tx DMA */ - if (drv_data->tx) - /* Linear source address */ - CCR(drv_data->tx_channel) = - CCR_DMOD_FIFO | - CCR_SMOD_LINEAR | - CCR_SSIZ_32 | CCR_DSIZ_16 | - CCR_REN; - else - /* Read only transfer -> fixed source address for - dummy write to achive read */ - CCR(drv_data->tx_channel) = - CCR_DMOD_FIFO | - CCR_SMOD_FIFO | - CCR_SSIZ_32 | CCR_DSIZ_16 | - CCR_REN; - - imx_dma_setup_single( - drv_data->tx_channel, - drv_data->tx_dma, - drv_data->len, - drv_data->rd_data_phys + 4, - DMA_MODE_WRITE); - - if (drv_data->rx) { - /* Setup rx DMA for linear destination address */ - CCR(drv_data->rx_channel) = - CCR_DMOD_LINEAR | - CCR_SMOD_FIFO | - CCR_DSIZ_32 | CCR_SSIZ_16 | - CCR_REN; - imx_dma_setup_single( - drv_data->rx_channel, - drv_data->rx_dma, - drv_data->len, - drv_data->rd_data_phys, - DMA_MODE_READ); - imx_dma_enable(drv_data->rx_channel); - - /* Enable SPI interrupt */ - writel(SPI_INTEN_RO, regs + SPI_INT_STATUS); - - /* Set SPI to request DMA service on both - Rx and Tx half fifo watermark */ - writel(SPI_DMA_RHDEN | SPI_DMA_THDEN, regs + SPI_DMA); - } else - /* Write only access -> set SPI to request DMA - service on Tx half fifo watermark */ - writel(SPI_DMA_THDEN, regs + SPI_DMA); - - imx_dma_enable(drv_data->tx_channel); - } else { - dev_dbg(&drv_data->pdev->dev, - "pump pio transfer\n" - " tx = %p\n" - " rx = %p\n" - " len = %d\n", - drv_data->tx, - drv_data->rx, - drv_data->len); - - /* Ensure we have the correct interrupt handler */ - if (drv_data->rx) - drv_data->transfer_handler = interrupt_transfer; - else - drv_data->transfer_handler = interrupt_wronly_transfer; - - /* Enable SPI interrupt */ - if (drv_data->rx) - writel(SPI_INTEN_TH | SPI_INTEN_RO, - regs + SPI_INT_STATUS); - else - writel(SPI_INTEN_TH, regs + SPI_INT_STATUS); - } -} - -static void pump_messages(struct work_struct *work) -{ - struct driver_data *drv_data = - container_of(work, struct driver_data, work); - unsigned long flags; - - /* Lock queue and check for queue work */ - spin_lock_irqsave(&drv_data->lock, flags); - if (list_empty(&drv_data->queue) || drv_data->run == QUEUE_STOPPED) { - drv_data->busy = 0; - spin_unlock_irqrestore(&drv_data->lock, flags); - return; - } - - /* Make sure we are not already running a message */ - if (drv_data->cur_msg) { - spin_unlock_irqrestore(&drv_data->lock, flags); - return; - } - - /* Extract head of queue */ - drv_data->cur_msg = list_entry(drv_data->queue.next, - struct spi_message, queue); - list_del_init(&drv_data->cur_msg->queue); - drv_data->busy = 1; - spin_unlock_irqrestore(&drv_data->lock, flags); - - /* Initial message state */ - drv_data->cur_msg->state = START_STATE; - drv_data->cur_transfer = list_entry(drv_data->cur_msg->transfers.next, - struct spi_transfer, - transfer_list); - - /* Setup the SPI using the per chip configuration */ - drv_data->cur_chip = spi_get_ctldata(drv_data->cur_msg->spi); - restore_state(drv_data); - - /* Mark as busy and launch transfers */ - tasklet_schedule(&drv_data->pump_transfers); -} - -static int transfer(struct spi_device *spi, struct spi_message *msg) -{ - struct driver_data *drv_data = spi_master_get_devdata(spi->master); - u32 min_speed_hz, max_speed_hz, tmp; - struct spi_transfer *trans; - unsigned long flags; - - msg->actual_length = 0; - - /* Per transfer setup check */ - min_speed_hz = spi_speed_hz(SPI_CONTROL_DATARATE_MIN); - max_speed_hz = spi->max_speed_hz; - list_for_each_entry(trans, &msg->transfers, transfer_list) { - tmp = trans->bits_per_word; - if (tmp > 16) { - dev_err(&drv_data->pdev->dev, - "message rejected : " - "invalid transfer bits_per_word (%d bits)\n", - tmp); - goto msg_rejected; - } - tmp = trans->speed_hz; - if (tmp) { - if (tmp < min_speed_hz) { - dev_err(&drv_data->pdev->dev, - "message rejected : " - "device min speed (%d Hz) exceeds " - "required transfer speed (%d Hz)\n", - min_speed_hz, - tmp); - goto msg_rejected; - } else if (tmp > max_speed_hz) { - dev_err(&drv_data->pdev->dev, - "message rejected : " - "transfer speed (%d Hz) exceeds " - "device max speed (%d Hz)\n", - tmp, - max_speed_hz); - goto msg_rejected; - } - } - } - - /* Message accepted */ - msg->status = -EINPROGRESS; - msg->state = START_STATE; - - spin_lock_irqsave(&drv_data->lock, flags); - if (drv_data->run == QUEUE_STOPPED) { - spin_unlock_irqrestore(&drv_data->lock, flags); - return -ESHUTDOWN; - } - - list_add_tail(&msg->queue, &drv_data->queue); - if (drv_data->run == QUEUE_RUNNING && !drv_data->busy) - queue_work(drv_data->workqueue, &drv_data->work); - - spin_unlock_irqrestore(&drv_data->lock, flags); - return 0; - -msg_rejected: - /* Message rejected and not queued */ - msg->status = -EINVAL; - msg->state = ERROR_STATE; - if (msg->complete) - msg->complete(msg->context); - return -EINVAL; -} - -/* On first setup bad values must free chip_data memory since will cause - spi_new_device to fail. Bad value setup from protocol driver are simply not - applied and notified to the calling driver. */ -static int setup(struct spi_device *spi) -{ - struct spi_imx_chip *chip_info; - struct chip_data *chip; - int first_setup = 0; - u32 tmp; - int status = 0; - - /* Get controller data */ - chip_info = spi->controller_data; - - /* Get controller_state */ - chip = spi_get_ctldata(spi); - if (chip == NULL) { - first_setup = 1; - - chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); - if (!chip) { - dev_err(&spi->dev, - "setup - cannot allocate controller state"); - return -ENOMEM; - } - chip->control = SPI_DEFAULT_CONTROL; - - if (chip_info == NULL) { - /* spi_board_info.controller_data not is supplied */ - chip_info = kzalloc(sizeof(struct spi_imx_chip), - GFP_KERNEL); - if (!chip_info) { - dev_err(&spi->dev, - "setup - " - "cannot allocate controller data"); - status = -ENOMEM; - goto err_first_setup; - } - /* Set controller data default value */ - chip_info->enable_loopback = - SPI_DEFAULT_ENABLE_LOOPBACK; - chip_info->enable_dma = SPI_DEFAULT_ENABLE_DMA; - chip_info->ins_ss_pulse = 1; - chip_info->bclk_wait = SPI_DEFAULT_PERIOD_WAIT; - chip_info->cs_control = null_cs_control; - } - } - - /* Now set controller state based on controller data */ - - if (first_setup) { - /* SPI loopback */ - if (chip_info->enable_loopback) - chip->test = SPI_TEST_LBC; - else - chip->test = 0; - - /* SPI dma driven */ - chip->enable_dma = chip_info->enable_dma; - - /* SPI /SS pulse between spi burst */ - if (chip_info->ins_ss_pulse) - u32_EDIT(chip->control, - SPI_CONTROL_SSCTL, SPI_CONTROL_SSCTL_1); - else - u32_EDIT(chip->control, - SPI_CONTROL_SSCTL, SPI_CONTROL_SSCTL_0); - - /* SPI bclk waits between each bits_per_word spi burst */ - if (chip_info->bclk_wait > SPI_PERIOD_MAX_WAIT) { - dev_err(&spi->dev, - "setup - " - "bclk_wait exceeds max allowed (%d)\n", - SPI_PERIOD_MAX_WAIT); - goto err_first_setup; - } - chip->period = SPI_PERIOD_CSRC_BCLK | - (chip_info->bclk_wait & SPI_PERIOD_WAIT); - } - - /* SPI mode */ - tmp = spi->mode; - if (tmp & SPI_LSB_FIRST) { - status = -EINVAL; - if (first_setup) { - dev_err(&spi->dev, - "setup - " - "HW doesn't support LSB first transfer\n"); - goto err_first_setup; - } else { - dev_err(&spi->dev, - "setup - " - "HW doesn't support LSB first transfer, " - "default to MSB first\n"); - spi->mode &= ~SPI_LSB_FIRST; - } - } - if (tmp & SPI_CS_HIGH) { - u32_EDIT(chip->control, - SPI_CONTROL_SSPOL, SPI_CONTROL_SSPOL_ACT_HIGH); - } - switch (tmp & SPI_MODE_3) { - case SPI_MODE_0: - tmp = 0; - break; - case SPI_MODE_1: - tmp = SPI_CONTROL_PHA_1; - break; - case SPI_MODE_2: - tmp = SPI_CONTROL_POL_ACT_LOW; - break; - default: - /* SPI_MODE_3 */ - tmp = SPI_CONTROL_PHA_1 | SPI_CONTROL_POL_ACT_LOW; - break; - } - u32_EDIT(chip->control, SPI_CONTROL_POL | SPI_CONTROL_PHA, tmp); - - /* SPI word width */ - tmp = spi->bits_per_word; - if (tmp == 0) { - tmp = 8; - spi->bits_per_word = 8; - } else if (tmp > 16) { - status = -EINVAL; - dev_err(&spi->dev, - "setup - " - "invalid bits_per_word (%d)\n", - tmp); - if (first_setup) - goto err_first_setup; - else { - /* Undo setup using chip as backup copy */ - tmp = chip->bits_per_word; - spi->bits_per_word = tmp; - } - } - chip->bits_per_word = tmp; - u32_EDIT(chip->control, SPI_CONTROL_BITCOUNT_MASK, tmp - 1); - chip->n_bytes = (tmp <= 8) ? 1 : 2; - - /* SPI datarate */ - tmp = spi_data_rate(spi->max_speed_hz); - if (tmp == SPI_CONTROL_DATARATE_BAD) { - status = -EINVAL; - dev_err(&spi->dev, - "setup - " - "HW min speed (%d Hz) exceeds required " - "max speed (%d Hz)\n", - spi_speed_hz(SPI_CONTROL_DATARATE_MIN), - spi->max_speed_hz); - if (first_setup) - goto err_first_setup; - else - /* Undo setup using chip as backup copy */ - spi->max_speed_hz = chip->max_speed_hz; - } else { - u32_EDIT(chip->control, SPI_CONTROL_DATARATE, tmp); - /* Actual rounded max_speed_hz */ - tmp = spi_speed_hz(tmp); - spi->max_speed_hz = tmp; - chip->max_speed_hz = tmp; - } - - /* SPI chip-select management */ - if (chip_info->cs_control) - chip->cs_control = chip_info->cs_control; - else - chip->cs_control = null_cs_control; - - /* Save controller_state */ - spi_set_ctldata(spi, chip); - - /* Summary */ - dev_dbg(&spi->dev, - "setup succeded\n" - " loopback enable = %s\n" - " dma enable = %s\n" - " insert /ss pulse = %s\n" - " period wait = %d\n" - " mode = %d\n" - " bits per word = %d\n" - " min speed = %d Hz\n" - " rounded max speed = %d Hz\n", - chip->test & SPI_TEST_LBC ? "Yes" : "No", - chip->enable_dma ? "Yes" : "No", - chip->control & SPI_CONTROL_SSCTL ? "Yes" : "No", - chip->period & SPI_PERIOD_WAIT, - spi->mode, - spi->bits_per_word, - spi_speed_hz(SPI_CONTROL_DATARATE_MIN), - spi->max_speed_hz); - -err_first_setup: - kfree(chip); - return status; -} - -static void cleanup(const struct spi_device *spi) -{ - struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi); - kfree(chip); -} - -static int init_queue(struct driver_data *drv_data) -{ - INIT_LIST_HEAD(&drv_data->queue); - spin_lock_init(&drv_data->lock); - - drv_data->run = QUEUE_STOPPED; - drv_data->busy = 0; - - tasklet_init(&drv_data->pump_transfers, - pump_transfers, (unsigned long)drv_data); - - INIT_WORK(&drv_data->work, pump_messages); - drv_data->workqueue = create_singlethread_workqueue( - drv_data->master->cdev.dev->bus_id); - if (drv_data->workqueue == NULL) - return -EBUSY; - - return 0; -} - -static int start_queue(struct driver_data *drv_data) -{ - unsigned long flags; - - spin_lock_irqsave(&drv_data->lock, flags); - - if (drv_data->run == QUEUE_RUNNING || drv_data->busy) { - spin_unlock_irqrestore(&drv_data->lock, flags); - return -EBUSY; - } - - drv_data->run = QUEUE_RUNNING; - drv_data->cur_msg = NULL; - drv_data->cur_transfer = NULL; - drv_data->cur_chip = NULL; - spin_unlock_irqrestore(&drv_data->lock, flags); - - queue_work(drv_data->workqueue, &drv_data->work); - - return 0; -} - -static int stop_queue(struct driver_data *drv_data) -{ - unsigned long flags; - unsigned limit = 500; - int status = 0; - - spin_lock_irqsave(&drv_data->lock, flags); - - /* This is a bit lame, but is optimized for the common execution path. - * A wait_queue on the drv_data->busy could be used, but then the common - * execution path (pump_messages) would be required to call wake_up or - * friends on every SPI message. Do this instead */ - drv_data->run = QUEUE_STOPPED; - while (!list_empty(&drv_data->queue) && drv_data->busy && limit--) { - spin_unlock_irqrestore(&drv_data->lock, flags); - msleep(10); - spin_lock_irqsave(&drv_data->lock, flags); - } - - if (!list_empty(&drv_data->queue) || drv_data->busy) - status = -EBUSY; - - spin_unlock_irqrestore(&drv_data->lock, flags); - - return status; -} - -static int destroy_queue(struct driver_data *drv_data) -{ - int status; - - status = stop_queue(drv_data); - if (status != 0) - return status; - - if (drv_data->workqueue) - destroy_workqueue(drv_data->workqueue); - - return 0; -} - -static int spi_imx_probe(struct platform_device *pdev) -{ - struct device *dev = &pdev->dev; - struct spi_imx_master *platform_info; - struct spi_master *master; - struct driver_data *drv_data = NULL; - struct resource *res; - int irq, status = 0; - - platform_info = dev->platform_data; - if (platform_info == NULL) { - dev_err(&pdev->dev, "probe - no platform data supplied\n"); - status = -ENODEV; - goto err_no_pdata; - } - - /* Allocate master with space for drv_data */ - master = spi_alloc_master(dev, sizeof(struct driver_data)); - if (!master) { - dev_err(&pdev->dev, "probe - cannot alloc spi_master\n"); - status = -ENOMEM; - goto err_no_mem; - } - drv_data = spi_master_get_devdata(master); - drv_data->master = master; - drv_data->master_info = platform_info; - drv_data->pdev = pdev; - - master->bus_num = pdev->id; - master->num_chipselect = platform_info->num_chipselect; - master->cleanup = cleanup; - master->setup = setup; - master->transfer = transfer; - - drv_data->dummy_dma_buf = SPI_DUMMY_u32; - - /* Find and map resources */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(&pdev->dev, "probe - MEM resources not defined\n"); - status = -ENODEV; - goto err_no_iores; - } - drv_data->ioarea = request_mem_region(res->start, - res->end - res->start + 1, - pdev->name); - if (drv_data->ioarea == NULL) { - dev_err(&pdev->dev, "probe - cannot reserve region\n"); - status = -ENXIO; - goto err_no_iores; - } - drv_data->regs = ioremap(res->start, res->end - res->start + 1); - if (drv_data->regs == NULL) { - dev_err(&pdev->dev, "probe - cannot map IO\n"); - status = -ENXIO; - goto err_no_iomap; - } - drv_data->rd_data_phys = (dma_addr_t)res->start; - - /* Attach to IRQ */ - irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(&pdev->dev, "probe - IRQ resource not defined\n"); - status = -ENODEV; - goto err_no_irqres; - } - status = request_irq(irq, spi_int, IRQF_DISABLED, dev->bus_id, drv_data); - if (status < 0) { - dev_err(&pdev->dev, "probe - cannot get IRQ (%d)\n", status); - goto err_no_irqres; - } - - /* Setup DMA if requested */ - drv_data->tx_channel = -1; - drv_data->rx_channel = -1; - if (platform_info->enable_dma) { - /* Get rx DMA channel */ - status = imx_dma_request_by_prio(&drv_data->rx_channel, - "spi_imx_rx", DMA_PRIO_HIGH); - if (status < 0) { - dev_err(dev, - "probe - problem (%d) requesting rx channel\n", - status); - goto err_no_rxdma; - } else - imx_dma_setup_handlers(drv_data->rx_channel, NULL, - dma_err_handler, drv_data); - - /* Get tx DMA channel */ - status = imx_dma_request_by_prio(&drv_data->tx_channel, - "spi_imx_tx", DMA_PRIO_MEDIUM); - if (status < 0) { - dev_err(dev, - "probe - problem (%d) requesting tx channel\n", - status); - imx_dma_free(drv_data->rx_channel); - goto err_no_txdma; - } else - imx_dma_setup_handlers(drv_data->tx_channel, - dma_tx_handler, dma_err_handler, - drv_data); - - /* Set request source and burst length for allocated channels */ - switch (drv_data->pdev->id) { - case 1: - /* Using SPI1 */ - RSSR(drv_data->rx_channel) = DMA_REQ_SPI1_R; - RSSR(drv_data->tx_channel) = DMA_REQ_SPI1_T; - break; - case 2: - /* Using SPI2 */ - RSSR(drv_data->rx_channel) = DMA_REQ_SPI2_R; - RSSR(drv_data->tx_channel) = DMA_REQ_SPI2_T; - break; - default: - dev_err(dev, "probe - bad SPI Id\n"); - imx_dma_free(drv_data->rx_channel); - imx_dma_free(drv_data->tx_channel); - status = -ENODEV; - goto err_no_devid; - } - BLR(drv_data->rx_channel) = SPI_DMA_BLR; - BLR(drv_data->tx_channel) = SPI_DMA_BLR; - } - - /* Load default SPI configuration */ - writel(SPI_RESET_START, drv_data->regs + SPI_RESET); - writel(0, drv_data->regs + SPI_RESET); - writel(SPI_DEFAULT_CONTROL, drv_data->regs + SPI_CONTROL); - - /* Initial and start queue */ - status = init_queue(drv_data); - if (status != 0) { - dev_err(&pdev->dev, "probe - problem initializing queue\n"); - goto err_init_queue; - } - status = start_queue(drv_data); - if (status != 0) { - dev_err(&pdev->dev, "probe - problem starting queue\n"); - goto err_start_queue; - } - - /* Register with the SPI framework */ - platform_set_drvdata(pdev, drv_data); - status = spi_register_master(master); - if (status != 0) { - dev_err(&pdev->dev, "probe - problem registering spi master\n"); - goto err_spi_register; - } - - dev_dbg(dev, "probe succeded\n"); - return 0; - -err_init_queue: -err_start_queue: -err_spi_register: - destroy_queue(drv_data); - -err_no_rxdma: -err_no_txdma: -err_no_devid: - free_irq(irq, drv_data); - -err_no_irqres: - iounmap(drv_data->regs); - -err_no_iomap: - release_resource(drv_data->ioarea); - kfree(drv_data->ioarea); - -err_no_iores: - spi_master_put(master); - -err_no_pdata: -err_no_mem: - return status; -} - -static int __devexit spi_imx_remove(struct platform_device *pdev) -{ - struct driver_data *drv_data = platform_get_drvdata(pdev); - int irq; - int status = 0; - - if (!drv_data) - return 0; - - tasklet_kill(&drv_data->pump_transfers); - - /* Remove the queue */ - status = destroy_queue(drv_data); - if (status != 0) { - dev_err(&pdev->dev, "queue remove failed (%d)\n", status); - return status; - } - - /* Reset SPI */ - writel(SPI_RESET_START, drv_data->regs + SPI_RESET); - writel(0, drv_data->regs + SPI_RESET); - - /* Release DMA */ - if (drv_data->master_info->enable_dma) { - RSSR(drv_data->rx_channel) = 0; - RSSR(drv_data->tx_channel) = 0; - imx_dma_free(drv_data->tx_channel); - imx_dma_free(drv_data->rx_channel); - } - - /* Release IRQ */ - irq = platform_get_irq(pdev, 0); - if (irq >= 0) - free_irq(irq, drv_data); - - /* Release map resources */ - iounmap(drv_data->regs); - release_resource(drv_data->ioarea); - kfree(drv_data->ioarea); - - /* Disconnect from the SPI framework */ - spi_unregister_master(drv_data->master); - spi_master_put(drv_data->master); - - /* Prevent double remove */ - platform_set_drvdata(pdev, NULL); - - dev_dbg(&pdev->dev, "remove succeded\n"); - - return 0; -} - -static void spi_imx_shutdown(struct platform_device *pdev) -{ - struct driver_data *drv_data = platform_get_drvdata(pdev); - - /* Reset SPI */ - writel(SPI_RESET_START, drv_data->regs + SPI_RESET); - writel(0, drv_data->regs + SPI_RESET); - - dev_dbg(&pdev->dev, "shutdown succeded\n"); -} - -#ifdef CONFIG_PM -static int suspend_devices(struct device *dev, void *pm_message) -{ - pm_message_t *state = pm_message; - - if (dev->power.power_state.event != state->event) { - dev_warn(dev, "pm state does not match request\n"); - return -1; - } - - return 0; -} - -static int spi_imx_suspend(struct platform_device *pdev, pm_message_t state) -{ - struct driver_data *drv_data = platform_get_drvdata(pdev); - int status = 0; - - status = stop_queue(drv_data); - if (status != 0) { - dev_warn(&pdev->dev, "suspend cannot stop queue\n"); - return status; - } - - dev_dbg(&pdev->dev, "suspended\n"); - - return 0; -} - -static int spi_imx_resume(struct platform_device *pdev) -{ - struct driver_data *drv_data = platform_get_drvdata(pdev); - int status = 0; - - /* Start the queue running */ - status = start_queue(drv_data); - if (status != 0) - dev_err(&pdev->dev, "problem starting queue (%d)\n", status); - else - dev_dbg(&pdev->dev, "resumed\n"); - - return status; -} -#else -#define spi_imx_suspend NULL -#define spi_imx_resume NULL -#endif /* CONFIG_PM */ - -static struct platform_driver driver = { - .driver = { - .name = "imx-spi", - .bus = &platform_bus_type, - .owner = THIS_MODULE, - }, - .probe = spi_imx_probe, - .remove = __devexit_p(spi_imx_remove), - .shutdown = spi_imx_shutdown, - .suspend = spi_imx_suspend, - .resume = spi_imx_resume, -}; - -static int __init spi_imx_init(void) -{ - return platform_driver_register(&driver); -} -module_init(spi_imx_init); - -static void __exit spi_imx_exit(void) -{ - platform_driver_unregister(&driver); -} -module_exit(spi_imx_exit); - -MODULE_AUTHOR("Andrea Paterniani, "); -MODULE_DESCRIPTION("iMX SPI Contoller Driver"); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/telephony/ixj.c b/trunk/drivers/telephony/ixj.c index 71cb64e41a1b..df4cc1fb5f68 100644 --- a/trunk/drivers/telephony/ixj.c +++ b/trunk/drivers/telephony/ixj.c @@ -648,9 +648,9 @@ static inline BYTE SLIC_GetState(IXJ *j) return j->pld_slicr.bits.state; } -static bool SLIC_SetState(BYTE byState, IXJ *j) +static BOOL SLIC_SetState(BYTE byState, IXJ *j) { - bool fRetVal = false; + BOOL fRetVal = FALSE; if (j->cardtype == QTI_PHONECARD) { if (j->flags.pcmciasct) { @@ -659,14 +659,14 @@ static bool SLIC_SetState(BYTE byState, IXJ *j) case PLD_SLIC_STATE_OC: j->pslic.bits.powerdown = 1; j->pslic.bits.ring0 = j->pslic.bits.ring1 = 0; - fRetVal = true; + fRetVal = TRUE; break; case PLD_SLIC_STATE_RINGING: if (j->readers || j->writers) { j->pslic.bits.powerdown = 0; j->pslic.bits.ring0 = 1; j->pslic.bits.ring1 = 0; - fRetVal = true; + fRetVal = TRUE; } break; case PLD_SLIC_STATE_OHT: /* On-hook transmit */ @@ -679,14 +679,14 @@ static bool SLIC_SetState(BYTE byState, IXJ *j) j->pslic.bits.powerdown = 1; } j->pslic.bits.ring0 = j->pslic.bits.ring1 = 0; - fRetVal = true; + fRetVal = TRUE; break; case PLD_SLIC_STATE_APR: /* Active polarity reversal */ case PLD_SLIC_STATE_OHTPR: /* OHT polarity reversal */ default: - fRetVal = false; + fRetVal = FALSE; break; } j->psccr.bits.dev = 3; @@ -703,7 +703,7 @@ static bool SLIC_SetState(BYTE byState, IXJ *j) j->pld_slicw.bits.c3 = 0; j->pld_slicw.bits.b2en = 0; outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01); - fRetVal = true; + fRetVal = TRUE; break; case PLD_SLIC_STATE_RINGING: j->pld_slicw.bits.c1 = 1; @@ -711,7 +711,7 @@ static bool SLIC_SetState(BYTE byState, IXJ *j) j->pld_slicw.bits.c3 = 0; j->pld_slicw.bits.b2en = 1; outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01); - fRetVal = true; + fRetVal = TRUE; break; case PLD_SLIC_STATE_ACTIVE: j->pld_slicw.bits.c1 = 0; @@ -719,7 +719,7 @@ static bool SLIC_SetState(BYTE byState, IXJ *j) j->pld_slicw.bits.c3 = 0; j->pld_slicw.bits.b2en = 0; outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01); - fRetVal = true; + fRetVal = TRUE; break; case PLD_SLIC_STATE_OHT: /* On-hook transmit */ @@ -728,7 +728,7 @@ static bool SLIC_SetState(BYTE byState, IXJ *j) j->pld_slicw.bits.c3 = 0; j->pld_slicw.bits.b2en = 0; outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01); - fRetVal = true; + fRetVal = TRUE; break; case PLD_SLIC_STATE_TIPOPEN: j->pld_slicw.bits.c1 = 0; @@ -736,7 +736,7 @@ static bool SLIC_SetState(BYTE byState, IXJ *j) j->pld_slicw.bits.c3 = 1; j->pld_slicw.bits.b2en = 0; outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01); - fRetVal = true; + fRetVal = TRUE; break; case PLD_SLIC_STATE_STANDBY: j->pld_slicw.bits.c1 = 1; @@ -744,7 +744,7 @@ static bool SLIC_SetState(BYTE byState, IXJ *j) j->pld_slicw.bits.c3 = 1; j->pld_slicw.bits.b2en = 1; outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01); - fRetVal = true; + fRetVal = TRUE; break; case PLD_SLIC_STATE_APR: /* Active polarity reversal */ @@ -753,7 +753,7 @@ static bool SLIC_SetState(BYTE byState, IXJ *j) j->pld_slicw.bits.c3 = 1; j->pld_slicw.bits.b2en = 0; outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01); - fRetVal = true; + fRetVal = TRUE; break; case PLD_SLIC_STATE_OHTPR: /* OHT polarity reversal */ @@ -762,10 +762,10 @@ static bool SLIC_SetState(BYTE byState, IXJ *j) j->pld_slicw.bits.c3 = 1; j->pld_slicw.bits.b2en = 0; outb_p(j->pld_slicw.byte, j->XILINXbase + 0x01); - fRetVal = true; + fRetVal = TRUE; break; default: - fRetVal = false; + fRetVal = FALSE; break; } } @@ -4969,8 +4969,7 @@ static int ixj_daa_cid_read(IXJ *j) { int i; BYTES bytes; - char CID[ALISDAA_CALLERID_SIZE]; - bool mContinue; + char CID[ALISDAA_CALLERID_SIZE], mContinue; char *pIn, *pOut; if (!SCI_Prepare(j)) @@ -5014,7 +5013,7 @@ static int ixj_daa_cid_read(IXJ *j) pIn = CID; pOut = j->m_DAAShadowRegs.CAO_REGS.CAO.CallerID; - mContinue = true; + mContinue = 1; while (mContinue) { if ((pIn[1] & 0x03) == 0x01) { pOut[0] = pIn[0]; @@ -5028,7 +5027,7 @@ static int ixj_daa_cid_read(IXJ *j) if ((pIn[4] & 0xc0) == 0x40) { pOut[3] = ((pIn[4] & 0x3f) << 2) | ((pIn[3] & 0xc0) >> 6); } else { - mContinue = false; + mContinue = FALSE; } pIn += 5, pOut += 4; } @@ -6663,7 +6662,7 @@ static int ixj_fasync(int fd, struct file *file_p, int mode) return fasync_helper(fd, file_p, mode, &j->async_queue); } -static const struct file_operations ixj_fops = +static struct file_operations ixj_fops = { .owner = THIS_MODULE, .read = ixj_enhanced_read, @@ -7499,7 +7498,7 @@ static BYTE PCIEE_ReadBit(WORD wEEPROMAddress, BYTE lastLCC) return ((inb(wEEPROMAddress) >> 3) & 1); } -static bool PCIEE_ReadWord(WORD wAddress, WORD wLoc, WORD * pwResult) +static BOOL PCIEE_ReadWord(WORD wAddress, WORD wLoc, WORD * pwResult) { BYTE lastLCC; WORD wEEPROMAddress = wAddress + 3; diff --git a/trunk/drivers/telephony/ixj.h b/trunk/drivers/telephony/ixj.h index 4c32a43b7914..8d69bcdc29c9 100644 --- a/trunk/drivers/telephony/ixj.h +++ b/trunk/drivers/telephony/ixj.h @@ -48,11 +48,15 @@ typedef __u16 WORD; typedef __u32 DWORD; typedef __u8 BYTE; +typedef __u8 BOOL; #ifndef IXJMAX #define IXJMAX 16 #endif +#define TRUE 1 +#define FALSE 0 + /****************************************************************************** * * This structure when unioned with the structures below makes simple byte diff --git a/trunk/drivers/telephony/phonedev.c b/trunk/drivers/telephony/phonedev.c index 4d8c2a5b3297..e41f49afd0f4 100644 --- a/trunk/drivers/telephony/phonedev.c +++ b/trunk/drivers/telephony/phonedev.c @@ -127,7 +127,7 @@ void phone_unregister_device(struct phone_device *pfd) } -static const struct file_operations phone_fops = +static struct file_operations phone_fops = { .owner = THIS_MODULE, .open = phone_open, diff --git a/trunk/drivers/usb/misc/adutux.c b/trunk/drivers/usb/misc/adutux.c index 75bfab95ab3c..af2934e016a7 100644 --- a/trunk/drivers/usb/misc/adutux.c +++ b/trunk/drivers/usb/misc/adutux.c @@ -644,7 +644,7 @@ static ssize_t adu_write(struct file *file, const __user char *buffer, } /* file operations needed when we register this driver */ -static const struct file_operations adu_fops = { +static struct file_operations adu_fops = { .owner = THIS_MODULE, .read = adu_read, .write = adu_write, diff --git a/trunk/drivers/usb/misc/appledisplay.c b/trunk/drivers/usb/misc/appledisplay.c index 32f0e3a5b022..a7932a72d298 100644 --- a/trunk/drivers/usb/misc/appledisplay.c +++ b/trunk/drivers/usb/misc/appledisplay.c @@ -281,8 +281,8 @@ static int appledisplay_probe(struct usb_interface *iface, /* Register backlight device */ snprintf(bl_name, sizeof(bl_name), "appledisplay%d", atomic_inc_return(&count_displays) - 1); - pdata->bd = backlight_device_register(bl_name, NULL, - pdata, &appledisplay_bl_data); + pdata->bd = backlight_device_register(bl_name, NULL, NULL, + &appledisplay_bl_data); if (IS_ERR(pdata->bd)) { err("appledisplay: Backlight registration failed"); goto error; diff --git a/trunk/drivers/usb/misc/ftdi-elan.c b/trunk/drivers/usb/misc/ftdi-elan.c index 0c1d66ddb812..41c0161abdb9 100644 --- a/trunk/drivers/usb/misc/ftdi-elan.c +++ b/trunk/drivers/usb/misc/ftdi-elan.c @@ -1209,7 +1209,7 @@ static ssize_t ftdi_elan_write(struct file *file, return retval; } -static const struct file_operations ftdi_elan_fops = { +static struct file_operations ftdi_elan_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .ioctl = ftdi_elan_ioctl, diff --git a/trunk/drivers/video/Kconfig b/trunk/drivers/video/Kconfig index 8874cf2fd279..45fe65d8d7a0 100644 --- a/trunk/drivers/video/Kconfig +++ b/trunk/drivers/video/Kconfig @@ -85,14 +85,6 @@ config FB_CFB_IMAGEBLIT blitting. This is used by drivers that don't provide their own (accelerated) version. -config FB_SVGALIB - tristate - depends on FB - default n - ---help--- - Common utility functions useful to fbdev drivers of VGA-based - cards. - config FB_MACMODES tristate depends on FB @@ -354,6 +346,42 @@ config FB_AMIGA_AGA and CD32. If you intend to run Linux on any of these systems, say Y; otherwise say N. +config FB_CYBER + tristate "Amiga CyberVision 64 support" + depends on FB && ZORRO && BROKEN + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + help + This enables support for the Cybervision 64 graphics card from + Phase5. Please note that its use is not all that intuitive (i.e. if + you have any questions, be sure to ask!). Say N unless you have a + Cybervision 64 or plan to get one before you next recompile the + kernel. Please note that this driver DOES NOT support the + Cybervision 64/3D card, as they use incompatible video chips. + +config FB_VIRGE + bool "Amiga CyberVision 64/3D support " + depends on (FB = y) && ZORRO && BROKEN + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + help + This enables support for the Cybervision 64/3D graphics card from + Phase5. Please note that its use is not all that intuitive (i.e. if + you have any questions, be sure to ask!). Say N unless you have a + Cybervision 64/3D or plan to get one before you next recompile the + kernel. Please note that this driver DOES NOT support the older + Cybervision 64 card, as they use incompatible video chips. + +config FB_RETINAZ3 + tristate "Amiga Retina Z3 support" + depends on (FB = y) && ZORRO && BROKEN + help + This enables support for the Retina Z3 graphics card. Say N unless + you have a Retina Z3 or plan to get one before you next recompile + the kernel. + config FB_FM2 bool "Amiga FrameMaster II/Rainbow II support" depends on (FB = y) && ZORRO @@ -589,6 +617,10 @@ config FB_GBE_MEM This is the amount of memory reserved for the framebuffer, which can be any value between 1MB and 8MB. +config FB_SUN3 + bool "Sun3 framebuffer support" + depends on (FB = y) && (SUN3 || SUN3X) && BROKEN + config FB_SBUS bool "SBUS and UPA framebuffers" depends on (FB = y) && SPARC @@ -597,7 +629,7 @@ config FB_SBUS config FB_BW2 bool "BWtwo support" - depends on (FB = y) && (SPARC && FB_SBUS) + depends on (FB = y) && (SPARC && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -606,7 +638,7 @@ config FB_BW2 config FB_CG3 bool "CGthree support" - depends on (FB = y) && (SPARC && FB_SBUS) + depends on (FB = y) && (SPARC && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT @@ -615,7 +647,7 @@ config FB_CG3 config FB_CG6 bool "CGsix (GX,TurboGX) support" - depends on (FB = y) && (SPARC && FB_SBUS) + depends on (FB = y) && (SPARC && FB_SBUS || (SUN3 || SUN3X) && FB_SUN3) select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT help @@ -1109,16 +1141,11 @@ config FB_ATY_BACKLIGHT help Say Y here if you want to control the backlight of your display. -config FB_S3 - tristate "S3 Trio/Virge support" - depends on FB && PCI - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - select FB_TILEBLITTING - select FB_SVGALIB - ---help--- - Driver for graphics boards with S3 Trio / S3 Virge chip. +config FB_S3TRIO + bool "S3 Trio display support" + depends on (FB = y) && PPC && BROKEN + help + If you have a S3 Trio say Y. Say N for S3 Virge. config FB_SAVAGE tristate "S3 Savage support" @@ -1598,26 +1625,6 @@ config FB_IBM_GXT4500 Say Y here to enable support for the IBM GXT4500P display adaptor, found on some IBM System P (pSeries) machines. -config FB_PS3 - bool "PS3 GPU framebuffer driver" - depends on FB && PPC_PS3 - select PS3_PS3AV - select FB_CFB_FILLRECT - select FB_CFB_COPYAREA - select FB_CFB_IMAGEBLIT - ---help--- - Include support for the virtual frame buffer in the PS3 platform. - -config FB_PS3_DEFAULT_SIZE_M - int "PS3 default frame buffer size (in MiB)" - depends on FB_PS3 - default 18 - ---help--- - This is the default size (in MiB) of the virtual frame buffer in - the PS3. - The default value can be overridden on the kernel command line - using the "ps3fb" option (e.g. "ps3fb=9M"); - config FB_VIRTUAL tristate "Virtual Frame Buffer support (ONLY FOR TESTING!)" depends on FB diff --git a/trunk/drivers/video/Makefile b/trunk/drivers/video/Makefile index 6801edff36d9..309a26dd164a 100644 --- a/trunk/drivers/video/Makefile +++ b/trunk/drivers/video/Makefile @@ -17,14 +17,15 @@ obj-$(CONFIG_SYSFS) += backlight/ obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o obj-$(CONFIG_FB_CFB_COPYAREA) += cfbcopyarea.o obj-$(CONFIG_FB_CFB_IMAGEBLIT) += cfbimgblt.o -obj-$(CONFIG_FB_SVGALIB) += svgalib.o obj-$(CONFIG_FB_MACMODES) += macmodes.o obj-$(CONFIG_FB_DDC) += fb_ddc.o # Hardware specific drivers go first +obj-$(CONFIG_FB_RETINAZ3) += retz3fb.o obj-$(CONFIG_FB_AMIGA) += amifb.o c2p.o obj-$(CONFIG_FB_ARC) += arcfb.o obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o +obj-$(CONFIG_FB_CYBER) += cyberfb.o obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o obj-$(CONFIG_FB_PM2) += pm2fb.o obj-$(CONFIG_FB_PM3) += pm3fb.o @@ -42,16 +43,17 @@ obj-$(CONFIG_FB_GEODE) += geode/ obj-$(CONFIG_FB_MBX) += mbx/ obj-$(CONFIG_FB_I810) += vgastate.o obj-$(CONFIG_FB_NEOMAGIC) += neofb.o vgastate.o +obj-$(CONFIG_FB_VIRGE) += virgefb.o obj-$(CONFIG_FB_3DFX) += tdfxfb.o obj-$(CONFIG_FB_CONTROL) += controlfb.o obj-$(CONFIG_FB_PLATINUM) += platinumfb.o obj-$(CONFIG_FB_VALKYRIE) += valkyriefb.o obj-$(CONFIG_FB_CT65550) += chipsfb.o obj-$(CONFIG_FB_IMSTT) += imsttfb.o +obj-$(CONFIG_FB_S3TRIO) += S3triofb.o obj-$(CONFIG_FB_FM2) += fm2fb.o obj-$(CONFIG_FB_CYBLA) += cyblafb.o obj-$(CONFIG_FB_TRIDENT) += tridentfb.o -obj-$(CONFIG_FB_S3) += s3fb.o vgastate.o obj-$(CONFIG_FB_STI) += stifb.o obj-$(CONFIG_FB_FFB) += ffb.o sbuslib.o obj-$(CONFIG_FB_CG6) += cg6.o sbuslib.o @@ -73,6 +75,7 @@ obj-$(CONFIG_FB_TGA) += tgafb.o obj-$(CONFIG_FB_HP300) += hpfb.o obj-$(CONFIG_FB_G364) += g364fb.o obj-$(CONFIG_FB_SA1100) += sa1100fb.o +obj-$(CONFIG_FB_SUN3) += sun3fb.o obj-$(CONFIG_FB_HIT) += hitfb.o obj-$(CONFIG_FB_EPSON1355) += epson1355fb.o obj-$(CONFIG_FB_PVR2) += pvr2fb.o @@ -97,7 +100,6 @@ obj-$(CONFIG_FB_S3C2410) += s3c2410fb.o obj-$(CONFIG_FB_PNX4008_DUM) += pnx4008/ obj-$(CONFIG_FB_PNX4008_DUM_RGB) += pnx4008/ obj-$(CONFIG_FB_IBM_GXT4500) += gxt4500.o -obj-$(CONFIG_FB_PS3) += ps3fb.o # Platform or fallback drivers go here obj-$(CONFIG_FB_VESA) += vesafb.o diff --git a/trunk/drivers/video/S3triofb.c b/trunk/drivers/video/S3triofb.c new file mode 100644 index 000000000000..b3717c8f1bc2 --- /dev/null +++ b/trunk/drivers/video/S3triofb.c @@ -0,0 +1,790 @@ +/* + * linux/drivers/video/S3Triofb.c -- Open Firmware based frame buffer device + * + * Copyright (C) 1997 Peter De Schrijver + * + * This driver is partly based on the PowerMac console driver: + * + * Copyright (C) 1996 Paul Mackerras + * + * and on the Open Firmware based frame buffer device: + * + * Copyright (C) 1997 Geert Uytterhoeven + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + */ + +/* + Bugs : + OF dependencies should be removed. + + This driver should be merged with the CyberVision driver. The + CyberVision is a Zorro III implementation of the S3Trio64 chip. + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include