From e6de16737a8f2bdbaa9f4371c794b66107f9cd2f Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Mon, 4 Aug 2008 12:02:28 +0900 Subject: [PATCH] --- yaml --- r: 107774 b: refs/heads/master c: 9b3cbf725fb98733976fd02e2e557f0ae3028df0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/00-INDEX | 2 + trunk/Documentation/DocBook/Makefile | 2 +- trunk/Documentation/DocBook/s390-drivers.tmpl | 8 +- trunk/Documentation/DocBook/sh.tmpl | 105 -- trunk/Documentation/DocBook/videobook.tmpl | 2 +- trunk/Documentation/cli-sti-removal.txt | 133 +++ .../Documentation/power/pm_qos_interface.txt | 7 +- .../powerpc/booting-without-of.txt | 4 +- .../powerpc/eeh-pci-error-recovery.txt | 2 +- trunk/Makefile | 2 +- trunk/arch/ia64/kernel/ivt.S | 4 +- trunk/arch/m68k/mac/baboon.c | 1 + trunk/arch/m68k/mac/via.c | 1 + trunk/arch/mips/emma2rh/markeins/setup.c | 1 + trunk/arch/mips/jazz/setup.c | 2 + trunk/arch/mn10300/kernel/module.c | 4 +- trunk/arch/powerpc/Kconfig.debug | 2 +- trunk/arch/powerpc/boot/dts/mpc8610_hpcd.dts | 5 - trunk/arch/powerpc/boot/io.h | 2 +- trunk/arch/powerpc/kernel/Makefile | 14 + trunk/arch/powerpc/kernel/cpu_setup_44x.S | 6 + trunk/arch/powerpc/kernel/irq.c | 25 +- trunk/arch/powerpc/kernel/process.c | 2 + trunk/arch/powerpc/kernel/vdso.c | 2 + trunk/arch/powerpc/lib/Makefile | 2 + trunk/arch/powerpc/mm/mem.c | 2 +- trunk/arch/powerpc/mm/ppc_mmu_32.c | 4 +- trunk/arch/powerpc/mm/tlb_64.c | 2 +- trunk/arch/powerpc/platforms/52xx/Makefile | 4 +- .../arch/powerpc/platforms/86xx/mpc86xx_smp.c | 2 +- trunk/arch/powerpc/platforms/Makefile | 6 + .../arch/powerpc/platforms/powermac/Makefile | 3 +- trunk/arch/powerpc/sysdev/Makefile | 2 + trunk/arch/sh/Kconfig | 27 +- trunk/arch/sh/Kconfig.debug | 2 +- trunk/arch/sh/Makefile | 16 +- trunk/arch/sh/boards/Makefile | 2 +- trunk/arch/sh/boards/board-ap325rxa.c | 1 + trunk/arch/sh/boards/mach-se/7343/irq.c | 1 + trunk/arch/sh/boards/mach-systemh/irq.c | 3 +- trunk/arch/sh/configs/dreamcast_defconfig | 14 +- trunk/arch/sh/include/asm/a.out.h | 20 + trunk/arch/sh/include/asm/ptrace.h | 9 - trunk/arch/sh/include/asm/seccomp.h | 10 - trunk/arch/sh/include/asm/thread_info.h | 51 +- trunk/arch/sh/include/asm/tlb_64.h | 12 +- trunk/arch/sh/include/cpu-sh2/cpu/cache.h | 6 +- .../arch/sh/include/cpu-sh2a/cpu/addrspace.h | 10 - trunk/arch/sh/include/cpu-sh2a/cpu/cache.h | 3 - .../arch/sh/include/cpu-sh2a/cpu/cacheflush.h | 34 - trunk/arch/sh/kernel/cpu/sh4/sq.c | 2 +- trunk/arch/sh/kernel/cpu/sh5/entry.S | 19 +- trunk/arch/sh/kernel/entry-common.S | 16 +- trunk/arch/sh/kernel/machine_kexec.c | 8 - trunk/arch/sh/kernel/module.c | 7 +- trunk/arch/sh/kernel/ptrace_32.c | 157 +-- trunk/arch/sh/kernel/ptrace_64.c | 144 ++- trunk/arch/sh/kernel/setup.c | 20 - trunk/arch/sh/kernel/signal_32.c | 22 +- trunk/arch/sh/kernel/signal_64.c | 166 ++-- trunk/arch/sh/mm/Kconfig | 1 + trunk/arch/sh/mm/Makefile_32 | 11 +- trunk/arch/sh/mm/cache-sh2.c | 45 +- trunk/arch/sh/mm/cache-sh2a.c | 129 --- trunk/arch/sh/mm/tlb-sh5.c | 20 +- trunk/arch/sh/tools/Makefile | 4 +- trunk/arch/sparc64/kernel/irq.c | 19 +- trunk/arch/sparc64/kernel/signal.c | 1 + trunk/arch/sparc64/kernel/smp.c | 292 +++--- trunk/arch/sparc64/mm/tsb.c | 5 +- trunk/arch/xtensa/kernel/xtensa_ksyms.c | 1 + trunk/block/scsi_ioctl.c | 2 +- trunk/drivers/block/cciss.c | 2 + trunk/drivers/cdrom/cdrom.c | 4 + trunk/drivers/char/efirtc.c | 1 + trunk/drivers/char/hvc_console.h | 2 +- trunk/drivers/char/hvcs.c | 2 +- trunk/drivers/char/viocons.c | 4 + trunk/drivers/char/vt.c | 2 + trunk/drivers/ide/Kconfig | 10 + trunk/drivers/ide/arm/palm_bk3710.c | 2 +- trunk/drivers/ide/ide-cd.c | 30 +- trunk/drivers/ide/ide-disk.c | 11 +- trunk/drivers/ide/ide-dma.c | 6 +- trunk/drivers/ide/ide-floppy.c | 11 +- trunk/drivers/ide/ide-iops.c | 6 +- trunk/drivers/ide/ide-tape.c | 11 +- trunk/drivers/ide/pci/aec62xx.c | 2 +- trunk/drivers/ide/pci/alim15x3.c | 2 +- trunk/drivers/ide/pci/amd74xx.c | 2 +- trunk/drivers/ide/pci/atiixp.c | 2 +- trunk/drivers/ide/pci/cmd64x.c | 2 +- trunk/drivers/ide/pci/cs5520.c | 1 - trunk/drivers/ide/pci/cs5535.c | 2 +- trunk/drivers/ide/pci/hpt366.c | 2 +- trunk/drivers/ide/pci/it8213.c | 2 +- trunk/drivers/ide/pci/it821x.c | 4 +- trunk/drivers/ide/pci/jmicron.c | 2 +- trunk/drivers/ide/pci/pdc202xx_new.c | 2 +- trunk/drivers/ide/pci/pdc202xx_old.c | 2 +- trunk/drivers/ide/pci/piix.c | 2 +- trunk/drivers/ide/pci/scc_pata.c | 2 +- trunk/drivers/ide/pci/serverworks.c | 8 +- trunk/drivers/ide/pci/siimage.c | 4 +- trunk/drivers/ide/pci/sis5513.c | 2 +- trunk/drivers/ide/pci/slc90e66.c | 2 +- trunk/drivers/ide/pci/tc86c001.c | 2 +- trunk/drivers/ide/pci/via82cxxx.c | 2 +- trunk/drivers/infiniband/hw/ehca/ehca_reqs.c | 2 +- trunk/drivers/input/keyboard/maple_keyb.c | 172 ++-- trunk/drivers/isdn/Makefile | 2 +- trunk/drivers/isdn/hardware/mISDN/hfcmulti.c | 37 +- trunk/drivers/isdn/hardware/mISDN/hfcpci.c | 2 +- trunk/drivers/isdn/mISDN/l1oip_core.c | 6 +- trunk/drivers/isdn/mISDN/socket.c | 4 +- trunk/drivers/macintosh/mediabay.c | 1 + trunk/drivers/media/video/vino.c | 1 - trunk/drivers/misc/sgi-gru/grutlbpurge.c | 1 + trunk/drivers/net/stnic.c | 2 +- trunk/drivers/net/tg3.c | 20 +- trunk/drivers/net/wireless/Kconfig | 1 - trunk/drivers/net/wireless/ath5k/ath5k.h | 8 +- trunk/drivers/net/wireless/ath5k/base.c | 1 - trunk/drivers/net/wireless/ath5k/debug.c | 2 +- trunk/drivers/net/wireless/ath5k/debug.h | 1 + trunk/drivers/net/wireless/ath5k/hw.c | 239 ++--- trunk/drivers/net/wireless/ath5k/initvals.c | 4 +- trunk/drivers/net/wireless/ath5k/phy.c | 185 +--- trunk/drivers/net/wireless/ath5k/reg.h | 934 +++++------------- trunk/drivers/net/wireless/ipw2200.c | 5 +- trunk/drivers/net/wireless/iwlwifi/Kconfig | 98 +- trunk/drivers/net/wireless/iwlwifi/Makefile | 13 +- .../net/wireless/iwlwifi/iwl-3945-led.c | 33 +- .../net/wireless/iwlwifi/iwl-3945-led.h | 1 - trunk/drivers/net/wireless/iwlwifi/iwl-3945.c | 17 +- .../iwlwifi/{iwl-agn-rs.c => iwl-4965-rs.c} | 327 +++--- .../iwlwifi/{iwl-agn-rs.h => iwl-4965-rs.h} | 23 +- trunk/drivers/net/wireless/iwlwifi/iwl-4965.c | 156 ++- trunk/drivers/net/wireless/iwlwifi/iwl-5000.c | 71 +- .../net/wireless/iwlwifi/iwl-commands.h | 44 +- trunk/drivers/net/wireless/iwlwifi/iwl-core.c | 7 +- trunk/drivers/net/wireless/iwlwifi/iwl-core.h | 3 +- trunk/drivers/net/wireless/iwlwifi/iwl-csr.h | 10 +- .../drivers/net/wireless/iwlwifi/iwl-debug.h | 4 +- .../net/wireless/iwlwifi/iwl-debugfs.c | 11 +- trunk/drivers/net/wireless/iwlwifi/iwl-dev.h | 22 +- .../drivers/net/wireless/iwlwifi/iwl-eeprom.c | 3 +- trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c | 2 +- trunk/drivers/net/wireless/iwlwifi/iwl-led.c | 69 +- trunk/drivers/net/wireless/iwlwifi/iwl-led.h | 1 - .../drivers/net/wireless/iwlwifi/iwl-power.c | 45 +- .../drivers/net/wireless/iwlwifi/iwl-power.h | 33 +- trunk/drivers/net/wireless/iwlwifi/iwl-prph.h | 12 +- trunk/drivers/net/wireless/iwlwifi/iwl-rx.c | 59 +- trunk/drivers/net/wireless/iwlwifi/iwl-scan.c | 1 - trunk/drivers/net/wireless/iwlwifi/iwl-sta.c | 4 +- trunk/drivers/net/wireless/iwlwifi/iwl-tx.c | 86 +- .../net/wireless/iwlwifi/iwl3945-base.c | 58 +- .../iwlwifi/{iwl-agn.c => iwl4965-base.c} | 232 ++--- trunk/drivers/net/wireless/libertas/main.c | 15 +- trunk/drivers/net/wireless/p54/p54.h | 1 - trunk/drivers/net/wireless/p54/p54common.c | 6 - .../drivers/net/wireless/prism54/isl_ioctl.c | 2 +- trunk/drivers/net/wireless/rt2x00/rt2500pci.c | 1 - trunk/drivers/net/wireless/rt2x00/rt2500usb.c | 20 +- trunk/drivers/net/wireless/rt2x00/rt2x00.h | 6 - .../net/wireless/rt2x00/rt2x00config.c | 4 - .../drivers/net/wireless/rt2x00/rt2x00debug.c | 17 +- trunk/drivers/net/wireless/rt2x00/rt2x00mac.c | 1 - .../drivers/net/wireless/rt2x00/rt2x00queue.c | 5 +- trunk/drivers/net/wireless/rt2x00/rt2x00usb.c | 4 +- trunk/drivers/net/wireless/rt2x00/rt2x00usb.h | 2 +- trunk/drivers/net/wireless/rt2x00/rt61pci.c | 5 - trunk/drivers/net/wireless/rtl8187.h | 4 - trunk/drivers/net/wireless/rtl8187_dev.c | 17 +- trunk/drivers/pcmcia/rsrc_nonstatic.c | 2 +- trunk/drivers/rtc/rtc-bfin.c | 105 +- trunk/drivers/scsi/hptiop.c | 8 +- trunk/drivers/scsi/ide-scsi.c | 11 +- trunk/drivers/scsi/scsi_transport_spi.c | 8 +- trunk/drivers/scsi/ses.c | 18 +- trunk/drivers/scsi/sg.c | 2 +- trunk/drivers/serial/bfin_5xx.c | 2 +- trunk/drivers/serial/crisv10.c | 79 +- trunk/drivers/serial/crisv10.h | 3 +- trunk/drivers/sh/maple/maple.c | 65 +- trunk/drivers/spi/Kconfig | 6 - trunk/drivers/spi/Makefile | 1 - trunk/drivers/spi/atmel_spi.c | 17 +- trunk/drivers/spi/orion_spi.c | 574 ----------- trunk/drivers/spi/spi_s3c24xx.c | 25 +- trunk/drivers/usb/core/message.c | 2 +- trunk/drivers/usb/storage/freecom.c | 2 + trunk/drivers/video/arkfb.c | 18 +- trunk/drivers/video/aty/atyfb_base.c | 29 +- trunk/drivers/video/aty/radeon_accel.c | 4 +- trunk/drivers/video/aty/radeon_i2c.c | 3 +- trunk/drivers/video/backlight/pwm_bl.c | 10 +- trunk/drivers/video/console/fbcon.c | 3 - trunk/drivers/video/fsl-diu-fb.c | 8 +- trunk/drivers/video/s3fb.c | 18 +- trunk/drivers/video/vt8623fb.c | 20 +- trunk/drivers/watchdog/ar7_wdt.c | 29 +- trunk/drivers/watchdog/it8712f_wdt.c | 77 +- trunk/drivers/watchdog/s3c2410_wdt.c | 148 ++- trunk/drivers/watchdog/sc1200wdt.c | 205 ++-- trunk/drivers/watchdog/wdt.c | 176 ++-- trunk/drivers/watchdog/wdt_pci.c | 301 +++--- trunk/firmware/ihex2fw.c | 6 +- trunk/fs/afs/write.c | 2 +- trunk/fs/buffer.c | 4 +- trunk/fs/cifs/file.c | 2 +- trunk/fs/jbd/commit.c | 6 +- trunk/fs/jbd2/commit.c | 2 +- trunk/fs/nfs/nfsroot.c | 2 +- trunk/fs/ntfs/aops.c | 2 +- trunk/fs/ntfs/compress.c | 2 +- trunk/fs/ntfs/mft.c | 4 +- trunk/fs/omfs/inode.c | 3 +- trunk/fs/proc/base.c | 11 +- trunk/fs/reiserfs/inode.c | 2 +- trunk/fs/reiserfs/journal.c | 6 +- trunk/fs/splice.c | 2 +- trunk/fs/ufs/super.c | 2 +- trunk/fs/xfs/linux-2.6/xfs_aops.c | 6 +- trunk/include/asm-m68k/contregs.h | 51 +- trunk/include/asm-m68k/fbio.h | 331 +------ trunk/include/asm-m68k/idprom.h | 21 +- .../asm => include/asm-powerpc}/8253pit.h | 0 .../asm => include/asm-powerpc}/8xx_immap.h | 0 .../asm => include/asm-powerpc}/Kbuild | 0 .../asm => include/asm-powerpc}/a.out.h | 0 .../asm => include/asm-powerpc}/abs_addr.h | 0 .../include/asm => include/asm-powerpc}/agp.h | 0 .../asm => include/asm-powerpc}/asm-compat.h | 0 .../asm => include/asm-powerpc}/atomic.h | 0 .../asm => include/asm-powerpc}/auxvec.h | 0 .../asm => include/asm-powerpc}/backlight.h | 0 .../asm => include/asm-powerpc}/bitops.h | 0 .../asm => include/asm-powerpc}/bootx.h | 0 .../asm => include/asm-powerpc}/btext.h | 0 .../include/asm => include/asm-powerpc}/bug.h | 0 .../asm => include/asm-powerpc}/bugs.h | 0 .../asm => include/asm-powerpc}/byteorder.h | 0 .../asm => include/asm-powerpc}/cache.h | 0 .../asm => include/asm-powerpc}/cacheflush.h | 0 .../asm => include/asm-powerpc}/cell-pmu.h | 0 .../asm => include/asm-powerpc}/cell-regs.h | 0 .../asm => include/asm-powerpc}/checksum.h | 0 .../asm-powerpc}/clk_interface.h | 0 .../asm-powerpc}/code-patching.h | 0 .../asm => include/asm-powerpc}/compat.h | 0 .../include/asm => include/asm-powerpc}/cpm.h | 0 .../asm => include/asm-powerpc}/cpm1.h | 0 .../asm => include/asm-powerpc}/cpm2.h | 0 .../asm => include/asm-powerpc}/cputable.h | 0 .../asm => include/asm-powerpc}/cputhreads.h | 0 .../asm => include/asm-powerpc}/cputime.h | 0 .../asm => include/asm-powerpc}/current.h | 0 .../asm => include/asm-powerpc}/dbdma.h | 0 .../asm => include/asm-powerpc}/dcr-generic.h | 0 .../asm => include/asm-powerpc}/dcr-mmio.h | 0 .../asm => include/asm-powerpc}/dcr-native.h | 0 .../asm => include/asm-powerpc}/dcr-regs.h | 0 .../include/asm => include/asm-powerpc}/dcr.h | 6 +- .../asm => include/asm-powerpc}/delay.h | 0 .../asm => include/asm-powerpc}/device.h | 0 .../asm => include/asm-powerpc}/div64.h | 0 .../asm => include/asm-powerpc}/dma-mapping.h | 0 .../include/asm => include/asm-powerpc}/dma.h | 0 .../asm => include/asm-powerpc}/edac.h | 0 .../include/asm => include/asm-powerpc}/eeh.h | 0 .../asm => include/asm-powerpc}/eeh_event.h | 0 .../include/asm => include/asm-powerpc}/elf.h | 0 .../asm-powerpc}/emergency-restart.h | 0 .../asm => include/asm-powerpc}/errno.h | 0 .../asm => include/asm-powerpc}/exception.h | 0 .../include/asm => include/asm-powerpc}/fb.h | 0 .../asm => include/asm-powerpc}/fcntl.h | 0 .../asm-powerpc}/feature-fixups.h | 0 .../asm => include/asm-powerpc}/firmware.h | 0 .../asm => include/asm-powerpc}/fixmap.h | 0 .../asm => include/asm-powerpc}/floppy.h | 0 .../asm => include/asm-powerpc}/fs_pd.h | 0 .../asm => include/asm-powerpc}/fsl_gtm.h | 0 .../asm => include/asm-powerpc}/fsl_lbc.h | 0 .../asm => include/asm-powerpc}/ftrace.h | 0 .../asm => include/asm-powerpc}/futex.h | 0 .../asm => include/asm-powerpc}/gpio.h | 0 .../asm => include/asm-powerpc}/grackle.h | 0 .../asm => include/asm-powerpc}/hardirq.h | 0 .../asm => include/asm-powerpc}/heathrow.h | 0 .../asm => include/asm-powerpc}/highmem.h | 0 .../asm => include/asm-powerpc}/hugetlb.h | 0 .../asm => include/asm-powerpc}/hvcall.h | 0 .../asm => include/asm-powerpc}/hvconsole.h | 0 .../asm => include/asm-powerpc}/hvcserver.h | 0 .../asm => include/asm-powerpc}/hw_irq.h | 0 .../asm => include/asm-powerpc}/hydra.h | 0 .../asm => include/asm-powerpc}/i8259.h | 5 + .../asm => include/asm-powerpc}/ibmebus.h | 0 .../include/asm => include/asm-powerpc}/ide.h | 1 + .../asm => include/asm-powerpc}/immap_86xx.h | 0 .../asm => include/asm-powerpc}/immap_cpm2.h | 0 .../asm => include/asm-powerpc}/immap_qe.h | 2 + .../asm => include/asm-powerpc}/io-defs.h | 0 .../include/asm => include/asm-powerpc}/io.h | 0 .../asm => include/asm-powerpc}/ioctl.h | 0 .../asm => include/asm-powerpc}/ioctls.h | 0 .../asm => include/asm-powerpc}/iommu.h | 0 .../asm => include/asm-powerpc}/ipcbuf.h | 0 .../asm => include/asm-powerpc}/ipic.h | 9 + .../include/asm => include/asm-powerpc}/irq.h | 288 ++++++ .../asm => include/asm-powerpc}/irq_regs.h | 0 .../asm => include/asm-powerpc}/irqflags.h | 4 +- .../asm-powerpc}/iseries/alpaca.h | 0 .../asm-powerpc}/iseries/hv_call.h | 0 .../asm-powerpc}/iseries/hv_call_event.h | 0 .../asm-powerpc}/iseries/hv_call_sc.h | 0 .../asm-powerpc}/iseries/hv_call_xm.h | 0 .../asm-powerpc}/iseries/hv_lp_config.h | 0 .../asm-powerpc}/iseries/hv_lp_event.h | 0 .../asm-powerpc}/iseries/hv_types.h | 0 .../asm-powerpc}/iseries/iommu.h | 0 .../asm-powerpc}/iseries/it_lp_queue.h | 0 .../asm-powerpc}/iseries/lpar_map.h | 0 .../asm => include/asm-powerpc}/iseries/mf.h | 0 .../asm => include/asm-powerpc}/iseries/vio.h | 0 .../asm => include/asm-powerpc}/kdebug.h | 0 .../asm => include/asm-powerpc}/kdump.h | 0 .../asm => include/asm-powerpc}/kexec.h | 0 .../asm => include/asm-powerpc}/keylargo.h | 0 .../asm => include/asm-powerpc}/kgdb.h | 2 + .../asm => include/asm-powerpc}/kmap_types.h | 0 .../asm => include/asm-powerpc}/kprobes.h | 0 .../include/asm => include/asm-powerpc}/kvm.h | 0 .../asm => include/asm-powerpc}/kvm_asm.h | 0 .../asm => include/asm-powerpc}/kvm_host.h | 0 .../asm => include/asm-powerpc}/kvm_para.h | 0 .../asm => include/asm-powerpc}/kvm_ppc.h | 0 .../asm-powerpc}/libata-portmap.h | 0 .../asm => include/asm-powerpc}/linkage.h | 0 .../include/asm => include/asm-powerpc}/lmb.h | 0 .../asm => include/asm-powerpc}/local.h | 0 .../asm => include/asm-powerpc}/lppaca.h | 0 .../asm => include/asm-powerpc}/lv1call.h | 0 .../asm => include/asm-powerpc}/machdep.h | 0 .../asm => include/asm-powerpc}/macio.h | 0 .../asm => include/asm-powerpc}/mc146818rtc.h | 0 .../asm => include/asm-powerpc}/mediabay.h | 0 .../asm => include/asm-powerpc}/mman.h | 0 .../asm => include/asm-powerpc}/mmu-40x.h | 0 .../asm => include/asm-powerpc}/mmu-44x.h | 0 .../asm => include/asm-powerpc}/mmu-8xx.h | 0 .../asm-powerpc}/mmu-fsl-booke.h | 0 .../asm => include/asm-powerpc}/mmu-hash32.h | 0 .../asm => include/asm-powerpc}/mmu-hash64.h | 0 .../include/asm => include/asm-powerpc}/mmu.h | 0 .../asm => include/asm-powerpc}/mmu_context.h | 0 .../asm => include/asm-powerpc}/mmzone.h | 0 .../asm => include/asm-powerpc}/module.h | 0 .../asm => include/asm-powerpc}/mpc512x.h | 0 .../asm => include/asm-powerpc}/mpc52xx.h | 0 .../asm => include/asm-powerpc}/mpc52xx_psc.h | 0 .../asm => include/asm-powerpc}/mpc6xx.h | 0 .../asm => include/asm-powerpc}/mpc8260.h | 0 .../asm => include/asm-powerpc}/mpc86xx.h | 0 .../asm => include/asm-powerpc}/mpc8xx.h | 0 .../asm => include/asm-powerpc}/mpic.h | 0 .../asm => include/asm-powerpc}/msgbuf.h | 0 .../asm => include/asm-powerpc}/mutex.h | 0 .../asm => include/asm-powerpc}/nvram.h | 0 .../asm => include/asm-powerpc}/of_device.h | 0 .../asm => include/asm-powerpc}/of_platform.h | 0 .../asm => include/asm-powerpc}/ohare.h | 0 .../asm-powerpc}/oprofile_impl.h | 0 .../asm-powerpc}/pSeries_reconfig.h | 0 .../asm => include/asm-powerpc}/paca.h | 2 + .../asm => include/asm-powerpc}/page.h | 0 .../asm => include/asm-powerpc}/page_32.h | 0 .../asm => include/asm-powerpc}/page_64.h | 0 .../asm => include/asm-powerpc}/param.h | 0 .../asm => include/asm-powerpc}/parport.h | 0 .../asm => include/asm-powerpc}/pasemi_dma.h | 0 .../asm => include/asm-powerpc}/pci-bridge.h | 0 .../include/asm => include/asm-powerpc}/pci.h | 0 .../asm => include/asm-powerpc}/percpu.h | 0 .../asm => include/asm-powerpc}/pgalloc-32.h | 0 .../asm => include/asm-powerpc}/pgalloc-64.h | 0 .../asm => include/asm-powerpc}/pgalloc.h | 0 .../asm => include/asm-powerpc}/pgtable-4k.h | 0 .../asm => include/asm-powerpc}/pgtable-64k.h | 0 .../asm-powerpc}/pgtable-ppc32.h | 0 .../asm-powerpc}/pgtable-ppc64.h | 2 +- .../asm => include/asm-powerpc}/pgtable.h | 0 .../asm => include/asm-powerpc}/phyp_dump.h | 0 .../asm-powerpc}/pmac_feature.h | 0 .../asm-powerpc}/pmac_low_i2c.h | 0 .../asm => include/asm-powerpc}/pmac_pfunc.h | 0 .../include/asm => include/asm-powerpc}/pmc.h | 0 .../include/asm => include/asm-powerpc}/pmi.h | 0 .../asm => include/asm-powerpc}/poll.h | 0 .../asm => include/asm-powerpc}/posix_types.h | 0 .../asm => include/asm-powerpc}/ppc-pci.h | 0 .../asm => include/asm-powerpc}/ppc4xx.h | 0 .../asm => include/asm-powerpc}/ppc_asm.h | 0 .../asm => include/asm-powerpc}/processor.h | 0 .../asm => include/asm-powerpc}/prom.h | 0 .../include/asm => include/asm-powerpc}/ps3.h | 0 .../asm => include/asm-powerpc}/ps3av.h | 0 .../asm => include/asm-powerpc}/ps3fb.h | 0 .../asm => include/asm-powerpc}/ps3stor.h | 0 .../asm => include/asm-powerpc}/ptrace.h | 0 .../include/asm => include/asm-powerpc}/qe.h | 0 .../asm => include/asm-powerpc}/qe_ic.h | 2 + .../include/asm => include/asm-powerpc}/reg.h | 0 .../asm => include/asm-powerpc}/reg_8xx.h | 0 .../asm => include/asm-powerpc}/reg_booke.h | 0 .../asm => include/asm-powerpc}/reg_fsl_emb.h | 0 .../asm => include/asm-powerpc}/resource.h | 0 .../asm => include/asm-powerpc}/rheap.h | 0 .../include/asm => include/asm-powerpc}/rio.h | 0 .../asm => include/asm-powerpc}/rtas.h | 0 .../include/asm => include/asm-powerpc}/rtc.h | 0 .../asm => include/asm-powerpc}/rwsem.h | 4 +- .../asm => include/asm-powerpc}/scatterlist.h | 0 .../asm => include/asm-powerpc}/seccomp.h | 0 .../asm => include/asm-powerpc}/sections.h | 0 .../asm => include/asm-powerpc}/sembuf.h | 0 .../asm => include/asm-powerpc}/serial.h | 0 .../asm => include/asm-powerpc}/setjmp.h | 0 .../asm => include/asm-powerpc}/setup.h | 0 .../asm => include/asm-powerpc}/shmbuf.h | 0 .../asm => include/asm-powerpc}/shmparam.h | 0 .../asm => include/asm-powerpc}/sigcontext.h | 0 .../asm => include/asm-powerpc}/siginfo.h | 0 .../asm => include/asm-powerpc}/signal.h | 0 .../include/asm => include/asm-powerpc}/smp.h | 0 .../include/asm => include/asm-powerpc}/smu.h | 0 .../asm => include/asm-powerpc}/socket.h | 0 .../asm => include/asm-powerpc}/sockios.h | 0 .../asm => include/asm-powerpc}/sparsemem.h | 0 .../asm => include/asm-powerpc}/spinlock.h | 0 .../asm-powerpc}/spinlock_types.h | 0 .../include/asm => include/asm-powerpc}/spu.h | 0 .../asm => include/asm-powerpc}/spu_csa.h | 0 .../asm => include/asm-powerpc}/spu_info.h | 0 .../asm => include/asm-powerpc}/spu_priv1.h | 0 .../asm => include/asm-powerpc}/sstep.h | 0 .../asm => include/asm-powerpc}/stat.h | 0 .../asm => include/asm-powerpc}/statfs.h | 0 .../asm => include/asm-powerpc}/string.h | 0 .../asm => include/asm-powerpc}/suspend.h | 0 .../asm => include/asm-powerpc}/synch.h | 0 .../asm => include/asm-powerpc}/syscall.h | 0 .../asm => include/asm-powerpc}/syscalls.h | 0 .../asm => include/asm-powerpc}/systbl.h | 0 .../asm => include/asm-powerpc}/system.h | 0 .../include/asm => include/asm-powerpc}/tce.h | 0 .../asm => include/asm-powerpc}/termbits.h | 0 .../asm => include/asm-powerpc}/termios.h | 0 .../asm => include/asm-powerpc}/thread_info.h | 0 .../asm => include/asm-powerpc}/time.h | 0 .../asm => include/asm-powerpc}/timex.h | 0 .../include/asm => include/asm-powerpc}/tlb.h | 0 .../asm => include/asm-powerpc}/tlbflush.h | 0 .../asm => include/asm-powerpc}/topology.h | 0 .../asm => include/asm-powerpc}/tsi108.h | 0 .../asm => include/asm-powerpc}/tsi108_irq.h | 0 .../asm => include/asm-powerpc}/tsi108_pci.h | 0 .../asm => include/asm-powerpc}/types.h | 0 .../asm => include/asm-powerpc}/uaccess.h | 0 .../include/asm => include/asm-powerpc}/ucc.h | 0 .../asm => include/asm-powerpc}/ucc_fast.h | 2 + .../asm => include/asm-powerpc}/ucc_slow.h | 0 .../asm => include/asm-powerpc}/ucontext.h | 0 .../asm => include/asm-powerpc}/udbg.h | 0 .../include/asm => include/asm-powerpc}/uic.h | 2 + .../asm => include/asm-powerpc}/unaligned.h | 0 .../asm => include/asm-powerpc}/uninorth.h | 0 .../asm => include/asm-powerpc}/unistd.h | 0 .../asm => include/asm-powerpc}/user.h | 0 .../asm => include/asm-powerpc}/vdso.h | 0 .../asm-powerpc}/vdso_datapage.h | 0 .../include/asm => include/asm-powerpc}/vga.h | 0 .../include/asm => include/asm-powerpc}/vio.h | 0 .../asm => include/asm-powerpc}/xilinx_intc.h | 0 .../asm => include/asm-powerpc}/xmon.h | 0 .../include/asm => include/asm-powerpc}/xor.h | 0 .../include/asm => include/asm-s390}/Kbuild | 0 .../include/asm => include/asm-s390}/airq.h | 0 .../asm => include/asm-s390}/appldata.h | 0 .../include/asm => include/asm-s390}/atomic.h | 0 .../include/asm => include/asm-s390}/auxvec.h | 0 .../include/asm => include/asm-s390}/bitops.h | 0 .../include/asm => include/asm-s390}/bug.h | 0 .../include/asm => include/asm-s390}/bugs.h | 0 .../asm => include/asm-s390}/byteorder.h | 0 .../include/asm => include/asm-s390}/cache.h | 0 .../asm => include/asm-s390}/cacheflush.h | 0 .../include/asm => include/asm-s390}/ccwdev.h | 0 .../asm => include/asm-s390}/ccwgroup.h | 0 .../asm => include/asm-s390}/checksum.h | 0 .../include/asm => include/asm-s390}/chpid.h | 0 .../include/asm => include/asm-s390}/chsc.h | 0 .../include/asm => include/asm-s390}/cio.h | 0 .../include/asm => include/asm-s390}/cmb.h | 0 .../include/asm => include/asm-s390}/compat.h | 0 .../include/asm => include/asm-s390}/cpcmd.h | 0 .../include/asm => include/asm-s390}/cpu.h | 0 .../asm => include/asm-s390}/cputime.h | 0 .../asm => include/asm-s390}/current.h | 0 .../include/asm => include/asm-s390}/dasd.h | 0 .../include/asm => include/asm-s390}/debug.h | 0 .../include/asm => include/asm-s390}/delay.h | 0 .../include/asm => include/asm-s390}/device.h | 0 .../include/asm => include/asm-s390}/diag.h | 0 .../include/asm => include/asm-s390}/div64.h | 0 .../include/asm => include/asm-s390}/dma.h | 0 .../include/asm => include/asm-s390}/ebcdic.h | 0 .../include/asm => include/asm-s390}/elf.h | 0 .../asm-s390}/emergency-restart.h | 0 .../include/asm => include/asm-s390}/errno.h | 0 .../include/asm => include/asm-s390}/etr.h | 0 .../include/asm => include/asm-s390}/extmem.h | 0 .../include/asm => include/asm-s390}/fb.h | 0 .../include/asm => include/asm-s390}/fcntl.h | 0 .../include/asm => include/asm-s390}/fcx.h | 0 .../include/asm => include/asm-s390}/futex.h | 0 .../asm => include/asm-s390}/hardirq.h | 0 .../asm => include/asm-s390}/hugetlb.h | 0 .../include/asm => include/asm-s390}/idals.h | 0 .../include/asm => include/asm-s390}/io.h | 0 .../include/asm => include/asm-s390}/ioctl.h | 0 .../include/asm => include/asm-s390}/ioctls.h | 0 .../include/asm => include/asm-s390}/ipcbuf.h | 0 .../include/asm => include/asm-s390}/ipl.h | 0 .../include/asm => include/asm-s390}/irq.h | 0 .../asm => include/asm-s390}/irq_regs.h | 0 .../asm => include/asm-s390}/irqflags.h | 0 .../include/asm => include/asm-s390}/isc.h | 0 .../include/asm => include/asm-s390}/itcw.h | 0 .../include/asm => include/asm-s390}/kdebug.h | 0 .../include/asm => include/asm-s390}/kexec.h | 0 .../asm => include/asm-s390}/kmap_types.h | 0 .../asm => include/asm-s390}/kprobes.h | 0 .../include/asm => include/asm-s390}/kvm.h | 0 .../asm => include/asm-s390}/kvm_host.h | 0 .../asm => include/asm-s390}/kvm_para.h | 0 .../asm => include/asm-s390}/kvm_virtio.h | 0 .../asm => include/asm-s390}/linkage.h | 0 .../include/asm => include/asm-s390}/local.h | 0 .../asm => include/asm-s390}/lowcore.h | 0 .../asm => include/asm-s390}/mathemu.h | 0 .../include/asm => include/asm-s390}/mman.h | 0 .../include/asm => include/asm-s390}/mmu.h | 0 .../asm => include/asm-s390}/mmu_context.h | 0 .../include/asm => include/asm-s390}/module.h | 0 .../asm => include/asm-s390}/monwriter.h | 0 .../include/asm => include/asm-s390}/msgbuf.h | 0 .../include/asm => include/asm-s390}/mutex.h | 0 .../include/asm => include/asm-s390}/page.h | 0 .../include/asm => include/asm-s390}/param.h | 0 .../include/asm => include/asm-s390}/pci.h | 0 .../include/asm => include/asm-s390}/percpu.h | 0 .../asm => include/asm-s390}/pgalloc.h | 0 .../asm => include/asm-s390}/pgtable.h | 0 .../include/asm => include/asm-s390}/poll.h | 0 .../asm => include/asm-s390}/posix_types.h | 0 .../asm => include/asm-s390}/processor.h | 0 .../include/asm => include/asm-s390}/ptrace.h | 0 .../include/asm => include/asm-s390}/qdio.h | 0 .../include/asm => include/asm-s390}/qeth.h | 0 .../include/asm => include/asm-s390}/reset.h | 0 .../asm => include/asm-s390}/resource.h | 0 .../include/asm => include/asm-s390}/rwsem.h | 0 .../asm => include/asm-s390}/s390_ext.h | 0 .../asm => include/asm-s390}/s390_rdev.h | 0 .../asm => include/asm-s390}/scatterlist.h | 0 .../include/asm => include/asm-s390}/schid.h | 0 .../include/asm => include/asm-s390}/sclp.h | 0 .../asm => include/asm-s390}/sections.h | 0 .../asm => include/asm-s390}/segment.h | 0 .../include/asm => include/asm-s390}/sembuf.h | 0 .../include/asm => include/asm-s390}/setup.h | 0 .../asm => include/asm-s390}/sfp-machine.h | 0 .../asm => include/asm-s390}/sfp-util.h | 0 .../include/asm => include/asm-s390}/shmbuf.h | 0 .../asm => include/asm-s390}/shmparam.h | 0 .../asm => include/asm-s390}/sigcontext.h | 0 .../asm => include/asm-s390}/siginfo.h | 0 .../include/asm => include/asm-s390}/signal.h | 0 .../include/asm => include/asm-s390}/sigp.h | 0 .../include/asm => include/asm-s390}/smp.h | 0 .../include/asm => include/asm-s390}/socket.h | 0 .../asm => include/asm-s390}/sockios.h | 0 .../asm => include/asm-s390}/sparsemem.h | 0 .../asm => include/asm-s390}/spinlock.h | 0 .../asm => include/asm-s390}/spinlock_types.h | 0 .../include/asm => include/asm-s390}/stat.h | 0 .../include/asm => include/asm-s390}/statfs.h | 0 .../include/asm => include/asm-s390}/string.h | 0 .../asm => include/asm-s390}/suspend.h | 0 .../asm => include/asm-s390}/sysinfo.h | 0 .../include/asm => include/asm-s390}/system.h | 0 .../asm => include/asm-s390}/tape390.h | 0 .../asm => include/asm-s390}/termbits.h | 0 .../asm => include/asm-s390}/termios.h | 0 .../asm => include/asm-s390}/thread_info.h | 0 .../include/asm => include/asm-s390}/timer.h | 0 .../include/asm => include/asm-s390}/timex.h | 0 .../include/asm => include/asm-s390}/tlb.h | 0 .../asm => include/asm-s390}/tlbflush.h | 0 .../include/asm => include/asm-s390}/todclk.h | 0 .../asm => include/asm-s390}/topology.h | 0 .../include/asm => include/asm-s390}/types.h | 0 .../asm => include/asm-s390}/uaccess.h | 0 .../asm => include/asm-s390}/ucontext.h | 0 .../asm => include/asm-s390}/unaligned.h | 0 .../include/asm => include/asm-s390}/unistd.h | 0 .../include/asm => include/asm-s390}/user.h | 0 .../include/asm => include/asm-s390}/vtoc.h | 0 .../include/asm => include/asm-s390}/xor.h | 0 .../include/asm => include/asm-s390}/zcrypt.h | 0 trunk/include/linux/buffer_head.h | 8 +- trunk/include/linux/ide.h | 40 +- trunk/include/linux/ieee80211.h | 13 - trunk/include/linux/ihex.h | 2 +- trunk/include/linux/interrupt.h | 29 + trunk/include/linux/kexec.h | 4 +- trunk/include/linux/mISDNif.h | 32 +- trunk/include/linux/maple.h | 8 +- trunk/include/linux/netdevice.h | 4 +- trunk/include/linux/page-flags.h | 2 +- trunk/include/linux/pagemap.h | 67 +- trunk/include/linux/parser.h | 2 +- trunk/include/linux/pm_qos_params.h | 2 +- trunk/include/linux/spi/orion_spi.h | 17 - trunk/include/linux/tracehook.h | 5 +- trunk/include/linux/vt_kern.h | 1 - trunk/include/net/dst.h | 12 +- trunk/include/net/flow.h | 1 + trunk/include/net/mac80211.h | 13 +- trunk/include/net/sch_generic.h | 26 +- trunk/include/net/sctp/structs.h | 3 +- trunk/include/video/radeon.h | 5 +- trunk/init/main.c | 1 + trunk/kernel/auditsc.c | 7 - trunk/kernel/dma-coherent.c | 5 +- trunk/kernel/irq/manage.c | 3 +- trunk/kernel/pm_qos_params.c | 16 +- trunk/kernel/relay.c | 12 +- trunk/kernel/sched.c | 22 +- trunk/kernel/semaphore.c | 4 +- trunk/mm/filemap.c | 12 +- trunk/mm/memory.c | 18 +- trunk/mm/migrate.c | 4 +- trunk/mm/mlock.c | 2 + trunk/mm/mm_init.c | 8 +- trunk/mm/mmap.c | 2 +- trunk/mm/nommu.c | 21 - trunk/mm/rmap.c | 2 +- trunk/mm/shmem.c | 4 +- trunk/mm/swap.c | 2 +- trunk/mm/swap_state.c | 8 +- trunk/mm/swapfile.c | 2 +- trunk/mm/truncate.c | 4 +- trunk/mm/vmscan.c | 4 +- trunk/net/ax25/sysctl_net_ax25.c | 14 +- trunk/net/bridge/br_netfilter.c | 2 +- trunk/net/bridge/br_stp.c | 25 +- trunk/net/core/dev.c | 32 +- trunk/net/core/neighbour.c | 13 +- trunk/net/core/pktgen.c | 10 +- trunk/net/ipv4/sysctl_net_ipv4.c | 1 - trunk/net/ipv6/ip6_output.c | 2 +- trunk/net/ipv6/ipv6_sockglue.c | 2 - trunk/net/ipv6/syncookies.c | 22 +- trunk/net/mac80211/ieee80211_i.h | 2 - trunk/net/mac80211/main.c | 5 - trunk/net/mac80211/mlme.c | 39 +- trunk/net/mac80211/tx.c | 17 +- trunk/net/mac80211/util.c | 1 - trunk/net/mac80211/wme.c | 6 +- trunk/net/rfkill/rfkill-input.c | 54 +- trunk/net/rfkill/rfkill.c | 15 +- trunk/net/sched/sch_atm.c | 14 +- trunk/net/sched/sch_cbq.c | 27 +- trunk/net/sched/sch_dsmark.c | 10 +- trunk/net/sched/sch_generic.c | 12 +- trunk/net/sched/sch_hfsc.c | 12 +- trunk/net/sched/sch_htb.c | 24 +- trunk/net/sched/sch_netem.c | 5 +- trunk/net/sched/sch_prio.c | 14 +- trunk/net/sched/sch_red.c | 2 +- trunk/net/sched/sch_sfq.c | 8 +- trunk/net/sched/sch_tbf.c | 3 +- trunk/net/sctp/ipv6.c | 8 +- trunk/net/sctp/output.c | 6 +- trunk/net/sctp/protocol.c | 9 +- trunk/scripts/kconfig/conf.c | 2 +- trunk/scripts/kconfig/confdata.c | 8 +- trunk/scripts/kernel-doc | 2 +- trunk/sound/core/seq/oss/seq_oss_synth.c | 3 - 705 files changed, 3414 insertions(+), 5272 deletions(-) delete mode 100644 trunk/Documentation/DocBook/sh.tmpl create mode 100644 trunk/Documentation/cli-sti-removal.txt create mode 100644 trunk/arch/sh/include/asm/a.out.h delete mode 100644 trunk/arch/sh/include/asm/seccomp.h delete mode 100644 trunk/arch/sh/include/cpu-sh2a/cpu/addrspace.h delete mode 100644 trunk/arch/sh/include/cpu-sh2a/cpu/cacheflush.h delete mode 100644 trunk/arch/sh/mm/cache-sh2a.c rename trunk/drivers/net/wireless/iwlwifi/{iwl-agn-rs.c => iwl-4965-rs.c} (89%) rename trunk/drivers/net/wireless/iwlwifi/{iwl-agn-rs.h => iwl-4965-rs.h} (93%) rename trunk/drivers/net/wireless/iwlwifi/{iwl-agn.c => iwl4965-base.c} (96%) delete mode 100644 trunk/drivers/spi/orion_spi.c rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/8253pit.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/8xx_immap.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/Kbuild (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/a.out.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/abs_addr.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/agp.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/asm-compat.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/atomic.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/auxvec.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/backlight.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/bitops.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/bootx.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/btext.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/bug.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/bugs.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/byteorder.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/cache.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/cacheflush.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/cell-pmu.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/cell-regs.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/checksum.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/clk_interface.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/code-patching.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/compat.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/cpm.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/cpm1.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/cpm2.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/cputable.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/cputhreads.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/cputime.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/current.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/dbdma.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/dcr-generic.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/dcr-mmio.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/dcr-native.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/dcr-regs.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/dcr.h (94%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/delay.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/device.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/div64.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/dma-mapping.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/dma.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/edac.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/eeh.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/eeh_event.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/elf.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/emergency-restart.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/errno.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/exception.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/fb.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/fcntl.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/feature-fixups.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/firmware.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/fixmap.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/floppy.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/fs_pd.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/fsl_gtm.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/fsl_lbc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ftrace.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/futex.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/gpio.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/grackle.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/hardirq.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/heathrow.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/highmem.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/hugetlb.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/hvcall.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/hvconsole.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/hvcserver.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/hw_irq.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/hydra.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/i8259.h (71%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ibmebus.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ide.h (98%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/immap_86xx.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/immap_cpm2.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/immap_qe.h (99%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/io-defs.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/io.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ioctl.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ioctls.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iommu.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ipcbuf.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ipic.h (93%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/irq.h (58%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/irq_regs.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/irqflags.h (93%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/alpaca.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/hv_call.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/hv_call_event.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/hv_call_sc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/hv_call_xm.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/hv_lp_config.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/hv_lp_event.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/hv_types.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/iommu.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/it_lp_queue.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/lpar_map.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/mf.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/iseries/vio.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kdebug.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kdump.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kexec.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/keylargo.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kgdb.h (98%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kmap_types.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kprobes.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kvm.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kvm_asm.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kvm_host.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kvm_para.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/kvm_ppc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/libata-portmap.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/linkage.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/lmb.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/local.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/lppaca.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/lv1call.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/machdep.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/macio.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mc146818rtc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mediabay.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mman.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mmu-40x.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mmu-44x.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mmu-8xx.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mmu-fsl-booke.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mmu-hash32.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mmu-hash64.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mmu.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mmu_context.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mmzone.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/module.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mpc512x.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mpc52xx.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mpc52xx_psc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mpc6xx.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mpc8260.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mpc86xx.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mpc8xx.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mpic.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/msgbuf.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/mutex.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/nvram.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/of_device.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/of_platform.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ohare.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/oprofile_impl.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pSeries_reconfig.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/paca.h (99%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/page.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/page_32.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/page_64.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/param.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/parport.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pasemi_dma.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pci-bridge.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pci.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/percpu.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pgalloc-32.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pgalloc-64.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pgalloc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pgtable-4k.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pgtable-64k.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pgtable-ppc32.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pgtable-ppc64.h (99%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pgtable.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/phyp_dump.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pmac_feature.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pmac_low_i2c.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pmac_pfunc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pmc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/pmi.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/poll.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/posix_types.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ppc-pci.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ppc4xx.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ppc_asm.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/processor.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/prom.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ps3.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ps3av.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ps3fb.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ps3stor.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ptrace.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/qe.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/qe_ic.h (99%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/reg.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/reg_8xx.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/reg_booke.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/reg_fsl_emb.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/resource.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/rheap.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/rio.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/rtas.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/rtc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/rwsem.h (96%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/scatterlist.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/seccomp.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/sections.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/sembuf.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/serial.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/setjmp.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/setup.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/shmbuf.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/shmparam.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/sigcontext.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/siginfo.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/signal.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/smp.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/smu.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/socket.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/sockios.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/sparsemem.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/spinlock.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/spinlock_types.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/spu.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/spu_csa.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/spu_info.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/spu_priv1.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/sstep.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/stat.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/statfs.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/string.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/suspend.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/synch.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/syscall.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/syscalls.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/systbl.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/system.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/tce.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/termbits.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/termios.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/thread_info.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/time.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/timex.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/tlb.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/tlbflush.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/topology.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/tsi108.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/tsi108_irq.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/tsi108_pci.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/types.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/uaccess.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ucc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ucc_fast.h (99%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ucc_slow.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/ucontext.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/udbg.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/uic.h (95%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/unaligned.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/uninorth.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/unistd.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/user.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/vdso.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/vdso_datapage.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/vga.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/vio.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/xilinx_intc.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/xmon.h (100%) rename trunk/{arch/powerpc/include/asm => include/asm-powerpc}/xor.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/Kbuild (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/airq.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/appldata.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/atomic.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/auxvec.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/bitops.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/bug.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/bugs.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/byteorder.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/cache.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/cacheflush.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/ccwdev.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/ccwgroup.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/checksum.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/chpid.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/chsc.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/cio.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/cmb.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/compat.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/cpcmd.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/cpu.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/cputime.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/current.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/dasd.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/debug.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/delay.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/device.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/diag.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/div64.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/dma.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/ebcdic.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/elf.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/emergency-restart.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/errno.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/etr.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/extmem.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/fb.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/fcntl.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/fcx.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/futex.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/hardirq.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/hugetlb.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/idals.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/io.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/ioctl.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/ioctls.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/ipcbuf.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/ipl.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/irq.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/irq_regs.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/irqflags.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/isc.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/itcw.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/kdebug.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/kexec.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/kmap_types.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/kprobes.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/kvm.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/kvm_host.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/kvm_para.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/kvm_virtio.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/linkage.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/local.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/lowcore.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/mathemu.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/mman.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/mmu.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/mmu_context.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/module.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/monwriter.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/msgbuf.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/mutex.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/page.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/param.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/pci.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/percpu.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/pgalloc.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/pgtable.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/poll.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/posix_types.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/processor.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/ptrace.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/qdio.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/qeth.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/reset.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/resource.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/rwsem.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/s390_ext.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/s390_rdev.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/scatterlist.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/schid.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/sclp.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/sections.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/segment.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/sembuf.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/setup.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/sfp-machine.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/sfp-util.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/shmbuf.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/shmparam.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/sigcontext.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/siginfo.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/signal.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/sigp.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/smp.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/socket.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/sockios.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/sparsemem.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/spinlock.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/spinlock_types.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/stat.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/statfs.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/string.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/suspend.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/sysinfo.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/system.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/tape390.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/termbits.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/termios.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/thread_info.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/timer.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/timex.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/tlb.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/tlbflush.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/todclk.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/topology.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/types.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/uaccess.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/ucontext.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/unaligned.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/unistd.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/user.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/vtoc.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/xor.h (100%) rename trunk/{arch/s390/include/asm => include/asm-s390}/zcrypt.h (100%) delete mode 100644 trunk/include/linux/spi/orion_spi.h diff --git a/[refs] b/[refs] index 8dcc23b3be38..6edc15ba7d82 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8bc5fb6abb670fa9079cd1994f016a39f99698fe +refs/heads/master: 9b3cbf725fb98733976fd02e2e557f0ae3028df0 diff --git a/trunk/Documentation/00-INDEX b/trunk/Documentation/00-INDEX index 5b5aba404aac..6de71308a906 100644 --- a/trunk/Documentation/00-INDEX +++ b/trunk/Documentation/00-INDEX @@ -89,6 +89,8 @@ cciss.txt - info, major/minor #'s for Compaq's SMART Array Controllers. cdrom/ - directory with information on the CD-ROM drivers that Linux has. +cli-sti-removal.txt + - cli()/sti() removal guide. computone.txt - info on Computone Intelliport II/Plus Multiport Serial Driver. connector/ diff --git a/trunk/Documentation/DocBook/Makefile b/trunk/Documentation/DocBook/Makefile index 1d1b34500b69..0eb0d027eb32 100644 --- a/trunk/Documentation/DocBook/Makefile +++ b/trunk/Documentation/DocBook/Makefile @@ -12,7 +12,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ - mac80211.xml debugobjects.xml sh.xml + mac80211.xml debugobjects.xml ### # The build process is as follows (targets): diff --git a/trunk/Documentation/DocBook/s390-drivers.tmpl b/trunk/Documentation/DocBook/s390-drivers.tmpl index 95bfc12e5439..4acc73240a6d 100644 --- a/trunk/Documentation/DocBook/s390-drivers.tmpl +++ b/trunk/Documentation/DocBook/s390-drivers.tmpl @@ -100,7 +100,7 @@ the hardware structures represented here, please consult the Principles of Operation. -!Iarch/s390/include/asm/cio.h +!Iinclude/asm-s390/cio.h ccw devices @@ -114,7 +114,7 @@ ccw device structure. Device drivers must not bypass those functions or strange side effects may happen. -!Iarch/s390/include/asm/ccwdev.h +!Iinclude/asm-s390/ccwdev.h !Edrivers/s390/cio/device.c !Edrivers/s390/cio/device_ops.c @@ -125,7 +125,7 @@ measurement data which is made available by the channel subsystem for each channel attached device. -!Iarch/s390/include/asm/cmb.h +!Iinclude/asm-s390/cmb.h !Edrivers/s390/cio/cmf.c @@ -142,7 +142,7 @@ ccw group devices -!Iarch/s390/include/asm/ccwgroup.h +!Iinclude/asm-s390/ccwgroup.h !Edrivers/s390/cio/ccwgroup.c diff --git a/trunk/Documentation/DocBook/sh.tmpl b/trunk/Documentation/DocBook/sh.tmpl deleted file mode 100644 index 0c3dc4c69dd1..000000000000 --- a/trunk/Documentation/DocBook/sh.tmpl +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - SuperH Interfaces Guide - - - - Paul - Mundt - -
- lethal@linux-sh.org -
-
-
-
- - - 2008 - Paul Mundt - - - 2008 - Renesas Technology Corp. - - - - - This documentation is free software; you can redistribute - it and/or modify it under the terms of the GNU General Public - License version 2 as published by the Free Software Foundation. - - - - 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., 59 Temple Place, Suite 330, Boston, - MA 02111-1307 USA - - - - For more details see the file COPYING in the source - distribution of Linux. - - -
- - - - - Memory Management - - SH-4 - - Store Queue API -!Earch/sh/kernel/cpu/sh4/sq.c - - - - SH-5 - - TLB Interfaces -!Iarch/sh/mm/tlb-sh5.c -!Iarch/sh/include/asm/tlb_64.h - - - - - Clock Framework Extensions -!Iarch/sh/include/asm/clock.h - - - Machine Specific Interfaces - - mach-dreamcast -!Iarch/sh/boards/mach-dreamcast/rtc.c - - - mach-x3proto -!Earch/sh/boards/mach-x3proto/ilsel.c - - - - Busses - - SuperHyway -!Edrivers/sh/superhyway/superhyway.c - - - - Maple -!Edrivers/sh/maple/maple.c - - -
diff --git a/trunk/Documentation/DocBook/videobook.tmpl b/trunk/Documentation/DocBook/videobook.tmpl index 0bc25949b668..89817795e668 100644 --- a/trunk/Documentation/DocBook/videobook.tmpl +++ b/trunk/Documentation/DocBook/videobook.tmpl @@ -1648,7 +1648,7 @@ static struct video_buffer capture_fb; Public Functions Provided -!Edrivers/media/video/v4l2-dev.c +!Edrivers/media/video/videodev.c diff --git a/trunk/Documentation/cli-sti-removal.txt b/trunk/Documentation/cli-sti-removal.txt new file mode 100644 index 000000000000..60932b02fcb3 --- /dev/null +++ b/trunk/Documentation/cli-sti-removal.txt @@ -0,0 +1,133 @@ + +#### cli()/sti() removal guide, started by Ingo Molnar + + +as of 2.5.28, five popular macros have been removed on SMP, and +are being phased out on UP: + + cli(), sti(), save_flags(flags), save_flags_cli(flags), restore_flags(flags) + +until now it was possible to protect driver code against interrupt +handlers via a cli(), but from now on other, more lightweight methods +have to be used for synchronization, such as spinlocks or semaphores. + +for example, driver code that used to do something like: + + struct driver_data; + + irq_handler (...) + { + .... + driver_data.finish = 1; + driver_data.new_work = 0; + .... + } + + ... + + ioctl_func (...) + { + ... + cli(); + ... + driver_data.finish = 0; + driver_data.new_work = 2; + ... + sti(); + ... + } + +was SMP-correct because the cli() function ensured that no +interrupt handler (amongst them the above irq_handler()) function +would execute while the cli()-ed section is executing. + +but from now on a more direct method of locking has to be used: + + DEFINE_SPINLOCK(driver_lock); + struct driver_data; + + irq_handler (...) + { + unsigned long flags; + .... + spin_lock_irqsave(&driver_lock, flags); + .... + driver_data.finish = 1; + driver_data.new_work = 0; + .... + spin_unlock_irqrestore(&driver_lock, flags); + .... + } + + ... + + ioctl_func (...) + { + ... + spin_lock_irq(&driver_lock); + ... + driver_data.finish = 0; + driver_data.new_work = 2; + ... + spin_unlock_irq(&driver_lock); + ... + } + +the above code has a number of advantages: + +- the locking relation is easier to understand - actual lock usage + pinpoints the critical sections. cli() usage is too opaque. + Easier to understand means it's easier to debug. + +- it's faster, because spinlocks are faster to acquire than the + potentially heavily-used IRQ lock. Furthermore, your driver does + not have to wait eg. for a big heavy SCSI interrupt to finish, + because the driver_lock spinlock is only used by your driver. + cli() on the other hand was used by many drivers, and extended + the critical section to the whole IRQ handler function - creating + serious lock contention. + + +to make the transition easier, we've still kept the cli(), sti(), +save_flags(), save_flags_cli() and restore_flags() macros defined +on UP systems - but their usage will be phased out until 2.6 is +released. + +drivers that want to disable local interrupts (interrupts on the +current CPU), can use the following five macros: + + local_irq_disable(), local_irq_enable(), local_save_flags(flags), + local_irq_save(flags), local_irq_restore(flags) + +but beware, their meaning and semantics are much simpler, far from +that of the old cli(), sti(), save_flags(flags) and restore_flags(flags) +SMP meaning: + + local_irq_disable() => turn local IRQs off + + local_irq_enable() => turn local IRQs on + + local_save_flags(flags) => save the current IRQ state into flags. The + state can be on or off. (on some + architectures there's even more bits in it.) + + local_irq_save(flags) => save the current IRQ state into flags and + disable interrupts. + + local_irq_restore(flags) => restore the IRQ state from flags. + +(local_irq_save can save both irqs on and irqs off state, and +local_irq_restore can restore into both irqs on and irqs off state.) + +another related change is that synchronize_irq() now takes a parameter: +synchronize_irq(irq). This change too has the purpose of making SMP +synchronization more lightweight - this way you can wait for your own +interrupt handler to finish, no need to wait for other IRQ sources. + + +why were these changes done? The main reason was the architectural burden +of maintaining the cli()/sti() interface - it became a real problem. The +new interrupt system is much more streamlined, easier to understand, debug, +and it's also a bit faster - the same happened to it that will happen to +cli()/sti() using drivers once they convert to spinlocks :-) + diff --git a/trunk/Documentation/power/pm_qos_interface.txt b/trunk/Documentation/power/pm_qos_interface.txt index c40866e8b957..49adb1a33514 100644 --- a/trunk/Documentation/power/pm_qos_interface.txt +++ b/trunk/Documentation/power/pm_qos_interface.txt @@ -1,4 +1,4 @@ -PM Quality Of Service Interface. +PM quality of Service interface. This interface provides a kernel and user mode interface for registering performance expectations by drivers, subsystems and user space applications on @@ -7,11 +7,6 @@ one of the parameters. Currently we have {cpu_dma_latency, network_latency, network_throughput} as the initial set of pm_qos parameters. -Each parameters have defined units: - * latency: usec - * timeout: usec - * throughput: kbs (kilo bit / sec) - The infrastructure exposes multiple misc device nodes one per implemented parameter. The set of parameters implement is defined by pm_qos_power_init() and pm_qos_params.h. This is done because having the available parameters diff --git a/trunk/Documentation/powerpc/booting-without-of.txt b/trunk/Documentation/powerpc/booting-without-of.txt index de4063cb4fdc..928a79ceb7aa 100644 --- a/trunk/Documentation/powerpc/booting-without-of.txt +++ b/trunk/Documentation/powerpc/booting-without-of.txt @@ -278,7 +278,7 @@ it with special cases. a 64-bit platform. d) request and get assigned a platform number (see PLATFORM_* - constants in arch/powerpc/include/asm/processor.h + constants in include/asm-powerpc/processor.h 32-bit embedded kernels: @@ -340,7 +340,7 @@ the block to RAM before passing it to the kernel. --------- The kernel is entered with r3 pointing to an area of memory that is - roughly described in arch/powerpc/include/asm/prom.h by the structure + roughly described in include/asm-powerpc/prom.h by the structure boot_param_header: struct boot_param_header { diff --git a/trunk/Documentation/powerpc/eeh-pci-error-recovery.txt b/trunk/Documentation/powerpc/eeh-pci-error-recovery.txt index 9d4e33df624c..df7afe43d462 100644 --- a/trunk/Documentation/powerpc/eeh-pci-error-recovery.txt +++ b/trunk/Documentation/powerpc/eeh-pci-error-recovery.txt @@ -133,7 +133,7 @@ error. Given an arbitrary address, the routine pci_get_device_by_addr() will find the pci device associated with that address (if any). -The default arch/powerpc/include/asm/io.h macros readb(), inb(), insb(), +The default include/asm-powerpc/io.h macros readb(), inb(), insb(), etc. include a check to see if the i/o read returned all-0xff's. If so, these make a call to eeh_dn_check_failure(), which in turn asks the firmware if the all-ff's value is the sign of a true EEH diff --git a/trunk/Makefile b/trunk/Makefile index ea413fa03e4e..f156f40d6334 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 27 -EXTRAVERSION = -rc2 +EXTRAVERSION = -rc1 NAME = Rotary Wombat # *DOCUMENTATION* diff --git a/trunk/arch/ia64/kernel/ivt.S b/trunk/arch/ia64/kernel/ivt.S index c39627df3cde..416a952b19bd 100644 --- a/trunk/arch/ia64/kernel/ivt.S +++ b/trunk/arch/ia64/kernel/ivt.S @@ -1243,11 +1243,11 @@ ENTRY(speculation_vector) add r17=r17,r18 // now add the offset ;; - MOV_FROM_IIP(r17) + MOV_TO_IIP(r17, r19) dep r16=0,r16,41,2 // clear EI ;; - MOV_FROM_IPSR(p0, r16) + MOV_TO_IPSR(p0, r16, r19) ;; RFI diff --git a/trunk/arch/m68k/mac/baboon.c b/trunk/arch/m68k/mac/baboon.c index c7b25b0aacff..dae9c982aa89 100644 --- a/trunk/arch/m68k/mac/baboon.c +++ b/trunk/arch/m68k/mac/baboon.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/m68k/mac/via.c b/trunk/arch/m68k/mac/via.c index 1bdb03c73c0f..f3b27d04a31f 100644 --- a/trunk/arch/m68k/mac/via.c +++ b/trunk/arch/m68k/mac/via.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/mips/emma2rh/markeins/setup.c b/trunk/arch/mips/emma2rh/markeins/setup.c index 822a20e21fa4..a56c4b804b07 100644 --- a/trunk/arch/mips/emma2rh/markeins/setup.c +++ b/trunk/arch/mips/emma2rh/markeins/setup.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include /* for HZ */ #include diff --git a/trunk/arch/mips/jazz/setup.c b/trunk/arch/mips/jazz/setup.c index b59ba6b93cdd..f60524e8bc44 100644 --- a/trunk/arch/mips/jazz/setup.c +++ b/trunk/arch/mips/jazz/setup.c @@ -10,6 +10,7 @@ * Copyright (C) 2007 by Thomas Bogendoerfer */ #include +#include #include #include #include @@ -17,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/mn10300/kernel/module.c b/trunk/arch/mn10300/kernel/module.c index 8fa36893df7a..0e4d2f6fa6e8 100644 --- a/trunk/arch/mn10300/kernel/module.c +++ b/trunk/arch/mn10300/kernel/module.c @@ -24,7 +24,6 @@ #include #include #include -#include #if 0 #define DEBUGP printk @@ -196,7 +195,7 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) { - return module_bug_finalize(hdr, sechdrs, me); + return 0; } /* @@ -204,5 +203,4 @@ int module_finalize(const Elf_Ehdr *hdr, */ void module_arch_cleanup(struct module *mod) { - module_bug_cleanup(mod); } diff --git a/trunk/arch/powerpc/Kconfig.debug b/trunk/arch/powerpc/Kconfig.debug index 4ebc52a19f0a..8c8aadbe9563 100644 --- a/trunk/arch/powerpc/Kconfig.debug +++ b/trunk/arch/powerpc/Kconfig.debug @@ -97,7 +97,7 @@ config IRQSTACKS config VIRQ_DEBUG bool "Expose hardware/virtual IRQ mapping via debugfs" - depends on DEBUG_FS + depends on DEBUG_FS && PPC_MERGE help This option will show the mapping relationship between hardware irq numbers and virtual irq numbers. The mapping is exposed via debugfs diff --git a/trunk/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/trunk/arch/powerpc/boot/dts/mpc8610_hpcd.dts index 3b3a1062cb25..666185f59459 100644 --- a/trunk/arch/powerpc/boot/dts/mpc8610_hpcd.dts +++ b/trunk/arch/powerpc/boot/dts/mpc8610_hpcd.dts @@ -202,11 +202,6 @@ fsl,has-rstcr; }; - wdt@e4000 { - compatible = "fsl,mpc8610-wdt"; - reg = <0xe4000 0x100>; - }; - i2s@16000 { compatible = "fsl,mpc8610-ssi"; cell-index = <0>; diff --git a/trunk/arch/powerpc/boot/io.h b/trunk/arch/powerpc/boot/io.h index 7c09f4861fe1..ccaedaec50d5 100644 --- a/trunk/arch/powerpc/boot/io.h +++ b/trunk/arch/powerpc/boot/io.h @@ -6,7 +6,7 @@ /* * Low-level I/O routines. * - * Copied from (which has no copyright) + * Copied from (which has no copyright) */ static inline int in_8(const volatile unsigned char *addr) { diff --git a/trunk/arch/powerpc/kernel/Makefile b/trunk/arch/powerpc/kernel/Makefile index 64f5948ebc9d..1a4094704b1f 100644 --- a/trunk/arch/powerpc/kernel/Makefile +++ b/trunk/arch/powerpc/kernel/Makefile @@ -59,6 +59,8 @@ obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o obj-$(CONFIG_MODULES) += module.o module_$(CONFIG_WORD_SIZE).o obj-$(CONFIG_44x) += cpu_setup_44x.o +ifeq ($(CONFIG_PPC_MERGE),y) + extra-$(CONFIG_PPC_STD_MMU) := head_32.o extra-$(CONFIG_PPC64) := head_64.o extra-$(CONFIG_40x) := head_40x.o @@ -98,6 +100,12 @@ ifneq ($(CONFIG_PPC_INDIRECT_IO),y) obj-y += iomap.o endif +else +# stuff used from here for ARCH=ppc +smpobj-$(CONFIG_SMP) += smp.o + +endif + obj-$(CONFIG_PPC64) += $(obj64-y) extra-$(CONFIG_PPC_FPU) += fpu.o @@ -113,6 +121,9 @@ PHONY += systbl_chk systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i $(call cmd,systbl_chk) + +ifeq ($(CONFIG_PPC_MERGE),y) + $(obj)/built-in.o: prom_init_check quiet_cmd_prom_init_check = CALL $< @@ -122,4 +133,7 @@ PHONY += prom_init_check prom_init_check: $(src)/prom_init_check.sh $(obj)/prom_init.o $(call cmd,prom_init_check) +endif + + clean-files := vmlinux.lds diff --git a/trunk/arch/powerpc/kernel/cpu_setup_44x.S b/trunk/arch/powerpc/kernel/cpu_setup_44x.S index 80cac984d85d..5465e8de0e61 100644 --- a/trunk/arch/powerpc/kernel/cpu_setup_44x.S +++ b/trunk/arch/powerpc/kernel/cpu_setup_44x.S @@ -39,6 +39,12 @@ _GLOBAL(__setup_cpu_440gx) _GLOBAL(__setup_cpu_440spe) b __fixup_440A_mcheck + /* Temporary fixup for arch/ppc until we kill the whole thing */ +#ifndef CONFIG_PPC_MERGE +_GLOBAL(__fixup_440A_mcheck) + blr +#endif + /* enable APU between CPU and FPU */ _GLOBAL(__init_fpu_44x) mfspr r3,SPRN_CCR0 diff --git a/trunk/arch/powerpc/kernel/irq.c b/trunk/arch/powerpc/kernel/irq.c index d972decf0324..6ac8612da3c3 100644 --- a/trunk/arch/powerpc/kernel/irq.c +++ b/trunk/arch/powerpc/kernel/irq.c @@ -77,12 +77,22 @@ static int ppc_spurious_interrupts; EXPORT_SYMBOL(__irq_offset_value); atomic_t ppc_n_lost_interrupts; +#ifndef CONFIG_PPC_MERGE +#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) +unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; +#endif + #ifdef CONFIG_TAU_INT extern int tau_initialized; extern int tau_interrupts(int); #endif #endif /* CONFIG_PPC32 */ +#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_MERGE) +extern atomic_t ipi_recv; +extern atomic_t ipi_sent; +#endif + #ifdef CONFIG_PPC64 EXPORT_SYMBOL(irq_desc); @@ -206,14 +216,21 @@ int show_interrupts(struct seq_file *p, void *v) skip: spin_unlock_irqrestore(&desc->lock, flags); } else if (i == NR_IRQS) { -#if defined(CONFIG_PPC32) && defined(CONFIG_TAU_INT) +#ifdef CONFIG_PPC32 +#ifdef CONFIG_TAU_INT if (tau_initialized){ seq_puts(p, "TAU: "); for_each_online_cpu(j) seq_printf(p, "%10u ", tau_interrupts(j)); seq_puts(p, " PowerPC Thermal Assist (cpu temp)\n"); } -#endif /* CONFIG_PPC32 && CONFIG_TAU_INT*/ +#endif +#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_MERGE) + /* should this be per processor send/receive? */ + seq_printf(p, "IPI (recv/sent): %10u/%u\n", + atomic_read(&ipi_recv), atomic_read(&ipi_sent)); +#endif +#endif /* CONFIG_PPC32 */ seq_printf(p, "BAD: %10u\n", ppc_spurious_interrupts); } return 0; @@ -437,6 +454,8 @@ void do_softirq(void) * IRQ controller and virtual interrupts */ +#ifdef CONFIG_PPC_MERGE + static LIST_HEAD(irq_hosts); static DEFINE_SPINLOCK(irq_big_lock); static DEFINE_PER_CPU(unsigned int, irq_radix_reader); @@ -1095,6 +1114,8 @@ static int __init irq_debugfs_init(void) __initcall(irq_debugfs_init); #endif /* CONFIG_VIRQ_DEBUG */ +#endif /* CONFIG_PPC_MERGE */ + #ifdef CONFIG_PPC64 static int __init setup_noirqdistrib(char *str) { diff --git a/trunk/arch/powerpc/kernel/process.c b/trunk/arch/powerpc/kernel/process.c index 957bded0020d..e030f3bd5024 100644 --- a/trunk/arch/powerpc/kernel/process.c +++ b/trunk/arch/powerpc/kernel/process.c @@ -276,8 +276,10 @@ int set_dabr(unsigned long dabr) { __get_cpu_var(current_dabr) = dabr; +#ifdef CONFIG_PPC_MERGE /* XXX for now */ if (ppc_md.set_dabr) return ppc_md.set_dabr(dabr); +#endif /* XXX should we have a CPU_FTR_HAS_DABR ? */ #if defined(CONFIG_PPC64) || defined(CONFIG_6xx) diff --git a/trunk/arch/powerpc/kernel/vdso.c b/trunk/arch/powerpc/kernel/vdso.c index 65639a43e644..f177c60ea766 100644 --- a/trunk/arch/powerpc/kernel/vdso.c +++ b/trunk/arch/powerpc/kernel/vdso.c @@ -788,7 +788,9 @@ static int __init vdso_init(void) return 0; } +#ifdef CONFIG_PPC_MERGE arch_initcall(vdso_init); +#endif int in_gate_area_no_task(unsigned long addr) { diff --git a/trunk/arch/powerpc/lib/Makefile b/trunk/arch/powerpc/lib/Makefile index d69912c07ce7..2a88e8b9a3c6 100644 --- a/trunk/arch/powerpc/lib/Makefile +++ b/trunk/arch/powerpc/lib/Makefile @@ -6,10 +6,12 @@ ifeq ($(CONFIG_PPC64),y) EXTRA_CFLAGS += -mno-minimal-toc endif +ifeq ($(CONFIG_PPC_MERGE),y) obj-y := string.o alloc.o \ checksum_$(CONFIG_WORD_SIZE).o obj-$(CONFIG_PPC32) += div64.o copy_32.o crtsavres.o obj-$(CONFIG_HAS_IOMEM) += devres.o +endif obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \ memcpy_64.o usercopy_64.o mem_64.o string.o diff --git a/trunk/arch/powerpc/mm/mem.c b/trunk/arch/powerpc/mm/mem.c index 1c93c255873b..702691cb9e82 100644 --- a/trunk/arch/powerpc/mm/mem.c +++ b/trunk/arch/powerpc/mm/mem.c @@ -311,7 +311,7 @@ void __init paging_init(void) #endif /* CONFIG_HIGHMEM */ printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%lx\n", - (unsigned long long)top_of_ram, total_ram); + (u64)top_of_ram, total_ram); printk(KERN_DEBUG "Memory hole size: %ldMB\n", (long int)((top_of_ram - total_ram) >> 20)); memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); diff --git a/trunk/arch/powerpc/mm/ppc_mmu_32.c b/trunk/arch/powerpc/mm/ppc_mmu_32.c index 6aa120813775..c53145f61942 100644 --- a/trunk/arch/powerpc/mm/ppc_mmu_32.c +++ b/trunk/arch/powerpc/mm/ppc_mmu_32.c @@ -236,8 +236,8 @@ void __init MMU_init_hw(void) Hash_end = (struct hash_pte *) ((unsigned long)Hash + Hash_size); - printk("Total memory = %lldMB; using %ldkB for hash table (at %p)\n", - (unsigned long long)(total_memory >> 20), Hash_size >> 10, Hash); + printk("Total memory = %ldMB; using %ldkB for hash table (at %p)\n", + total_memory >> 20, Hash_size >> 10, Hash); /* diff --git a/trunk/arch/powerpc/mm/tlb_64.c b/trunk/arch/powerpc/mm/tlb_64.c index be7dd422c0fa..409fcc7b63ce 100644 --- a/trunk/arch/powerpc/mm/tlb_64.c +++ b/trunk/arch/powerpc/mm/tlb_64.c @@ -34,7 +34,7 @@ DEFINE_PER_CPU(struct ppc64_tlb_batch, ppc64_tlb_batch); /* This is declared as we are using the more or less generic - * arch/powerpc/include/asm/tlb.h file -- tgall + * include/asm-powerpc/tlb.h file -- tgall */ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); static DEFINE_PER_CPU(struct pte_freelist_batch *, pte_freelist_cur); diff --git a/trunk/arch/powerpc/platforms/52xx/Makefile b/trunk/arch/powerpc/platforms/52xx/Makefile index b8a52062738a..daf0e1568d6d 100644 --- a/trunk/arch/powerpc/platforms/52xx/Makefile +++ b/trunk/arch/powerpc/platforms/52xx/Makefile @@ -1,8 +1,10 @@ # # Makefile for 52xx based boards # +ifeq ($(CONFIG_PPC_MERGE),y) obj-y += mpc52xx_pic.o mpc52xx_common.o obj-$(CONFIG_PCI) += mpc52xx_pci.o +endif obj-$(CONFIG_PPC_MPC5200_SIMPLE) += mpc5200_simple.o obj-$(CONFIG_PPC_EFIKA) += efika.o @@ -13,4 +15,4 @@ ifeq ($(CONFIG_PPC_LITE5200),y) obj-$(CONFIG_PM) += lite5200_sleep.o lite5200_pm.o endif -obj-$(CONFIG_PPC_MPC5200_GPIO) += mpc52xx_gpio.o +obj-$(CONFIG_PPC_MPC5200_GPIO) += mpc52xx_gpio.o \ No newline at end of file diff --git a/trunk/arch/powerpc/platforms/86xx/mpc86xx_smp.c b/trunk/arch/powerpc/platforms/86xx/mpc86xx_smp.c index 014e26cda08d..835f2dc24dc9 100644 --- a/trunk/arch/powerpc/platforms/86xx/mpc86xx_smp.c +++ b/trunk/arch/powerpc/platforms/86xx/mpc86xx_smp.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include diff --git a/trunk/arch/powerpc/platforms/Makefile b/trunk/arch/powerpc/platforms/Makefile index 8079e0b4fd69..423a0234dc31 100644 --- a/trunk/arch/powerpc/platforms/Makefile +++ b/trunk/arch/powerpc/platforms/Makefile @@ -1,7 +1,13 @@ obj-$(CONFIG_FSL_ULI1575) += fsl_uli1575.o +ifeq ($(CONFIG_PPC_MERGE),y) obj-$(CONFIG_PPC_PMAC) += powermac/ +else +ifeq ($(CONFIG_PPC64),y) +obj-$(CONFIG_PPC_PMAC) += powermac/ +endif +endif obj-$(CONFIG_PPC_CHRP) += chrp/ obj-$(CONFIG_40x) += 40x/ obj-$(CONFIG_44x) += 44x/ diff --git a/trunk/arch/powerpc/platforms/powermac/Makefile b/trunk/arch/powerpc/platforms/powermac/Makefile index 58ecdd72630f..89774177b209 100644 --- a/trunk/arch/powerpc/platforms/powermac/Makefile +++ b/trunk/arch/powerpc/platforms/powermac/Makefile @@ -7,7 +7,7 @@ endif obj-y += pic.o setup.o time.o feature.o pci.o \ sleep.o low_i2c.o cache.o pfunc_core.o \ - pfunc_base.o udbg_scc.o udbg_adb.o + pfunc_base.o obj-$(CONFIG_PMAC_BACKLIGHT) += backlight.o obj-$(CONFIG_CPU_FREQ_PMAC) += cpufreq_32.o obj-$(CONFIG_CPU_FREQ_PMAC64) += cpufreq_64.o @@ -19,3 +19,4 @@ obj-$(CONFIG_NVRAM:m=y) += nvram.o obj-$(CONFIG_PPC64) += nvram.o obj-$(CONFIG_PPC32) += bootx_init.o obj-$(CONFIG_SMP) += smp.o +obj-$(CONFIG_PPC_MERGE) += udbg_scc.o udbg_adb.o diff --git a/trunk/arch/powerpc/sysdev/Makefile b/trunk/arch/powerpc/sysdev/Makefile index a90054b56d5c..16a0ed28eb00 100644 --- a/trunk/arch/powerpc/sysdev/Makefile +++ b/trunk/arch/powerpc/sysdev/Makefile @@ -25,6 +25,7 @@ obj-$(CONFIG_MV64X60) += $(mv64x60-y) mv64x60_pic.o mv64x60_dev.o \ obj-$(CONFIG_RTC_DRV_CMOS) += rtc_cmos_setup.o obj-$(CONFIG_AXON_RAM) += axonram.o +ifeq ($(CONFIG_PPC_MERGE),y) obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o obj-$(CONFIG_PPC_I8259) += i8259.o obj-$(CONFIG_IPIC) += ipic.o @@ -35,6 +36,7 @@ obj-$(CONFIG_OF_RTC) += of_rtc.o ifeq ($(CONFIG_PCI),y) obj-$(CONFIG_4xx) += ppc4xx_pci.o endif +endif # Temporary hack until we have migrated to asm-powerpc ifeq ($(ARCH),powerpc) diff --git a/trunk/arch/sh/Kconfig b/trunk/arch/sh/Kconfig index 5131d50f851a..cb992c3d6b71 100644 --- a/trunk/arch/sh/Kconfig +++ b/trunk/arch/sh/Kconfig @@ -48,9 +48,6 @@ config GENERIC_HWEIGHT config GENERIC_HARDIRQS def_bool y -config GENERIC_HARDIRQS_NO__DO_IRQ - def_bool y - config GENERIC_IRQ_PROBE def_bool y @@ -66,10 +63,6 @@ config GENERIC_TIME config GENERIC_CLOCKEVENTS def_bool n -config GENERIC_LOCKBREAK - def_bool y - depends on SMP && PREEMPT - config SYS_SUPPORTS_PM bool @@ -101,6 +94,9 @@ config ARCH_HAS_ILOG2_U64 config ARCH_NO_VIRT_TO_BUS def_bool y +config ARCH_SUPPORTS_AOUT + def_bool y + config IO_TRAPPED bool @@ -487,23 +483,6 @@ config CRASH_DUMP For more details see Documentation/kdump/kdump.txt -config SECCOMP - bool "Enable seccomp to safely compute untrusted bytecode" - depends on PROC_FS - default y - help - This kernel feature is useful for number crunching applications - that may need to compute untrusted bytecode during their - execution. By using pipes or other transports made available to - the process as file descriptors supporting the read/write - syscalls, it's possible to isolate those applications in - their own address space using seccomp. Once seccomp is - enabled via prctl, it cannot be disabled and the task is only - allowed to execute a few safe syscalls defined by each seccomp - mode. - - If unsure, say N. - config SMP bool "Symmetric multi-processing support" depends on SYS_SUPPORTS_SMP diff --git a/trunk/arch/sh/Kconfig.debug b/trunk/arch/sh/Kconfig.debug index 4d2d102e00d5..36f4b1f7066d 100644 --- a/trunk/arch/sh/Kconfig.debug +++ b/trunk/arch/sh/Kconfig.debug @@ -182,7 +182,7 @@ if SUPERH64 config SH64_PROC_ASIDS bool "Debug: report ASIDs through /proc/asids" - depends on PROC_FS && MMU + depends on PROC_FS config SH64_SR_WATCH bool "Debug: set SR.WATCH to enable hardware watchpoints and trace" diff --git a/trunk/arch/sh/Makefile b/trunk/arch/sh/Makefile index 01d85c74481d..25659ce74baa 100644 --- a/trunk/arch/sh/Makefile +++ b/trunk/arch/sh/Makefile @@ -95,6 +95,8 @@ head-y := arch/sh/kernel/init_task.o head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o +LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) + core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ @@ -143,6 +145,10 @@ cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4 cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5 cpuincdir-y += cpu-common # Must be last +libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) +libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) +libs-y += $(LIBGCC) + drivers-y += arch/sh/drivers/ drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ @@ -155,16 +161,10 @@ KBUILD_CFLAGS += -pipe $(cflags-y) KBUILD_CPPFLAGS += $(cflags-y) KBUILD_AFLAGS += $(cflags-y) -LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) - -libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) -libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) -libs-y += $(LIBGCC) - PHONY += maketools FORCE maketools: include/linux/version.h FORCE - $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h + $(Q)$(MAKE) $(build)=arch/sh/tools arch/sh/include/asm/machtypes.h all: $(KBUILD_IMAGE) @@ -215,4 +215,4 @@ arch/sh/lib64/syscalltab.h: arch/sh/kernel/syscalls_64.S $(call filechk,gen-syscalltab) CLEAN_FILES += arch/sh/lib64/syscalltab.h \ - include/asm-sh/machtypes.h + arch/sh/include/asm/machtypes.h diff --git a/trunk/arch/sh/boards/Makefile b/trunk/arch/sh/boards/Makefile index 463022c7df3c..ff9b93c5a91b 100644 --- a/trunk/arch/sh/boards/Makefile +++ b/trunk/arch/sh/boards/Makefile @@ -5,4 +5,4 @@ obj-$(CONFIG_SH_AP325RXA) += board-ap325rxa.o obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o obj-$(CONFIG_SH_RSK7203) += board-rsk7203.o obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o -obj-$(CONFIG_SH_SHMIN) += board-shmin.o +obj-$(CONFIG_SH_SHMIN) += board-shmin..o diff --git a/trunk/arch/sh/boards/board-ap325rxa.c b/trunk/arch/sh/boards/board-ap325rxa.c index 025d4fe55a58..9c71603d29a2 100644 --- a/trunk/arch/sh/boards/board-ap325rxa.c +++ b/trunk/arch/sh/boards/board-ap325rxa.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/arch/sh/boards/mach-se/7343/irq.c b/trunk/arch/sh/boards/mach-se/7343/irq.c index 051c29d4eae0..5d96e2eef82a 100644 --- a/trunk/arch/sh/boards/mach-se/7343/irq.c +++ b/trunk/arch/sh/boards/mach-se/7343/irq.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/sh/boards/mach-systemh/irq.c b/trunk/arch/sh/boards/mach-systemh/irq.c index 601c9c8cdbec..0ba2fe674c47 100644 --- a/trunk/arch/sh/boards/mach-systemh/irq.c +++ b/trunk/arch/sh/boards/mach-systemh/irq.c @@ -11,8 +11,9 @@ #include #include -#include +#include +#include #include #include #include diff --git a/trunk/arch/sh/configs/dreamcast_defconfig b/trunk/arch/sh/configs/dreamcast_defconfig index 3dc1cbd8a981..d4075283956d 100644 --- a/trunk/arch/sh/configs/dreamcast_defconfig +++ b/trunk/arch/sh/configs/dreamcast_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.27-rc1 -# Mon Aug 4 16:49:13 2008 +# Linux kernel version: 2.6.26 +# Wed Jul 30 01:34:24 2008 # CONFIG_SUPERH=y CONFIG_SUPERH32=y @@ -11,7 +11,6 @@ CONFIG_GENERIC_BUG=y CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_HARDIRQS=y -CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_GENERIC_TIME=y @@ -22,6 +21,7 @@ CONFIG_LOCKDEP_SUPPORT=y # CONFIG_ARCH_HAS_ILOG2_U32 is not set # CONFIG_ARCH_HAS_ILOG2_U64 is not set CONFIG_ARCH_NO_VIRT_TO_BUS=y +CONFIG_ARCH_SUPPORTS_AOUT=y CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # @@ -87,7 +87,6 @@ CONFIG_HAVE_OPROFILE=y # CONFIG_USE_GENERIC_SMP_HELPERS is not set CONFIG_HAVE_CLK=y CONFIG_PROC_PAGE_MONITOR=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_SLABINFO=y CONFIG_RT_MUTEXES=y # CONFIG_TINY_SHMEM is not set @@ -285,7 +284,6 @@ CONFIG_HZ=250 # CONFIG_SCHED_HRTICK is not set # CONFIG_KEXEC is not set # CONFIG_CRASH_DUMP is not set -CONFIG_SECCOMP=y # CONFIG_PREEMPT_NONE is not set # CONFIG_PREEMPT_VOLUNTARY is not set CONFIG_PREEMPT=y @@ -319,6 +317,10 @@ CONFIG_PCI_LEGACY=y # CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set + +# +# Networking +# CONFIG_NET=y # @@ -553,7 +555,7 @@ CONFIG_INPUT_KEYBOARD=y # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_STOWAWAY is not set -CONFIG_KEYBOARD_MAPLE=y +# CONFIG_KEYBOARD_MAPLE is not set # CONFIG_KEYBOARD_SH_KEYSC is not set CONFIG_INPUT_MOUSE=y # CONFIG_MOUSE_PS2 is not set diff --git a/trunk/arch/sh/include/asm/a.out.h b/trunk/arch/sh/include/asm/a.out.h new file mode 100644 index 000000000000..1f93130e179c --- /dev/null +++ b/trunk/arch/sh/include/asm/a.out.h @@ -0,0 +1,20 @@ +#ifndef __ASM_SH_A_OUT_H +#define __ASM_SH_A_OUT_H + +struct exec +{ + unsigned long a_info; /* Use macros N_MAGIC, etc for access */ + unsigned a_text; /* length of text, in bytes */ + unsigned a_data; /* length of data, in bytes */ + unsigned a_bss; /* length of uninitialized data area for file, in bytes */ + unsigned a_syms; /* length of symbol table data in file, in bytes */ + unsigned a_entry; /* start address */ + unsigned a_trsize; /* length of relocation info for text, in bytes */ + unsigned a_drsize; /* length of relocation info for data, in bytes */ +}; + +#define N_TRSIZE(a) ((a).a_trsize) +#define N_DRSIZE(a) ((a).a_drsize) +#define N_SYMSIZE(a) ((a).a_syms) + +#endif /* __ASM_SH_A_OUT_H */ diff --git a/trunk/arch/sh/include/asm/ptrace.h b/trunk/arch/sh/include/asm/ptrace.h index b86aeabba61a..643ab5a7cf3b 100644 --- a/trunk/arch/sh/include/asm/ptrace.h +++ b/trunk/arch/sh/include/asm/ptrace.h @@ -104,15 +104,6 @@ struct pt_dspregs { extern void show_regs(struct pt_regs *); -/* - * These are defined as per linux/ptrace.h. - */ -struct task_struct; - -#define arch_has_single_step() (1) -extern void user_enable_single_step(struct task_struct *); -extern void user_disable_single_step(struct task_struct *); - #ifdef CONFIG_SH_DSP #define task_pt_regs(task) \ ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \ diff --git a/trunk/arch/sh/include/asm/seccomp.h b/trunk/arch/sh/include/asm/seccomp.h deleted file mode 100644 index 3280ed3802ef..000000000000 --- a/trunk/arch/sh/include/asm/seccomp.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __ASM_SECCOMP_H - -#include - -#define __NR_seccomp_read __NR_read -#define __NR_seccomp_write __NR_write -#define __NR_seccomp_exit __NR_exit -#define __NR_seccomp_sigreturn __NR_rt_sigreturn - -#endif /* __ASM_SECCOMP_H */ diff --git a/trunk/arch/sh/include/asm/thread_info.h b/trunk/arch/sh/include/asm/thread_info.h index 0a894cafb1dd..eeb4c747119e 100644 --- a/trunk/arch/sh/include/asm/thread_info.h +++ b/trunk/arch/sh/include/asm/thread_info.h @@ -117,45 +117,24 @@ static inline struct thread_info *current_thread_info(void) #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ #define TIF_RESTORE_SIGMASK 3 /* restore signal mask in do_signal() */ #define TIF_SINGLESTEP 4 /* singlestepping active */ -#define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ -#define TIF_SECCOMP 6 /* secure computing */ -#define TIF_NOTIFY_RESUME 7 /* callback before returning to user */ +#define TIF_SYSCALL_AUDIT 5 #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_MEMDIE 18 -#define TIF_FREEZE 19 /* Freezing for suspend */ - -#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) -#define _TIF_SIGPENDING (1 << TIF_SIGPENDING) -#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) -#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) -#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) -#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) -#define _TIF_SECCOMP (1 << TIF_SECCOMP) -#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) -#define _TIF_USEDFPU (1 << TIF_USEDFPU) -#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) -#define _TIF_FREEZE (1 << TIF_FREEZE) - -/* - * _TIF_ALLWORK_MASK and _TIF_WORK_MASK need to fit within a byte, or we - * blow the tst immediate size constraints and need to fix up - * arch/sh/kernel/entry-common.S. - */ - -/* work to do in syscall trace */ -#define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \ - _TIF_SYSCALL_AUDIT | _TIF_SECCOMP) - -/* work to do on any return to u-space */ -#define _TIF_ALLWORK_MASK (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING | \ - _TIF_NEED_RESCHED | _TIF_SYSCALL_AUDIT | \ - _TIF_SINGLESTEP | _TIF_RESTORE_SIGMASK | \ - _TIF_NOTIFY_RESUME) - -/* work to do on interrupt/exception return */ -#define _TIF_WORK_MASK (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \ - _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP)) +#define TIF_FREEZE 19 + +#define _TIF_SYSCALL_TRACE (1<dtlb.first; \ @@ -31,9 +33,11 @@ tlb += cpu_data->dtlb.step) /** - * for_each_itlb_entry - Iterate over free (non-wired) ITLB entries + * for_each_itlb_entry * * @tlb: TLB entry + * + * Iterate over free (non-wired) ITLB entries */ #define for_each_itlb_entry(tlb) \ for (tlb = cpu_data->itlb.first; \ @@ -41,9 +45,11 @@ tlb += cpu_data->itlb.step) /** - * __flush_tlb_slot - Flushes TLB slot @slot. + * __flush_tlb_slot * * @slot: Address of TLB slot. + * + * Flushes TLB slot @slot. */ static inline void __flush_tlb_slot(unsigned long long slot) { diff --git a/trunk/arch/sh/include/cpu-sh2/cpu/cache.h b/trunk/arch/sh/include/cpu-sh2/cpu/cache.h index 673515bc4135..4e0b16500686 100644 --- a/trunk/arch/sh/include/cpu-sh2/cpu/cache.h +++ b/trunk/arch/sh/include/cpu-sh2/cpu/cache.h @@ -21,11 +21,11 @@ #define CCR 0xffffffec #define CCR_CACHE_CE 0x01 /* Cache enable */ -#define CCR_CACHE_WT 0x02 /* CCR[bit1=1,bit2=1] */ +#define CCR_CACHE_WT 0x06 /* CCR[bit1=1,bit2=1] */ /* 0x00000000-0x7fffffff: Write-through */ /* 0x80000000-0x9fffffff: Write-back */ /* 0xc0000000-0xdfffffff: Write-through */ -#define CCR_CACHE_CB 0x04 /* CCR[bit1=0,bit2=0] */ +#define CCR_CACHE_CB 0x00 /* CCR[bit1=0,bit2=0] */ /* 0x00000000-0x7fffffff: Write-back */ /* 0x80000000-0x9fffffff: Write-through */ /* 0xc0000000-0xdfffffff: Write-back */ @@ -36,8 +36,6 @@ #define CCR_CACHE_ENABLE CCR_CACHE_CE #define CCR_CACHE_INVALIDATE CCR_CACHE_CF -#define CACHE_PHYSADDR_MASK 0x1ffffc00 - #endif #endif /* __ASM_CPU_SH2_CACHE_H */ diff --git a/trunk/arch/sh/include/cpu-sh2a/cpu/addrspace.h b/trunk/arch/sh/include/cpu-sh2a/cpu/addrspace.h deleted file mode 100644 index 31eb4b58aa6d..000000000000 --- a/trunk/arch/sh/include/cpu-sh2a/cpu/addrspace.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __ASM_SH_CPU_SH2A_ADDRSPACE_H -#define __ASM_SH_CPU_SH2A_ADDRSPACE_H - -#define P0SEG 0x00000000 -#define P1SEG 0x00000000 -#define P2SEG 0x20000000 -#define P3SEG 0x40000000 -#define P4SEG 0x60000000 - -#endif /* __ASM_SH_CPU_SH2A_ADDRSPACE_H */ diff --git a/trunk/arch/sh/include/cpu-sh2a/cpu/cache.h b/trunk/arch/sh/include/cpu-sh2a/cpu/cache.h index defb0baa5a06..afe228b3f493 100644 --- a/trunk/arch/sh/include/cpu-sh2a/cpu/cache.h +++ b/trunk/arch/sh/include/cpu-sh2a/cpu/cache.h @@ -36,8 +36,5 @@ #define CCR_CACHE_ENABLE (CCR_CACHE_OCE | CCR_CACHE_ICE) #define CCR_CACHE_INVALIDATE (CCR_CACHE_OCI | CCR_CACHE_ICI) -#define CCR_ICACHE_INVALIDATE CCR_CACHE_ICI -#define CCR_OCACHE_INVALIDATE CCR_CACHE_OCI -#define CACHE_PHYSADDR_MASK 0x1ffffc00 #endif /* __ASM_CPU_SH2A_CACHE_H */ diff --git a/trunk/arch/sh/include/cpu-sh2a/cpu/cacheflush.h b/trunk/arch/sh/include/cpu-sh2a/cpu/cacheflush.h deleted file mode 100644 index 3d3b9205d2ac..000000000000 --- a/trunk/arch/sh/include/cpu-sh2a/cpu/cacheflush.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef __ASM_CPU_SH2A_CACHEFLUSH_H -#define __ASM_CPU_SH2A_CACHEFLUSH_H - -/* - * Cache flushing: - * - * - flush_cache_all() flushes entire cache - * - flush_cache_mm(mm) flushes the specified mm context's cache lines - * - flush_cache_dup mm(mm) handles cache flushing when forking - * - flush_cache_page(mm, vmaddr, pfn) flushes a single page - * - flush_cache_range(vma, start, end) flushes a range of pages - * - * - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache - * - flush_icache_range(start, end) flushes(invalidates) a range for icache - * - flush_icache_page(vma, pg) flushes(invalidates) a page for icache - * - * Caches are indexed (effectively) by physical address on SH-2, so - * we don't need them. - */ -#define flush_cache_all() do { } while (0) -#define flush_cache_mm(mm) do { } while (0) -#define flush_cache_dup_mm(mm) do { } while (0) -#define flush_cache_range(vma, start, end) do { } while (0) -#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) -#define flush_dcache_page(page) do { } while (0) -#define flush_dcache_mmap_lock(mapping) do { } while (0) -#define flush_dcache_mmap_unlock(mapping) do { } while (0) -void flush_icache_range(unsigned long start, unsigned long end); -#define flush_icache_page(vma,pg) do { } while (0) -#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) -#define flush_cache_sigtramp(vaddr) do { } while (0) - -#define p3_cache_init() do { } while (0) -#endif /* __ASM_CPU_SH2A_CACHEFLUSH_H */ diff --git a/trunk/arch/sh/kernel/cpu/sh4/sq.c b/trunk/arch/sh/kernel/cpu/sh4/sq.c index 8a8a993f55ea..dcdf959a3d44 100644 --- a/trunk/arch/sh/kernel/cpu/sh4/sq.c +++ b/trunk/arch/sh/kernel/cpu/sh4/sq.c @@ -199,7 +199,7 @@ EXPORT_SYMBOL(sq_remap); /** * sq_unmap - Unmap a Store Queue allocation - * @vaddr: Pre-allocated Store Queue mapping. + * @map: Pre-allocated Store Queue mapping. * * Unmaps the store queue allocation @map that was previously created by * sq_remap(). Also frees up the pte that was previously inserted into diff --git a/trunk/arch/sh/kernel/cpu/sh5/entry.S b/trunk/arch/sh/kernel/cpu/sh5/entry.S index 04c7da968146..ca08e7f26a3a 100644 --- a/trunk/arch/sh/kernel/cpu/sh5/entry.S +++ b/trunk/arch/sh/kernel/cpu/sh5/entry.S @@ -987,11 +987,11 @@ work_resched: work_notifysig: gettr tr1, LINK - movi do_notify_resume, r6 + movi do_signal, r6 ptabs r6, tr0 or SP, ZERO, r2 - or r7, ZERO, r3 - blink tr0, LINK /* Call do_notify_resume(regs, current_thread_info->flags), return here */ + or ZERO, ZERO, r3 + blink tr0, LINK /* Call do_signal(regs, 0), return here */ restore_all: /* Do prefetches */ @@ -1300,20 +1300,18 @@ syscall_allowed: getcon KCR0, r2 ld.l r2, TI_FLAGS, r4 - movi _TIF_WORK_SYSCALL_MASK, r6 + movi (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | _TIF_SYSCALL_AUDIT), r6 and r6, r4, r6 beq/l r6, ZERO, tr0 /* Trace it by calling syscall_trace before and after */ - movi do_syscall_trace_enter, r4 + movi syscall_trace, r4 or SP, ZERO, r2 + or ZERO, ZERO, r3 ptabs r4, tr0 blink tr0, LINK - /* Save the retval */ - st.q SP, FRAME_R(2), r2 - - /* Reload syscall number as r5 is trashed by do_syscall_trace_enter */ + /* Reload syscall number as r5 is trashed by syscall_trace */ ld.q SP, FRAME_S(FSYSCALL_ID), r5 andi r5, 0x1ff, r5 @@ -1345,8 +1343,9 @@ syscall_ret_trace: /* We get back here only if under trace */ st.q SP, FRAME_R(9), r2 /* Save return value */ - movi do_syscall_trace_leave, LINK + movi syscall_trace, LINK or SP, ZERO, r2 + movi 1, r3 ptabs LINK, tr0 blink tr0, LINK diff --git a/trunk/arch/sh/kernel/entry-common.S b/trunk/arch/sh/kernel/entry-common.S index 0bc17def55a7..5e0dd1933847 100644 --- a/trunk/arch/sh/kernel/entry-common.S +++ b/trunk/arch/sh/kernel/entry-common.S @@ -202,7 +202,7 @@ work_resched: syscall_exit_work: ! r0: current_thread_info->flags ! r8: current_thread_info - tst #_TIF_WORK_SYSCALL_MASK, r0 + tst #_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | _TIF_SYSCALL_AUDIT, r0 bt/s work_pending tst #_TIF_NEED_RESCHED, r0 #ifdef CONFIG_TRACE_IRQFLAGS @@ -211,8 +211,10 @@ syscall_exit_work: nop #endif sti + ! XXX setup arguments... mov r15, r4 - mov.l 8f, r0 ! do_syscall_trace_leave + mov #1, r5 + mov.l 4f, r0 ! do_syscall_trace jsr @r0 nop bra resume_userspace @@ -221,11 +223,12 @@ syscall_exit_work: .align 2 syscall_trace_entry: ! Yes it is traced. + ! XXX setup arguments... mov r15, r4 - mov.l 7f, r11 ! Call do_syscall_trace_enter which notifies + mov #0, r5 + mov.l 4f, r11 ! Call do_syscall_trace which notifies jsr @r11 ! superior (will chomp R[0-7]) nop - mov.l r0, @(OFF_R0,r15) ! Save return value ! Reload R0-R4 from kernel stack, where the ! parent may have modified them using ! ptrace(POKEUSR). (Note that R0-R2 are @@ -348,7 +351,7 @@ ENTRY(system_call) ! get_current_thread_info r8, r10 mov.l @(TI_FLAGS,r8), r8 - mov #_TIF_WORK_SYSCALL_MASK, r10 + mov #(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT), r10 tst r10, r8 bf syscall_trace_entry ! @@ -386,9 +389,8 @@ syscall_exit: #endif 2: .long NR_syscalls 3: .long sys_call_table +4: .long do_syscall_trace #ifdef CONFIG_TRACE_IRQFLAGS 5: .long trace_hardirqs_on 6: .long trace_hardirqs_off #endif -7: .long do_syscall_trace_enter -8: .long do_syscall_trace_leave diff --git a/trunk/arch/sh/kernel/machine_kexec.c b/trunk/arch/sh/kernel/machine_kexec.c index 4703dff174d5..ec1eadce4aaa 100644 --- a/trunk/arch/sh/kernel/machine_kexec.c +++ b/trunk/arch/sh/kernel/machine_kexec.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -105,10 +104,3 @@ void machine_kexec(struct kimage *image) (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg); } -void arch_crash_save_vmcoreinfo(void) -{ -#ifdef CONFIG_NUMA - VMCOREINFO_SYMBOL(node_data); - VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); -#endif -} diff --git a/trunk/arch/sh/kernel/module.c b/trunk/arch/sh/kernel/module.c index c43081039dd5..5482e65375a9 100644 --- a/trunk/arch/sh/kernel/module.c +++ b/trunk/arch/sh/kernel/module.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -37,8 +36,7 @@ void *module_alloc(unsigned long size) { if (size == 0) return NULL; - - return vmalloc_exec(size); + return vmalloc(size); } @@ -147,10 +145,9 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *me) { - return module_bug_finalize(hdr, sechdrs, me); + return 0; } void module_arch_cleanup(struct module *mod) { - module_bug_cleanup(mod); } diff --git a/trunk/arch/sh/kernel/ptrace_32.c b/trunk/arch/sh/kernel/ptrace_32.c index 035cb300d3dc..2bc72def5cf8 100644 --- a/trunk/arch/sh/kernel/ptrace_32.c +++ b/trunk/arch/sh/kernel/ptrace_32.c @@ -20,8 +20,6 @@ #include #include #include -#include -#include #include #include #include @@ -59,23 +57,7 @@ static inline int put_stack_long(struct task_struct *task, int offset, return 0; } -void user_enable_single_step(struct task_struct *child) -{ - struct pt_regs *regs = task_pt_regs(child); - long pc; - - pc = get_stack_long(child, (long)®s->pc); - - /* Next scheduling will set up UBC */ - if (child->thread.ubc_pc == 0) - ubc_usercnt += 1; - - child->thread.ubc_pc = pc; - - set_tsk_thread_flag(child, TIF_SINGLESTEP); -} - -void user_disable_single_step(struct task_struct *child) +static void ptrace_disable_singlestep(struct task_struct *child) { clear_tsk_thread_flag(child, TIF_SINGLESTEP); @@ -99,7 +81,7 @@ void user_disable_single_step(struct task_struct *child) */ void ptrace_disable(struct task_struct *child) { - user_disable_single_step(child); + ptrace_disable_singlestep(child); } long arch_ptrace(struct task_struct *child, long request, long addr, long data) @@ -108,6 +90,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) int ret; switch (request) { + /* when I and D space are separate, these will need to be fixed. */ + case PTRACE_PEEKTEXT: /* read word at location addr. */ + case PTRACE_PEEKDATA: + ret = generic_ptrace_peekdata(child, addr, data); + break; + /* read the word at location addr in the USER area. */ case PTRACE_PEEKUSR: { unsigned long tmp; @@ -137,6 +125,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) break; } + /* when I and D space are separate, this will have to be fixed. */ + case PTRACE_POKETEXT: /* write the word at location addr. */ + case PTRACE_POKEDATA: + ret = generic_ptrace_pokedata(child, addr, data); + break; + case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ ret = -EIO; if ((addr & 3) || addr < 0 || @@ -157,6 +151,67 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) } break; + case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ + case PTRACE_CONT: { /* restart after signal. */ + ret = -EIO; + if (!valid_signal(data)) + break; + if (request == PTRACE_SYSCALL) + set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + else + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + + ptrace_disable_singlestep(child); + + child->exit_code = data; + wake_up_process(child); + ret = 0; + break; + } + +/* + * make the child exit. Best I can do is send it a sigkill. + * perhaps it should be put in the status that it wants to + * exit. + */ + case PTRACE_KILL: { + ret = 0; + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ + break; + ptrace_disable_singlestep(child); + child->exit_code = SIGKILL; + wake_up_process(child); + break; + } + + case PTRACE_SINGLESTEP: { /* set the trap flag. */ + long pc; + struct pt_regs *regs = NULL; + + ret = -EIO; + if (!valid_signal(data)) + break; + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + if ((child->ptrace & PT_DTRACE) == 0) { + /* Spurious delayed TF traps may occur */ + child->ptrace |= PT_DTRACE; + } + + pc = get_stack_long(child, (long)®s->pc); + + /* Next scheduling will set up UBC */ + if (child->thread.ubc_pc == 0) + ubc_usercnt += 1; + child->thread.ubc_pc = pc; + + set_tsk_thread_flag(child, TIF_SINGLESTEP); + child->exit_code = data; + /* give it a chance to run. */ + wake_up_process(child); + ret = 0; + break; + } + #ifdef CONFIG_SH_DSP case PTRACE_GETDSPREGS: { unsigned long dp; @@ -217,49 +272,39 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) return ret; } -static inline int audit_arch(void) +asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) { - int arch = EM_SH; + struct task_struct *tsk = current; -#ifdef CONFIG_CPU_LITTLE_ENDIAN - arch |= __AUDIT_ARCH_LE; -#endif - - return arch; -} + if (unlikely(current->audit_context) && entryexit) + audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]), + regs->regs[0]); -asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) -{ - long ret = 0; + if (!test_thread_flag(TIF_SYSCALL_TRACE) && + !test_thread_flag(TIF_SINGLESTEP)) + goto out; + if (!(tsk->ptrace & PT_PTRACED)) + goto out; - secure_computing(regs->regs[0]); + /* the 0x80 provides a way for the tracing parent to distinguish + between a syscall stop and SIGTRAP delivery */ + ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && + !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0)); - if (test_thread_flag(TIF_SYSCALL_TRACE) && - tracehook_report_syscall_entry(regs)) - /* - * Tracing decided this syscall should not happen. - * We'll return a bogus call number to get an ENOSYS - * error, but leave the original number in regs->regs[0]. - */ - ret = -1L; + /* + * this isn't the same as continuing with a signal, but it will do + * for normal use. strace only continues with a signal if the + * stopping signal is not SIGTRAP. -brl + */ + if (tsk->exit_code) { + send_sig(tsk->exit_code, tsk, 1); + tsk->exit_code = 0; + } - if (unlikely(current->audit_context)) - audit_syscall_entry(audit_arch(), regs->regs[3], +out: + if (unlikely(current->audit_context) && !entryexit) + audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[3], regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]); - return ret ?: regs->regs[0]; -} - -asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) -{ - int step; - - if (unlikely(current->audit_context)) - audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]), - regs->regs[0]); - - step = test_thread_flag(TIF_SINGLESTEP); - if (step || test_thread_flag(TIF_SYSCALL_TRACE)) - tracehook_report_syscall_exit(regs, step); } diff --git a/trunk/arch/sh/kernel/ptrace_64.c b/trunk/arch/sh/kernel/ptrace_64.c index 5922edd416db..d453c47dc522 100644 --- a/trunk/arch/sh/kernel/ptrace_64.c +++ b/trunk/arch/sh/kernel/ptrace_64.c @@ -27,8 +27,6 @@ #include #include #include -#include -#include #include #include #include @@ -122,23 +120,18 @@ put_fpu_long(struct task_struct *task, unsigned long addr, unsigned long data) return 0; } -void user_enable_single_step(struct task_struct *child) -{ - struct pt_regs *regs = child->thread.uregs; - - regs->sr |= SR_SSTEP; /* auto-resetting upon exception */ -} - -void user_disable_single_step(struct task_struct *child) -{ - regs->sr &= ~SR_SSTEP; -} long arch_ptrace(struct task_struct *child, long request, long addr, long data) { int ret; switch (request) { + /* when I and D space are separate, these will need to be fixed. */ + case PTRACE_PEEKTEXT: /* read word at location addr. */ + case PTRACE_PEEKDATA: + ret = generic_ptrace_peekdata(child, addr, data); + break; + /* read the word at location addr in the USER area. */ case PTRACE_PEEKUSR: { unsigned long tmp; @@ -161,6 +154,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) break; } + /* when I and D space are separate, this will have to be fixed. */ + case PTRACE_POKETEXT: /* write the word at location addr. */ + case PTRACE_POKEDATA: + ret = generic_ptrace_pokedata(child, addr, data); + break; + case PTRACE_POKEUSR: /* write the word at location addr in the USER area. We must disallow any changes to certain SR bits or u_fpvalid, since @@ -192,6 +191,58 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) } break; + case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ + case PTRACE_CONT: { /* restart after signal. */ + ret = -EIO; + if (!valid_signal(data)) + break; + if (request == PTRACE_SYSCALL) + set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + else + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + child->exit_code = data; + wake_up_process(child); + ret = 0; + break; + } + +/* + * make the child exit. Best I can do is send it a sigkill. + * perhaps it should be put in the status that it wants to + * exit. + */ + case PTRACE_KILL: { + ret = 0; + if (child->exit_state == EXIT_ZOMBIE) /* already dead */ + break; + child->exit_code = SIGKILL; + wake_up_process(child); + break; + } + + case PTRACE_SINGLESTEP: { /* set the trap flag. */ + struct pt_regs *regs; + + ret = -EIO; + if (!valid_signal(data)) + break; + clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); + if ((child->ptrace & PT_DTRACE) == 0) { + /* Spurious delayed TF traps may occur */ + child->ptrace |= PT_DTRACE; + } + + regs = child->thread.uregs; + + regs->sr |= SR_SSTEP; /* auto-resetting upon exception */ + + child->exit_code = data; + /* give it a chance to run. */ + wake_up_process(child); + ret = 0; + break; + } + default: ret = ptrace_request(child, request, addr, data); break; @@ -222,51 +273,38 @@ asmlinkage int sh64_ptrace(long request, long pid, long addr, long data) return sys_ptrace(request, pid, addr, data); } -static inline int audit_arch(void) +asmlinkage void syscall_trace(struct pt_regs *regs, int entryexit) { - int arch = EM_SH; - -#ifdef CONFIG_64BIT - arch |= __AUDIT_ARCH_64BIT; -#endif -#ifdef CONFIG_CPU_LITTLE_ENDIAN - arch |= __AUDIT_ARCH_LE; -#endif + struct task_struct *tsk = current; - return arch; -} - -asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs) -{ - long long ret = 0; - - secure_computing(regs->regs[9]); + if (unlikely(current->audit_context) && entryexit) + audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]), + regs->regs[9]); - if (test_thread_flag(TIF_SYSCALL_TRACE) && - tracehook_report_syscall_entry(regs)) - /* - * Tracing decided this syscall should not happen. - * We'll return a bogus call number to get an ENOSYS - * error, but leave the original number in regs->regs[0]. - */ - ret = -1LL; + if (!test_thread_flag(TIF_SYSCALL_TRACE) && + !test_thread_flag(TIF_SINGLESTEP)) + goto out; + if (!(tsk->ptrace & PT_PTRACED)) + goto out; + + ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && + !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0)); + + /* + * this isn't the same as continuing with a signal, but it will do + * for normal use. strace only continues with a signal if the + * stopping signal is not SIGTRAP. -brl + */ + if (tsk->exit_code) { + send_sig(tsk->exit_code, tsk, 1); + tsk->exit_code = 0; + } - if (unlikely(current->audit_context)) - audit_syscall_entry(audit_arch(), regs->regs[1], +out: + if (unlikely(current->audit_context) && !entryexit) + audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[1], regs->regs[2], regs->regs[3], regs->regs[4], regs->regs[5]); - - return ret ?: regs->regs[9]; -} - -asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) -{ - if (unlikely(current->audit_context)) - audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]), - regs->regs[9]); - - if (test_thread_flag(TIF_SYSCALL_TRACE)) - tracehook_report_syscall_exit(regs, 0); } /* Called with interrupts disabled */ @@ -300,5 +338,5 @@ asmlinkage void do_software_break_point(unsigned long long vec, */ void ptrace_disable(struct task_struct *child) { - user_disable_single_step(child); + /* nothing to do.. */ } diff --git a/trunk/arch/sh/kernel/setup.c b/trunk/arch/sh/kernel/setup.c index a35207655e7b..6339d0c95715 100644 --- a/trunk/arch/sh/kernel/setup.c +++ b/trunk/arch/sh/kernel/setup.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -287,25 +286,6 @@ static void __init setup_memory(void) extern void __init setup_memory(void); #endif -/* - * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by - * is_kdump_kernel() to determine if we are booting after a panic. Hence - * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE. - */ -#ifdef CONFIG_CRASH_DUMP -/* elfcorehdr= specifies the location of elf core header - * stored by the crashed kernel. - */ -static int __init parse_elfcorehdr(char *arg) -{ - if (!arg) - return -EINVAL; - elfcorehdr_addr = memparse(arg, &arg); - return 0; -} -early_param("elfcorehdr", parse_elfcorehdr); -#endif - void __init setup_arch(char **cmdline_p) { enable_mmu(); diff --git a/trunk/arch/sh/kernel/signal_32.c b/trunk/arch/sh/kernel/signal_32.c index 51689d29ad45..4bbbde895a53 100644 --- a/trunk/arch/sh/kernel/signal_32.c +++ b/trunk/arch/sh/kernel/signal_32.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -508,13 +507,14 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, switch (regs->regs[0]) { case -ERESTART_RESTARTBLOCK: case -ERESTARTNOHAND: - no_system_call_restart: regs->regs[0] = -EINTR; break; case -ERESTARTSYS: - if (!(ka->sa.sa_flags & SA_RESTART)) - goto no_system_call_restart; + if (!(ka->sa.sa_flags & SA_RESTART)) { + regs->regs[0] = -EINTR; + break; + } /* fallthrough */ case -ERESTARTNOINTR: regs->regs[0] = save_r0; @@ -589,15 +589,12 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) * clear the TIF_RESTORE_SIGMASK flag */ if (test_thread_flag(TIF_RESTORE_SIGMASK)) clear_thread_flag(TIF_RESTORE_SIGMASK); - - tracehook_signal_handler(signr, &info, &ka, regs, - test_thread_flag(TIF_SINGLESTEP)); } return; } -no_signal: + no_signal: /* Did we come from a system call? */ if (regs->tra >= 0) { /* Restart the system call - no handlers present */ @@ -621,14 +618,9 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) } asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0, - unsigned long thread_info_flags) + __u32 thread_info_flags) { /* deal with pending signal delivery */ - if (thread_info_flags & _TIF_SIGPENDING) + if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) do_signal(regs, save_r0); - - if (thread_info_flags & _TIF_NOTIFY_RESUME) { - clear_thread_flag(TIF_NOTIFY_RESUME); - tracehook_notify_resume(regs); - } } diff --git a/trunk/arch/sh/kernel/signal_64.c b/trunk/arch/sh/kernel/signal_64.c index 1d62dfef77f1..552eb810cd85 100644 --- a/trunk/arch/sh/kernel/signal_64.c +++ b/trunk/arch/sh/kernel/signal_64.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -43,84 +42,7 @@ #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) -/* - * Note that 'init' is a special process: it doesn't get signals it doesn't - * want to handle. Thus you cannot kill init even with a SIGKILL even by - * mistake. - * - * Note that we go through the signals twice: once to check the signals that - * the kernel can handle, and then we build all the user-level signal handling - * stack-frames in one go after that. - */ -static int do_signal(struct pt_regs *regs, sigset_t *oldset) -{ - siginfo_t info; - int signr; - struct k_sigaction ka; - - /* - * We want the common case to go fast, which - * is why we may in certain cases get here from - * kernel mode. Just return without doing anything - * if so. - */ - if (!user_mode(regs)) - return 1; - - if (try_to_freeze()) - goto no_signal; - - if (test_thread_flag(TIF_RESTORE_SIGMASK)) - oldset = ¤t->saved_sigmask; - else if (!oldset) - oldset = ¤t->blocked; - - signr = get_signal_to_deliver(&info, &ka, regs, 0); - - if (signr > 0) { - /* Whee! Actually deliver the signal. */ - handle_signal(signr, &info, &ka, oldset, regs); - - /* - * If a signal was successfully delivered, the saved sigmask - * is in its frame, and we can clear the TIF_RESTORE_SIGMASK - * flag. - */ - if (test_thread_flag(TIF_RESTORE_SIGMASK)) - clear_thread_flag(TIF_RESTORE_SIGMASK); - - tracehook_signal_handler(signr, &info, &ka, regs, 0); - return 1; - } - -no_signal: - /* Did we come from a system call? */ - if (regs->syscall_nr >= 0) { - /* Restart the system call - no handlers present */ - switch (regs->regs[REG_RET]) { - case -ERESTARTNOHAND: - case -ERESTARTSYS: - case -ERESTARTNOINTR: - /* Decode Syscall # */ - regs->regs[REG_RET] = regs->syscall_nr; - regs->pc -= 4; - break; - - case -ERESTART_RESTARTBLOCK: - regs->regs[REG_RET] = __NR_restart_syscall; - regs->pc -= 4; - break; - } - } - - /* No signal to deliver -- put the saved sigmask back */ - if (test_thread_flag(TIF_RESTORE_SIGMASK)) { - clear_thread_flag(TIF_RESTORE_SIGMASK); - sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); - } - - return 0; -} +asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset); /* * Atomically swap in the new signal mask, and wait for a signal. @@ -721,13 +643,14 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, switch (regs->regs[REG_RET]) { case -ERESTART_RESTARTBLOCK: case -ERESTARTNOHAND: - no_system_call_restart: regs->regs[REG_RET] = -EINTR; break; case -ERESTARTSYS: - if (!(ka->sa.sa_flags & SA_RESTART)) - goto no_system_call_restart; + if (!(ka->sa.sa_flags & SA_RESTART)) { + regs->regs[REG_RET] = -EINTR; + break; + } /* fallthrough */ case -ERESTARTNOINTR: /* Decode syscall # */ @@ -750,13 +673,80 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, spin_unlock_irq(¤t->sighand->siglock); } -asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) +/* + * Note that 'init' is a special process: it doesn't get signals it doesn't + * want to handle. Thus you cannot kill init even with a SIGKILL even by + * mistake. + * + * Note that we go through the signals twice: once to check the signals that + * the kernel can handle, and then we build all the user-level signal handling + * stack-frames in one go after that. + */ +int do_signal(struct pt_regs *regs, sigset_t *oldset) { - if (thread_info_flags & _TIF_SIGPENDING) - do_signal(regs, 0); + siginfo_t info; + int signr; + struct k_sigaction ka; + + /* + * We want the common case to go fast, which + * is why we may in certain cases get here from + * kernel mode. Just return without doing anything + * if so. + */ + if (!user_mode(regs)) + return 1; + + if (try_to_freeze()) + goto no_signal; + + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + oldset = ¤t->saved_sigmask; + else if (!oldset) + oldset = ¤t->blocked; + + signr = get_signal_to_deliver(&info, &ka, regs, 0); + + if (signr > 0) { + /* Whee! Actually deliver the signal. */ + handle_signal(signr, &info, &ka, oldset, regs); - if (thread_info_flags & _TIF_NOTIFY_RESUME) { - clear_thread_flag(TIF_NOTIFY_RESUME); - tracehook_notify_resume(regs); + /* + * If a signal was successfully delivered, the saved sigmask + * is in its frame, and we can clear the TIF_RESTORE_SIGMASK + * flag. + */ + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + clear_thread_flag(TIF_RESTORE_SIGMASK); + + return 1; } + +no_signal: + /* Did we come from a system call? */ + if (regs->syscall_nr >= 0) { + /* Restart the system call - no handlers present */ + switch (regs->regs[REG_RET]) { + case -ERESTARTNOHAND: + case -ERESTARTSYS: + case -ERESTARTNOINTR: + /* Decode Syscall # */ + regs->regs[REG_RET] = regs->syscall_nr; + regs->pc -= 4; + break; + + case -ERESTART_RESTARTBLOCK: + regs->regs[REG_RET] = __NR_restart_syscall; + regs->pc -= 4; + break; + } + } + + /* No signal to deliver -- put the saved sigmask back */ + if (test_thread_flag(TIF_RESTORE_SIGMASK)) { + clear_thread_flag(TIF_RESTORE_SIGMASK); + sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); + } + + return 0; } diff --git a/trunk/arch/sh/mm/Kconfig b/trunk/arch/sh/mm/Kconfig index 9c131cac91a4..56d0a7daa34b 100644 --- a/trunk/arch/sh/mm/Kconfig +++ b/trunk/arch/sh/mm/Kconfig @@ -237,6 +237,7 @@ choice config CACHE_WRITEBACK bool "Write-back" + depends on CPU_SH2A || CPU_SH3 || CPU_SH4 || CPU_SH5 config CACHE_WRITETHROUGH bool "Write-through" diff --git a/trunk/arch/sh/mm/Makefile_32 b/trunk/arch/sh/mm/Makefile_32 index 70e0906023cc..e295db60b91b 100644 --- a/trunk/arch/sh/mm/Makefile_32 +++ b/trunk/arch/sh/mm/Makefile_32 @@ -5,15 +5,12 @@ obj-y := init.o extable_32.o consistent.o ifndef CONFIG_CACHE_OFF -cache-$(CONFIG_CPU_SH2) := cache-sh2.o -cache-$(CONFIG_CPU_SH2A) := cache-sh2a.o -cache-$(CONFIG_CPU_SH3) := cache-sh3.o -cache-$(CONFIG_CPU_SH4) := cache-sh4.o -cache-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o +obj-$(CONFIG_CPU_SH2) += cache-sh2.o +obj-$(CONFIG_CPU_SH3) += cache-sh3.o +obj-$(CONFIG_CPU_SH4) += cache-sh4.o +obj-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o endif -obj-y += $(cache-y) - mmu-y := tlb-nommu.o pg-nommu.o mmu-$(CONFIG_MMU) := fault_32.o tlbflush_32.o ioremap_32.o diff --git a/trunk/arch/sh/mm/cache-sh2.c b/trunk/arch/sh/mm/cache-sh2.c index c4e80d2b764b..6614033f6be9 100644 --- a/trunk/arch/sh/mm/cache-sh2.c +++ b/trunk/arch/sh/mm/cache-sh2.c @@ -2,7 +2,6 @@ * arch/sh/mm/cache-sh2.c * * Copyright (C) 2002 Paul Mundt - * Copyright (C) 2008 Yoshinori Sato * * Released under the terms of the GNU GPL v2.0. */ @@ -25,15 +24,8 @@ void __flush_wback_region(void *start, int size) end = ((unsigned long)start + size + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); for (v = begin; v < end; v+=L1_CACHE_BYTES) { - unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0); - int way; - for (way = 0; way < 4; way++) { - unsigned long data = ctrl_inl(addr | (way << 12)); - if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { - data &= ~SH_CACHE_UPDATED; - ctrl_outl(data, addr | (way << 12)); - } - } + /* FIXME cache purge */ + ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); } } @@ -45,40 +37,21 @@ void __flush_purge_region(void *start, int size) begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); end = ((unsigned long)start + size + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); - - for (v = begin; v < end; v+=L1_CACHE_BYTES) - ctrl_outl((v & CACHE_PHYSADDR_MASK), - CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); + for (v = begin; v < end; v+=L1_CACHE_BYTES) { + ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); + } } void __flush_invalidate_region(void *start, int size) { -#ifdef CONFIG_CACHE_WRITEBACK - /* - * SH-2 does not support individual line invalidation, only a - * global invalidate. - */ - unsigned long ccr; - unsigned long flags; - local_irq_save(flags); - jump_to_uncached(); - - ccr = ctrl_inl(CCR); - ccr |= CCR_CACHE_INVALIDATE; - ctrl_outl(ccr, CCR); - - back_to_cached(); - local_irq_restore(flags); -#else unsigned long v; unsigned long begin, end; begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); end = ((unsigned long)start + size + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); - - for (v = begin; v < end; v+=L1_CACHE_BYTES) - ctrl_outl((v & CACHE_PHYSADDR_MASK), - CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); -#endif + for (v = begin; v < end; v+=L1_CACHE_BYTES) { + ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); + } } + diff --git a/trunk/arch/sh/mm/cache-sh2a.c b/trunk/arch/sh/mm/cache-sh2a.c deleted file mode 100644 index 62c0c5f35120..000000000000 --- a/trunk/arch/sh/mm/cache-sh2a.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * arch/sh/mm/cache-sh2a.c - * - * Copyright (C) 2008 Yoshinori Sato - * - * Released under the terms of the GNU GPL v2.0. - */ - -#include -#include - -#include -#include -#include -#include -#include - -void __flush_wback_region(void *start, int size) -{ - unsigned long v; - unsigned long begin, end; - unsigned long flags; - - begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); - end = ((unsigned long)start + size + L1_CACHE_BYTES-1) - & ~(L1_CACHE_BYTES-1); - - local_irq_save(flags); - jump_to_uncached(); - - for (v = begin; v < end; v+=L1_CACHE_BYTES) { - unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0); - int way; - for (way = 0; way < 4; way++) { - unsigned long data = ctrl_inl(addr | (way << 11)); - if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { - data &= ~SH_CACHE_UPDATED; - ctrl_outl(data, addr | (way << 11)); - } - } - } - - back_to_cached(); - local_irq_restore(flags); -} - -void __flush_purge_region(void *start, int size) -{ - unsigned long v; - unsigned long begin, end; - unsigned long flags; - - begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); - end = ((unsigned long)start + size + L1_CACHE_BYTES-1) - & ~(L1_CACHE_BYTES-1); - - local_irq_save(flags); - jump_to_uncached(); - - for (v = begin; v < end; v+=L1_CACHE_BYTES) { - ctrl_outl((v & CACHE_PHYSADDR_MASK), - CACHE_OC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); - } - back_to_cached(); - local_irq_restore(flags); -} - -void __flush_invalidate_region(void *start, int size) -{ - unsigned long v; - unsigned long begin, end; - unsigned long flags; - - begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); - end = ((unsigned long)start + size + L1_CACHE_BYTES-1) - & ~(L1_CACHE_BYTES-1); - local_irq_save(flags); - jump_to_uncached(); - -#ifdef CONFIG_CACHE_WRITEBACK - ctrl_outl(ctrl_inl(CCR) | CCR_OCACHE_INVALIDATE, CCR); - /* I-cache invalidate */ - for (v = begin; v < end; v+=L1_CACHE_BYTES) { - ctrl_outl((v & CACHE_PHYSADDR_MASK), - CACHE_IC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); - } -#else - for (v = begin; v < end; v+=L1_CACHE_BYTES) { - ctrl_outl((v & CACHE_PHYSADDR_MASK), - CACHE_IC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); - ctrl_outl((v & CACHE_PHYSADDR_MASK), - CACHE_OC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); - } -#endif - back_to_cached(); - local_irq_restore(flags); -} - -/* WBack O-Cache and flush I-Cache */ -void flush_icache_range(unsigned long start, unsigned long end) -{ - unsigned long v; - unsigned long flags; - - start = start & ~(L1_CACHE_BYTES-1); - end = (end + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); - - local_irq_save(flags); - jump_to_uncached(); - - for (v = start; v < end; v+=L1_CACHE_BYTES) { - unsigned long addr = (v & 0x000007f0); - int way; - /* O-Cache writeback */ - for (way = 0; way < 4; way++) { - unsigned long data = ctrl_inl(CACHE_OC_ADDRESS_ARRAY | addr | (way << 11)); - if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { - data &= ~SH_CACHE_UPDATED; - ctrl_outl(data, CACHE_OC_ADDRESS_ARRAY | addr | (way << 11)); - } - } - /* I-Cache invalidate */ - ctrl_outl(addr, - CACHE_IC_ADDRESS_ARRAY | addr | 0x00000008); - } - - back_to_cached(); - local_irq_restore(flags); -} diff --git a/trunk/arch/sh/mm/tlb-sh5.c b/trunk/arch/sh/mm/tlb-sh5.c index dae131243bcc..f34274a1ded3 100644 --- a/trunk/arch/sh/mm/tlb-sh5.c +++ b/trunk/arch/sh/mm/tlb-sh5.c @@ -15,7 +15,9 @@ #include /** - * sh64_tlb_init - Perform initial setup for the DTLB and ITLB. + * sh64_tlb_init + * + * Perform initial setup for the DTLB and ITLB. */ int __init sh64_tlb_init(void) { @@ -44,7 +46,9 @@ int __init sh64_tlb_init(void) } /** - * sh64_next_free_dtlb_entry - Find the next available DTLB entry + * sh64_next_free_dtlb_entry + * + * Find the next available DTLB entry */ unsigned long long sh64_next_free_dtlb_entry(void) { @@ -52,7 +56,9 @@ unsigned long long sh64_next_free_dtlb_entry(void) } /** - * sh64_get_wired_dtlb_entry - Allocate a wired (locked-in) entry in the DTLB + * sh64_get_wired_dtlb_entry + * + * Allocate a wired (locked-in) entry in the DTLB */ unsigned long long sh64_get_wired_dtlb_entry(void) { @@ -65,10 +71,12 @@ unsigned long long sh64_get_wired_dtlb_entry(void) } /** - * sh64_put_wired_dtlb_entry - Free a wired (locked-in) entry in the DTLB. + * sh64_put_wired_dtlb_entry * * @entry: Address of TLB slot. * + * Free a wired (locked-in) entry in the DTLB. + * * Works like a stack, last one to allocate must be first one to free. */ int sh64_put_wired_dtlb_entry(unsigned long long entry) @@ -107,7 +115,7 @@ int sh64_put_wired_dtlb_entry(unsigned long long entry) } /** - * sh64_setup_tlb_slot - Load up a translation in a wired slot. + * sh64_setup_tlb_slot * * @config_addr: Address of TLB slot. * @eaddr: Virtual address. @@ -146,7 +154,7 @@ inline void sh64_setup_tlb_slot(unsigned long long config_addr, } /** - * sh64_teardown_tlb_slot - Teardown a translation. + * sh64_teardown_tlb_slot * * @config_addr: Address of TLB slot. * diff --git a/trunk/arch/sh/tools/Makefile b/trunk/arch/sh/tools/Makefile index 567516b58acc..b5d202be8206 100644 --- a/trunk/arch/sh/tools/Makefile +++ b/trunk/arch/sh/tools/Makefile @@ -10,7 +10,7 @@ # Shamelessly cloned from ARM. # -include/asm-sh/machtypes.h: $(src)/gen-mach-types $(src)/mach-types +arch/sh/include/asm/machtypes.h: $(src)/gen-mach-types $(src)/mach-types @echo ' Generating $@' - $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi + $(Q)if [ ! -d arch/sh/include/asm ]; then mkdir -p arch/sh/include/asm; fi $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } diff --git a/trunk/arch/sparc64/kernel/irq.c b/trunk/arch/sparc64/kernel/irq.c index ba43d85e8dde..c481673d249c 100644 --- a/trunk/arch/sparc64/kernel/irq.c +++ b/trunk/arch/sparc64/kernel/irq.c @@ -915,18 +915,12 @@ static void __init sun4v_init_mondo_queues(void) alloc_one_mondo(&tb->nonresum_mondo_pa, tb->nonresum_qmask); alloc_one_kbuf(&tb->nonresum_kernel_buf_pa, tb->nonresum_qmask); - } -} - -static void __init init_send_mondo_info(void) -{ - int cpu; - - for_each_possible_cpu(cpu) { - struct trap_per_cpu *tb = &trap_block[cpu]; init_cpu_send_mondo_info(tb); } + + /* Load up the boot cpu's entries. */ + sun4v_register_mondo_queues(hard_smp_processor_id()); } static struct irqaction timer_irq_action = { @@ -955,13 +949,6 @@ void __init init_IRQ(void) if (tlb_type == hypervisor) sun4v_init_mondo_queues(); - init_send_mondo_info(); - - if (tlb_type == hypervisor) { - /* Load up the boot cpu's entries. */ - sun4v_register_mondo_queues(hard_smp_processor_id()); - } - /* We need to clear any IRQ's pending in the soft interrupt * registers, a spurious one could be left around from the * PROM timer which we just disabled. diff --git a/trunk/arch/sparc64/kernel/signal.c b/trunk/arch/sparc64/kernel/signal.c index ec82d76dc6f2..ca5a6ae3a6e2 100644 --- a/trunk/arch/sparc64/kernel/signal.c +++ b/trunk/arch/sparc64/kernel/signal.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/trunk/arch/sparc64/kernel/smp.c b/trunk/arch/sparc64/kernel/smp.c index 27b81775a4de..340842e51ce1 100644 --- a/trunk/arch/sparc64/kernel/smp.c +++ b/trunk/arch/sparc64/kernel/smp.c @@ -459,35 +459,27 @@ static void spitfire_xcall_helper(u64 data0, u64 data1, u64 data2, u64 pstate, u } } -static void spitfire_xcall_deliver(struct trap_per_cpu *tb, int cnt) +static inline void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask) { - u64 *mondo, data0, data1, data2; - u16 *cpu_list; u64 pstate; int i; __asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate)); - cpu_list = __va(tb->cpu_list_pa); - mondo = __va(tb->cpu_mondo_block_pa); - data0 = mondo[0]; - data1 = mondo[1]; - data2 = mondo[2]; - for (i = 0; i < cnt; i++) - spitfire_xcall_helper(data0, data1, data2, pstate, cpu_list[i]); + for_each_cpu_mask(i, mask) + spitfire_xcall_helper(data0, data1, data2, pstate, i); } /* Cheetah now allows to send the whole 64-bytes of data in the interrupt * packet, but we have no use for that. However we do take advantage of * the new pipelining feature (ie. dispatch to multiple cpus simultaneously). */ -static void cheetah_xcall_deliver(struct trap_per_cpu *tb, int cnt) +static void cheetah_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask) { + u64 pstate, ver, busy_mask; int nack_busy_id, is_jbus, need_more; - u64 *mondo, pstate, ver, busy_mask; - u16 *cpu_list; - cpu_list = __va(tb->cpu_list_pa); - mondo = __va(tb->cpu_mondo_block_pa); + if (cpus_empty(mask)) + return; /* Unfortunately, someone at Sun had the brilliant idea to make the * busy/nack fields hard-coded by ITID number for this Ultra-III @@ -510,7 +502,7 @@ static void cheetah_xcall_deliver(struct trap_per_cpu *tb, int cnt) "stxa %2, [%5] %6\n\t" "membar #Sync\n\t" : /* no outputs */ - : "r" (mondo[0]), "r" (mondo[1]), "r" (mondo[2]), + : "r" (data0), "r" (data1), "r" (data2), "r" (0x40), "r" (0x50), "r" (0x60), "i" (ASI_INTR_W)); @@ -519,16 +511,11 @@ static void cheetah_xcall_deliver(struct trap_per_cpu *tb, int cnt) { int i; - for (i = 0; i < cnt; i++) { - u64 target, nr; - - nr = cpu_list[i]; - if (nr == 0xffff) - continue; + for_each_cpu_mask(i, mask) { + u64 target = (i << 14) | 0x70; - target = (nr << 14) | 0x70; if (is_jbus) { - busy_mask |= (0x1UL << (nr * 2)); + busy_mask |= (0x1UL << (i * 2)); } else { target |= (nack_busy_id << 24); busy_mask |= (0x1UL << @@ -562,13 +549,11 @@ static void cheetah_xcall_deliver(struct trap_per_cpu *tb, int cnt) __asm__ __volatile__("wrpr %0, 0x0, %%pstate" : : "r" (pstate)); if (unlikely(need_more)) { - int i, this_cnt = 0; - for (i = 0; i < cnt; i++) { - if (cpu_list[i] == 0xffff) - continue; - cpu_list[i] = 0xffff; - this_cnt++; - if (this_cnt == 32) + int i, cnt = 0; + for_each_cpu_mask(i, mask) { + cpu_clear(i, mask); + cnt++; + if (cnt == 32) break; } goto retry; @@ -599,20 +584,16 @@ static void cheetah_xcall_deliver(struct trap_per_cpu *tb, int cnt) /* Clear out the mask bits for cpus which did not * NACK us. */ - for (i = 0; i < cnt; i++) { - u64 check_mask, nr; - - nr = cpu_list[i]; - if (nr == 0xffff) - continue; + for_each_cpu_mask(i, mask) { + u64 check_mask; if (is_jbus) - check_mask = (0x2UL << (2*nr)); + check_mask = (0x2UL << (2*i)); else check_mask = (0x2UL << this_busy_nack); if ((dispatch_stat & check_mask) == 0) - cpu_list[i] = 0xffff; + cpu_clear(i, mask); this_busy_nack += 2; if (this_busy_nack == 64) break; @@ -624,17 +605,47 @@ static void cheetah_xcall_deliver(struct trap_per_cpu *tb, int cnt) } /* Multi-cpu list version. */ -static void hypervisor_xcall_deliver(struct trap_per_cpu *tb, int cnt) +static void hypervisor_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask) { - int retries, this_cpu, prev_sent, i, saw_cpu_error; - unsigned long status; + struct trap_per_cpu *tb; u16 *cpu_list; + u64 *mondo; + cpumask_t error_mask; + unsigned long flags, status; + int cnt, retries, this_cpu, prev_sent, i; + + if (cpus_empty(mask)) + return; + + /* We have to do this whole thing with interrupts fully disabled. + * Otherwise if we send an xcall from interrupt context it will + * corrupt both our mondo block and cpu list state. + * + * One consequence of this is that we cannot use timeout mechanisms + * that depend upon interrupts being delivered locally. So, for + * example, we cannot sample jiffies and expect it to advance. + * + * Fortunately, udelay() uses %stick/%tick so we can use that. + */ + local_irq_save(flags); this_cpu = smp_processor_id(); + tb = &trap_block[this_cpu]; + + mondo = __va(tb->cpu_mondo_block_pa); + mondo[0] = data0; + mondo[1] = data1; + mondo[2] = data2; + wmb(); cpu_list = __va(tb->cpu_list_pa); - saw_cpu_error = 0; + /* Setup the initial cpu list. */ + cnt = 0; + for_each_cpu_mask(i, mask) + cpu_list[cnt++] = i; + + cpus_clear(error_mask); retries = 0; prev_sent = 0; do { @@ -679,9 +690,10 @@ static void hypervisor_xcall_deliver(struct trap_per_cpu *tb, int cnt) continue; err = sun4v_cpu_state(cpu); - if (err == HV_CPU_STATE_ERROR) { - saw_cpu_error = (cpu + 1); + if (err >= 0 && + err == HV_CPU_STATE_ERROR) { cpu_list[i] = 0xffff; + cpu_set(cpu, error_mask); } } } else if (unlikely(status != HV_EWOULDBLOCK)) @@ -705,24 +717,32 @@ static void hypervisor_xcall_deliver(struct trap_per_cpu *tb, int cnt) } } while (1); - if (unlikely(saw_cpu_error)) + local_irq_restore(flags); + + if (unlikely(!cpus_empty(error_mask))) goto fatal_mondo_cpu_error; return; fatal_mondo_cpu_error: printk(KERN_CRIT "CPU[%d]: SUN4V mondo cpu error, some target cpus " - "(including %d) were in error state\n", - this_cpu, saw_cpu_error - 1); + "were in error state\n", + this_cpu); + printk(KERN_CRIT "CPU[%d]: Error mask [ ", this_cpu); + for_each_cpu_mask(i, error_mask) + printk("%d ", i); + printk("]\n"); return; fatal_mondo_timeout: + local_irq_restore(flags); printk(KERN_CRIT "CPU[%d]: SUN4V mondo timeout, no forward " " progress after %d retries.\n", this_cpu, retries); goto dump_cpu_list_and_out; fatal_mondo_error: + local_irq_restore(flags); printk(KERN_CRIT "CPU[%d]: Unexpected SUN4V mondo error %lu\n", this_cpu, status); printk(KERN_CRIT "CPU[%d]: Args were cnt(%d) cpulist_pa(%lx) " @@ -736,93 +756,58 @@ static void hypervisor_xcall_deliver(struct trap_per_cpu *tb, int cnt) printk("]\n"); } -static void (*xcall_deliver_impl)(struct trap_per_cpu *, int); - -static void xcall_deliver(u64 data0, u64 data1, u64 data2, const cpumask_t *mask) -{ - struct trap_per_cpu *tb; - int this_cpu, i, cnt; - unsigned long flags; - u16 *cpu_list; - u64 *mondo; - - /* We have to do this whole thing with interrupts fully disabled. - * Otherwise if we send an xcall from interrupt context it will - * corrupt both our mondo block and cpu list state. - * - * One consequence of this is that we cannot use timeout mechanisms - * that depend upon interrupts being delivered locally. So, for - * example, we cannot sample jiffies and expect it to advance. - * - * Fortunately, udelay() uses %stick/%tick so we can use that. - */ - local_irq_save(flags); - - this_cpu = smp_processor_id(); - tb = &trap_block[this_cpu]; - - mondo = __va(tb->cpu_mondo_block_pa); - mondo[0] = data0; - mondo[1] = data1; - mondo[2] = data2; - wmb(); - - cpu_list = __va(tb->cpu_list_pa); - - /* Setup the initial cpu list. */ - cnt = 0; - for_each_cpu_mask_nr(i, *mask) { - if (i == this_cpu || !cpu_online(i)) - continue; - cpu_list[cnt++] = i; - } - - if (cnt) - xcall_deliver_impl(tb, cnt); - - local_irq_restore(flags); -} - -/* Send cross call to all processors mentioned in MASK_P - * except self. Really, there are only two cases currently, - * "&cpu_online_map" and "&mm->cpu_vm_mask". +/* Send cross call to all processors mentioned in MASK + * except self. */ -static void smp_cross_call_masked(unsigned long *func, u32 ctx, u64 data1, u64 data2, const cpumask_t *mask) +static void smp_cross_call_masked(unsigned long *func, u32 ctx, u64 data1, u64 data2, cpumask_t mask) { u64 data0 = (((u64)ctx)<<32 | (((u64)func) & 0xffffffff)); + int this_cpu = get_cpu(); - xcall_deliver(data0, data1, data2, mask); -} + cpus_and(mask, mask, cpu_online_map); + cpu_clear(this_cpu, mask); -/* Send cross call to all processors except self. */ -static void smp_cross_call(unsigned long *func, u32 ctx, u64 data1, u64 data2) -{ - smp_cross_call_masked(func, ctx, data1, data2, &cpu_online_map); + if (tlb_type == spitfire) + spitfire_xcall_deliver(data0, data1, data2, mask); + else if (tlb_type == cheetah || tlb_type == cheetah_plus) + cheetah_xcall_deliver(data0, data1, data2, mask); + else + hypervisor_xcall_deliver(data0, data1, data2, mask); + /* NOTE: Caller runs local copy on master. */ + + put_cpu(); } extern unsigned long xcall_sync_tick; static void smp_start_sync_tick_client(int cpu) { - xcall_deliver((u64) &xcall_sync_tick, 0, 0, - &cpumask_of_cpu(cpu)); + cpumask_t mask = cpumask_of_cpu(cpu); + + smp_cross_call_masked(&xcall_sync_tick, + 0, 0, 0, mask); } extern unsigned long xcall_call_function; void arch_send_call_function_ipi(cpumask_t mask) { - xcall_deliver((u64) &xcall_call_function, 0, 0, &mask); + smp_cross_call_masked(&xcall_call_function, 0, 0, 0, mask); } extern unsigned long xcall_call_function_single; void arch_send_call_function_single_ipi(int cpu) { - xcall_deliver((u64) &xcall_call_function_single, 0, 0, - &cpumask_of_cpu(cpu)); + cpumask_t mask = cpumask_of_cpu(cpu); + + smp_cross_call_masked(&xcall_call_function_single, 0, 0, 0, mask); } +/* Send cross call to all processors except self. */ +#define smp_cross_call(func, ctx, data1, data2) \ + smp_cross_call_masked(func, ctx, data1, data2, cpu_online_map) + void smp_call_function_client(int irq, struct pt_regs *regs) { clear_softint(1 << irq); @@ -892,6 +877,7 @@ static inline void __local_flush_dcache_page(struct page *page) void smp_flush_dcache_page_impl(struct page *page, int cpu) { + cpumask_t mask = cpumask_of_cpu(cpu); int this_cpu; if (tlb_type == hypervisor) @@ -907,24 +893,29 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu) __local_flush_dcache_page(page); } else if (cpu_online(cpu)) { void *pg_addr = page_address(page); - u64 data0 = 0; + u64 data0; if (tlb_type == spitfire) { - data0 = ((u64)&xcall_flush_dcache_page_spitfire); + data0 = + ((u64)&xcall_flush_dcache_page_spitfire); if (page_mapping(page) != NULL) data0 |= ((u64)1 << 32); + spitfire_xcall_deliver(data0, + __pa(pg_addr), + (u64) pg_addr, + mask); } else if (tlb_type == cheetah || tlb_type == cheetah_plus) { #ifdef DCACHE_ALIASING_POSSIBLE - data0 = ((u64)&xcall_flush_dcache_page_cheetah); + data0 = + ((u64)&xcall_flush_dcache_page_cheetah); + cheetah_xcall_deliver(data0, + __pa(pg_addr), + 0, mask); #endif } - if (data0) { - xcall_deliver(data0, __pa(pg_addr), - (u64) pg_addr, &cpumask_of_cpu(cpu)); #ifdef CONFIG_DEBUG_DCFLUSH - atomic_inc(&dcpage_flushes_xcall); + atomic_inc(&dcpage_flushes_xcall); #endif - } } put_cpu(); @@ -932,41 +923,66 @@ void smp_flush_dcache_page_impl(struct page *page, int cpu) void flush_dcache_page_all(struct mm_struct *mm, struct page *page) { - void *pg_addr; - int this_cpu; + void *pg_addr = page_address(page); + cpumask_t mask = cpu_online_map; u64 data0; + int this_cpu; if (tlb_type == hypervisor) return; this_cpu = get_cpu(); + cpu_clear(this_cpu, mask); + #ifdef CONFIG_DEBUG_DCFLUSH atomic_inc(&dcpage_flushes); #endif - data0 = 0; - pg_addr = page_address(page); + if (cpus_empty(mask)) + goto flush_self; if (tlb_type == spitfire) { data0 = ((u64)&xcall_flush_dcache_page_spitfire); if (page_mapping(page) != NULL) data0 |= ((u64)1 << 32); + spitfire_xcall_deliver(data0, + __pa(pg_addr), + (u64) pg_addr, + mask); } else if (tlb_type == cheetah || tlb_type == cheetah_plus) { #ifdef DCACHE_ALIASING_POSSIBLE data0 = ((u64)&xcall_flush_dcache_page_cheetah); + cheetah_xcall_deliver(data0, + __pa(pg_addr), + 0, mask); #endif } - if (data0) { - xcall_deliver(data0, __pa(pg_addr), - (u64) pg_addr, &cpu_online_map); #ifdef CONFIG_DEBUG_DCFLUSH - atomic_inc(&dcpage_flushes_xcall); + atomic_inc(&dcpage_flushes_xcall); #endif - } + flush_self: __local_flush_dcache_page(page); put_cpu(); } +static void __smp_receive_signal_mask(cpumask_t mask) +{ + smp_cross_call_masked(&xcall_receive_signal, 0, 0, 0, mask); +} + +void smp_receive_signal(int cpu) +{ + cpumask_t mask = cpumask_of_cpu(cpu); + + if (cpu_online(cpu)) + __smp_receive_signal_mask(mask); +} + +void smp_receive_signal_client(int irq, struct pt_regs *regs) +{ + clear_softint(1 << irq); +} + void smp_new_mmu_context_version_client(int irq, struct pt_regs *regs) { struct mm_struct *mm; @@ -1067,7 +1083,7 @@ void smp_flush_tlb_mm(struct mm_struct *mm) smp_cross_call_masked(&xcall_flush_tlb_mm, ctx, 0, 0, - &mm->cpu_vm_mask); + mm->cpu_vm_mask); local_flush_and_out: __flush_tlb_mm(ctx, SECONDARY_CONTEXT); @@ -1085,7 +1101,7 @@ void smp_flush_tlb_pending(struct mm_struct *mm, unsigned long nr, unsigned long else smp_cross_call_masked(&xcall_flush_tlb_pending, ctx, nr, (unsigned long) vaddrs, - &mm->cpu_vm_mask); + mm->cpu_vm_mask); __flush_tlb_pending(ctx, nr, vaddrs); @@ -1186,16 +1202,6 @@ void __devinit smp_prepare_boot_cpu(void) { } -void __init smp_setup_processor_id(void) -{ - if (tlb_type == spitfire) - xcall_deliver_impl = spitfire_xcall_deliver; - else if (tlb_type == cheetah || tlb_type == cheetah_plus) - xcall_deliver_impl = cheetah_xcall_deliver; - else - xcall_deliver_impl = hypervisor_xcall_deliver; -} - void __devinit smp_fill_in_sib_core_maps(void) { unsigned int i; @@ -1364,13 +1370,7 @@ void __init smp_cpus_done(unsigned int max_cpus) void smp_send_reschedule(int cpu) { - xcall_deliver((u64) &xcall_receive_signal, 0, 0, - &cpumask_of_cpu(cpu)); -} - -void smp_receive_signal_client(int irq, struct pt_regs *regs) -{ - clear_softint(1 << irq); + smp_receive_signal(cpu); } /* This is a nop because we capture all other cpus diff --git a/trunk/arch/sparc64/mm/tsb.c b/trunk/arch/sparc64/mm/tsb.c index 587f8efb2e05..3547937b17a2 100644 --- a/trunk/arch/sparc64/mm/tsb.c +++ b/trunk/arch/sparc64/mm/tsb.c @@ -1,10 +1,9 @@ /* arch/sparc64/mm/tsb.c * - * Copyright (C) 2006, 2008 David S. Miller + * Copyright (C) 2006 David S. Miller */ #include -#include #include #include #include @@ -416,9 +415,7 @@ void tsb_grow(struct mm_struct *mm, unsigned long tsb_index, unsigned long rss) tsb_context_switch(mm); /* Now force other processors to do the same. */ - preempt_disable(); smp_tsb_sync(mm); - preempt_enable(); /* Now it is safe to free the old tsb. */ kmem_cache_free(tsb_caches[old_cache_index], old_tsb); diff --git a/trunk/arch/xtensa/kernel/xtensa_ksyms.c b/trunk/arch/xtensa/kernel/xtensa_ksyms.c index c9a7c5b74a0d..6e52cdd6166f 100644 --- a/trunk/arch/xtensa/kernel/xtensa_ksyms.c +++ b/trunk/arch/xtensa/kernel/xtensa_ksyms.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include diff --git a/trunk/block/scsi_ioctl.c b/trunk/block/scsi_ioctl.c index 12a5182173f6..c5b9bcfc0a6d 100644 --- a/trunk/block/scsi_ioctl.c +++ b/trunk/block/scsi_ioctl.c @@ -518,7 +518,7 @@ int scsi_cmd_ioctl(struct file *file, struct request_queue *q, hdr.sbp = cgc.sense; if (hdr.sbp) hdr.mx_sb_len = sizeof(struct request_sense); - hdr.timeout = jiffies_to_msecs(cgc.timeout); + hdr.timeout = cgc.timeout; hdr.cmdp = ((struct cdrom_generic_command __user*) arg)->cmd; hdr.cmd_len = sizeof(cgc.cmd); diff --git a/trunk/drivers/block/cciss.c b/trunk/drivers/block/cciss.c index 0ce0c279aabf..d81632cd7d06 100644 --- a/trunk/drivers/block/cciss.c +++ b/trunk/drivers/block/cciss.c @@ -1292,6 +1292,8 @@ static void cciss_check_queues(ctlr_info_t *h) h->next_to_run = curr_queue; break; } + } else { + curr_queue = (curr_queue + 1) % (h->highest_lun + 1); } } } diff --git a/trunk/drivers/cdrom/cdrom.c b/trunk/drivers/cdrom/cdrom.c index d9d1b65d206c..a5da35632651 100644 --- a/trunk/drivers/cdrom/cdrom.c +++ b/trunk/drivers/cdrom/cdrom.c @@ -1436,6 +1436,10 @@ static void cdrom_count_tracks(struct cdrom_device_info *cdi, tracktype* tracks) tracks->xa=0; tracks->error=0; cdinfo(CD_COUNT_TRACKS, "entering cdrom_count_tracks\n"); + if (!CDROM_CAN(CDC_PLAY_AUDIO)) { + tracks->error=CDS_NO_INFO; + return; + } /* Grab the TOC header so we can see how many tracks there are */ if ((ret = cdi->ops->audio_ioctl(cdi, CDROMREADTOCHDR, &header))) { if (ret == -ENOMEDIUM) diff --git a/trunk/drivers/char/efirtc.c b/trunk/drivers/char/efirtc.c index 34d15d548236..67fbd7aab5db 100644 --- a/trunk/drivers/char/efirtc.c +++ b/trunk/drivers/char/efirtc.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff --git a/trunk/drivers/char/hvc_console.h b/trunk/drivers/char/hvc_console.h index 9790201718ae..d9ce10915625 100644 --- a/trunk/drivers/char/hvc_console.h +++ b/trunk/drivers/char/hvc_console.h @@ -6,7 +6,7 @@ * Ryan S. Arnold * * hvc_console header information: - * moved here from arch/powerpc/include/asm/hvconsole.h + * moved here from include/asm-powerpc/hvconsole.h * and drivers/char/hvc_console.c * * This program is free software; you can redistribute it and/or modify diff --git a/trunk/drivers/char/hvcs.c b/trunk/drivers/char/hvcs.c index 473d9b14439a..786d518e9477 100644 --- a/trunk/drivers/char/hvcs.c +++ b/trunk/drivers/char/hvcs.c @@ -114,7 +114,7 @@ * the hvcs_final_close() function in order to get it out of the spinlock. * Rearranged hvcs_close(). Cleaned up some printks and did some housekeeping * on the changelog. Removed local CLC_LENGTH and used HVCS_CLC_LENGTH from - * arch/powerepc/include/asm/hvcserver.h + * include/asm-powerpc/hvcserver.h * * 1.3.2 -> 1.3.3 Replaced yield() in hvcs_close() with tty_wait_until_sent() to * prevent possible lockup with realtime scheduling as similarily pointed out by diff --git a/trunk/drivers/char/viocons.c b/trunk/drivers/char/viocons.c index f48892ba12f5..65fb848e1cce 100644 --- a/trunk/drivers/char/viocons.c +++ b/trunk/drivers/char/viocons.c @@ -705,6 +705,10 @@ static int viotty_ioctl(struct tty_struct *tty, struct file *file, case KDSKBLED: return 0; } + /* FIXME: WTF is this being called for ??? */ + lock_kernel(); + ret = n_tty_ioctl(tty, file, cmd, arg); + unlock_kernel(); return ret; } diff --git a/trunk/drivers/char/vt.c b/trunk/drivers/char/vt.c index 1bc00c9d860d..82a51f38a546 100644 --- a/trunk/drivers/char/vt.c +++ b/trunk/drivers/char/vt.c @@ -916,6 +916,7 @@ 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; + mutex_lock(&vc->vc_tty->termios_mutex); spin_lock_irq(&vc->vc_tty->ctrl_lock); if ((ws.ws_row != cws->ws_row || ws.ws_col != cws->ws_col)) pgrp = get_pid(vc->vc_tty->pgrp); @@ -925,6 +926,7 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) put_pid(pgrp); } *cws = ws; + mutex_unlock(&vc->vc_tty->termios_mutex); } if (CON_IS_VISIBLE(vc)) diff --git a/trunk/drivers/ide/Kconfig b/trunk/drivers/ide/Kconfig index a34758d29516..130ef64b44f7 100644 --- a/trunk/drivers/ide/Kconfig +++ b/trunk/drivers/ide/Kconfig @@ -54,6 +54,16 @@ menuconfig IDE if IDE +config IDE_MAX_HWIFS + int "Max IDE interfaces" + depends on ALPHA || SUPERH || IA64 || EMBEDDED + range 1 10 + default 4 + help + This is the maximum number of IDE hardware interfaces that will + be supported by the driver. Make sure it is at least as high as + the number of IDE interfaces in your system. + config BLK_DEV_IDE tristate "Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support" ---help--- diff --git a/trunk/drivers/ide/arm/palm_bk3710.c b/trunk/drivers/ide/arm/palm_bk3710.c index f788fa5a977b..3e842d60eae9 100644 --- a/trunk/drivers/ide/arm/palm_bk3710.c +++ b/trunk/drivers/ide/arm/palm_bk3710.c @@ -309,7 +309,7 @@ static void __devinit palm_bk3710_chipinit(void __iomem *base) palm_bk3710_setpiomode(base, NULL, 1, 600, 0); } -static u8 palm_bk3710_cable_detect(ide_hwif_t *hwif) +static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif) { return ATA_CBL_PATA80; } diff --git a/trunk/drivers/ide/ide-cd.c b/trunk/drivers/ide/ide-cd.c index 89a112d513ad..e617cf08aef6 100644 --- a/trunk/drivers/ide/ide-cd.c +++ b/trunk/drivers/ide/ide-cd.c @@ -66,11 +66,11 @@ static struct cdrom_info *ide_cd_get(struct gendisk *disk) mutex_lock(&idecd_ref_mutex); cd = ide_cd_g(disk); if (cd) { - if (ide_device_get(cd->drive)) + kref_get(&cd->kref); + if (ide_device_get(cd->drive)) { + kref_put(&cd->kref, ide_cd_release); cd = NULL; - else - kref_get(&cd->kref); - + } } mutex_unlock(&idecd_ref_mutex); return cd; @@ -78,11 +78,9 @@ static struct cdrom_info *ide_cd_get(struct gendisk *disk) static void ide_cd_put(struct cdrom_info *cd) { - ide_drive_t *drive = cd->drive; - mutex_lock(&idecd_ref_mutex); + ide_device_put(cd->drive); kref_put(&cd->kref, ide_cd_release); - ide_device_put(drive); mutex_unlock(&idecd_ref_mutex); } @@ -1307,7 +1305,6 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, int stat; unsigned char cmd[BLK_MAX_CDB]; unsigned len = sizeof(capbuf); - u32 blocklen; memset(cmd, 0, BLK_MAX_CDB); cmd[0] = GPCMD_READ_CDVD_CAPACITY; @@ -1320,24 +1317,23 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, /* * Sanity check the given block size */ - blocklen = be32_to_cpu(capbuf.blocklen); - switch (blocklen) { - case 512: - case 1024: - case 2048: - case 4096: + switch (capbuf.blocklen) { + case __constant_cpu_to_be32(512): + case __constant_cpu_to_be32(1024): + case __constant_cpu_to_be32(2048): + case __constant_cpu_to_be32(4096): break; default: printk(KERN_ERR "%s: weird block size %u\n", - drive->name, blocklen); + drive->name, capbuf.blocklen); printk(KERN_ERR "%s: default to 2kb block size\n", drive->name); - blocklen = 2048; + capbuf.blocklen = __constant_cpu_to_be32(2048); break; } *capacity = 1 + be32_to_cpu(capbuf.lba); - *sectors_per_frame = blocklen >> SECTOR_BITS; + *sectors_per_frame = be32_to_cpu(capbuf.blocklen) >> SECTOR_BITS; return 0; } diff --git a/trunk/drivers/ide/ide-disk.c b/trunk/drivers/ide/ide-disk.c index 68b9cf0138b0..28d85b410f7c 100644 --- a/trunk/drivers/ide/ide-disk.c +++ b/trunk/drivers/ide/ide-disk.c @@ -65,10 +65,11 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk) mutex_lock(&idedisk_ref_mutex); idkp = ide_disk_g(disk); if (idkp) { - if (ide_device_get(idkp->drive)) + kref_get(&idkp->kref); + if (ide_device_get(idkp->drive)) { + kref_put(&idkp->kref, ide_disk_release); idkp = NULL; - else - kref_get(&idkp->kref); + } } mutex_unlock(&idedisk_ref_mutex); return idkp; @@ -76,11 +77,9 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk) static void ide_disk_put(struct ide_disk_obj *idkp) { - ide_drive_t *drive = idkp->drive; - mutex_lock(&idedisk_ref_mutex); + ide_device_put(idkp->drive); kref_put(&idkp->kref, ide_disk_release); - ide_device_put(drive); mutex_unlock(&idedisk_ref_mutex); } diff --git a/trunk/drivers/ide/ide-dma.c b/trunk/drivers/ide/ide-dma.c index adc682755857..71c377a7bcf2 100644 --- a/trunk/drivers/ide/ide-dma.c +++ b/trunk/drivers/ide/ide-dma.c @@ -649,7 +649,11 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base, u8 req_mode) if (id->field_valid & 2) { mask = id->dma_1word & hwif->swdma_mask; } else if (id->tDMA) { - u8 mode = id->tDMA; + /* + * ide_fix_driveid() doesn't convert ->tDMA to the + * CPU endianness so we need to do it here + */ + u8 mode = le16_to_cpu(id->tDMA); /* * if the mode is valid convert it to the mask diff --git a/trunk/drivers/ide/ide-floppy.c b/trunk/drivers/ide/ide-floppy.c index e9034c0125f3..ca11a26746f1 100644 --- a/trunk/drivers/ide/ide-floppy.c +++ b/trunk/drivers/ide/ide-floppy.c @@ -167,10 +167,11 @@ static struct ide_floppy_obj *ide_floppy_get(struct gendisk *disk) mutex_lock(&idefloppy_ref_mutex); floppy = ide_floppy_g(disk); if (floppy) { - if (ide_device_get(floppy->drive)) + kref_get(&floppy->kref); + if (ide_device_get(floppy->drive)) { + kref_put(&floppy->kref, idefloppy_cleanup_obj); floppy = NULL; - else - kref_get(&floppy->kref); + } } mutex_unlock(&idefloppy_ref_mutex); return floppy; @@ -178,11 +179,9 @@ static struct ide_floppy_obj *ide_floppy_get(struct gendisk *disk) static void ide_floppy_put(struct ide_floppy_obj *floppy) { - ide_drive_t *drive = floppy->drive; - mutex_lock(&idefloppy_ref_mutex); + ide_device_put(floppy->drive); kref_put(&floppy->kref, idefloppy_cleanup_obj); - ide_device_put(drive); mutex_unlock(&idefloppy_ref_mutex); } diff --git a/trunk/drivers/ide/ide-iops.c b/trunk/drivers/ide/ide-iops.c index 2cbadffe922e..8aae91764513 100644 --- a/trunk/drivers/ide/ide-iops.c +++ b/trunk/drivers/ide/ide-iops.c @@ -484,11 +484,11 @@ void ide_fix_driveid (struct hd_driveid *id) for (i = 0; i < 3; i++) id->words157_159[i] = __le16_to_cpu(id->words157_159[i]); id->cfa_power = __le16_to_cpu(id->cfa_power); - for (i = 0; i < 15; i++) + for (i = 0; i < 14; i++) id->words161_175[i] = __le16_to_cpu(id->words161_175[i]); - for (i = 0; i < 30; i++) + for (i = 0; i < 31; i++) id->words176_205[i] = __le16_to_cpu(id->words176_205[i]); - for (i = 0; i < 49; i++) + for (i = 0; i < 48; i++) id->words206_254[i] = __le16_to_cpu(id->words206_254[i]); id->integrity_word = __le16_to_cpu(id->integrity_word); # else diff --git a/trunk/drivers/ide/ide-tape.c b/trunk/drivers/ide/ide-tape.c index 1bce84b56630..82c2afe4d28a 100644 --- a/trunk/drivers/ide/ide-tape.c +++ b/trunk/drivers/ide/ide-tape.c @@ -331,10 +331,11 @@ static struct ide_tape_obj *ide_tape_get(struct gendisk *disk) mutex_lock(&idetape_ref_mutex); tape = ide_tape_g(disk); if (tape) { - if (ide_device_get(tape->drive)) + kref_get(&tape->kref); + if (ide_device_get(tape->drive)) { + kref_put(&tape->kref, ide_tape_release); tape = NULL; - else - kref_get(&tape->kref); + } } mutex_unlock(&idetape_ref_mutex); return tape; @@ -342,11 +343,9 @@ static struct ide_tape_obj *ide_tape_get(struct gendisk *disk) static void ide_tape_put(struct ide_tape_obj *tape) { - ide_drive_t *drive = tape->drive; - mutex_lock(&idetape_ref_mutex); + ide_device_put(tape->drive); kref_put(&tape->kref, ide_tape_release); - ide_device_put(drive); mutex_unlock(&idetape_ref_mutex); } diff --git a/trunk/drivers/ide/pci/aec62xx.c b/trunk/drivers/ide/pci/aec62xx.c index 40644b6f1c00..e0c8fe7d9fea 100644 --- a/trunk/drivers/ide/pci/aec62xx.c +++ b/trunk/drivers/ide/pci/aec62xx.c @@ -160,7 +160,7 @@ static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev) return dev->irq; } -static u8 atp86x_cable_detect(ide_hwif_t *hwif) +static u8 __devinit atp86x_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); u8 ata66 = 0, mask = hwif->channel ? 0x02 : 0x01; diff --git a/trunk/drivers/ide/pci/alim15x3.c b/trunk/drivers/ide/pci/alim15x3.c index d647526af557..b582687e0cd4 100644 --- a/trunk/drivers/ide/pci/alim15x3.c +++ b/trunk/drivers/ide/pci/alim15x3.c @@ -371,7 +371,7 @@ static int ali_cable_override(struct pci_dev *pdev) * FIXME: frobs bits that are not defined on newer ALi devicea */ -static u8 ali_cable_detect(ide_hwif_t *hwif) +static u8 __devinit ali_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); unsigned long flags; diff --git a/trunk/drivers/ide/pci/amd74xx.c b/trunk/drivers/ide/pci/amd74xx.c index 1e66a960a96a..2cea7bf51a0f 100644 --- a/trunk/drivers/ide/pci/amd74xx.c +++ b/trunk/drivers/ide/pci/amd74xx.c @@ -175,7 +175,7 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev) return dev->irq; } -static u8 amd_cable_detect(ide_hwif_t *hwif) +static u8 __devinit amd_cable_detect(ide_hwif_t *hwif) { if ((amd_80w >> hwif->channel) & 1) return ATA_CBL_PATA80; diff --git a/trunk/drivers/ide/pci/atiixp.c b/trunk/drivers/ide/pci/atiixp.c index 41f6cb6c163a..332f08f43b56 100644 --- a/trunk/drivers/ide/pci/atiixp.c +++ b/trunk/drivers/ide/pci/atiixp.c @@ -119,7 +119,7 @@ static void atiixp_set_dma_mode(ide_drive_t *drive, const u8 speed) spin_unlock_irqrestore(&atiixp_lock, flags); } -static u8 atiixp_cable_detect(ide_hwif_t *hwif) +static u8 __devinit atiixp_cable_detect(ide_hwif_t *hwif) { struct pci_dev *pdev = to_pci_dev(hwif->dev); u8 udma_mode = 0, ch = hwif->channel; diff --git a/trunk/drivers/ide/pci/cmd64x.c b/trunk/drivers/ide/pci/cmd64x.c index e064398e03b4..1360b4fa9fd3 100644 --- a/trunk/drivers/ide/pci/cmd64x.c +++ b/trunk/drivers/ide/pci/cmd64x.c @@ -354,7 +354,7 @@ static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev) return 0; } -static u8 cmd64x_cable_detect(ide_hwif_t *hwif) +static u8 __devinit cmd64x_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); u8 bmidecsr = 0, mask = hwif->channel ? 0x02 : 0x01; diff --git a/trunk/drivers/ide/pci/cs5520.c b/trunk/drivers/ide/pci/cs5520.c index 151844fcbb07..c0364b287f17 100644 --- a/trunk/drivers/ide/pci/cs5520.c +++ b/trunk/drivers/ide/pci/cs5520.c @@ -96,7 +96,6 @@ static const struct ide_port_ops cs5520_port_ops = { static const struct ide_port_info cyrix_chipset __devinitdata = { .name = DRV_NAME, - .enablebits = { { 0x60, 0x01, 0x01 }, { 0x60, 0x02, 0x02 } }, .port_ops = &cs5520_port_ops, .host_flags = IDE_HFLAG_ISA_PORTS | IDE_HFLAG_CS5520, .pio_mask = ATA_PIO4, diff --git a/trunk/drivers/ide/pci/cs5535.c b/trunk/drivers/ide/pci/cs5535.c index dd3dc23af995..f7b50cdeefa6 100644 --- a/trunk/drivers/ide/pci/cs5535.c +++ b/trunk/drivers/ide/pci/cs5535.c @@ -153,7 +153,7 @@ static void cs5535_set_pio_mode(ide_drive_t *drive, const u8 pio) cs5535_set_speed(drive, XFER_PIO_0 + pio); } -static u8 cs5535_cable_detect(ide_hwif_t *hwif) +static u8 __devinit cs5535_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); u8 bit; diff --git a/trunk/drivers/ide/pci/hpt366.c b/trunk/drivers/ide/pci/hpt366.c index 748793a413ab..5271b246b88c 100644 --- a/trunk/drivers/ide/pci/hpt366.c +++ b/trunk/drivers/ide/pci/hpt366.c @@ -1214,7 +1214,7 @@ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev) return dev->irq; } -static u8 hpt3xx_cable_detect(ide_hwif_t *hwif) +static u8 __devinit hpt3xx_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); struct ide_host *host = pci_get_drvdata(dev); diff --git a/trunk/drivers/ide/pci/it8213.c b/trunk/drivers/ide/pci/it8213.c index 652e47dd7e89..6eba8f188264 100644 --- a/trunk/drivers/ide/pci/it8213.c +++ b/trunk/drivers/ide/pci/it8213.c @@ -141,7 +141,7 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed) } } -static u8 it8213_cable_detect(ide_hwif_t *hwif) +static u8 __devinit it8213_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); u8 reg42h = 0; diff --git a/trunk/drivers/ide/pci/it821x.c b/trunk/drivers/ide/pci/it821x.c index b6dc723de702..e16a1d113a2a 100644 --- a/trunk/drivers/ide/pci/it821x.c +++ b/trunk/drivers/ide/pci/it821x.c @@ -428,7 +428,7 @@ static void it821x_set_dma_mode(ide_drive_t *drive, const u8 speed) * the needed logic onboard. */ -static u8 it821x_cable_detect(ide_hwif_t *hwif) +static u8 __devinit it821x_cable_detect(ide_hwif_t *hwif) { /* The reference driver also only does disk side */ return ATA_CBL_PATA80; @@ -443,7 +443,7 @@ static u8 it821x_cable_detect(ide_hwif_t *hwif) * final tuning that is needed, or fixups to work around bugs. */ -static void it821x_quirkproc(ide_drive_t *drive) +static void __devinit it821x_quirkproc(ide_drive_t *drive) { struct it821x_dev *itdev = ide_get_hwifdata(drive->hwif); struct hd_driveid *id = drive->id; diff --git a/trunk/drivers/ide/pci/jmicron.c b/trunk/drivers/ide/pci/jmicron.c index bb9d09d8f196..545b6e172d9b 100644 --- a/trunk/drivers/ide/pci/jmicron.c +++ b/trunk/drivers/ide/pci/jmicron.c @@ -27,7 +27,7 @@ typedef enum { * Returns the cable type. */ -static u8 jmicron_cable_detect(ide_hwif_t *hwif) +static u8 __devinit jmicron_cable_detect(ide_hwif_t *hwif) { struct pci_dev *pdev = to_pci_dev(hwif->dev); diff --git a/trunk/drivers/ide/pci/pdc202xx_new.c b/trunk/drivers/ide/pci/pdc202xx_new.c index 0f609b72f470..998615fa285f 100644 --- a/trunk/drivers/ide/pci/pdc202xx_new.c +++ b/trunk/drivers/ide/pci/pdc202xx_new.c @@ -193,7 +193,7 @@ static void pdcnew_set_pio_mode(ide_drive_t *drive, const u8 pio) } } -static u8 pdcnew_cable_detect(ide_hwif_t *hwif) +static u8 __devinit pdcnew_cable_detect(ide_hwif_t *hwif) { if (get_indexed_reg(hwif, 0x0b) & 0x04) return ATA_CBL_PATA40; diff --git a/trunk/drivers/ide/pci/pdc202xx_old.c b/trunk/drivers/ide/pci/pdc202xx_old.c index de9a27400462..6ff2def58da0 100644 --- a/trunk/drivers/ide/pci/pdc202xx_old.c +++ b/trunk/drivers/ide/pci/pdc202xx_old.c @@ -117,7 +117,7 @@ static void pdc202xx_set_pio_mode(ide_drive_t *drive, const u8 pio) pdc202xx_set_mode(drive, XFER_PIO_0 + pio); } -static u8 pdc2026x_cable_detect(ide_hwif_t *hwif) +static u8 __devinit pdc2026x_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); u16 CIS, mask = hwif->channel ? (1 << 11) : (1 << 10); diff --git a/trunk/drivers/ide/pci/piix.c b/trunk/drivers/ide/pci/piix.c index 30cfc815fe31..7fc3022dcf68 100644 --- a/trunk/drivers/ide/pci/piix.c +++ b/trunk/drivers/ide/pci/piix.c @@ -256,7 +256,7 @@ static const struct ich_laptop ich_laptop[] = { { 0, } }; -static u8 piix_cable_detect(ide_hwif_t *hwif) +static u8 __devinit piix_cable_detect(ide_hwif_t *hwif) { struct pci_dev *pdev = to_pci_dev(hwif->dev); const struct ich_laptop *lap = &ich_laptop[0]; diff --git a/trunk/drivers/ide/pci/scc_pata.c b/trunk/drivers/ide/pci/scc_pata.c index 6cde48bba6f8..94a7ab864236 100644 --- a/trunk/drivers/ide/pci/scc_pata.c +++ b/trunk/drivers/ide/pci/scc_pata.c @@ -827,7 +827,7 @@ static void __devinit init_iops_scc(ide_hwif_t *hwif) init_mmio_iops_scc(hwif); } -static u8 scc_cable_detect(ide_hwif_t *hwif) +static u8 __devinit scc_cable_detect(ide_hwif_t *hwif) { return ATA_CBL_PATA80; } diff --git a/trunk/drivers/ide/pci/serverworks.c b/trunk/drivers/ide/pci/serverworks.c index c3bdc6e51a48..d173f2937722 100644 --- a/trunk/drivers/ide/pci/serverworks.c +++ b/trunk/drivers/ide/pci/serverworks.c @@ -272,7 +272,7 @@ static unsigned int __devinit init_chipset_svwks(struct pci_dev *dev) return dev->irq; } -static u8 ata66_svwks_svwks(ide_hwif_t *hwif) +static u8 __devinit ata66_svwks_svwks(ide_hwif_t *hwif) { return ATA_CBL_PATA80; } @@ -284,7 +284,7 @@ static u8 ata66_svwks_svwks(ide_hwif_t *hwif) * Bit 14 clear = primary IDE channel does not have 80-pin cable. * Bit 14 set = primary IDE channel has 80-pin cable. */ -static u8 ata66_svwks_dell(ide_hwif_t *hwif) +static u8 __devinit ata66_svwks_dell(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); @@ -303,7 +303,7 @@ static u8 ata66_svwks_dell(ide_hwif_t *hwif) * * WARNING: this only works on Alpine hardware! */ -static u8 ata66_svwks_cobalt(ide_hwif_t *hwif) +static u8 __devinit ata66_svwks_cobalt(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); @@ -315,7 +315,7 @@ static u8 ata66_svwks_cobalt(ide_hwif_t *hwif) return ATA_CBL_PATA40; } -static u8 svwks_cable_detect(ide_hwif_t *hwif) +static u8 __devinit svwks_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); diff --git a/trunk/drivers/ide/pci/siimage.c b/trunk/drivers/ide/pci/siimage.c index 445ce6fbea33..b8ad9ad6cf0d 100644 --- a/trunk/drivers/ide/pci/siimage.c +++ b/trunk/drivers/ide/pci/siimage.c @@ -639,7 +639,7 @@ static int is_dev_seagate_sata(ide_drive_t *drive) * that can occur before we know what drives are present. */ -static void sil_quirkproc(ide_drive_t *drive) +static void __devinit sil_quirkproc(ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; @@ -679,7 +679,7 @@ static void __devinit init_iops_siimage(ide_hwif_t *hwif) * Check for the presence of an ATA66 capable cable on the interface. */ -static u8 sil_cable_detect(ide_hwif_t *hwif) +static u8 __devinit sil_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); unsigned long addr = siimage_selreg(hwif, 0); diff --git a/trunk/drivers/ide/pci/sis5513.c b/trunk/drivers/ide/pci/sis5513.c index e5a4b42b4e33..cc95f90b53b7 100644 --- a/trunk/drivers/ide/pci/sis5513.c +++ b/trunk/drivers/ide/pci/sis5513.c @@ -518,7 +518,7 @@ static const struct sis_laptop sis_laptop[] = { { 0, } }; -static u8 sis_cable_detect(ide_hwif_t *hwif) +static u8 __devinit sis_cable_detect(ide_hwif_t *hwif) { struct pci_dev *pdev = to_pci_dev(hwif->dev); const struct sis_laptop *lap = &sis_laptop[0]; diff --git a/trunk/drivers/ide/pci/slc90e66.c b/trunk/drivers/ide/pci/slc90e66.c index 866d6c65e3a0..13d1fa491f26 100644 --- a/trunk/drivers/ide/pci/slc90e66.c +++ b/trunk/drivers/ide/pci/slc90e66.c @@ -116,7 +116,7 @@ static void slc90e66_set_dma_mode(ide_drive_t *drive, const u8 speed) } } -static u8 slc90e66_cable_detect(ide_hwif_t *hwif) +static u8 __devinit slc90e66_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); u8 reg47 = 0, mask = hwif->channel ? 0x01 : 0x02; diff --git a/trunk/drivers/ide/pci/tc86c001.c b/trunk/drivers/ide/pci/tc86c001.c index 7fc88c375e5d..b1cb8a9ce5a9 100644 --- a/trunk/drivers/ide/pci/tc86c001.c +++ b/trunk/drivers/ide/pci/tc86c001.c @@ -131,7 +131,7 @@ static void tc86c001_dma_start(ide_drive_t *drive) ide_dma_start(drive); } -static u8 tc86c001_cable_detect(ide_hwif_t *hwif) +static u8 __devinit tc86c001_cable_detect(ide_hwif_t *hwif) { struct pci_dev *dev = to_pci_dev(hwif->dev); unsigned long sc_base = pci_resource_start(dev, 5); diff --git a/trunk/drivers/ide/pci/via82cxxx.c b/trunk/drivers/ide/pci/via82cxxx.c index a6b2cc83f293..454d2bf62dce 100644 --- a/trunk/drivers/ide/pci/via82cxxx.c +++ b/trunk/drivers/ide/pci/via82cxxx.c @@ -352,7 +352,7 @@ static int via_cable_override(struct pci_dev *pdev) return 0; } -static u8 via82cxxx_cable_detect(ide_hwif_t *hwif) +static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif) { struct pci_dev *pdev = to_pci_dev(hwif->dev); struct ide_host *host = pci_get_drvdata(pdev); diff --git a/trunk/drivers/infiniband/hw/ehca/ehca_reqs.c b/trunk/drivers/infiniband/hw/ehca/ehca_reqs.c index 898c8b5c38dd..dd9bc68f1c7b 100644 --- a/trunk/drivers/infiniband/hw/ehca/ehca_reqs.c +++ b/trunk/drivers/infiniband/hw/ehca/ehca_reqs.c @@ -42,7 +42,7 @@ */ -#include +#include #include "ehca_classes.h" #include "ehca_tools.h" #include "ehca_qes.h" diff --git a/trunk/drivers/input/keyboard/maple_keyb.c b/trunk/drivers/input/keyboard/maple_keyb.c index 22f17a593be7..7797ef6e5e64 100644 --- a/trunk/drivers/input/keyboard/maple_keyb.c +++ b/trunk/drivers/input/keyboard/maple_keyb.c @@ -2,7 +2,7 @@ * SEGA Dreamcast keyboard driver * Based on drivers/usb/usbkbd.c * Copyright YAEGASHI Takeshi, 2001 - * Porting to 2.6 Copyright Adrian McMenamin, 2007, 2008 + * Porting to 2.6 Copyright Adrian McMenamin, 2007 * * 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 @@ -45,51 +45,39 @@ struct dc_kbd { }; static const unsigned short dc_kbd_keycode[NR_SCANCODES] = { - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_A, KEY_B, - KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, - KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, - KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, - KEY_7, KEY_8, KEY_9, KEY_0, KEY_ENTER, KEY_ESC, KEY_BACKSPACE, - KEY_TAB, KEY_SPACE, KEY_MINUS, KEY_EQUAL, KEY_LEFTBRACE, - KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_BACKSLASH, KEY_SEMICOLON, - KEY_APOSTROPHE, KEY_GRAVE, KEY_COMMA, KEY_DOT, KEY_SLASH, - KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_A, KEY_B, KEY_C, KEY_D, + KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, + KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, + KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_1, KEY_2, + KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0, + KEY_ENTER, KEY_ESC, KEY_BACKSPACE, KEY_TAB, KEY_SPACE, KEY_MINUS, KEY_EQUAL, KEY_LEFTBRACE, + KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_BACKSLASH, KEY_SEMICOLON, KEY_APOSTROPHE, KEY_GRAVE, KEY_COMMA, + KEY_DOT, KEY_SLASH, KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12, KEY_SYSRQ, - KEY_SCROLLLOCK, KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP, - KEY_DELETE, KEY_END, KEY_PAGEDOWN, KEY_RIGHT, KEY_LEFT, KEY_DOWN, - KEY_UP, KEY_NUMLOCK, KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS, - KEY_KPPLUS, KEY_KPENTER, KEY_KP1, KEY_KP2, KEY_KP3, KEY_KP4, KEY_KP5, - KEY_KP6, KEY_KP7, KEY_KP8, KEY_KP9, KEY_KP0, KEY_KPDOT, KEY_102ND, - KEY_COMPOSE, KEY_POWER, KEY_KPEQUAL, KEY_F13, KEY_F14, KEY_F15, - KEY_F16, KEY_F17, KEY_F18, KEY_F19, KEY_F20, KEY_F21, KEY_F22, - KEY_F23, KEY_F24, KEY_OPEN, KEY_HELP, KEY_PROPS, KEY_FRONT, KEY_STOP, - KEY_AGAIN, KEY_UNDO, KEY_CUT, KEY_COPY, KEY_PASTE, KEY_FIND, KEY_MUTE, - KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_KPCOMMA, KEY_RESERVED, KEY_RO, KEY_KATAKANAHIRAGANA , KEY_YEN, - KEY_HENKAN, KEY_MUHENKAN, KEY_KPJPCOMMA, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_HANGEUL, KEY_HANJA, KEY_KATAKANA, KEY_HIRAGANA, - KEY_ZENKAKUHANKAKU, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, - KEY_RESERVED, KEY_RESERVED, KEY_LEFTCTRL, KEY_LEFTSHIFT, KEY_LEFTALT, - KEY_LEFTMETA, KEY_RIGHTCTRL, KEY_RIGHTSHIFT, KEY_RIGHTALT, - KEY_RIGHTMETA, KEY_PLAYPAUSE, KEY_STOPCD, KEY_PREVIOUSSONG, - KEY_NEXTSONG, KEY_EJECTCD, KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_MUTE, - KEY_WWW, KEY_BACK, KEY_FORWARD, KEY_STOP, KEY_FIND, KEY_SCROLLUP, - KEY_SCROLLDOWN, KEY_EDIT, KEY_SLEEP, KEY_SCREENLOCK, KEY_REFRESH, - KEY_CALC, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED + KEY_SCROLLLOCK, KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP, KEY_DELETE, + KEY_END, KEY_PAGEDOWN, KEY_RIGHT, KEY_LEFT, KEY_DOWN, KEY_UP, + KEY_NUMLOCK, KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS, KEY_KPPLUS, KEY_KPENTER, KEY_KP1, KEY_KP2, + KEY_KP3, KEY_KP4, KEY_KP5, KEY_KP6, KEY_KP7, KEY_KP8, KEY_KP9, KEY_KP0, KEY_KPDOT, + KEY_102ND, KEY_COMPOSE, KEY_POWER, KEY_KPEQUAL, KEY_F13, KEY_F14, KEY_F15, + KEY_F16, KEY_F17, KEY_F18, KEY_F19, KEY_F20, + KEY_F21, KEY_F22, KEY_F23, KEY_F24, KEY_OPEN, KEY_HELP, KEY_PROPS, KEY_FRONT, + KEY_STOP, KEY_AGAIN, KEY_UNDO, KEY_CUT, KEY_COPY, KEY_PASTE, KEY_FIND, KEY_MUTE, + KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_KPCOMMA, KEY_RESERVED, KEY_RO, KEY_KATAKANAHIRAGANA , KEY_YEN, + KEY_HENKAN, KEY_MUHENKAN, KEY_KPJPCOMMA, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_HANGEUL, KEY_HANJA, KEY_KATAKANA, KEY_HIRAGANA, KEY_ZENKAKUHANKAKU, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, + KEY_LEFTCTRL, KEY_LEFTSHIFT, KEY_LEFTALT, KEY_LEFTMETA, KEY_RIGHTCTRL, KEY_RIGHTSHIFT, KEY_RIGHTALT, KEY_RIGHTMETA, + KEY_PLAYPAUSE, KEY_STOPCD, KEY_PREVIOUSSONG, KEY_NEXTSONG, KEY_EJECTCD, KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_MUTE, + KEY_WWW, KEY_BACK, KEY_FORWARD, KEY_STOP, KEY_FIND, KEY_SCROLLUP, KEY_SCROLLDOWN, KEY_EDIT, KEY_SLEEP, + KEY_SCREENLOCK, KEY_REFRESH, KEY_CALC, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED }; static void dc_scan_kbd(struct dc_kbd *kbd) @@ -139,12 +127,12 @@ static void dc_scan_kbd(struct dc_kbd *kbd) static void dc_kbd_callback(struct mapleq *mq) { struct maple_device *mapledev = mq->dev; - struct dc_kbd *kbd = maple_get_drvdata(mapledev); + struct dc_kbd *kbd = mapledev->private_data; unsigned long *buf = mq->recvbuf; /* - * We should always get the lock because the only - * time it may be locked is if the driver is in the cleanup phase. + * We should always be getting the lock because the only + * time it may be locked if driver is in cleanup phase. */ if (likely(mutex_trylock(&maple_keyb_mutex))) { @@ -157,96 +145,106 @@ static void dc_kbd_callback(struct mapleq *mq) } } -static int probe_maple_kbd(struct device *dev) +static int dc_kbd_connect(struct maple_device *mdev) { - struct maple_device *mdev = to_maple_dev(dev); - struct maple_driver *mdrv = to_maple_driver(dev->driver); int i, error; struct dc_kbd *kbd; - struct input_dev *idev; + struct input_dev *dev; if (!(mdev->function & MAPLE_FUNC_KEYBOARD)) return -EINVAL; kbd = kzalloc(sizeof(struct dc_kbd), GFP_KERNEL); - idev = input_allocate_device(); - if (!kbd || !idev) { + dev = input_allocate_device(); + if (!kbd || !dev) { error = -ENOMEM; goto fail; } - kbd->dev = idev; + mdev->private_data = kbd; + + kbd->dev = dev; memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode)); - idev->name = mdev->product_name; - idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); - idev->keycode = kbd->keycode; - idev->keycodesize = sizeof(unsigned short); - idev->keycodemax = ARRAY_SIZE(kbd->keycode); - idev->id.bustype = BUS_HOST; - idev->dev.parent = &mdev->dev; + dev->name = mdev->product_name; + dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); + dev->keycode = kbd->keycode; + dev->keycodesize = sizeof (unsigned short); + dev->keycodemax = ARRAY_SIZE(kbd->keycode); + dev->id.bustype = BUS_HOST; + dev->dev.parent = &mdev->dev; for (i = 0; i < NR_SCANCODES; i++) - __set_bit(dc_kbd_keycode[i], idev->keybit); - __clear_bit(KEY_RESERVED, idev->keybit); + __set_bit(dc_kbd_keycode[i], dev->keybit); + __clear_bit(KEY_RESERVED, dev->keybit); - input_set_capability(idev, EV_MSC, MSC_SCAN); - input_set_drvdata(idev, kbd); + input_set_capability(dev, EV_MSC, MSC_SCAN); + input_set_drvdata(dev, kbd); - error = input_register_device(idev); + error = input_register_device(dev); if (error) goto fail; /* Maple polling is locked to VBLANK - which may be just 50/s */ - maple_getcond_callback(mdev, dc_kbd_callback, HZ/50, - MAPLE_FUNC_KEYBOARD); - - mdev->driver = mdrv; - - maple_set_drvdata(mdev, kbd); - - return error; + maple_getcond_callback(mdev, dc_kbd_callback, HZ/50, MAPLE_FUNC_KEYBOARD); + return 0; -fail: - input_free_device(idev); + fail: + input_free_device(dev); kfree(kbd); - maple_set_drvdata(mdev, NULL); + mdev->private_data = NULL; return error; } -static int remove_maple_kbd(struct device *dev) +static void dc_kbd_disconnect(struct maple_device *mdev) { - struct maple_device *mdev = to_maple_dev(dev); - struct dc_kbd *kbd = maple_get_drvdata(mdev); + struct dc_kbd *kbd; mutex_lock(&maple_keyb_mutex); + kbd = mdev->private_data; + mdev->private_data = NULL; input_unregister_device(kbd->dev); kfree(kbd); - maple_set_drvdata(mdev, NULL); - mutex_unlock(&maple_keyb_mutex); +} + +/* allow the keyboard to be used */ +static int probe_maple_kbd(struct device *dev) +{ + struct maple_device *mdev = to_maple_dev(dev); + struct maple_driver *mdrv = to_maple_driver(dev->driver); + int error; + + error = dc_kbd_connect(mdev); + if (error) + return error; + + mdev->driver = mdrv; + mdev->registered = 1; + return 0; } static struct maple_driver dc_kbd_driver = { .function = MAPLE_FUNC_KEYBOARD, + .connect = dc_kbd_connect, + .disconnect = dc_kbd_disconnect, .drv = { .name = "Dreamcast_keyboard", .probe = probe_maple_kbd, - .remove = remove_maple_kbd, - }, + }, }; static int __init dc_kbd_init(void) { - return maple_driver_register(&dc_kbd_driver); + return maple_driver_register(&dc_kbd_driver.drv); } static void __exit dc_kbd_exit(void) { - maple_driver_unregister(&dc_kbd_driver); + driver_unregister(&dc_kbd_driver.drv); } module_init(dc_kbd_init); diff --git a/trunk/drivers/isdn/Makefile b/trunk/drivers/isdn/Makefile index f1f777570e8e..8380a4568d11 100644 --- a/trunk/drivers/isdn/Makefile +++ b/trunk/drivers/isdn/Makefile @@ -5,7 +5,7 @@ obj-$(CONFIG_ISDN_I4L) += i4l/ obj-$(CONFIG_ISDN_CAPI) += capi/ obj-$(CONFIG_MISDN) += mISDN/ -obj-$(CONFIG_ISDN) += hardware/ +obj-$(CONFIG_ISDN_CAPI) += hardware/ obj-$(CONFIG_ISDN_DIVERSION) += divert/ obj-$(CONFIG_ISDN_DRV_HISAX) += hisax/ obj-$(CONFIG_ISDN_DRV_ICN) += icn/ diff --git a/trunk/drivers/isdn/hardware/mISDN/hfcmulti.c b/trunk/drivers/isdn/hardware/mISDN/hfcmulti.c index 1eac03f39d00..2649ea55a9e8 100644 --- a/trunk/drivers/isdn/hardware/mISDN/hfcmulti.c +++ b/trunk/drivers/isdn/hardware/mISDN/hfcmulti.c @@ -140,7 +140,7 @@ * #define HFC_REGISTER_DEBUG */ -static const char *hfcmulti_revision = "2.02"; +static const char *hfcmulti_revision = "2.00"; #include #include @@ -427,12 +427,12 @@ write_fifo_regio(struct hfc_multi *hc, u_char *data, int len) { outb(A_FIFO_DATA0, (hc->pci_iobase)+4); while (len>>2) { - outl(cpu_to_le32(*(u32 *)data), hc->pci_iobase); + outl(*(u32 *)data, hc->pci_iobase); data += 4; len -= 4; } while (len>>1) { - outw(cpu_to_le16(*(u16 *)data), hc->pci_iobase); + outw(*(u16 *)data, hc->pci_iobase); data += 2; len -= 2; } @@ -447,19 +447,17 @@ void write_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len) { while (len>>2) { - writel(cpu_to_le32(*(u32 *)data), - hc->pci_membase + A_FIFO_DATA0); + writel(*(u32 *)data, (hc->pci_membase)+A_FIFO_DATA0); data += 4; len -= 4; } while (len>>1) { - writew(cpu_to_le16(*(u16 *)data), - hc->pci_membase + A_FIFO_DATA0); + writew(*(u16 *)data, (hc->pci_membase)+A_FIFO_DATA0); data += 2; len -= 2; } while (len) { - writeb(*data, hc->pci_membase + A_FIFO_DATA0); + writeb(*data, (hc->pci_membase)+A_FIFO_DATA0); data++; len--; } @@ -470,12 +468,12 @@ read_fifo_regio(struct hfc_multi *hc, u_char *data, int len) { outb(A_FIFO_DATA0, (hc->pci_iobase)+4); while (len>>2) { - *(u32 *)data = le32_to_cpu(inl(hc->pci_iobase)); + *(u32 *)data = inl(hc->pci_iobase); data += 4; len -= 4; } while (len>>1) { - *(u16 *)data = le16_to_cpu(inw(hc->pci_iobase)); + *(u16 *)data = inw(hc->pci_iobase); data += 2; len -= 2; } @@ -492,18 +490,18 @@ read_fifo_pcimem(struct hfc_multi *hc, u_char *data, int len) { while (len>>2) { *(u32 *)data = - le32_to_cpu(readl(hc->pci_membase + A_FIFO_DATA0)); + readl((hc->pci_membase)+A_FIFO_DATA0); data += 4; len -= 4; } while (len>>1) { *(u16 *)data = - le16_to_cpu(readw(hc->pci_membase + A_FIFO_DATA0)); + readw((hc->pci_membase)+A_FIFO_DATA0); data += 2; len -= 2; } while (len) { - *data = readb(hc->pci_membase + A_FIFO_DATA0); + *data = readb((hc->pci_membase)+A_FIFO_DATA0); data++; len--; } @@ -3973,7 +3971,7 @@ open_bchannel(struct hfc_multi *hc, struct dchannel *dch, struct bchannel *bch; int ch; - if (!test_channelmap(rq->adr.channel, dch->dev.channelmap)) + if (!test_bit(rq->adr.channel, &dch->dev.channelmap[0])) return -EINVAL; if (rq->protocol == ISDN_P_NONE) return -EINVAL; @@ -4589,7 +4587,7 @@ init_e1_port(struct hfc_multi *hc, struct hm_map *m) list_add(&bch->ch.list, &dch->dev.bchannels); hc->chan[ch].bch = bch; hc->chan[ch].port = 0; - set_channelmap(bch->nr, dch->dev.channelmap); + test_and_set_bit(bch->nr, &dch->dev.channelmap[0]); } /* set optical line type */ if (port[Port_cnt] & 0x001) { @@ -4757,7 +4755,7 @@ init_multi_port(struct hfc_multi *hc, int pt) list_add(&bch->ch.list, &dch->dev.bchannels); hc->chan[i + ch].bch = bch; hc->chan[i + ch].port = pt; - set_channelmap(bch->nr, dch->dev.channelmap); + test_and_set_bit(bch->nr, &dch->dev.channelmap[0]); } /* set master clock */ if (port[Port_cnt] & 0x001) { @@ -5052,12 +5050,12 @@ static void __devexit hfc_remove_pci(struct pci_dev *pdev) static const struct hm_map hfcm_map[] = { /*0*/ {VENDOR_BN, "HFC-1S Card (mini PCI)", 4, 1, 1, 3, 0, DIP_4S, 0}, -/*1*/ {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S, 0}, +/*1*/ {VENDOR_BN, "HFC-2S Card", 4, 2, 1, 3, 0, DIP_4S}, /*2*/ {VENDOR_BN, "HFC-2S Card (mini PCI)", 4, 2, 1, 3, 0, DIP_4S, 0}, /*3*/ {VENDOR_BN, "HFC-4S Card", 4, 4, 1, 2, 0, DIP_4S, 0}, /*4*/ {VENDOR_BN, "HFC-4S Card (mini PCI)", 4, 4, 1, 2, 0, 0, 0}, /*5*/ {VENDOR_CCD, "HFC-4S Eval (old)", 4, 4, 0, 0, 0, 0, 0}, -/*6*/ {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, DIP_4S, 0}, +/*6*/ {VENDOR_CCD, "HFC-4S IOB4ST", 4, 4, 1, 2, 0, 0, 0}, /*7*/ {VENDOR_CCD, "HFC-4S", 4, 4, 1, 2, 0, 0, 0}, /*8*/ {VENDOR_DIG, "HFC-4S Card", 4, 4, 0, 2, 0, 0, HFC_IO_MODE_REGIO}, /*9*/ {VENDOR_CCD, "HFC-4S Swyx 4xS0 SX2 QuadBri", 4, 4, 1, 2, 0, 0, 0}, @@ -5253,6 +5251,9 @@ HFCmulti_init(void) if (debug & DEBUG_HFCMULTI_INIT) printk(KERN_DEBUG "%s: init entered\n", __func__); +#ifdef __BIG_ENDIAN +#error "not running on big endian machines now" +#endif hfc_interrupt = symbol_get(ztdummy_extern_interrupt); register_interrupt = symbol_get(ztdummy_register_interrupt); unregister_interrupt = symbol_get(ztdummy_unregister_interrupt); diff --git a/trunk/drivers/isdn/hardware/mISDN/hfcpci.c b/trunk/drivers/isdn/hardware/mISDN/hfcpci.c index 9cf5edbb1a9b..3231814e7efa 100644 --- a/trunk/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/trunk/drivers/isdn/hardware/mISDN/hfcpci.c @@ -2056,7 +2056,7 @@ setup_card(struct hfc_pci *card) card->dch.dev.nrbchan = 2; for (i = 0; i < 2; i++) { card->bch[i].nr = i + 1; - set_channelmap(i + 1, card->dch.dev.channelmap); + test_and_set_bit(i + 1, &card->dch.dev.channelmap[0]); card->bch[i].debug = debug; mISDN_initbchannel(&card->bch[i], MAX_DATA_MEM); card->bch[i].hw = card; diff --git a/trunk/drivers/isdn/mISDN/l1oip_core.c b/trunk/drivers/isdn/mISDN/l1oip_core.c index e42150a57780..155b99780c4f 100644 --- a/trunk/drivers/isdn/mISDN/l1oip_core.c +++ b/trunk/drivers/isdn/mISDN/l1oip_core.c @@ -1006,7 +1006,8 @@ open_bchannel(struct l1oip *hc, struct dchannel *dch, struct channel_req *rq) struct bchannel *bch; int ch; - if (!test_channelmap(rq->adr.channel, dch->dev.channelmap)) + if (!test_bit(rq->adr.channel & 0x1f, + &dch->dev.channelmap[rq->adr.channel >> 5])) return -EINVAL; if (rq->protocol == ISDN_P_NONE) return -EINVAL; @@ -1411,7 +1412,8 @@ init_card(struct l1oip *hc, int pri, int bundle) bch->ch.nr = i + ch; list_add(&bch->ch.list, &dch->dev.bchannels); hc->chan[i + ch].bch = bch; - set_channelmap(bch->nr, dch->dev.channelmap); + test_and_set_bit(bch->nr & 0x1f, + &dch->dev.channelmap[bch->nr >> 5]); } ret = mISDN_register_device(&dch->dev, hc->name); if (ret) diff --git a/trunk/drivers/isdn/mISDN/socket.c b/trunk/drivers/isdn/mISDN/socket.c index e5a20f9542d1..4ba4cc364c9e 100644 --- a/trunk/drivers/isdn/mISDN/socket.c +++ b/trunk/drivers/isdn/mISDN/socket.c @@ -379,7 +379,7 @@ data_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) di.Bprotocols = dev->Bprotocols | get_all_Bprotocols(); di.protocol = dev->D.protocol; memcpy(di.channelmap, dev->channelmap, - sizeof(di.channelmap)); + MISDN_CHMAP_SIZE * 4); di.nrbchan = dev->nrbchan; strcpy(di.name, dev->name); if (copy_to_user((void __user *)arg, &di, sizeof(di))) @@ -637,7 +637,7 @@ base_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) di.Bprotocols = dev->Bprotocols | get_all_Bprotocols(); di.protocol = dev->D.protocol; memcpy(di.channelmap, dev->channelmap, - sizeof(di.channelmap)); + MISDN_CHMAP_SIZE * 4); di.nrbchan = dev->nrbchan; strcpy(di.name, dev->name); if (copy_to_user((void __user *)arg, &di, sizeof(di))) diff --git a/trunk/drivers/macintosh/mediabay.c b/trunk/drivers/macintosh/mediabay.c index d7e46d345d9e..b1e5b4705250 100644 --- a/trunk/drivers/macintosh/mediabay.c +++ b/trunk/drivers/macintosh/mediabay.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/drivers/media/video/vino.c b/trunk/drivers/media/video/vino.c index ef7572cbc4ab..3989b0eded28 100644 --- a/trunk/drivers/media/video/vino.c +++ b/trunk/drivers/media/video/vino.c @@ -39,7 +39,6 @@ #include #include -#include #include #include #include diff --git a/trunk/drivers/misc/sgi-gru/grutlbpurge.c b/trunk/drivers/misc/sgi-gru/grutlbpurge.c index c84496a77691..bcfd5425e2e6 100644 --- a/trunk/drivers/misc/sgi-gru/grutlbpurge.c +++ b/trunk/drivers/misc/sgi-gru/grutlbpurge.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include "gru.h" diff --git a/trunk/drivers/net/stnic.c b/trunk/drivers/net/stnic.c index 2ed0bd596815..b65be5d70fec 100644 --- a/trunk/drivers/net/stnic.c +++ b/trunk/drivers/net/stnic.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include #ifdef CONFIG_SH_STANDARD_BIOS #include diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c index d2439b85a790..26aa37aa531f 100644 --- a/trunk/drivers/net/tg3.c +++ b/trunk/drivers/net/tg3.c @@ -7687,11 +7687,21 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) */ static int tg3_init_hw(struct tg3 *tp, int reset_phy) { + int err; + + /* Force the chip into D0. */ + err = tg3_set_power_state(tp, PCI_D0); + if (err) + goto out; + tg3_switch_clocks(tp); tw32(TG3PCI_MEM_WIN_BASE_ADDR, 0); - return tg3_reset_hw(tp, reset_phy); + err = tg3_reset_hw(tp, reset_phy); + +out: + return err; } #define TG3_STAT_ADD32(PSTAT, REG) \ @@ -8006,11 +8016,13 @@ static int tg3_open(struct net_device *dev) netif_carrier_off(tp->dev); + tg3_full_lock(tp, 0); + err = tg3_set_power_state(tp, PCI_D0); - if (err) + if (err) { + tg3_full_unlock(tp); return err; - - tg3_full_lock(tp, 0); + } tg3_disable_ints(tp); tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; diff --git a/trunk/drivers/net/wireless/Kconfig b/trunk/drivers/net/wireless/Kconfig index 4c7ff61a1a9c..91fc2c765d90 100644 --- a/trunk/drivers/net/wireless/Kconfig +++ b/trunk/drivers/net/wireless/Kconfig @@ -649,7 +649,6 @@ config RTL8187 Trendnet TEW-424UB ASUS P5B Deluxe Toshiba Satellite Pro series of laptops - Asus Wireless Link Thanks to Realtek for their support! diff --git a/trunk/drivers/net/wireless/ath5k/ath5k.h b/trunk/drivers/net/wireless/ath5k/ath5k.h index 9102eea3c8bf..ba35c30d203c 100644 --- a/trunk/drivers/net/wireless/ath5k/ath5k.h +++ b/trunk/drivers/net/wireless/ath5k/ath5k.h @@ -186,13 +186,11 @@ struct ath5k_srev_name { #define AR5K_SREV_RAD_2111 0x20 #define AR5K_SREV_RAD_5112 0x30 #define AR5K_SREV_RAD_5112A 0x35 -#define AR5K_SREV_RAD_5112B 0x36 #define AR5K_SREV_RAD_2112 0x40 #define AR5K_SREV_RAD_2112A 0x45 -#define AR5K_SREV_RAD_2112B 0x46 -#define AR5K_SREV_RAD_SC0 0x50 /* Found on 2413/2414 */ -#define AR5K_SREV_RAD_SC1 0x60 /* Found on 5413/5414 */ -#define AR5K_SREV_RAD_SC2 0xa0 /* Found on 2424-5/5424 */ +#define AR5K_SREV_RAD_SC0 0x56 /* Found on 2413/2414 */ +#define AR5K_SREV_RAD_SC1 0x63 /* Found on 5413/5414 */ +#define AR5K_SREV_RAD_SC2 0xa2 /* Found on 2424-5/5424 */ #define AR5K_SREV_RAD_5133 0xc0 /* MIMO found on 5418 */ /* IEEE defs */ diff --git a/trunk/drivers/net/wireless/ath5k/base.c b/trunk/drivers/net/wireless/ath5k/base.c index ebf19bc11f5b..ff3fad794b61 100644 --- a/trunk/drivers/net/wireless/ath5k/base.c +++ b/trunk/drivers/net/wireless/ath5k/base.c @@ -2170,7 +2170,6 @@ ath5k_beacon_config(struct ath5k_softc *sc) ath5k_hw_set_intr(ah, 0); sc->bmisscount = 0; - sc->imask &= ~(AR5K_INT_BMISS | AR5K_INT_SWBA); if (sc->opmode == IEEE80211_IF_TYPE_STA) { sc->imask |= AR5K_INT_BMISS; diff --git a/trunk/drivers/net/wireless/ath5k/debug.c b/trunk/drivers/net/wireless/ath5k/debug.c index 6fa6c8e04ff0..41d5fa34b544 100644 --- a/trunk/drivers/net/wireless/ath5k/debug.c +++ b/trunk/drivers/net/wireless/ath5k/debug.c @@ -129,7 +129,7 @@ static struct reg regs[] = { REG_STRUCT_INIT(AR5K_CPC1), REG_STRUCT_INIT(AR5K_CPC2), REG_STRUCT_INIT(AR5K_CPC3), - REG_STRUCT_INIT(AR5K_CPCOVF), + REG_STRUCT_INIT(AR5K_CPCORN), REG_STRUCT_INIT(AR5K_RESET_CTL), REG_STRUCT_INIT(AR5K_SLEEP_CTL), REG_STRUCT_INIT(AR5K_INTPEND), diff --git a/trunk/drivers/net/wireless/ath5k/debug.h b/trunk/drivers/net/wireless/ath5k/debug.h index ffc529393306..2cf8d18b10e3 100644 --- a/trunk/drivers/net/wireless/ath5k/debug.h +++ b/trunk/drivers/net/wireless/ath5k/debug.h @@ -63,6 +63,7 @@ struct ath5k_softc; struct ath5k_hw; +struct ieee80211_hw_mode; struct sk_buff; struct ath5k_buf; diff --git a/trunk/drivers/net/wireless/ath5k/hw.c b/trunk/drivers/net/wireless/ath5k/hw.c index ad1a5b422c8c..7ca87a557312 100644 --- a/trunk/drivers/net/wireless/ath5k/hw.c +++ b/trunk/drivers/net/wireless/ath5k/hw.c @@ -139,8 +139,6 @@ static int ath5k_hw_post(struct ath5k_hw *ah) for (c = 0; c < 2; c++) { cur_reg = regs[c]; - - /* Save previous value */ init_val = ath5k_hw_reg_read(ah, cur_reg); for (i = 0; i < 256; i++) { @@ -172,10 +170,6 @@ static int ath5k_hw_post(struct ath5k_hw *ah) var_pattern = 0x003b080f; ath5k_hw_reg_write(ah, var_pattern, cur_reg); } - - /* Restore previous value */ - ath5k_hw_reg_write(ah, init_val, cur_reg); - } return 0; @@ -293,42 +287,67 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) /* Identify the radio chip*/ if (ah->ah_version == AR5K_AR5210) { ah->ah_radio = AR5K_RF5110; - /* - * Register returns 0x0/0x04 for radio revision - * so ath5k_hw_radio_revision doesn't parse the value - * correctly. For now we are based on mac's srev to - * identify RF2425 radio. - */ - } else if (srev == AR5K_SREV_VER_AR2425) { - ah->ah_radio = AR5K_RF2425; - ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2425; } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_5112) { ah->ah_radio = AR5K_RF5111; ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5111; } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_SC0) { + ah->ah_radio = AR5K_RF5112; - ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112; + + if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_5112A) { + ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112; + } else { + ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112A; + } + } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_SC1) { ah->ah_radio = AR5K_RF2413; - ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2413; + ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112A; } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_SC2) { ah->ah_radio = AR5K_RF5413; - ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5413; + ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112A; } else if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_5133) { + /* AR5424 */ if (srev >= AR5K_SREV_VER_AR5424) { ah->ah_radio = AR5K_RF5413; - ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5413; + ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5424; /* AR2424 */ } else { ah->ah_radio = AR5K_RF2413; /* For testing */ - ah->ah_phy_spending = AR5K_PHY_SPENDING_RF2413; + ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112A; } + + /* + * Register returns 0x4 for radio revision + * so ath5k_hw_radio_revision doesn't parse the value + * correctly. For now we are based on mac's srev to + * identify RF2425 radio. + */ + } else if (srev == AR5K_SREV_VER_AR2425) { + ah->ah_radio = AR5K_RF2425; + ah->ah_phy_spending = AR5K_PHY_SPENDING_RF5112; } + ah->ah_phy = AR5K_PHY(0); /* - * Write PCI-E power save settings + * Identify AR5212-based PCI-E cards + * And write some initial settings. + * + * (doing a "strings" on ndis driver + * -ar5211.sys- reveals the following + * pci-e related functions: + * + * pcieClockReq + * pcieRxErrNotify + * pcieL1SKPEnable + * pcieAspm + * pcieDisableAspmOnRfWake + * pciePowerSaveEnable + * + * I guess these point to ClockReq but + * i'm not sure.) */ if ((ah->ah_version == AR5K_AR5212) && (pdev->is_pcie)) { ath5k_hw_reg_write(ah, 0x9248fc00, 0x4080); @@ -350,15 +369,10 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) if (ret) goto err_free; - /* Write AR5K_PCICFG_UNK on 2112B and later chips */ - if (ah->ah_radio_5ghz_revision > AR5K_SREV_RAD_2112B || - srev > AR5K_SREV_VER_AR2413) { - ath5k_hw_reg_write(ah, AR5K_PCICFG_UNK, AR5K_PCICFG); - } - /* * Get card capabilities, values, ... */ + ret = ath5k_eeprom_init(ah); if (ret) { ATH5K_ERR(sc, "unable to init EEPROM\n"); @@ -829,41 +843,27 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, * Write some more initial register settings */ if (ah->ah_version == AR5K_AR5212) { - ath5k_hw_reg_write(ah, 0x0002a002, 0x982c); + ath5k_hw_reg_write(ah, 0x0002a002, AR5K_PHY(11)); if (channel->hw_value == CHANNEL_G) if (ah->ah_mac_srev < AR5K_SREV_VER_AR2413) ath5k_hw_reg_write(ah, 0x00f80d80, - 0x994c); + AR5K_PHY(83)); else if (ah->ah_mac_srev < AR5K_SREV_VER_AR2424) ath5k_hw_reg_write(ah, 0x00380140, - 0x994c); + AR5K_PHY(83)); else if (ah->ah_mac_srev < AR5K_SREV_VER_AR2425) ath5k_hw_reg_write(ah, 0x00fc0ec0, - 0x994c); + AR5K_PHY(83)); else /* 2425 */ ath5k_hw_reg_write(ah, 0x00fc0fc0, - 0x994c); + AR5K_PHY(83)); else - ath5k_hw_reg_write(ah, 0x00000000, 0x994c); - - /* Some bits are disabled here, we know nothing about - * register 0xa228 yet, most of the times this ends up - * with a value 0x9b5 -haven't seen any dump with - * a different value- */ - /* Got this from decompiling binary HAL */ - data = ath5k_hw_reg_read(ah, 0xa228); - data &= 0xfffffdff; - ath5k_hw_reg_write(ah, data, 0xa228); - - data = ath5k_hw_reg_read(ah, 0xa228); - data &= 0xfffe03ff; - ath5k_hw_reg_write(ah, data, 0xa228); - data = 0; - - /* Just write 0x9b5 ? */ - /* ath5k_hw_reg_write(ah, 0x000009b5, 0xa228); */ - ath5k_hw_reg_write(ah, 0x0000000f, AR5K_SEQ_MASK); + ath5k_hw_reg_write(ah, 0x00000000, + AR5K_PHY(83)); + + ath5k_hw_reg_write(ah, 0x000009b5, 0xa228); + ath5k_hw_reg_write(ah, 0x0000000f, 0x8060); ath5k_hw_reg_write(ah, 0x00000000, 0xa254); ath5k_hw_reg_write(ah, 0x0000000e, AR5K_PHY_SCAL); } @@ -879,7 +879,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, else data = 0xffb80d20; ath5k_hw_reg_write(ah, data, AR5K_PHY_FRAME_CTL); - data = 0; } /* @@ -899,6 +898,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, /* * Write RF registers + * TODO:Does this work on 5211 (5111) ? */ ret = ath5k_hw_rfregs(ah, channel, mode); if (ret) @@ -935,7 +935,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, return ret; /* Set antenna mode */ - AR5K_REG_MASKED_BITS(ah, AR5K_PHY_ANT_CTL, + AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x44), ah->ah_antenna[ee_mode][0], 0xfffffc06); /* @@ -965,15 +965,15 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, ath5k_hw_reg_write(ah, AR5K_PHY_NF_SVAL(ee->ee_noise_floor_thr[ee_mode]), - AR5K_PHY_NFTHRES); + AR5K_PHY(0x5a)); - AR5K_REG_MASKED_BITS(ah, AR5K_PHY_SETTLING, + AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x11), (ee->ee_switch_settling[ee_mode] << 7) & 0x3f80, 0xffffc07f); - AR5K_REG_MASKED_BITS(ah, AR5K_PHY_GAIN, + AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x12), (ee->ee_ant_tx_rx[ee_mode] << 12) & 0x3f000, 0xfffc0fff); - AR5K_REG_MASKED_BITS(ah, AR5K_PHY_DESIRED_SIZE, + AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x14), (ee->ee_adc_desired_size[ee_mode] & 0x00ff) | ((ee->ee_pga_desired_size[ee_mode] << 8) & 0xff00), 0xffff0000); @@ -982,13 +982,13 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, (ee->ee_tx_end2xpa_disable[ee_mode] << 24) | (ee->ee_tx_end2xpa_disable[ee_mode] << 16) | (ee->ee_tx_frm2xpa_enable[ee_mode] << 8) | - (ee->ee_tx_frm2xpa_enable[ee_mode]), AR5K_PHY_RF_CTL4); + (ee->ee_tx_frm2xpa_enable[ee_mode]), AR5K_PHY(0x0d)); - AR5K_REG_MASKED_BITS(ah, AR5K_PHY_RF_CTL3, + AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x0a), ee->ee_tx_end2xlna_enable[ee_mode] << 8, 0xffff00ff); - AR5K_REG_MASKED_BITS(ah, AR5K_PHY_NF, + AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x19), (ee->ee_thr_62[ee_mode] << 12) & 0x7f000, 0xfff80fff); - AR5K_REG_MASKED_BITS(ah, AR5K_PHY_OFDM_SELFCORR, 4, 0xffffff01); + AR5K_REG_MASKED_BITS(ah, AR5K_PHY(0x49), 4, 0xffffff01); AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_ENABLE | @@ -1063,8 +1063,7 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, ath5k_hw_reg_write(ah, AR5K_PHY_ACT_ENABLE, AR5K_PHY_ACT); /* - * On 5211+ read activation -> rx delay - * and use it. + * 5111/5112 Specific */ if (ah->ah_version != AR5K_AR5210) { data = ath5k_hw_reg_read(ah, AR5K_PHY_RX_DELAY) & @@ -1072,77 +1071,40 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, data = (channel->hw_value & CHANNEL_CCK) ? ((data << 2) / 22) : (data / 10); - udelay(100 + (2 * data)); - data = 0; + udelay(100 + data); } else { mdelay(1); } /* - * Perform ADC test (?) - */ - data = ath5k_hw_reg_read(ah, AR5K_PHY_TST1); - ath5k_hw_reg_write(ah, AR5K_PHY_TST1_TXHOLD, AR5K_PHY_TST1); - for (i = 0; i <= 20; i++) { - if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10)) - break; - udelay(200); - } - ath5k_hw_reg_write(ah, data, AR5K_PHY_TST1); - data = 0; - - /* - * Start automatic gain calibration - * - * During AGC calibration RX path is re-routed to - * a signal detector so we don't receive anything. - * - * This method is used to calibrate some static offsets - * used together with on-the fly I/Q calibration (the - * one performed via ath5k_hw_phy_calibrate), that doesn't - * interrupt rx path. - * - * If we are in a noisy environment AGC calibration may time - * out. + * Enable calibration and wait until completion */ AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL, AR5K_PHY_AGCCTL_CAL); - /* At the same time start I/Q calibration for QAM constellation - * -no need for CCK- */ - ah->ah_calibration = false; - if (!(mode == AR5K_MODE_11B)) { - ah->ah_calibration = true; - AR5K_REG_WRITE_BITS(ah, AR5K_PHY_IQ, - AR5K_PHY_IQ_CAL_NUM_LOG_MAX, 15); - AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, - AR5K_PHY_IQ_RUN); - } - - /* Wait for gain calibration to finish (we check for I/Q calibration - * during ath5k_phy_calibrate) */ if (ath5k_hw_register_timeout(ah, AR5K_PHY_AGCCTL, AR5K_PHY_AGCCTL_CAL, 0, false)) { - ATH5K_ERR(ah->ah_sc, "gain calibration timeout (%uMHz)\n", + ATH5K_ERR(ah->ah_sc, "calibration timeout (%uMHz)\n", channel->center_freq); return -EAGAIN; } - /* - * Start noise floor calibration - * - * If we run NF calibration before AGC, it always times out. - * Binary HAL starts NF and AGC calibration at the same time - * and only waits for AGC to finish. I believe that's wrong because - * during NF calibration, rx path is also routed to a detector, so if - * it doesn't finish we won't have RX. - * - * XXX: Find an interval that's OK for all cards... - */ ret = ath5k_hw_noise_floor_calibration(ah, channel->center_freq); if (ret) return ret; + ah->ah_calibration = false; + + /* A and G modes can use QAM modulation which requires enabling + * I and Q calibration. Don't bother in B mode. */ + if (!(mode == AR5K_MODE_11B)) { + ah->ah_calibration = true; + AR5K_REG_WRITE_BITS(ah, AR5K_PHY_IQ, + AR5K_PHY_IQ_CAL_NUM_LOG_MAX, 15); + AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, + AR5K_PHY_IQ_RUN); + } + /* * Reset queues and start beacon timers at the end of the reset routine */ @@ -1192,12 +1154,6 @@ int ath5k_hw_reset(struct ath5k_hw *ah, enum ieee80211_if_types op_mode, ath5k_hw_reg_write(ah, AR5K_PHY_SCLOCK_32MHZ, AR5K_PHY_SCLOCK); ath5k_hw_reg_write(ah, AR5K_PHY_SDELAY_32MHZ, AR5K_PHY_SDELAY); ath5k_hw_reg_write(ah, ah->ah_phy_spending, AR5K_PHY_SPENDING); - - data = ath5k_hw_reg_read(ah, AR5K_USEC_5211) & 0xffffc07f ; - data |= (ah->ah_phy_spending == AR5K_PHY_SPENDING_18) ? - 0x00000f80 : 0x00001380 ; - ath5k_hw_reg_write(ah, data, AR5K_USEC_5211); - data = 0; } if (ah->ah_version == AR5K_AR5212) { @@ -1270,7 +1226,7 @@ int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, bool set_chip, u16 sleep_duration) { unsigned int i; - u32 staid, data; + u32 staid; ATH5K_TRACE(ah->ah_sc); staid = ath5k_hw_reg_read(ah, AR5K_STA_ID1); @@ -1282,8 +1238,7 @@ int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, case AR5K_PM_NETWORK_SLEEP: if (set_chip) ath5k_hw_reg_write(ah, - AR5K_SLEEP_CTL_SLE_ALLOW | - sleep_duration, + AR5K_SLEEP_CTL_SLE | sleep_duration, AR5K_SLEEP_CTL); staid |= AR5K_STA_ID1_PWR_SV; @@ -1298,24 +1253,13 @@ int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, break; case AR5K_PM_AWAKE: - - staid &= ~AR5K_STA_ID1_PWR_SV; - if (!set_chip) goto commit; - /* Preserve sleep duration */ - data = ath5k_hw_reg_read(ah, AR5K_SLEEP_CTL); - if( data & 0xffc00000 ){ - data = 0; - } else { - data = data & 0xfffcffff; - } - - ath5k_hw_reg_write(ah, data, AR5K_SLEEP_CTL); - udelay(15); + ath5k_hw_reg_write(ah, AR5K_SLEEP_CTL_SLE_WAKE, + AR5K_SLEEP_CTL); - for (i = 50; i > 0; i--) { + for (i = 5000; i > 0; i--) { /* Check if the chip did wake up */ if ((ath5k_hw_reg_read(ah, AR5K_PCICFG) & AR5K_PCICFG_SPWR_DN) == 0) @@ -1323,13 +1267,15 @@ int ath5k_hw_set_power(struct ath5k_hw *ah, enum ath5k_power_mode mode, /* Wait a bit and retry */ udelay(200); - ath5k_hw_reg_write(ah, data, AR5K_SLEEP_CTL); + ath5k_hw_reg_write(ah, AR5K_SLEEP_CTL_SLE_WAKE, + AR5K_SLEEP_CTL); } /* Fail if the chip didn't wake up */ if (i <= 0) return -EIO; + staid &= ~AR5K_STA_ID1_PWR_SV; break; default: @@ -1358,7 +1304,6 @@ void ath5k_hw_start_rx(struct ath5k_hw *ah) { ATH5K_TRACE(ah->ah_sc); ath5k_hw_reg_write(ah, AR5K_CR_RXE, AR5K_CR); - ath5k_hw_reg_read(ah, AR5K_CR); } /* @@ -1445,7 +1390,6 @@ int ath5k_hw_tx_start(struct ath5k_hw *ah, unsigned int queue) } /* Start queue */ ath5k_hw_reg_write(ah, tx_queue, AR5K_CR); - ath5k_hw_reg_read(ah, AR5K_CR); } else { /* Return if queue is disabled */ if (AR5K_REG_READ_Q(ah, AR5K_QCU_TXD, queue)) @@ -1743,7 +1687,6 @@ enum ath5k_int ath5k_hw_set_intr(struct ath5k_hw *ah, enum ath5k_int new_mask) * (they will be re-enabled afterwards). */ ath5k_hw_reg_write(ah, AR5K_IER_DISABLE, AR5K_IER); - ath5k_hw_reg_read(ah, AR5K_IER); old_mask = ah->ah_imr; @@ -3420,13 +3363,11 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue) ath5k_hw_reg_write(ah, ah->ah_turbo ? AR5K_INIT_PROTO_TIME_CNTRL_TURBO : AR5K_INIT_PROTO_TIME_CNTRL, AR5K_IFS1); - /* Set AR5K_PHY_SETTLING */ + /* Set PHY register 0x9844 (??) */ ath5k_hw_reg_write(ah, ah->ah_turbo ? - (ath5k_hw_reg_read(ah, AR5K_PHY_SETTLING) & ~0x7F) - | 0x38 : - (ath5k_hw_reg_read(ah, AR5K_PHY_SETTLING) & ~0x7F) - | 0x1C, - AR5K_PHY_SETTLING); + (ath5k_hw_reg_read(ah, AR5K_PHY(17)) & ~0x7F) | 0x38 : + (ath5k_hw_reg_read(ah, AR5K_PHY(17)) & ~0x7F) | 0x1C, + AR5K_PHY(17)); /* Set Frame Control Register */ ath5k_hw_reg_write(ah, ah->ah_turbo ? (AR5K_PHY_FRAME_CTL_INI | AR5K_PHY_TURBO_MODE | @@ -3547,7 +3488,7 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue) if (tq->tqi_flags & AR5K_TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE) AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue), - AR5K_QCU_MISC_RDY_VEOL_POLICY); + AR5K_QCU_MISC_TXE); } if (tq->tqi_flags & AR5K_TXQ_FLAG_BACKOFF_DISABLE) diff --git a/trunk/drivers/net/wireless/ath5k/initvals.c b/trunk/drivers/net/wireless/ath5k/initvals.c index 2806b21bf90b..04c84e9da89d 100644 --- a/trunk/drivers/net/wireless/ath5k/initvals.c +++ b/trunk/drivers/net/wireless/ath5k/initvals.c @@ -489,7 +489,7 @@ static const struct ath5k_ini ar5212_ini[] = { { AR5K_QUEUE_TXDP(9), 0x00000000 }, { AR5K_DCU_FP, 0x00000000 }, { AR5K_DCU_TXP, 0x00000000 }, - { AR5K_DCU_TX_FILTER_0_BASE, 0x00000000 }, + { AR5K_DCU_TX_FILTER, 0x00000000 }, /* Unknown table */ { 0x1078, 0x00000000 }, { 0x10b8, 0x00000000 }, @@ -679,7 +679,7 @@ static const struct ath5k_ini ar5212_ini[] = { { AR5K_PHY(645), 0x00106c10 }, { AR5K_PHY(646), 0x009c4060 }, { AR5K_PHY(647), 0x1483800a }, - /* { AR5K_PHY(648), 0x018830c6 },*/ /* 2413/2425 */ + /* { AR5K_PHY(648), 0x018830c6 },*/ /* 2413 */ { AR5K_PHY(648), 0x01831061 }, { AR5K_PHY(649), 0x00000400 }, /*{ AR5K_PHY(650), 0x000001b5 },*/ diff --git a/trunk/drivers/net/wireless/ath5k/phy.c b/trunk/drivers/net/wireless/ath5k/phy.c index fa0d47faf574..afd8689e5c03 100644 --- a/trunk/drivers/net/wireless/ath5k/phy.c +++ b/trunk/drivers/net/wireless/ath5k/phy.c @@ -1020,74 +1020,6 @@ static const struct ath5k_ini_rfgain rfgain_2413[] = { { AR5K_RF_GAIN(63), { 0x000000f9 } }, }; -/* Initial RF Gain settings for RF2425 */ -static const struct ath5k_ini_rfgain rfgain_2425[] = { - { AR5K_RF_GAIN(0), { 0x00000000 } }, - { AR5K_RF_GAIN(1), { 0x00000040 } }, - { AR5K_RF_GAIN(2), { 0x00000080 } }, - { AR5K_RF_GAIN(3), { 0x00000181 } }, - { AR5K_RF_GAIN(4), { 0x000001c1 } }, - { AR5K_RF_GAIN(5), { 0x00000001 } }, - { AR5K_RF_GAIN(6), { 0x00000041 } }, - { AR5K_RF_GAIN(7), { 0x00000081 } }, - { AR5K_RF_GAIN(8), { 0x00000188 } }, - { AR5K_RF_GAIN(9), { 0x000001c8 } }, - { AR5K_RF_GAIN(10), { 0x00000008 } }, - { AR5K_RF_GAIN(11), { 0x00000048 } }, - { AR5K_RF_GAIN(12), { 0x00000088 } }, - { AR5K_RF_GAIN(13), { 0x00000189 } }, - { AR5K_RF_GAIN(14), { 0x000001c9 } }, - { AR5K_RF_GAIN(15), { 0x00000009 } }, - { AR5K_RF_GAIN(16), { 0x00000049 } }, - { AR5K_RF_GAIN(17), { 0x00000089 } }, - { AR5K_RF_GAIN(18), { 0x000001b0 } }, - { AR5K_RF_GAIN(19), { 0x000001f0 } }, - { AR5K_RF_GAIN(20), { 0x00000030 } }, - { AR5K_RF_GAIN(21), { 0x00000070 } }, - { AR5K_RF_GAIN(22), { 0x00000171 } }, - { AR5K_RF_GAIN(23), { 0x000001b1 } }, - { AR5K_RF_GAIN(24), { 0x000001f1 } }, - { AR5K_RF_GAIN(25), { 0x00000031 } }, - { AR5K_RF_GAIN(26), { 0x00000071 } }, - { AR5K_RF_GAIN(27), { 0x000001b8 } }, - { AR5K_RF_GAIN(28), { 0x000001f8 } }, - { AR5K_RF_GAIN(29), { 0x00000038 } }, - { AR5K_RF_GAIN(30), { 0x00000078 } }, - { AR5K_RF_GAIN(31), { 0x000000b8 } }, - { AR5K_RF_GAIN(32), { 0x000001b9 } }, - { AR5K_RF_GAIN(33), { 0x000001f9 } }, - { AR5K_RF_GAIN(34), { 0x00000039 } }, - { AR5K_RF_GAIN(35), { 0x00000079 } }, - { AR5K_RF_GAIN(36), { 0x000000b9 } }, - { AR5K_RF_GAIN(37), { 0x000000f9 } }, - { AR5K_RF_GAIN(38), { 0x000000f9 } }, - { AR5K_RF_GAIN(39), { 0x000000f9 } }, - { AR5K_RF_GAIN(40), { 0x000000f9 } }, - { AR5K_RF_GAIN(41), { 0x000000f9 } }, - { AR5K_RF_GAIN(42), { 0x000000f9 } }, - { AR5K_RF_GAIN(43), { 0x000000f9 } }, - { AR5K_RF_GAIN(44), { 0x000000f9 } }, - { AR5K_RF_GAIN(45), { 0x000000f9 } }, - { AR5K_RF_GAIN(46), { 0x000000f9 } }, - { AR5K_RF_GAIN(47), { 0x000000f9 } }, - { AR5K_RF_GAIN(48), { 0x000000f9 } }, - { AR5K_RF_GAIN(49), { 0x000000f9 } }, - { AR5K_RF_GAIN(50), { 0x000000f9 } }, - { AR5K_RF_GAIN(51), { 0x000000f9 } }, - { AR5K_RF_GAIN(52), { 0x000000f9 } }, - { AR5K_RF_GAIN(53), { 0x000000f9 } }, - { AR5K_RF_GAIN(54), { 0x000000f9 } }, - { AR5K_RF_GAIN(55), { 0x000000f9 } }, - { AR5K_RF_GAIN(56), { 0x000000f9 } }, - { AR5K_RF_GAIN(57), { 0x000000f9 } }, - { AR5K_RF_GAIN(58), { 0x000000f9 } }, - { AR5K_RF_GAIN(59), { 0x000000f9 } }, - { AR5K_RF_GAIN(60), { 0x000000f9 } }, - { AR5K_RF_GAIN(61), { 0x000000f9 } }, - { AR5K_RF_GAIN(62), { 0x000000f9 } }, - { AR5K_RF_GAIN(63), { 0x000000f9 } }, -}; - static const struct ath5k_gain_opt rfgain_opt_5112 = { 1, 8, @@ -1656,8 +1588,8 @@ int ath5k_hw_rfgain(struct ath5k_hw *ah, unsigned int freq) freq = 0; /* only 2Ghz */ break; case AR5K_RF2425: - ath5k_rfg = rfgain_2425; - size = ARRAY_SIZE(rfgain_2425); + ath5k_rfg = rfgain_2413; + size = ARRAY_SIZE(rfgain_2413); freq = 0; /* only 2Ghz */ break; default: @@ -1898,6 +1830,9 @@ static int ath5k_hw_rf5112_channel(struct ath5k_hw *ah, data = data0 = data1 = data2 = 0; c = channel->center_freq; + /* + * Set the channel on the RF5112 or newer + */ if (c < 4800) { if (!((c - 2224) % 5)) { data0 = ((2 * (c - 704)) - 3040) / 10; @@ -1909,7 +1844,7 @@ static int ath5k_hw_rf5112_channel(struct ath5k_hw *ah, return -EINVAL; data0 = ath5k_hw_bitswap((data0 << 2) & 0xff, 8); - } else if ((c - (c % 5)) != 2 || c > 5435) { + } else { if (!(c % 20) && c >= 5120) { data0 = ath5k_hw_bitswap(((c - 4800) / 20 << 2), 8); data2 = ath5k_hw_bitswap(3, 2); @@ -1921,9 +1856,6 @@ static int ath5k_hw_rf5112_channel(struct ath5k_hw *ah, data2 = ath5k_hw_bitswap(1, 2); } else return -EINVAL; - } else { - data0 = ath5k_hw_bitswap((10 * (c - 2) - 4800) / 25 + 1, 8); - data2 = ath5k_hw_bitswap(0, 2); } data = (data0 << 4) | (data1 << 1) | (data2 << 2) | 0x1001; @@ -1934,45 +1866,6 @@ static int ath5k_hw_rf5112_channel(struct ath5k_hw *ah, return 0; } -/* - * Set the channel on the RF2425 - */ -static int ath5k_hw_rf2425_channel(struct ath5k_hw *ah, - struct ieee80211_channel *channel) -{ - u32 data, data0, data2; - u16 c; - - data = data0 = data2 = 0; - c = channel->center_freq; - - if (c < 4800) { - data0 = ath5k_hw_bitswap((c - 2272), 8); - data2 = 0; - /* ? 5GHz ? */ - } else if ((c - (c % 5)) != 2 || c > 5435) { - if (!(c % 20) && c < 5120) - data0 = ath5k_hw_bitswap(((c - 4800) / 20 << 2), 8); - else if (!(c % 10)) - data0 = ath5k_hw_bitswap(((c - 4800) / 10 << 1), 8); - else if (!(c % 5)) - data0 = ath5k_hw_bitswap((c - 4800) / 5, 8); - else - return -EINVAL; - data2 = ath5k_hw_bitswap(1, 2); - } else { - data0 = ath5k_hw_bitswap((10 * (c - 2) - 4800) / 25 + 1, 8); - data2 = ath5k_hw_bitswap(0, 2); - } - - data = (data0 << 4) | data2 << 2 | 0x1001; - - ath5k_hw_reg_write(ah, data & 0xff, AR5K_RF_BUFFER); - ath5k_hw_reg_write(ah, (data >> 8) & 0x7f, AR5K_RF_BUFFER_CONTROL_5); - - return 0; -} - /* * Set a channel on the radio chip */ @@ -2002,9 +1895,6 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel) case AR5K_RF5111: ret = ath5k_hw_rf5111_channel(ah, channel); break; - case AR5K_RF2425: - ret = ath5k_hw_rf2425_channel(ah, channel); - break; default: ret = ath5k_hw_rf5112_channel(ah, channel); break; @@ -2013,15 +1903,6 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel) if (ret) return ret; - /* Set JAPAN setting for channel 14 */ - if (channel->center_freq == 2484) { - AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_CCKTXCTL, - AR5K_PHY_CCKTXCTL_JAPAN); - } else { - AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_CCKTXCTL, - AR5K_PHY_CCKTXCTL_WORLD); - } - ah->ah_current_channel.center_freq = channel->center_freq; ah->ah_current_channel.hw_value = channel->hw_value; ah->ah_turbo = channel->hw_value == CHANNEL_T ? true : false; @@ -2052,8 +1933,6 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel) * http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL \ * &p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.htm&r=1&f=G&l=50&s1=7245893.PN.&OS=PN/7 * - * XXX: Since during noise floor calibration antennas are detached according to - * the patent, we should stop tx queues here. */ int ath5k_hw_noise_floor_calibration(struct ath5k_hw *ah, short freq) @@ -2063,7 +1942,7 @@ ath5k_hw_noise_floor_calibration(struct ath5k_hw *ah, short freq) s32 noise_floor; /* - * Enable noise floor calibration + * Enable noise floor calibration and wait until completion */ AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_AGCCTL, AR5K_PHY_AGCCTL_NF); @@ -2073,7 +1952,7 @@ ath5k_hw_noise_floor_calibration(struct ath5k_hw *ah, short freq) if (ret) { ATH5K_ERR(ah->ah_sc, "noise floor calibration timeout (%uMHz)\n", freq); - return -EAGAIN; + return ret; } /* Wait until the noise floor is calibrated and read the value */ @@ -2095,7 +1974,7 @@ ath5k_hw_noise_floor_calibration(struct ath5k_hw *ah, short freq) if (noise_floor > AR5K_TUNE_NOISE_FLOOR) { ATH5K_ERR(ah->ah_sc, "noise floor calibration failed (%uMHz)\n", freq); - return -EAGAIN; + return -EIO; } ah->ah_noise_floor = noise_floor; @@ -2208,66 +2087,38 @@ static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah, } /* - * Perform a PHY calibration on RF5111/5112 and newer chips + * Perform a PHY calibration on RF5111/5112 */ static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah, struct ieee80211_channel *channel) { u32 i_pwr, q_pwr; s32 iq_corr, i_coff, i_coffd, q_coff, q_coffd; - int i; ATH5K_TRACE(ah->ah_sc); if (!ah->ah_calibration || - ath5k_hw_reg_read(ah, AR5K_PHY_IQ) & AR5K_PHY_IQ_RUN) + ath5k_hw_reg_read(ah, AR5K_PHY_IQ) & AR5K_PHY_IQ_RUN) goto done; - /* Calibration has finished, get the results and re-run */ - for (i = 0; i <= 10; i++) { - iq_corr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_CORR); - i_pwr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_PWR_I); - q_pwr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_PWR_Q); - } + ah->ah_calibration = false; + iq_corr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_CORR); + i_pwr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_PWR_I); + q_pwr = ath5k_hw_reg_read(ah, AR5K_PHY_IQRES_CAL_PWR_Q); i_coffd = ((i_pwr >> 1) + (q_pwr >> 1)) >> 7; - q_coffd = q_pwr >> 7; + q_coffd = q_pwr >> 6; - /* No correction */ if (i_coffd == 0 || q_coffd == 0) goto done; i_coff = ((-iq_corr) / i_coffd) & 0x3f; + q_coff = (((s32)i_pwr / q_coffd) - 64) & 0x1f; - /* Boundary check */ - if (i_coff > 31) - i_coff = 31; - if (i_coff < -32) - i_coff = -32; - - q_coff = (((s32)i_pwr / q_coffd) - 128) & 0x1f; - - /* Boundary check */ - if (q_coff > 15) - q_coff = 15; - if (q_coff < -16) - q_coff = -16; - - /* Commit new I/Q value */ + /* Commit new IQ value */ AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_CORR_ENABLE | ((u32)q_coff) | ((u32)i_coff << AR5K_PHY_IQ_CORR_Q_I_COFF_S)); - /* Re-enable calibration -if we don't we'll commit - * the same values again and again */ - AR5K_REG_WRITE_BITS(ah, AR5K_PHY_IQ, - AR5K_PHY_IQ_CAL_NUM_LOG_MAX, 15); - AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_IQ, AR5K_PHY_IQ_RUN); - done: - - /* TODO: Separate noise floor calibration from I/Q calibration - * since noise floor calibration interrupts rx path while I/Q - * calibration doesn't. We don't need to run noise floor calibration - * as often as I/Q calibration.*/ ath5k_hw_noise_floor_calibration(ah, channel->center_freq); /* Request RF gain */ diff --git a/trunk/drivers/net/wireless/ath5k/reg.h b/trunk/drivers/net/wireless/ath5k/reg.h index 7562bf173d3e..30629b3e37c2 100644 --- a/trunk/drivers/net/wireless/ath5k/reg.h +++ b/trunk/drivers/net/wireless/ath5k/reg.h @@ -53,7 +53,7 @@ #define AR5K_CR_TXD0 0x00000008 /* TX Disable for queue 0 on 5210 */ #define AR5K_CR_TXD1 0x00000010 /* TX Disable for queue 1 on 5210 */ #define AR5K_CR_RXD 0x00000020 /* RX Disable */ -#define AR5K_CR_SWI 0x00000040 /* Software Interrupt */ +#define AR5K_CR_SWI 0x00000040 /* * RX Descriptor Pointer register @@ -65,19 +65,19 @@ */ #define AR5K_CFG 0x0014 /* Register Address */ #define AR5K_CFG_SWTD 0x00000001 /* Byte-swap TX descriptor (for big endian archs) */ -#define AR5K_CFG_SWTB 0x00000002 /* Byte-swap TX buffer */ +#define AR5K_CFG_SWTB 0x00000002 /* Byte-swap TX buffer (?) */ #define AR5K_CFG_SWRD 0x00000004 /* Byte-swap RX descriptor */ -#define AR5K_CFG_SWRB 0x00000008 /* Byte-swap RX buffer */ -#define AR5K_CFG_SWRG 0x00000010 /* Byte-swap Register access */ -#define AR5K_CFG_ADHOC 0x00000020 /* AP/Adhoc indication [5211+] */ +#define AR5K_CFG_SWRB 0x00000008 /* Byte-swap RX buffer (?) */ +#define AR5K_CFG_SWRG 0x00000010 /* Byte-swap Register values (?) */ +#define AR5K_CFG_ADHOC 0x00000020 /* [5211+] */ #define AR5K_CFG_PHY_OK 0x00000100 /* [5211+] */ #define AR5K_CFG_EEBS 0x00000200 /* EEPROM is busy */ -#define AR5K_CFG_CLKGD 0x00000400 /* Clock gated (Disable dynamic clock) */ +#define AR5K_CFG_CLKGD 0x00000400 /* Clock gated (?) */ #define AR5K_CFG_TXCNT 0x00007800 /* Tx frame count (?) [5210] */ #define AR5K_CFG_TXCNT_S 11 #define AR5K_CFG_TXFSTAT 0x00008000 /* Tx frame status (?) [5210] */ #define AR5K_CFG_TXFSTRT 0x00010000 /* [5210] */ -#define AR5K_CFG_PCI_THRES 0x00060000 /* PCI Master req q threshold [5211+] */ +#define AR5K_CFG_PCI_THRES 0x00060000 /* [5211+] */ #define AR5K_CFG_PCI_THRES_S 17 /* @@ -162,40 +162,35 @@ /* * Transmit configuration register */ -#define AR5K_TXCFG 0x0030 /* Register Address */ -#define AR5K_TXCFG_SDMAMR 0x00000007 /* DMA size (read) */ -#define AR5K_TXCFG_SDMAMR_S 0 -#define AR5K_TXCFG_B_MODE 0x00000008 /* Set b mode for 5111 (enable 2111) */ -#define AR5K_TXCFG_TXFSTP 0x00000008 /* TX DMA full Stop [5210] */ -#define AR5K_TXCFG_TXFULL 0x000003f0 /* TX Triger level mask */ -#define AR5K_TXCFG_TXFULL_S 4 -#define AR5K_TXCFG_TXFULL_0B 0x00000000 -#define AR5K_TXCFG_TXFULL_64B 0x00000010 -#define AR5K_TXCFG_TXFULL_128B 0x00000020 -#define AR5K_TXCFG_TXFULL_192B 0x00000030 -#define AR5K_TXCFG_TXFULL_256B 0x00000040 -#define AR5K_TXCFG_TXCONT_EN 0x00000080 -#define AR5K_TXCFG_DMASIZE 0x00000100 /* Flag for passing DMA size [5210] */ -#define AR5K_TXCFG_JUMBO_DESC_EN 0x00000400 /* Enable jumbo tx descriptors [5211+] */ -#define AR5K_TXCFG_ADHOC_BCN_ATIM 0x00000800 /* Adhoc Beacon ATIM Policy */ -#define AR5K_TXCFG_ATIM_WINDOW_DEF_DIS 0x00001000 /* Disable ATIM window defer [5211+] */ -#define AR5K_TXCFG_RTSRND 0x00001000 /* [5211+] */ -#define AR5K_TXCFG_FRMPAD_DIS 0x00002000 /* [5211+] */ -#define AR5K_TXCFG_RDY_CBR_DIS 0x00004000 /* Ready time CBR disable [5211+] */ -#define AR5K_TXCFG_JUMBO_FRM_MODE 0x00008000 /* Jumbo frame mode [5211+] */ -#define AR5K_TXCFG_DCU_CACHING_DIS 0x00010000 /* Disable DCU caching */ +#define AR5K_TXCFG 0x0030 /* Register Address */ +#define AR5K_TXCFG_SDMAMR 0x00000007 /* DMA size */ +#define AR5K_TXCFG_SDMAMR_S 0 +#define AR5K_TXCFG_B_MODE 0x00000008 /* Set b mode for 5111 (enable 2111) */ +#define AR5K_TXCFG_TXFSTP 0x00000008 /* TX DMA full Stop [5210] */ +#define AR5K_TXCFG_TXFULL 0x000003f0 /* TX Triger level mask */ +#define AR5K_TXCFG_TXFULL_S 4 +#define AR5K_TXCFG_TXFULL_0B 0x00000000 +#define AR5K_TXCFG_TXFULL_64B 0x00000010 +#define AR5K_TXCFG_TXFULL_128B 0x00000020 +#define AR5K_TXCFG_TXFULL_192B 0x00000030 +#define AR5K_TXCFG_TXFULL_256B 0x00000040 +#define AR5K_TXCFG_TXCONT_EN 0x00000080 +#define AR5K_TXCFG_DMASIZE 0x00000100 /* Flag for passing DMA size [5210] */ +#define AR5K_TXCFG_JUMBO_TXE 0x00000400 /* Enable jumbo frames transmition (?) [5211+] */ +#define AR5K_TXCFG_RTSRND 0x00001000 /* [5211+] */ +#define AR5K_TXCFG_FRMPAD_DIS 0x00002000 /* [5211+] */ +#define AR5K_TXCFG_RDY_DIS 0x00004000 /* [5211+] */ /* * Receive configuration register */ #define AR5K_RXCFG 0x0034 /* Register Address */ -#define AR5K_RXCFG_SDMAMW 0x00000007 /* DMA size (write) */ +#define AR5K_RXCFG_SDMAMW 0x00000007 /* DMA size */ #define AR5K_RXCFG_SDMAMW_S 0 -#define AR5K_RXCFG_ZLFDMA 0x00000008 /* Enable Zero-length frame DMA */ -#define AR5K_RXCFG_DEF_ANTENNA 0x00000010 /* Default antenna (?) */ -#define AR5K_RXCFG_JUMBO_RXE 0x00000020 /* Enable jumbo rx descriptors [5211+] */ -#define AR5K_RXCFG_JUMBO_WRAP 0x00000040 /* Wrap jumbo frames [5211+] */ -#define AR5K_RXCFG_SLE_ENTRY 0x00000080 /* Sleep entry policy */ +#define AR5K_RXCFG_DEF_ANTENNA 0x00000008 /* Default antenna */ +#define AR5K_RXCFG_ZLFDMA 0x00000010 /* Zero-length DMA */ +#define AR5K_RXCFG_JUMBO_RXE 0x00000020 /* Enable jumbo frames reception (?) [5211+] */ +#define AR5K_RXCFG_JUMBO_WRAP 0x00000040 /* Wrap jumbo frames (?) [5211+] */ /* * Receive jumbo descriptor last address register @@ -207,35 +202,35 @@ * MIB control register */ #define AR5K_MIBC 0x0040 /* Register Address */ -#define AR5K_MIBC_COW 0x00000001 /* Warn test indicator */ -#define AR5K_MIBC_FMC 0x00000002 /* Freeze MIB Counters */ -#define AR5K_MIBC_CMC 0x00000004 /* Clean MIB Counters */ -#define AR5K_MIBC_MCS 0x00000008 /* MIB counter strobe */ +#define AR5K_MIBC_COW 0x00000001 +#define AR5K_MIBC_FMC 0x00000002 /* Freeze Mib Counters (?) */ +#define AR5K_MIBC_CMC 0x00000004 /* Clean Mib Counters (?) */ +#define AR5K_MIBC_MCS 0x00000008 /* * Timeout prescale register */ #define AR5K_TOPS 0x0044 -#define AR5K_TOPS_M 0x0000ffff +#define AR5K_TOPS_M 0x0000ffff /* [5211+] (?) */ /* * Receive timeout register (no frame received) */ #define AR5K_RXNOFRM 0x0048 -#define AR5K_RXNOFRM_M 0x000003ff +#define AR5K_RXNOFRM_M 0x000003ff /* [5211+] (?) */ /* * Transmit timeout register (no frame sent) */ #define AR5K_TXNOFRM 0x004c -#define AR5K_TXNOFRM_M 0x000003ff -#define AR5K_TXNOFRM_QCU 0x000ffc00 +#define AR5K_TXNOFRM_M 0x000003ff /* [5211+] (?) */ +#define AR5K_TXNOFRM_QCU 0x000ffc00 /* [5211+] (?) */ /* * Receive frame gap timeout register */ #define AR5K_RPGTO 0x0050 -#define AR5K_RPGTO_M 0x000003ff +#define AR5K_RPGTO_M 0x000003ff /* [5211+] (?) */ /* * Receive frame count limit register @@ -246,7 +241,6 @@ /* * Misc settings register - * (reserved0-3) */ #define AR5K_MISC 0x0058 /* Register Address */ #define AR5K_MISC_DMA_OBS_M 0x000001e0 @@ -262,7 +256,6 @@ /* * QCU/DCU clock gating register (5311) - * (reserved4-5) */ #define AR5K_QCUDCU_CLKGT 0x005c /* Register Address (?) */ #define AR5K_QCUDCU_CLKGT_QCU 0x0000ffff /* Mask for QCU clock */ @@ -291,18 +284,18 @@ #define AR5K_ISR_TXEOL 0x00000400 /* Empty TX descriptor */ #define AR5K_ISR_TXURN 0x00000800 /* Transmit FIFO underrun */ #define AR5K_ISR_MIB 0x00001000 /* Update MIB counters */ -#define AR5K_ISR_SWI 0x00002000 /* Software interrupt */ +#define AR5K_ISR_SWI 0x00002000 /* Software interrupt (?) */ #define AR5K_ISR_RXPHY 0x00004000 /* PHY error */ -#define AR5K_ISR_RXKCM 0x00008000 /* RX Key cache miss */ +#define AR5K_ISR_RXKCM 0x00008000 #define AR5K_ISR_SWBA 0x00010000 /* Software beacon alert */ #define AR5K_ISR_BRSSI 0x00020000 #define AR5K_ISR_BMISS 0x00040000 /* Beacon missed */ #define AR5K_ISR_HIUERR 0x00080000 /* Host Interface Unit error [5211+] */ #define AR5K_ISR_BNR 0x00100000 /* Beacon not ready [5211+] */ -#define AR5K_ISR_MCABT 0x00100000 /* Master Cycle Abort [5210] */ -#define AR5K_ISR_RXCHIRP 0x00200000 /* CHIRP Received [5212+] */ -#define AR5K_ISR_SSERR 0x00200000 /* Signaled System Error [5210] */ -#define AR5K_ISR_DPERR 0x00400000 /* Det par Error (?) [5210] */ +#define AR5K_ISR_MCABT 0x00100000 /* [5210] */ +#define AR5K_ISR_RXCHIRP 0x00200000 /* [5212+] */ +#define AR5K_ISR_SSERR 0x00200000 /* [5210] */ +#define AR5K_ISR_DPERR 0x00400000 /* [5210] */ #define AR5K_ISR_TIM 0x00800000 /* [5210] */ #define AR5K_ISR_BCNMISC 0x00800000 /* [5212+] */ #define AR5K_ISR_GPIO 0x01000000 /* GPIO (rf kill)*/ @@ -327,14 +320,14 @@ #define AR5K_SISR2 0x008c /* Register Address [5211+] */ #define AR5K_SISR2_QCU_TXURN 0x000003ff /* Mask for QCU_TXURN */ -#define AR5K_SISR2_MCABT 0x00100000 /* Master Cycle Abort */ -#define AR5K_SISR2_SSERR 0x00200000 /* Signaled System Error */ -#define AR5K_SISR2_DPERR 0x00400000 /* Det par Error (?) */ +#define AR5K_SISR2_MCABT 0x00100000 +#define AR5K_SISR2_SSERR 0x00200000 +#define AR5K_SISR2_DPERR 0x00400000 #define AR5K_SISR2_TIM 0x01000000 /* [5212+] */ #define AR5K_SISR2_CAB_END 0x02000000 /* [5212+] */ -#define AR5K_SISR2_DTIM_SYNC 0x04000000 /* DTIM sync lost [5212+] */ -#define AR5K_SISR2_BCN_TIMEOUT 0x08000000 /* Beacon Timeout [5212+] */ -#define AR5K_SISR2_CAB_TIMEOUT 0x10000000 /* CAB Timeout [5212+] */ +#define AR5K_SISR2_DTIM_SYNC 0x04000000 /* [5212+] */ +#define AR5K_SISR2_BCN_TIMEOUT 0x08000000 /* [5212+] */ +#define AR5K_SISR2_CAB_TIMEOUT 0x10000000 /* [5212+] */ #define AR5K_SISR2_DTIM 0x20000000 /* [5212+] */ #define AR5K_SISR3 0x0090 /* Register Address [5211+] */ @@ -375,18 +368,18 @@ #define AR5K_IMR_TXEOL 0x00000400 /* Empty TX descriptor*/ #define AR5K_IMR_TXURN 0x00000800 /* Transmit FIFO underrun*/ #define AR5K_IMR_MIB 0x00001000 /* Update MIB counters*/ -#define AR5K_IMR_SWI 0x00002000 /* Software interrupt */ +#define AR5K_IMR_SWI 0x00002000 #define AR5K_IMR_RXPHY 0x00004000 /* PHY error*/ -#define AR5K_IMR_RXKCM 0x00008000 /* RX Key cache miss */ +#define AR5K_IMR_RXKCM 0x00008000 #define AR5K_IMR_SWBA 0x00010000 /* Software beacon alert*/ #define AR5K_IMR_BRSSI 0x00020000 #define AR5K_IMR_BMISS 0x00040000 /* Beacon missed*/ #define AR5K_IMR_HIUERR 0x00080000 /* Host Interface Unit error [5211+] */ #define AR5K_IMR_BNR 0x00100000 /* Beacon not ready [5211+] */ -#define AR5K_IMR_MCABT 0x00100000 /* Master Cycle Abort [5210] */ -#define AR5K_IMR_RXCHIRP 0x00200000 /* CHIRP Received [5212+]*/ -#define AR5K_IMR_SSERR 0x00200000 /* Signaled System Error [5210] */ -#define AR5K_IMR_DPERR 0x00400000 /* Det par Error (?) [5210] */ +#define AR5K_IMR_MCABT 0x00100000 /* [5210] */ +#define AR5K_IMR_RXCHIRP 0x00200000 /* [5212+]*/ +#define AR5K_IMR_SSERR 0x00200000 /* [5210] */ +#define AR5K_IMR_DPERR 0x00400000 /* [5210] */ #define AR5K_IMR_TIM 0x00800000 /* [5211+] */ #define AR5K_IMR_BCNMISC 0x00800000 /* [5212+] */ #define AR5K_IMR_GPIO 0x01000000 /* GPIO (rf kill)*/ @@ -412,14 +405,14 @@ #define AR5K_SIMR2 0x00ac /* Register Address [5211+] */ #define AR5K_SIMR2_QCU_TXURN 0x000003ff /* Mask for QCU_TXURN */ #define AR5K_SIMR2_QCU_TXURN_S 0 -#define AR5K_SIMR2_MCABT 0x00100000 /* Master Cycle Abort */ -#define AR5K_SIMR2_SSERR 0x00200000 /* Signaled System Error */ -#define AR5K_SIMR2_DPERR 0x00400000 /* Det par Error (?) */ +#define AR5K_SIMR2_MCABT 0x00100000 +#define AR5K_SIMR2_SSERR 0x00200000 +#define AR5K_SIMR2_DPERR 0x00400000 #define AR5K_SIMR2_TIM 0x01000000 /* [5212+] */ #define AR5K_SIMR2_CAB_END 0x02000000 /* [5212+] */ -#define AR5K_SIMR2_DTIM_SYNC 0x04000000 /* DTIM Sync lost [5212+] */ -#define AR5K_SIMR2_BCN_TIMEOUT 0x08000000 /* Beacon Timeout [5212+] */ -#define AR5K_SIMR2_CAB_TIMEOUT 0x10000000 /* CAB Timeout [5212+] */ +#define AR5K_SIMR2_DTIM_SYNC 0x04000000 /* [5212+] */ +#define AR5K_SIMR2_BCN_TIMEOUT 0x08000000 /* [5212+] */ +#define AR5K_SIMR2_CAB_TIMEOUT 0x10000000 /* [5212+] */ #define AR5K_SIMR2_DTIM 0x20000000 /* [5212+] */ #define AR5K_SIMR3 0x00b0 /* Register Address [5211+] */ @@ -432,69 +425,23 @@ #define AR5K_SIMR4_QTRIG 0x000003ff /* Mask for QTRIG */ #define AR5K_SIMR4_QTRIG_S 0 -/* - * DMA Debug registers 0-7 - * 0xe0 - 0xfc - */ /* * Decompression mask registers [5212+] */ -#define AR5K_DCM_ADDR 0x0400 /*Decompression mask address (index) */ -#define AR5K_DCM_DATA 0x0404 /*Decompression mask data */ - -/* - * Wake On Wireless pattern control register [5212+] - */ -#define AR5K_WOW_PCFG 0x0410 /* Register Address */ -#define AR5K_WOW_PCFG_PAT_MATCH_EN 0x00000001 /* Pattern match enable */ -#define AR5K_WOW_PCFG_LONG_FRAME_POL 0x00000002 /* Long frame policy */ -#define AR5K_WOW_PCFG_WOBMISS 0x00000004 /* Wake on bea(con) miss (?) */ -#define AR5K_WOW_PCFG_PAT_0_EN 0x00000100 /* Enable pattern 0 */ -#define AR5K_WOW_PCFG_PAT_1_EN 0x00000200 /* Enable pattern 1 */ -#define AR5K_WOW_PCFG_PAT_2_EN 0x00000400 /* Enable pattern 2 */ -#define AR5K_WOW_PCFG_PAT_3_EN 0x00000800 /* Enable pattern 3 */ -#define AR5K_WOW_PCFG_PAT_4_EN 0x00001000 /* Enable pattern 4 */ -#define AR5K_WOW_PCFG_PAT_5_EN 0x00002000 /* Enable pattern 5 */ - -/* - * Wake On Wireless pattern index register (?) [5212+] - */ -#define AR5K_WOW_PAT_IDX 0x0414 - -/* - * Wake On Wireless pattern data register [5212+] - */ -#define AR5K_WOW_PAT_DATA 0x0418 /* Register Address */ -#define AR5K_WOW_PAT_DATA_0_3_V 0x00000001 /* Pattern 0, 3 value */ -#define AR5K_WOW_PAT_DATA_1_4_V 0x00000100 /* Pattern 1, 4 value */ -#define AR5K_WOW_PAT_DATA_2_5_V 0x00010000 /* Pattern 2, 5 value */ -#define AR5K_WOW_PAT_DATA_0_3_M 0x01000000 /* Pattern 0, 3 mask */ -#define AR5K_WOW_PAT_DATA_1_4_M 0x04000000 /* Pattern 1, 4 mask */ -#define AR5K_WOW_PAT_DATA_2_5_M 0x10000000 /* Pattern 2, 5 mask */ +#define AR5K_DCM_ADDR 0x0400 /*Decompression mask address (?)*/ +#define AR5K_DCM_DATA 0x0404 /*Decompression mask data (?)*/ /* * Decompression configuration registers [5212+] */ -#define AR5K_DCCFG 0x0420 /* Register Address */ -#define AR5K_DCCFG_GLOBAL_EN 0x00000001 /* Enable decompression on all queues */ -#define AR5K_DCCFG_BYPASS_EN 0x00000002 /* Bypass decompression */ -#define AR5K_DCCFG_BCAST_EN 0x00000004 /* Enable decompression for bcast frames */ -#define AR5K_DCCFG_MCAST_EN 0x00000008 /* Enable decompression for mcast frames */ +#define AR5K_DCCFG 0x0420 /* * Compression configuration registers [5212+] */ -#define AR5K_CCFG 0x0600 /* Register Address */ -#define AR5K_CCFG_WINDOW_SIZE 0x00000007 /* Compression window size */ -#define AR5K_CCFG_CPC_EN 0x00000008 /* Enable performance counters */ - -#define AR5K_CCFG_CCU 0x0604 /* Register Address */ -#define AR5K_CCFG_CCU_CUP_EN 0x00000001 /* CCU Catchup enable */ -#define AR5K_CCFG_CCU_CREDIT 0x00000002 /* CCU Credit (field) */ -#define AR5K_CCFG_CCU_CD_THRES 0x00000080 /* CCU Cyc(lic?) debt threshold (field) */ -#define AR5K_CCFG_CCU_CUP_LCNT 0x00010000 /* CCU Catchup lit(?) count */ -#define AR5K_CCFG_CCU_INIT 0x00100200 /* Initial value during reset */ +#define AR5K_CCFG 0x0600 +#define AR5K_CCFG_CUP 0x0604 /* * Compression performance counter registers [5212+] @@ -503,7 +450,7 @@ #define AR5K_CPC1 0x0614 /* Compression performance counter 1*/ #define AR5K_CPC2 0x0618 /* Compression performance counter 2 */ #define AR5K_CPC3 0x061c /* Compression performance counter 3 */ -#define AR5K_CPCOVF 0x0620 /* Compression performance overflow */ +#define AR5K_CPCORN 0x0620 /* Compression performance overrun (?) */ /* @@ -519,6 +466,8 @@ * set/clear, which contain status for all queues (we shift by 1 for each * queue). To access these registers easily we define some macros here * that are used inside HAL. For more infos check out *_tx_queue functs. + * + * TODO: Boundary checking on macros (here?) */ /* @@ -564,6 +513,7 @@ #define AR5K_QCU_RDYTIMECFG_BASE 0x0900 /* Register Address - Queue0 RDYTIMECFG */ #define AR5K_QCU_RDYTIMECFG_INTVAL 0x00ffffff /* Ready time interval mask */ #define AR5K_QCU_RDYTIMECFG_INTVAL_S 0 +#define AR5K_QCU_RDYTIMECFG_DURATION 0x00ffffff /* Ready time duration mask */ #define AR5K_QCU_RDYTIMECFG_ENABLE 0x01000000 /* Ready time enable mask */ #define AR5K_QUEUE_RDYTIMECFG(_q) AR5K_QUEUE_REG(AR5K_QCU_RDYTIMECFG_BASE, _q) @@ -584,20 +534,19 @@ */ #define AR5K_QCU_MISC_BASE 0x09c0 /* Register Address -Queue0 MISC */ #define AR5K_QCU_MISC_FRSHED_M 0x0000000f /* Frame sheduling mask */ -#define AR5K_QCU_MISC_FRSHED_ASAP 0 /* ASAP */ -#define AR5K_QCU_MISC_FRSHED_CBR 1 /* Constant Bit Rate */ -#define AR5K_QCU_MISC_FRSHED_DBA_GT 2 /* DMA Beacon alert gated (?) */ -#define AR5K_QCU_MISC_FRSHED_TIM_GT 3 /* Time gated (?) */ +#define AR5K_QCU_MISC_FRSHED_ASAP 0 /* ASAP */ +#define AR5K_QCU_MISC_FRSHED_CBR 1 /* Constant Bit Rate */ +#define AR5K_QCU_MISC_FRSHED_DBA_GT 2 /* DMA Beacon alert gated (?) */ +#define AR5K_QCU_MISC_FRSHED_TIM_GT 3 /* Time gated (?) */ #define AR5K_QCU_MISC_FRSHED_BCN_SENT_GT 4 /* Beacon sent gated (?) */ #define AR5K_QCU_MISC_ONESHOT_ENABLE 0x00000010 /* Oneshot enable */ #define AR5K_QCU_MISC_CBREXP 0x00000020 /* CBR expired (normal queue) */ #define AR5K_QCU_MISC_CBREXP_BCN 0x00000040 /* CBR expired (beacon queue) */ -#define AR5K_QCU_MISC_BCN_ENABLE 0x00000080 /* Enable Beacon use */ -#define AR5K_QCU_MISC_CBR_THRES_ENABLE 0x00000100 /* CBR threshold enabled */ -#define AR5K_QCU_MISC_RDY_VEOL_POLICY 0x00000200 /* TXE reset when RDYTIME enalbed */ -#define AR5K_QCU_MISC_CBR_RESET_CNT 0x00000400 /* CBR threshold (counter) reset */ -#define AR5K_QCU_MISC_DCU_EARLY 0x00000800 /* DCU early termination */ -#define AR5K_QCU_MISC_DCU_CMP_EN 0x00001000 /* Enable frame compression */ +#define AR5K_QCU_MISC_BCN_ENABLE 0x00000080 /* Beacons enabled */ +#define AR5K_QCU_MISC_CBR_THRES_ENABLE 0x00000100 /* CBR threshold enabled (?) */ +#define AR5K_QCU_MISC_TXE 0x00000200 /* TXE reset when RDYTIME enalbed (?) */ +#define AR5K_QCU_MISC_CBR 0x00000400 /* CBR threshold reset (?) */ +#define AR5K_QCU_MISC_DCU_EARLY 0x00000800 /* DCU reset (?) */ #define AR5K_QUEUE_MISC(_q) AR5K_QUEUE_REG(AR5K_QCU_MISC_BASE, _q) @@ -606,7 +555,7 @@ */ #define AR5K_QCU_STS_BASE 0x0a00 /* Register Address - Queue0 STS */ #define AR5K_QCU_STS_FRMPENDCNT 0x00000003 /* Frames pending counter */ -#define AR5K_QCU_STS_CBREXPCNT 0x0000ff00 /* CBR expired counter */ +#define AR5K_QCU_STS_CBREXPCNT 0x0000ff00 /* CBR expired counter (?) */ #define AR5K_QUEUE_STATUS(_q) AR5K_QUEUE_REG(AR5K_QCU_STS_BASE, _q) /* @@ -620,11 +569,9 @@ */ #define AR5K_QCU_CBB_SELECT 0x0b00 #define AR5K_QCU_CBB_ADDR 0x0b04 -#define AR5K_QCU_CBB_ADDR_S 9 /* * QCU compression buffer configuration register [5212+] - * (buffer size) */ #define AR5K_QCU_CBCFG 0x0b08 @@ -705,100 +652,80 @@ * No lockout means there is no special handling. */ #define AR5K_DCU_MISC_BASE 0x1100 /* Register Address -Queue0 DCU_MISC */ -#define AR5K_DCU_MISC_BACKOFF 0x000007ff /* Mask for backoff threshold */ +#define AR5K_DCU_MISC_BACKOFF 0x000007ff /* Mask for backoff setting (?) */ #define AR5K_DCU_MISC_BACKOFF_FRAG 0x00000200 /* Enable backoff while bursting */ -#define AR5K_DCU_MISC_HCFPOLL_ENABLE 0x00000800 /* CF - Poll enable */ -#define AR5K_DCU_MISC_BACKOFF_PERSIST 0x00001000 /* Persistent backoff */ -#define AR5K_DCU_MISC_FRMPRFTCH_ENABLE 0x00002000 /* Enable frame pre-fetch */ +#define AR5K_DCU_MISC_HCFPOLL_ENABLE 0x00000800 /* CF - Poll (?) */ +#define AR5K_DCU_MISC_BACKOFF_PERSIST 0x00001000 /* Persistent backoff (?) */ +#define AR5K_DCU_MISC_FRMPRFTCH_ENABLE 0x00002000 /* Enable frame pre-fetch (?) */ #define AR5K_DCU_MISC_VIRTCOL 0x0000c000 /* Mask for Virtual Collision (?) */ -#define AR5K_DCU_MISC_VIRTCOL_NORMAL 0 -#define AR5K_DCU_MISC_VIRTCOL_MODIFIED 1 -#define AR5K_DCU_MISC_VIRTCOL_IGNORE 2 -#define AR5K_DCU_MISC_BCN_ENABLE 0x00010000 /* Enable Beacon use */ +#define AR5K_DCU_MISC_VIRTCOL_NORMAL 0 +#define AR5K_DCU_MISC_VIRTCOL_MODIFIED 1 +#define AR5K_DCU_MISC_VIRTCOL_IGNORE 2 +#define AR5K_DCU_MISC_BCN_ENABLE 0x00010000 /* Beacon enable (?) */ #define AR5K_DCU_MISC_ARBLOCK_CTL 0x00060000 /* Arbiter lockout control mask */ #define AR5K_DCU_MISC_ARBLOCK_CTL_S 17 -#define AR5K_DCU_MISC_ARBLOCK_CTL_NONE 0 /* No arbiter lockout */ +#define AR5K_DCU_MISC_ARBLOCK_CTL_NONE 0 /* No arbiter lockout */ #define AR5K_DCU_MISC_ARBLOCK_CTL_INTFRM 1 /* Intra-frame lockout */ #define AR5K_DCU_MISC_ARBLOCK_CTL_GLOBAL 2 /* Global lockout */ -#define AR5K_DCU_MISC_ARBLOCK_IGNORE 0x00080000 /* Ignore Arbiter lockout */ -#define AR5K_DCU_MISC_SEQ_NUM_INCR_DIS 0x00100000 /* Disable sequence number increment */ -#define AR5K_DCU_MISC_POST_FR_BKOFF_DIS 0x00200000 /* Disable post-frame backoff */ -#define AR5K_DCU_MISC_VIRT_COLL_POLICY 0x00400000 /* Virtual Collision cw policy */ -#define AR5K_DCU_MISC_BLOWN_IFS_POLICY 0x00800000 /* Blown IFS policy (?) */ +#define AR5K_DCU_MISC_ARBLOCK_IGNORE 0x00080000 +#define AR5K_DCU_MISC_SEQ_NUM_INCR_DIS 0x00100000 /* Disable sequence number increment (?) */ +#define AR5K_DCU_MISC_POST_FR_BKOFF_DIS 0x00200000 /* Disable post-frame backoff (?) */ +#define AR5K_DCU_MISC_VIRT_COLL_POLICY 0x00400000 /* Virtual Collision policy (?) */ +#define AR5K_DCU_MISC_BLOWN_IFS_POLICY 0x00800000 #define AR5K_DCU_MISC_SEQNUM_CTL 0x01000000 /* Sequence number control (?) */ #define AR5K_QUEUE_DFS_MISC(_q) AR5K_QUEUE_REG(AR5K_DCU_MISC_BASE, _q) /* * DCU frame sequence number registers */ -#define AR5K_DCU_SEQNUM_BASE 0x1140 -#define AR5K_DCU_SEQNUM_M 0x00000fff +#define AR5K_DCU_SEQNUM_BASE 0x1140 +#define AR5K_DCU_SEQNUM_M 0x00000fff #define AR5K_QUEUE_DFS_SEQNUM(_q) AR5K_QUEUE_REG(AR5K_DCU_SEQNUM_BASE, _q) /* - * DCU global IFS SIFS register + * DCU global IFS SIFS registers */ #define AR5K_DCU_GBL_IFS_SIFS 0x1030 #define AR5K_DCU_GBL_IFS_SIFS_M 0x0000ffff /* - * DCU global IFS slot interval register + * DCU global IFS slot interval registers */ #define AR5K_DCU_GBL_IFS_SLOT 0x1070 #define AR5K_DCU_GBL_IFS_SLOT_M 0x0000ffff /* - * DCU global IFS EIFS register + * DCU global IFS EIFS registers */ #define AR5K_DCU_GBL_IFS_EIFS 0x10b0 #define AR5K_DCU_GBL_IFS_EIFS_M 0x0000ffff /* - * DCU global IFS misc register - * - * LFSR stands for Linear Feedback Shift Register - * and it's used for generating pseudo-random - * number sequences. - * - * (If i understand corectly, random numbers are - * used for idle sensing -multiplied with cwmin/max etc-) + * DCU global IFS misc registers */ #define AR5K_DCU_GBL_IFS_MISC 0x10f0 /* Register Address */ -#define AR5K_DCU_GBL_IFS_MISC_LFSR_SLICE 0x00000007 /* LFSR Slice Select */ -#define AR5K_DCU_GBL_IFS_MISC_TURBO_MODE 0x00000008 /* Turbo mode */ -#define AR5K_DCU_GBL_IFS_MISC_SIFS_DUR_USEC 0x000003f0 /* SIFS Duration mask */ -#define AR5K_DCU_GBL_IFS_MISC_USEC_DUR 0x000ffc00 /* USEC Duration mask */ -#define AR5K_DCU_GBL_IFS_MISC_DCU_ARB_DELAY 0x00300000 /* DCU Arbiter delay mask */ -#define AR5K_DCU_GBL_IFS_MISC_SIFS_CNT_RST 0x00400000 /* SIFC cnt reset policy (?) */ -#define AR5K_DCU_GBL_IFS_MISC_AIFS_CNT_RST 0x00800000 /* AIFS cnt reset policy (?) */ -#define AR5K_DCU_GBL_IFS_MISC_RND_LFSR_SL_DIS 0x01000000 /* Disable random LFSR slice */ +#define AR5K_DCU_GBL_IFS_MISC_LFSR_SLICE 0x00000007 +#define AR5K_DCU_GBL_IFS_MISC_TURBO_MODE 0x00000008 /* Turbo mode (?) */ +#define AR5K_DCU_GBL_IFS_MISC_SIFS_DUR_USEC 0x000003f0 /* SIFS Duration mask (?) */ +#define AR5K_DCU_GBL_IFS_MISC_USEC_DUR 0x000ffc00 +#define AR5K_DCU_GBL_IFS_MISC_DCU_ARB_DELAY 0x00300000 /* * DCU frame prefetch control register */ -#define AR5K_DCU_FP 0x1230 /* Register Address */ -#define AR5K_DCU_FP_NOBURST_DCU_EN 0x00000001 /* Enable non-burst prefetch on DCU (?) */ -#define AR5K_DCU_FP_NOBURST_EN 0x00000010 /* Enable non-burst prefetch (?) */ -#define AR5K_DCU_FP_BURST_DCU_EN 0x00000020 /* Enable burst prefetch on DCU (?) */ +#define AR5K_DCU_FP 0x1230 /* * DCU transmit pause control/status register */ #define AR5K_DCU_TXP 0x1270 /* Register Address */ -#define AR5K_DCU_TXP_M 0x000003ff /* Tx pause mask */ -#define AR5K_DCU_TXP_STATUS 0x00010000 /* Tx pause status */ - -/* - * DCU transmit filter table 0 (32 entries) - */ -#define AR5K_DCU_TX_FILTER_0_BASE 0x1038 -#define AR5K_DCU_TX_FILTER_0(_n) (AR5K_DCU_TX_FILTER_0_BASE + (_n * 64)) +#define AR5K_DCU_TXP_M 0x000003ff /* Tx pause mask (?) */ +#define AR5K_DCU_TXP_STATUS 0x00010000 /* Tx pause status (?) */ /* - * DCU transmit filter table 1 (16 entries) + * DCU transmit filter register */ -#define AR5K_DCU_TX_FILTER_1_BASE 0x103c -#define AR5K_DCU_TX_FILTER_1(_n) (AR5K_DCU_TX_FILTER_1_BASE + ((_n - 32) * 64)) +#define AR5K_DCU_TX_FILTER 0x1038 /* * DCU clear transmit filter register @@ -812,6 +739,9 @@ /* * Reset control register + * + * 4 and 8 are not used in 5211/5212 and + * 2 means "baseband reset" on 5211/5212. */ #define AR5K_RESET_CTL 0x4000 /* Register Address */ #define AR5K_RESET_CTL_PCU 0x00000001 /* Protocol Control Unit reset */ @@ -835,7 +765,6 @@ #define AR5K_SLEEP_CTL_SLE_SLP 0x00010000 /* Force chip sleep */ #define AR5K_SLEEP_CTL_SLE_ALLOW 0x00020000 #define AR5K_SLEEP_CTL_SLE_UNITS 0x00000008 /* [5211+] */ -/* more bits */ /* * Interrupt pending register @@ -847,14 +776,13 @@ * Sleep force register */ #define AR5K_SFR 0x400c -#define AR5K_SFR_EN 0x00000001 +#define AR5K_SFR_M 0x00000001 /* * PCI configuration register */ #define AR5K_PCICFG 0x4010 /* Register Address */ #define AR5K_PCICFG_EEAE 0x00000001 /* Eeprom access enable [5210] */ -#define AR5K_PCICFG_SLEEP_CLOCK_EN 0x00000002 /* Enable sleep clock (?) */ #define AR5K_PCICFG_CLKRUNEN 0x00000004 /* CLKRUN enable [5211+] */ #define AR5K_PCICFG_EESIZE 0x00000018 /* Mask for EEPROM size [5211+] */ #define AR5K_PCICFG_EESIZE_S 3 @@ -870,21 +798,19 @@ #define AR5K_PCICFG_CBEFIX_DIS 0x00000400 /* Disable CBE fix (?) */ #define AR5K_PCICFG_SL_INTEN 0x00000800 /* Enable interrupts when asleep (?) */ #define AR5K_PCICFG_LED_BCTL 0x00001000 /* Led blink (?) [5210] */ -#define AR5K_PCICFG_UNK 0x00001000 /* Passed on some parts durring attach (?) */ -#define AR5K_PCICFG_SL_INPEN 0x00002000 /* Sleep even whith pending interrupts (?) */ +#define AR5K_PCICFG_SL_INPEN 0x00002800 /* Sleep even whith pending interrupts (?) */ #define AR5K_PCICFG_SPWR_DN 0x00010000 /* Mask for power status */ #define AR5K_PCICFG_LEDMODE 0x000e0000 /* Ledmode [5211+] */ #define AR5K_PCICFG_LEDMODE_PROP 0x00000000 /* Blink on standard traffic [5211+] */ #define AR5K_PCICFG_LEDMODE_PROM 0x00020000 /* Default mode (blink on any traffic) [5211+] */ #define AR5K_PCICFG_LEDMODE_PWR 0x00040000 /* Some other blinking mode (?) [5211+] */ #define AR5K_PCICFG_LEDMODE_RAND 0x00060000 /* Random blinking (?) [5211+] */ -#define AR5K_PCICFG_LEDBLINK 0x00700000 /* Led blink rate */ +#define AR5K_PCICFG_LEDBLINK 0x00700000 #define AR5K_PCICFG_LEDBLINK_S 20 -#define AR5K_PCICFG_LEDSLOW 0x00800000 /* Slowest led blink rate [5211+] */ +#define AR5K_PCICFG_LEDSLOW 0x00800000 /* Slow led blink rate (?) [5211+] */ #define AR5K_PCICFG_LEDSTATE \ (AR5K_PCICFG_LED | AR5K_PCICFG_LEDMODE | \ AR5K_PCICFG_LEDBLINK | AR5K_PCICFG_LEDSLOW) -#define AR5K_PCICFG_SLEEP_CLOCK_RATE 0x03000000 /* Sleep clock rate (field) */ /* * "General Purpose Input/Output" (GPIO) control register @@ -1021,7 +947,7 @@ #define AR5K_EEPROM_VERSION_4_4 0x4004 #define AR5K_EEPROM_VERSION_4_5 0x4005 #define AR5K_EEPROM_VERSION_4_6 0x4006 /* has ee_scaled_cck_delta */ -#define AR5K_EEPROM_VERSION_4_7 0x4007 +#define AR5K_EEPROM_VERSION_4_7 0x3007 #define AR5K_EEPROM_MODE_11A 0 #define AR5K_EEPROM_MODE_11B 1 @@ -1097,14 +1023,10 @@ #define AR5K_EEPROM_STAT_WRDONE 0x00000008 /* EEPROM write successful */ /* - * EEPROM config register + * EEPROM config register (?) */ -#define AR5K_EEPROM_CFG 0x6010 /* Register Addres */ -#define AR5K_EEPROM_CFG_SIZE_OVR 0x00000001 -#define AR5K_EEPROM_CFG_WR_WAIT_DIS 0x00000004 /* Disable write wait */ -#define AR5K_EEPROM_CFG_CLK_RATE 0x00000018 /* Clock rate */ -#define AR5K_EEPROM_CFG_PROT_KEY 0x00ffff00 /* Protectio key */ -#define AR5K_EEPROM_CFG_LIND_EN 0x01000000 /* Enable length indicator (?) */ +#define AR5K_EEPROM_CFG 0x6010 + /* @@ -1128,7 +1050,7 @@ #define AR5K_STA_ID1 0x8004 /* Register Address */ #define AR5K_STA_ID1_AP 0x00010000 /* Set AP mode */ #define AR5K_STA_ID1_ADHOC 0x00020000 /* Set Ad-Hoc mode */ -#define AR5K_STA_ID1_PWR_SV 0x00040000 /* Power save reporting */ +#define AR5K_STA_ID1_PWR_SV 0x00040000 /* Power save reporting (?) */ #define AR5K_STA_ID1_NO_KEYSRCH 0x00080000 /* No key search */ #define AR5K_STA_ID1_NO_PSPOLL 0x00100000 /* No power save polling [5210] */ #define AR5K_STA_ID1_PCF_5211 0x00100000 /* Enable PCF on [5211+] */ @@ -1137,13 +1059,9 @@ AR5K_STA_ID1_PCF_5210 : AR5K_STA_ID1_PCF_5211) #define AR5K_STA_ID1_DEFAULT_ANTENNA 0x00200000 /* Use default antenna */ #define AR5K_STA_ID1_DESC_ANTENNA 0x00400000 /* Update antenna from descriptor */ -#define AR5K_STA_ID1_RTS_DEF_ANTENNA 0x00800000 /* Use default antenna for RTS */ -#define AR5K_STA_ID1_ACKCTS_6MB 0x01000000 /* Use 6Mbit/s for ACK/CTS */ +#define AR5K_STA_ID1_RTS_DEF_ANTENNA 0x00800000 /* Use default antenna for RTS (?) */ +#define AR5K_STA_ID1_ACKCTS_6MB 0x01000000 /* Use 6Mbit/s for ACK/CTS (?) */ #define AR5K_STA_ID1_BASE_RATE_11B 0x02000000 /* Use 11b base rate (for ACK/CTS ?) [5211+] */ -#define AR5K_STA_ID1_SELF_GEN_SECTORE 0x04000000 /* Self generate sectore (?) */ -#define AR5K_STA_ID1_CRYPT_MIC_EN 0x08000000 /* Enable MIC */ -#define AR5K_STA_ID1_KEYSRCH_MODE 0x10000000 /* Keysearch mode (?) */ -#define AR5K_STA_ID1_PRESERVE_SEQ_NUM 0x20000000 /* Preserve sequence number */ /* * First BSSID register (MAC address, lower 32bits) @@ -1199,7 +1117,7 @@ * * Retry limit register for 5210 (no QCU/DCU so it's done in PCU) */ -#define AR5K_NODCU_RETRY_LMT 0x801c /* Register Address */ +#define AR5K_NODCU_RETRY_LMT 0x801c /*Register Address */ #define AR5K_NODCU_RETRY_LMT_SH_RETRY 0x0000000f /* Short retry limit mask */ #define AR5K_NODCU_RETRY_LMT_SH_RETRY_S 0 #define AR5K_NODCU_RETRY_LMT_LG_RETRY 0x000000f0 /* Long retry mask */ @@ -1218,9 +1136,9 @@ #define AR5K_USEC_5211 0x801c /* Register Address [5211+] */ #define AR5K_USEC (ah->ah_version == AR5K_AR5210 ? \ AR5K_USEC_5210 : AR5K_USEC_5211) -#define AR5K_USEC_1 0x0000007f /* clock cycles for 1us */ +#define AR5K_USEC_1 0x0000007f #define AR5K_USEC_1_S 0 -#define AR5K_USEC_32 0x00003f80 /* clock cycles for 1us while on 32Mhz clock */ +#define AR5K_USEC_32 0x00003f80 #define AR5K_USEC_32_S 7 #define AR5K_USEC_TX_LATENCY_5211 0x007fc000 #define AR5K_USEC_TX_LATENCY_5211_S 14 @@ -1234,16 +1152,16 @@ /* * PCU beacon control register */ -#define AR5K_BEACON_5210 0x8024 /*Register Address [5210] */ -#define AR5K_BEACON_5211 0x8020 /*Register Address [5211+] */ +#define AR5K_BEACON_5210 0x8024 +#define AR5K_BEACON_5211 0x8020 #define AR5K_BEACON (ah->ah_version == AR5K_AR5210 ? \ AR5K_BEACON_5210 : AR5K_BEACON_5211) -#define AR5K_BEACON_PERIOD 0x0000ffff /* Mask for beacon period */ +#define AR5K_BEACON_PERIOD 0x0000ffff #define AR5K_BEACON_PERIOD_S 0 -#define AR5K_BEACON_TIM 0x007f0000 /* Mask for TIM offset */ +#define AR5K_BEACON_TIM 0x007f0000 #define AR5K_BEACON_TIM_S 16 -#define AR5K_BEACON_ENABLE 0x00800000 /* Enable beacons */ -#define AR5K_BEACON_RESET_TSF 0x01000000 /* Force TSF reset */ +#define AR5K_BEACON_ENABLE 0x00800000 +#define AR5K_BEACON_RESET_TSF 0x01000000 /* * CFP period register @@ -1316,6 +1234,7 @@ /* * Receive filter register + * TODO: Get these out of ar5xxx.h on ath5k */ #define AR5K_RX_FILTER_5210 0x804c /* Register Address [5210] */ #define AR5K_RX_FILTER_5211 0x803c /* Register Address [5211+] */ @@ -1388,11 +1307,11 @@ #define AR5K_DIAG_SW_5211 0x8048 /* Register Address [5211+] */ #define AR5K_DIAG_SW (ah->ah_version == AR5K_AR5210 ? \ AR5K_DIAG_SW_5210 : AR5K_DIAG_SW_5211) -#define AR5K_DIAG_SW_DIS_WEP_ACK 0x00000001 /* Disable ACKs if WEP key is invalid */ -#define AR5K_DIAG_SW_DIS_ACK 0x00000002 /* Disable ACKs */ -#define AR5K_DIAG_SW_DIS_CTS 0x00000004 /* Disable CTSs */ -#define AR5K_DIAG_SW_DIS_ENC 0x00000008 /* Disable encryption */ -#define AR5K_DIAG_SW_DIS_DEC 0x00000010 /* Disable decryption */ +#define AR5K_DIAG_SW_DIS_WEP_ACK 0x00000001 +#define AR5K_DIAG_SW_DIS_ACK 0x00000002 /* Disable ACKs (?) */ +#define AR5K_DIAG_SW_DIS_CTS 0x00000004 /* Disable CTSs (?) */ +#define AR5K_DIAG_SW_DIS_ENC 0x00000008 /* Disable encryption (?) */ +#define AR5K_DIAG_SW_DIS_DEC 0x00000010 /* Disable decryption (?) */ #define AR5K_DIAG_SW_DIS_TX 0x00000020 /* Disable transmit [5210] */ #define AR5K_DIAG_SW_DIS_RX_5210 0x00000040 /* Disable recieve */ #define AR5K_DIAG_SW_DIS_RX_5211 0x00000020 @@ -1410,13 +1329,13 @@ #define AR5K_DIAG_SW_CHAN_INFO_5211 0x00000100 #define AR5K_DIAG_SW_CHAN_INFO (ah->ah_version == AR5K_AR5210 ? \ AR5K_DIAG_SW_CHAN_INFO_5210 : AR5K_DIAG_SW_CHAN_INFO_5211) -#define AR5K_DIAG_SW_EN_SCRAM_SEED_5211 0x00000200 /* Enable scrambler seed */ +#define AR5K_DIAG_SW_EN_SCRAM_SEED_5211 0x00000200 /* Scrambler seed (?) */ #define AR5K_DIAG_SW_EN_SCRAM_SEED_5210 0x00000400 #define AR5K_DIAG_SW_EN_SCRAM_SEED (ah->ah_version == AR5K_AR5210 ? \ AR5K_DIAG_SW_EN_SCRAM_SEED_5210 : AR5K_DIAG_SW_EN_SCRAM_SEED_5211) #define AR5K_DIAG_SW_ECO_ENABLE 0x00000400 /* [5211+] */ #define AR5K_DIAG_SW_SCVRAM_SEED 0x0003f800 /* [5210] */ -#define AR5K_DIAG_SW_SCRAM_SEED_M 0x0001fc00 /* Scrambler seed mask */ +#define AR5K_DIAG_SW_SCRAM_SEED_M 0x0001fc00 /* Scrambler seed mask (?) */ #define AR5K_DIAG_SW_SCRAM_SEED_S 10 #define AR5K_DIAG_SW_DIS_SEQ_INC 0x00040000 /* Disable seqnum increment (?)[5210] */ #define AR5K_DIAG_SW_FRAME_NV0_5210 0x00080000 @@ -1425,7 +1344,6 @@ AR5K_DIAG_SW_FRAME_NV0_5210 : AR5K_DIAG_SW_FRAME_NV0_5211) #define AR5K_DIAG_SW_OBSPT_M 0x000c0000 #define AR5K_DIAG_SW_OBSPT_S 18 -/* more bits */ /* * TSF (clock) register (lower 32 bits) @@ -1451,34 +1369,15 @@ /* * ADDAC test register [5211+] */ -#define AR5K_ADDAC_TEST 0x8054 /* Register Address */ -#define AR5K_ADDAC_TEST_TXCONT 0x00000001 /* Test continuous tx */ -#define AR5K_ADDAC_TEST_TST_MODE 0x00000002 /* Test mode */ -#define AR5K_ADDAC_TEST_LOOP_EN 0x00000004 /* Enable loop */ -#define AR5K_ADDAC_TEST_LOOP_LEN 0x00000008 /* Loop length (field) */ -#define AR5K_ADDAC_TEST_USE_U8 0x00004000 /* Use upper 8 bits */ -#define AR5K_ADDAC_TEST_MSB 0x00008000 /* State of MSB */ -#define AR5K_ADDAC_TEST_TRIG_SEL 0x00010000 /* Trigger select */ -#define AR5K_ADDAC_TEST_TRIG_PTY 0x00020000 /* Trigger polarity */ -#define AR5K_ADDAC_TEST_RXCONT 0x00040000 /* Continuous capture */ -#define AR5K_ADDAC_TEST_CAPTURE 0x00080000 /* Begin capture */ -#define AR5K_ADDAC_TEST_TST_ARM 0x00100000 /* Test ARM (Adaptive Radio Mode ?) */ +#define AR5K_ADDAC_TEST 0x8054 +#define AR5K_ADDAC_TEST_TXCONT 0x00000001 /* * Default antenna register [5211+] */ #define AR5K_DEFAULT_ANTENNA 0x8058 -/* - * Frame control QoS mask register (?) [5211+] - * (FC_QOS_MASK) - */ -#define AR5K_FRAME_CTL_QOSM 0x805c -/* - * Seq mask register (?) [5211+] - */ -#define AR5K_SEQ_MASK 0x8060 /* * Retry count register [5210] @@ -1550,242 +1449,124 @@ /* * XR (eXtended Range) mode register */ -#define AR5K_XRMODE 0x80c0 /* Register Address */ -#define AR5K_XRMODE_POLL_TYPE_M 0x0000003f /* Mask for Poll type (?) */ +#define AR5K_XRMODE 0x80c0 +#define AR5K_XRMODE_POLL_TYPE_M 0x0000003f #define AR5K_XRMODE_POLL_TYPE_S 0 -#define AR5K_XRMODE_POLL_SUBTYPE_M 0x0000003c /* Mask for Poll subtype (?) */ +#define AR5K_XRMODE_POLL_SUBTYPE_M 0x0000003c #define AR5K_XRMODE_POLL_SUBTYPE_S 2 -#define AR5K_XRMODE_POLL_WAIT_ALL 0x00000080 /* Wait for poll */ -#define AR5K_XRMODE_SIFS_DELAY 0x000fff00 /* Mask for SIFS delay */ -#define AR5K_XRMODE_FRAME_HOLD_M 0xfff00000 /* Mask for frame hold (?) */ +#define AR5K_XRMODE_POLL_WAIT_ALL 0x00000080 +#define AR5K_XRMODE_SIFS_DELAY 0x000fff00 +#define AR5K_XRMODE_FRAME_HOLD_M 0xfff00000 #define AR5K_XRMODE_FRAME_HOLD_S 20 /* * XR delay register */ -#define AR5K_XRDELAY 0x80c4 /* Register Address */ -#define AR5K_XRDELAY_SLOT_DELAY_M 0x0000ffff /* Mask for slot delay */ +#define AR5K_XRDELAY 0x80c4 +#define AR5K_XRDELAY_SLOT_DELAY_M 0x0000ffff #define AR5K_XRDELAY_SLOT_DELAY_S 0 -#define AR5K_XRDELAY_CHIRP_DELAY_M 0xffff0000 /* Mask for CHIRP data delay */ +#define AR5K_XRDELAY_CHIRP_DELAY_M 0xffff0000 #define AR5K_XRDELAY_CHIRP_DELAY_S 16 /* * XR timeout register */ -#define AR5K_XRTIMEOUT 0x80c8 /* Register Address */ -#define AR5K_XRTIMEOUT_CHIRP_M 0x0000ffff /* Mask for CHIRP timeout */ +#define AR5K_XRTIMEOUT 0x80c8 +#define AR5K_XRTIMEOUT_CHIRP_M 0x0000ffff #define AR5K_XRTIMEOUT_CHIRP_S 0 -#define AR5K_XRTIMEOUT_POLL_M 0xffff0000 /* Mask for Poll timeout */ +#define AR5K_XRTIMEOUT_POLL_M 0xffff0000 #define AR5K_XRTIMEOUT_POLL_S 16 /* * XR chirp register */ -#define AR5K_XRCHIRP 0x80cc /* Register Address */ -#define AR5K_XRCHIRP_SEND 0x00000001 /* Send CHIRP */ -#define AR5K_XRCHIRP_GAP 0xffff0000 /* Mask for CHIRP gap (?) */ +#define AR5K_XRCHIRP 0x80cc +#define AR5K_XRCHIRP_SEND 0x00000001 +#define AR5K_XRCHIRP_GAP 0xffff0000 /* * XR stomp register */ -#define AR5K_XRSTOMP 0x80d0 /* Register Address */ -#define AR5K_XRSTOMP_TX 0x00000001 /* Stomp Tx (?) */ -#define AR5K_XRSTOMP_RX 0x00000002 /* Stomp Rx (?) */ -#define AR5K_XRSTOMP_TX_RSSI 0x00000004 /* Stomp Tx RSSI (?) */ -#define AR5K_XRSTOMP_TX_BSSID 0x00000008 /* Stomp Tx BSSID (?) */ -#define AR5K_XRSTOMP_DATA 0x00000010 /* Stomp data (?)*/ -#define AR5K_XRSTOMP_RSSI_THRES 0x0000ff00 /* Mask for XR RSSI threshold */ +#define AR5K_XRSTOMP 0x80d0 +#define AR5K_XRSTOMP_TX 0x00000001 +#define AR5K_XRSTOMP_RX_ABORT 0x00000002 +#define AR5K_XRSTOMP_RSSI_THRES 0x0000ff00 /* * First enhanced sleep register */ -#define AR5K_SLEEP0 0x80d4 /* Register Address */ -#define AR5K_SLEEP0_NEXT_DTIM 0x0007ffff /* Mask for next DTIM (?) */ +#define AR5K_SLEEP0 0x80d4 +#define AR5K_SLEEP0_NEXT_DTIM 0x0007ffff #define AR5K_SLEEP0_NEXT_DTIM_S 0 -#define AR5K_SLEEP0_ASSUME_DTIM 0x00080000 /* Assume DTIM */ -#define AR5K_SLEEP0_ENH_SLEEP_EN 0x00100000 /* Enable enchanced sleep control */ -#define AR5K_SLEEP0_CABTO 0xff000000 /* Mask for CAB Time Out */ +#define AR5K_SLEEP0_ASSUME_DTIM 0x00080000 +#define AR5K_SLEEP0_ENH_SLEEP_EN 0x00100000 +#define AR5K_SLEEP0_CABTO 0xff000000 #define AR5K_SLEEP0_CABTO_S 24 /* * Second enhanced sleep register */ -#define AR5K_SLEEP1 0x80d8 /* Register Address */ -#define AR5K_SLEEP1_NEXT_TIM 0x0007ffff /* Mask for next TIM (?) */ +#define AR5K_SLEEP1 0x80d8 +#define AR5K_SLEEP1_NEXT_TIM 0x0007ffff #define AR5K_SLEEP1_NEXT_TIM_S 0 -#define AR5K_SLEEP1_BEACON_TO 0xff000000 /* Mask for Beacon Time Out */ +#define AR5K_SLEEP1_BEACON_TO 0xff000000 #define AR5K_SLEEP1_BEACON_TO_S 24 /* * Third enhanced sleep register */ -#define AR5K_SLEEP2 0x80dc /* Register Address */ -#define AR5K_SLEEP2_TIM_PER 0x0000ffff /* Mask for TIM period (?) */ +#define AR5K_SLEEP2 0x80dc +#define AR5K_SLEEP2_TIM_PER 0x0000ffff #define AR5K_SLEEP2_TIM_PER_S 0 -#define AR5K_SLEEP2_DTIM_PER 0xffff0000 /* Mask for DTIM period (?) */ +#define AR5K_SLEEP2_DTIM_PER 0xffff0000 #define AR5K_SLEEP2_DTIM_PER_S 16 /* * BSSID mask registers */ -#define AR5K_BSS_IDM0 0x80e0 /* Upper bits */ -#define AR5K_BSS_IDM1 0x80e4 /* Lower bits */ +#define AR5K_BSS_IDM0 0x80e0 +#define AR5K_BSS_IDM1 0x80e4 /* * TX power control (TPC) register - * - * XXX: PCDAC steps (0.5dbm) or DBM ? - * - * XXX: Mask changes for newer chips to 7f - * like tx power table ? */ -#define AR5K_TXPC 0x80e8 /* Register Address */ -#define AR5K_TXPC_ACK_M 0x0000003f /* Mask for ACK tx power */ +#define AR5K_TXPC 0x80e8 +#define AR5K_TXPC_ACK_M 0x0000003f #define AR5K_TXPC_ACK_S 0 -#define AR5K_TXPC_CTS_M 0x00003f00 /* Mask for CTS tx power */ +#define AR5K_TXPC_CTS_M 0x00003f00 #define AR5K_TXPC_CTS_S 8 -#define AR5K_TXPC_CHIRP_M 0x003f0000 /* Mask for CHIRP tx power */ +#define AR5K_TXPC_CHIRP_M 0x003f0000 #define AR5K_TXPC_CHIRP_S 22 /* * Profile count registers */ -#define AR5K_PROFCNT_TX 0x80ec /* Tx count */ -#define AR5K_PROFCNT_RX 0x80f0 /* Rx count */ -#define AR5K_PROFCNT_RXCLR 0x80f4 /* Clear Rx count */ -#define AR5K_PROFCNT_CYCLE 0x80f8 /* Cycle count (?) */ - -/* - * Quiet (period) control registers (?) - */ -#define AR5K_QUIET_CTL1 0x80fc /* Register Address */ -#define AR5K_QUIET_CTL1_NEXT_QT 0x0000ffff /* Mask for next quiet (period?) (?) */ -#define AR5K_QUIET_CTL1_QT_EN 0x00010000 /* Enable quiet (period?) */ -#define AR5K_QUIET_CTL2 0x8100 /* Register Address */ -#define AR5K_QUIET_CTL2_QT_PER 0x0000ffff /* Mask for quiet period (?) */ -#define AR5K_QUIET_CTL2_QT_DUR 0xffff0000 /* Mask for quiet duration (?) */ +#define AR5K_PROFCNT_TX 0x80ec +#define AR5K_PROFCNT_RX 0x80f0 +#define AR5K_PROFCNT_RXCLR 0x80f4 +#define AR5K_PROFCNT_CYCLE 0x80f8 /* * TSF parameter register */ -#define AR5K_TSF_PARM 0x8104 /* Register Address */ -#define AR5K_TSF_PARM_INC_M 0x000000ff /* Mask for TSF increment */ +#define AR5K_TSF_PARM 0x8104 +#define AR5K_TSF_PARM_INC_M 0x000000ff #define AR5K_TSF_PARM_INC_S 0 -/* - * QoS register (?) - */ -#define AR5K_QOS 0x8108 /* Register Address */ -#define AR5K_QOS_NOACK_2BIT_VALUES 0x00000000 /* (field) */ -#define AR5K_QOS_NOACK_BIT_OFFSET 0x00000020 /* (field) */ -#define AR5K_QOS_NOACK_BYTE_OFFSET 0x00000080 /* (field) */ - /* * PHY error filter register */ #define AR5K_PHY_ERR_FIL 0x810c -#define AR5K_PHY_ERR_FIL_RADAR 0x00000020 /* Radar signal */ -#define AR5K_PHY_ERR_FIL_OFDM 0x00020000 /* OFDM false detect (ANI) */ -#define AR5K_PHY_ERR_FIL_CCK 0x02000000 /* CCK false detect (ANI) */ - -/* - * XR latency register - */ -#define AR5K_XRLAT_TX 0x8110 +#define AR5K_PHY_ERR_FIL_RADAR 0x00000020 +#define AR5K_PHY_ERR_FIL_OFDM 0x00020000 +#define AR5K_PHY_ERR_FIL_CCK 0x02000000 /* - * ACK SIFS register - */ -#define AR5K_ACKSIFS 0x8114 /* Register Address */ -#define AR5K_ACKSIFS_INC 0x00000000 /* ACK SIFS Increment (field) */ - -/* - * MIC QoS control register (?) - */ -#define AR5K_MIC_QOS_CTL 0x8118 /* Register Address */ -#define AR5K_MIC_QOS_CTL_0 0x00000001 /* MIC QoS control 0 (?) */ -#define AR5K_MIC_QOS_CTL_1 0x00000004 /* MIC QoS control 1 (?) */ -#define AR5K_MIC_QOS_CTL_2 0x00000010 /* MIC QoS control 2 (?) */ -#define AR5K_MIC_QOS_CTL_3 0x00000040 /* MIC QoS control 3 (?) */ -#define AR5K_MIC_QOS_CTL_4 0x00000100 /* MIC QoS control 4 (?) */ -#define AR5K_MIC_QOS_CTL_5 0x00000400 /* MIC QoS control 5 (?) */ -#define AR5K_MIC_QOS_CTL_6 0x00001000 /* MIC QoS control 6 (?) */ -#define AR5K_MIC_QOS_CTL_7 0x00004000 /* MIC QoS control 7 (?) */ -#define AR5K_MIC_QOS_CTL_MQ_EN 0x00010000 /* Enable MIC QoS */ - -/* - * MIC QoS select register (?) - */ -#define AR5K_MIC_QOS_SEL 0x811c -#define AR5K_MIC_QOS_SEL_0 0x00000001 -#define AR5K_MIC_QOS_SEL_1 0x00000010 -#define AR5K_MIC_QOS_SEL_2 0x00000100 -#define AR5K_MIC_QOS_SEL_3 0x00001000 -#define AR5K_MIC_QOS_SEL_4 0x00010000 -#define AR5K_MIC_QOS_SEL_5 0x00100000 -#define AR5K_MIC_QOS_SEL_6 0x01000000 -#define AR5K_MIC_QOS_SEL_7 0x10000000 - -/* - * Misc mode control register (?) - */ -#define AR5K_MISC_MODE 0x8120 /* Register Address */ -#define AR5K_MISC_MODE_FBSSID_MATCH 0x00000001 /* Force BSSID match */ -#define AR5K_MISC_MODE_ACKSIFS_MEM 0x00000002 /* ACK SIFS memory (?) */ -/* more bits */ - -/* - * OFDM Filter counter - */ -#define AR5K_OFDM_FIL_CNT 0x8124 - -/* - * CCK Filter counter - */ -#define AR5K_CCK_FIL_CNT 0x8128 - -/* - * PHY Error Counters (?) - */ -#define AR5K_PHYERR_CNT1 0x812c -#define AR5K_PHYERR_CNT1_MASK 0x8130 - -#define AR5K_PHYERR_CNT2 0x8134 -#define AR5K_PHYERR_CNT2_MASK 0x8138 - -/* - * TSF Threshold register (?) - */ -#define AR5K_TSF_THRES 0x813c - -/* - * Rate -> ACK SIFS mapping table (32 entries) - */ -#define AR5K_RATE_ACKSIFS_BASE 0x8680 /* Register Address */ -#define AR5K_RATE_ACKSIFS(_n) (AR5K_RATE_ACKSIFS_BSE + ((_n) << 2)) -#define AR5K_RATE_ACKSIFS_NORMAL 0x00000001 /* Normal SIFS (field) */ -#define AR5K_RATE_ACKSIFS_TURBO 0x00000400 /* Turbo SIFS (field) */ - -/* - * Rate -> duration mapping table (32 entries) + * Rate duration register */ #define AR5K_RATE_DUR_BASE 0x8700 #define AR5K_RATE_DUR(_n) (AR5K_RATE_DUR_BASE + ((_n) << 2)) -/* - * Rate -> db mapping table - * (8 entries, each one has 4 8bit fields) - */ -#define AR5K_RATE2DB_BASE 0x87c0 -#define AR5K_RATE2DB(_n) (AR5K_RATE2DB_BASE + ((_n) << 2)) - -/* - * db -> Rate mapping table - * (8 entries, each one has 4 8bit fields) - */ -#define AR5K_DB2RATE_BASE 0x87e0 -#define AR5K_DB2RATE(_n) (AR5K_DB2RATE_BASE + ((_n) << 2)) - /*===5212 end===*/ /* @@ -1832,34 +1613,12 @@ /*===PHY REGISTERS===*/ /* - * PHY registers start + * PHY register */ #define AR5K_PHY_BASE 0x9800 #define AR5K_PHY(_n) (AR5K_PHY_BASE + ((_n) << 2)) - -/* - * TST_2 (Misc config parameters) - */ -#define AR5K_PHY_TST2 0x9800 /* Register Address */ -#define AR5K_PHY_TST2_TRIG_SEL 0x00000001 /* Trigger select (?) (field ?) */ -#define AR5K_PHY_TST2_TRIG 0x00000010 /* Trigger (?) (field ?) */ -#define AR5K_PHY_TST2_CBUS_MODE 0x00000100 /* Cardbus mode (?) */ -/* bit reserved */ -#define AR5K_PHY_TST2_CLK32 0x00000400 /* CLK_OUT is CLK32 (32Khz external) */ -#define AR5K_PHY_TST2_CHANCOR_DUMP_EN 0x00000800 /* Enable Chancor dump (?) */ -#define AR5K_PHY_TST2_EVEN_CHANCOR_DUMP 0x00001000 /* Even Chancor dump (?) */ -#define AR5K_PHY_TST2_RFSILENT_EN 0x00002000 /* Enable RFSILENT */ -#define AR5K_PHY_TST2_ALT_RFDATA 0x00004000 /* Alternate RFDATA (5-2GHz switch) */ -#define AR5K_PHY_TST2_MINI_OBS_EN 0x00008000 /* Enable mini OBS (?) */ -#define AR5K_PHY_TST2_RX2_IS_RX5_INV 0x00010000 /* 2GHz rx path is the 5GHz path inverted (?) */ -#define AR5K_PHY_TST2_SLOW_CLK160 0x00020000 /* Slow CLK160 (?) */ -#define AR5K_PHY_TST2_AGC_OBS_SEL_3 0x00040000 /* AGC OBS Select 3 (?) */ -#define AR5K_PHY_TST2_BBB_OBS_SEL 0x00080000 /* BB OBS Select (field ?) */ -#define AR5K_PHY_TST2_ADC_OBS_SEL 0x00800000 /* ADC OBS Select (field ?) */ -#define AR5K_PHY_TST2_RX_CLR_SEL 0x08000000 /* RX Clear Select (?) */ -#define AR5K_PHY_TST2_FORCE_AGC_CLR 0x10000000 /* Force AGC clear (?) */ -#define AR5K_PHY_SHIFT_2GHZ 0x00004007 /* Used to access 2GHz radios */ -#define AR5K_PHY_SHIFT_5GHZ 0x00000007 /* Used to access 5GHz radios (default) */ +#define AR5K_PHY_SHIFT_2GHZ 0x00004007 +#define AR5K_PHY_SHIFT_5GHZ 0x00000007 /* * PHY frame control register [5110] /turbo mode register [5111+] @@ -1871,21 +1630,18 @@ * a "turbo mode register" for 5110. We treat this one as * a frame control register for 5110 below. */ -#define AR5K_PHY_TURBO 0x9804 /* Register Address */ -#define AR5K_PHY_TURBO_MODE 0x00000001 /* Enable turbo mode */ -#define AR5K_PHY_TURBO_SHORT 0x00000002 /* Short mode (20Mhz channels) (?) */ +#define AR5K_PHY_TURBO 0x9804 +#define AR5K_PHY_TURBO_MODE 0x00000001 +#define AR5K_PHY_TURBO_SHORT 0x00000002 /* * PHY agility command register - * (aka TST_1) */ -#define AR5K_PHY_AGC 0x9808 /* Register Address */ -#define AR5K_PHY_TST1 0x9808 -#define AR5K_PHY_AGC_DISABLE 0x08000000 /* Disable AGC to A2 (?)*/ -#define AR5K_PHY_TST1_TXHOLD 0x00003800 /* Set tx hold (?) */ +#define AR5K_PHY_AGC 0x9808 +#define AR5K_PHY_AGC_DISABLE 0x08000000 /* - * PHY timing register 3 [5112+] + * PHY timing register [5112+] */ #define AR5K_PHY_TIMING_3 0x9814 #define AR5K_PHY_TIMING_3_DSC_MAN 0xfffe0000 @@ -1901,81 +1657,26 @@ /* * PHY activation register */ -#define AR5K_PHY_ACT 0x981c /* Register Address */ -#define AR5K_PHY_ACT_ENABLE 0x00000001 /* Activate PHY */ -#define AR5K_PHY_ACT_DISABLE 0x00000002 /* Deactivate PHY */ - -/* - * PHY RF control registers - * (i think these are delay times, - * these calibration values exist - * in EEPROM) - */ -#define AR5K_PHY_RF_CTL2 0x9824 /* Register Address */ -#define AR5K_PHY_RF_CTL2_TXF2TXD_START 0x0000000f /* Mask for TX frame to TX d(esc?) start */ - -#define AR5K_PHY_RF_CTL3 0x9828 /* Register Address */ -#define AR5K_PHY_RF_CTL3_TXE2XLNA_ON 0x0000000f /* Mask for TX end to XLNA on */ - -#define AR5K_PHY_RF_CTL4 0x9834 /* Register Address */ -#define AR5K_PHY_RF_CTL4_TXF2XPA_A_ON 0x00000001 /* TX frame to XPA A on (field) */ -#define AR5K_PHY_RF_CTL4_TXF2XPA_B_ON 0x00000100 /* TX frame to XPA B on (field) */ -#define AR5K_PHY_RF_CTL4_TXE2XPA_A_OFF 0x00010000 /* TX end to XPA A off (field) */ -#define AR5K_PHY_RF_CTL4_TXE2XPA_B_OFF 0x01000000 /* TX end to XPA B off (field) */ - -/* - * Pre-Amplifier control register - * (XPA -> external pre-amplifier) - */ -#define AR5K_PHY_PA_CTL 0x9838 /* Register Address */ -#define AR5K_PHY_PA_CTL_XPA_A_HI 0x00000001 /* XPA A high (?) */ -#define AR5K_PHY_PA_CTL_XPA_B_HI 0x00000002 /* XPA B high (?) */ -#define AR5K_PHY_PA_CTL_XPA_A_EN 0x00000004 /* Enable XPA A */ -#define AR5K_PHY_PA_CTL_XPA_B_EN 0x00000008 /* Enable XPA B */ - -/* - * PHY settling register - */ -#define AR5K_PHY_SETTLING 0x9844 /* Register Address */ -#define AR5K_PHY_SETTLING_AGC 0x0000007f /* Mask for AGC settling time */ -#define AR5K_PHY_SETTLING_SWITCH 0x00003f80 /* Mask for Switch settlig time */ - -/* - * PHY Gain registers - */ -#define AR5K_PHY_GAIN 0x9848 /* Register Address */ -#define AR5K_PHY_GAIN_TXRX_ATTEN 0x0003f000 /* Mask for TX-RX Attenuation */ - -#define AR5K_PHY_GAIN_OFFSET 0x984c /* Register Address */ -#define AR5K_PHY_GAIN_OFFSET_RXTX_FLAG 0x00020000 /* RX-TX flag (?) */ - -/* - * Desired size register - * (for more infos read ANI patent) - */ -#define AR5K_PHY_DESIRED_SIZE 0x9850 /* Register Address */ -#define AR5K_PHY_DESIRED_SIZE_ADC 0x000000ff /* Mask for ADC desired size */ -#define AR5K_PHY_DESIRED_SIZE_PGA 0x0000ff00 /* Mask for PGA desired size */ -#define AR5K_PHY_DESIRED_SIZE_TOT 0x0ff00000 /* Mask for Total desired size (?) */ +#define AR5K_PHY_ACT 0x981c +#define AR5K_PHY_ACT_ENABLE 0x00000001 +#define AR5K_PHY_ACT_DISABLE 0x00000002 /* * PHY signal register - * (for more infos read ANI patent) */ -#define AR5K_PHY_SIG 0x9858 /* Register Address */ -#define AR5K_PHY_SIG_FIRSTEP 0x0003f000 /* Mask for FIRSTEP */ +#define AR5K_PHY_SIG 0x9858 +#define AR5K_PHY_SIG_FIRSTEP 0x0003f000 #define AR5K_PHY_SIG_FIRSTEP_S 12 -#define AR5K_PHY_SIG_FIRPWR 0x03fc0000 /* Mask for FIPWR */ +#define AR5K_PHY_SIG_FIRPWR 0x03fc0000 #define AR5K_PHY_SIG_FIRPWR_S 18 /* * PHY coarse agility control register - * (for more infos read ANI patent) */ -#define AR5K_PHY_AGCCOARSE 0x985c /* Register Address */ -#define AR5K_PHY_AGCCOARSE_LO 0x00007f80 /* Mask for AGC Coarse low */ +#define AR5K_PHY_AGCCOARSE 0x985c +#define AR5K_PHY_AGCCOARSE_LO 0x00007f80 #define AR5K_PHY_AGCCOARSE_LO_S 7 -#define AR5K_PHY_AGCCOARSE_HI 0x003f8000 /* Mask for AGC Coarse high */ +#define AR5K_PHY_AGCCOARSE_HI 0x003f8000 #define AR5K_PHY_AGCCOARSE_HI_S 15 /* @@ -1988,13 +1689,12 @@ /* * PHY noise floor status register */ -#define AR5K_PHY_NF 0x9864 /* Register address */ -#define AR5K_PHY_NF_M 0x000001ff /* Noise floor mask */ -#define AR5K_PHY_NF_ACTIVE 0x00000100 /* Noise floor calibration still active */ +#define AR5K_PHY_NF 0x9864 +#define AR5K_PHY_NF_M 0x000001ff +#define AR5K_PHY_NF_ACTIVE 0x00000100 #define AR5K_PHY_NF_RVAL(_n) (((_n) >> 19) & AR5K_PHY_NF_M) #define AR5K_PHY_NF_AVAL(_n) (-((_n) ^ AR5K_PHY_NF_M) + 1) #define AR5K_PHY_NF_SVAL(_n) (((_n) & AR5K_PHY_NF_M) | (1 << 9)) -#define AR5K_PHY_NF_THRESH62 0x00001000 /* Thresh62 -check ANI patent- (field) */ /* * PHY ADC saturation register [5110] @@ -2005,30 +1705,6 @@ #define AR5K_PHY_ADCSAT_THR 0x000007e0 #define AR5K_PHY_ADCSAT_THR_S 5 -/* - * PHY Weak ofdm signal detection threshold registers (ANI) [5212+] - */ - -/* High thresholds */ -#define AR5K_PHY_WEAK_OFDM_HIGH_THR 0x9868 -#define AR5K_PHY_WEAK_OFDM_HIGH_THR_M2_COUNT 0x0000001f -#define AR5K_PHY_WEAK_OFDM_HIGH_THR_M2_COUNT_S 0 -#define AR5K_PHY_WEAK_OFDM_HIGH_THR_M1 0x00fe0000 -#define AR5K_PHY_WEAK_OFDM_HIGH_THR_M1_S 17 -#define AR5K_PHY_WEAK_OFDM_HIGH_THR_M2 0x7f000000 -#define AR5K_PHY_WEAK_OFDM_HIGH_THR_M2_S 24 - -/* Low thresholds */ -#define AR5K_PHY_WEAK_OFDM_LOW_THR 0x986c -#define AR5K_PHY_WEAK_OFDM_LOW_THR_SELFCOR_EN 0x00000001 -#define AR5K_PHY_WEAK_OFDM_LOW_THR_M2_COUNT 0x00003f00 -#define AR5K_PHY_WEAK_OFDM_LOW_THR_M2_COUNT_S 8 -#define AR5K_PHY_WEAK_OFDM_LOW_THR_M1 0x001fc000 -#define AR5K_PHY_WEAK_OFDM_LOW_THR_M1_S 14 -#define AR5K_PHY_WEAK_OFDM_LOW_THR_M2 0x0fe00000 -#define AR5K_PHY_WEAK_OFDM_LOW_THR_M2_S 21 - - /* * PHY sleep registers [5112+] */ @@ -2054,8 +1730,6 @@ AR5K_PHY_PLL_44MHZ_5211 : AR5K_PHY_PLL_44MHZ_5212) #define AR5K_PHY_PLL_RF5111 0x00000000 #define AR5K_PHY_PLL_RF5112 0x00000040 -#define AR5K_PHY_PLL_HALF_RATE 0x00000100 -#define AR5K_PHY_PLL_QUARTER_RATE 0x00000200 /* * RF Buffer register @@ -2117,75 +1791,24 @@ #define AR5K_PHY_RFSTG 0x98d4 #define AR5K_PHY_RFSTG_DISABLE 0x00000021 -/* - * PHY Antenna control register - */ -#define AR5K_PHY_ANT_CTL 0x9910 /* Register Address */ -#define AR5K_PHY_ANT_CTL_TXRX_EN 0x00000001 /* Enable TX/RX (?) */ -#define AR5K_PHY_ANT_CTL_SECTORED_ANT 0x00000004 /* Sectored Antenna */ -#define AR5K_PHY_ANT_CTL_HITUNE5 0x00000008 /* Hitune5 (?) */ -#define AR5K_PHY_ANT_CTL_SWTABLE_IDLE 0x00000010 /* Switch table idle (?) */ - /* * PHY receiver delay register [5111+] */ -#define AR5K_PHY_RX_DELAY 0x9914 /* Register Address */ -#define AR5K_PHY_RX_DELAY_M 0x00003fff /* Mask for RX activate to receive delay (/100ns) */ - -/* - * PHY max rx length register (?) [5111] - */ -#define AR5K_PHY_MAX_RX_LEN 0x991c +#define AR5K_PHY_RX_DELAY 0x9914 +#define AR5K_PHY_RX_DELAY_M 0x00003fff /* - * PHY timing register 4 - * I(nphase)/Q(adrature) calibration register [5111+] + * PHY timing I(nphase) Q(adrature) control register [5111+] */ -#define AR5K_PHY_IQ 0x9920 /* Register Address */ +#define AR5K_PHY_IQ 0x9920 /* Register address */ #define AR5K_PHY_IQ_CORR_Q_Q_COFF 0x0000001f /* Mask for q correction info */ #define AR5K_PHY_IQ_CORR_Q_I_COFF 0x000007e0 /* Mask for i correction info */ #define AR5K_PHY_IQ_CORR_Q_I_COFF_S 5 #define AR5K_PHY_IQ_CORR_ENABLE 0x00000800 /* Enable i/q correction */ -#define AR5K_PHY_IQ_CAL_NUM_LOG_MAX 0x0000f000 /* Mask for max number of samples in log scale */ +#define AR5K_PHY_IQ_CAL_NUM_LOG_MAX 0x0000f000 #define AR5K_PHY_IQ_CAL_NUM_LOG_MAX_S 12 #define AR5K_PHY_IQ_RUN 0x00010000 /* Run i/q calibration */ -#define AR5K_PHY_IQ_USE_PT_DF 0x00020000 /* Use pilot track df (?) */ -#define AR5K_PHY_IQ_EARLY_TRIG_THR 0x00200000 /* Early trigger threshold (?) (field) */ -#define AR5K_PHY_IQ_PILOT_MASK_EN 0x10000000 /* Enable pilot mask (?) */ -#define AR5K_PHY_IQ_CHAN_MASK_EN 0x20000000 /* Enable channel mask (?) */ -#define AR5K_PHY_IQ_SPUR_FILT_EN 0x40000000 /* Enable spur filter */ -#define AR5K_PHY_IQ_SPUR_RSSI_EN 0x80000000 /* Enable spur rssi */ -/* - * PHY timing register 5 - * OFDM Self-correlator Cyclic RSSI threshold params - * (Check out bb_cycpwr_thr1 on ANI patent) - */ -#define AR5K_PHY_OFDM_SELFCORR 0x9924 /* Register Address */ -#define AR5K_PHY_OFDM_SELFCORR_CYPWR_THR1_EN 0x00000001 /* Enable cyclic RSSI thr 1 */ -#define AR5K_PHY_OFDM_SELFCORR_CYPWR_THR1 0x000000fe /* Mask for Cyclic RSSI threshold 1 */ -#define AR5K_PHY_OFDM_SELFCORR_CYPWR_THR3 0x00000100 /* Cyclic RSSI threshold 3 (field) (?) */ -#define AR5K_PHY_OFDM_SELFCORR_RSSI_1ATHR_EN 0x00008000 /* Enable 1A RSSI threshold (?) */ -#define AR5K_PHY_OFDM_SELFCORR_RSSI_1ATHR 0x00010000 /* 1A RSSI threshold (field) (?) */ -#define AR5K_PHY_OFDM_SELFCORR_LSCTHR_HIRSSI 0x00800000 /* Long sc threshold hi rssi (?) */ - -/* - * PHY-only warm reset register - */ -#define AR5K_PHY_WARM_RESET 0x9928 - -/* - * PHY-only control register - */ -#define AR5K_PHY_CTL 0x992c /* Register Address */ -#define AR5K_PHY_CTL_RX_DRAIN_RATE 0x00000001 /* RX drain rate (?) */ -#define AR5K_PHY_CTL_LATE_TX_SIG_SYM 0x00000002 /* Late tx signal symbol (?) */ -#define AR5K_PHY_CTL_GEN_SCRAMBLER 0x00000004 /* Generate scrambler */ -#define AR5K_PHY_CTL_TX_ANT_SEL 0x00000008 /* TX antenna select */ -#define AR5K_PHY_CTL_TX_ANT_STATIC 0x00000010 /* Static TX antenna */ -#define AR5K_PHY_CTL_RX_ANT_SEL 0x00000020 /* RX antenna select */ -#define AR5K_PHY_CTL_RX_ANT_STATIC 0x00000040 /* Static RX antenna */ -#define AR5K_PHY_CTL_LOW_FREQ_SLE_EN 0x00000080 /* Enable low freq sleep */ /* * PHY PAPD probe register [5111+ (?)] @@ -2193,13 +1816,9 @@ * Because it's always 0 in 5211 initialization code */ #define AR5K_PHY_PAPD_PROBE 0x9930 -#define AR5K_PHY_PAPD_PROBE_SH_HI_PAR 0x00000001 -#define AR5K_PHY_PAPD_PROBE_PCDAC_BIAS 0x00000002 -#define AR5K_PHY_PAPD_PROBE_COMP_GAIN 0x00000040 #define AR5K_PHY_PAPD_PROBE_TXPOWER 0x00007e00 #define AR5K_PHY_PAPD_PROBE_TXPOWER_S 9 #define AR5K_PHY_PAPD_PROBE_TX_NEXT 0x00008000 -#define AR5K_PHY_PAPD_PROBE_PREDIST_EN 0x00010000 #define AR5K_PHY_PAPD_PROBE_TYPE 0x01800000 /* [5112+] */ #define AR5K_PHY_PAPD_PROBE_TYPE_S 23 #define AR5K_PHY_PAPD_PROBE_TYPE_OFDM 0 @@ -2229,16 +1848,15 @@ #define AR5K_PHY_FRAME_CTL (ah->ah_version == AR5K_AR5210 ? \ AR5K_PHY_FRAME_CTL_5210 : AR5K_PHY_FRAME_CTL_5211) /*---[5111+]---*/ -#define AR5K_PHY_FRAME_CTL_TX_CLIP 0x00000038 /* Mask for tx clip (?) */ +#define AR5K_PHY_FRAME_CTL_TX_CLIP 0x00000038 #define AR5K_PHY_FRAME_CTL_TX_CLIP_S 3 -#define AR5K_PHY_FRAME_CTL_PREP_CHINFO 0x00010000 /* Prepend chan info */ /*---[5110/5111]---*/ -#define AR5K_PHY_FRAME_CTL_TIMING_ERR 0x01000000 /* PHY timing error */ -#define AR5K_PHY_FRAME_CTL_PARITY_ERR 0x02000000 /* Parity error */ -#define AR5K_PHY_FRAME_CTL_ILLRATE_ERR 0x04000000 /* Illegal rate */ -#define AR5K_PHY_FRAME_CTL_ILLLEN_ERR 0x08000000 /* Illegal length */ +#define AR5K_PHY_FRAME_CTL_TIMING_ERR 0x01000000 +#define AR5K_PHY_FRAME_CTL_PARITY_ERR 0x02000000 +#define AR5K_PHY_FRAME_CTL_ILLRATE_ERR 0x04000000 /* illegal rate */ +#define AR5K_PHY_FRAME_CTL_ILLLEN_ERR 0x08000000 /* illegal length */ #define AR5K_PHY_FRAME_CTL_SERVICE_ERR 0x20000000 -#define AR5K_PHY_FRAME_CTL_TXURN_ERR 0x40000000 /* TX underrun */ +#define AR5K_PHY_FRAME_CTL_TXURN_ERR 0x40000000 /* tx underrun */ #define AR5K_PHY_FRAME_CTL_INI AR5K_PHY_FRAME_CTL_SERVICE_ERR | \ AR5K_PHY_FRAME_CTL_TXURN_ERR | \ AR5K_PHY_FRAME_CTL_ILLLEN_ERR | \ @@ -2296,11 +1914,6 @@ after DFS is enabled */ #define AR5K_PHY_ANT_SWITCH_TABLE_0 0x9960 #define AR5K_PHY_ANT_SWITCH_TABLE_1 0x9964 -/* - * PHY Noise floor threshold - */ -#define AR5K_PHY_NFTHRES 0x9968 - /* * PHY clock sleep registers [5112+] */ @@ -2309,116 +1922,56 @@ after DFS is enabled */ #define AR5K_PHY_SDELAY 0x99f4 #define AR5K_PHY_SDELAY_32MHZ 0x000000ff #define AR5K_PHY_SPENDING 0x99f8 -#define AR5K_PHY_SPENDING_14 0x00000014 -#define AR5K_PHY_SPENDING_18 0x00000018 #define AR5K_PHY_SPENDING_RF5111 0x00000018 -#define AR5K_PHY_SPENDING_RF5112 0x00000014 -/* #define AR5K_PHY_SPENDING_RF5112A 0x0000000e */ -/* #define AR5K_PHY_SPENDING_RF5424 0x00000012 */ -#define AR5K_PHY_SPENDING_RF5413 0x00000014 -#define AR5K_PHY_SPENDING_RF2413 0x00000014 -#define AR5K_PHY_SPENDING_RF2425 0x00000018 +#define AR5K_PHY_SPENDING_RF5112 0x00000014 /* <- i 've only seen this on 2425 dumps ! */ +#define AR5K_PHY_SPENDING_RF5112A 0x0000000e /* but since i only have 5112A-based chips */ +#define AR5K_PHY_SPENDING_RF5424 0x00000012 /* to test it might be also for old 5112. */ /* * Misc PHY/radio registers [5110 - 5111] */ -#define AR5K_BB_GAIN_BASE 0x9b00 /* BaseBand Amplifier Gain table base address */ +#define AR5K_BB_GAIN_BASE 0x9b00 /* BaseBand Amplifier Gain table base address */ #define AR5K_BB_GAIN(_n) (AR5K_BB_GAIN_BASE + ((_n) << 2)) -#define AR5K_RF_GAIN_BASE 0x9a00 /* RF Amplrifier Gain table base address */ +#define AR5K_RF_GAIN_BASE 0x9a00 /* RF Amplrifier Gain table base address */ #define AR5K_RF_GAIN(_n) (AR5K_RF_GAIN_BASE + ((_n) << 2)) /* * PHY timing IQ calibration result register [5111+] */ -#define AR5K_PHY_IQRES_CAL_PWR_I 0x9c10 /* I (Inphase) power value */ -#define AR5K_PHY_IQRES_CAL_PWR_Q 0x9c14 /* Q (Quadrature) power value */ +#define AR5K_PHY_IQRES_CAL_PWR_I 0x9c10 /* I (Inphase) power value */ +#define AR5K_PHY_IQRES_CAL_PWR_Q 0x9c14 /* Q (Quadrature) power value */ #define AR5K_PHY_IQRES_CAL_CORR 0x9c18 /* I/Q Correlation */ /* * PHY current RSSI register [5111+] */ -#define AR5K_PHY_CURRENT_RSSI 0x9c1c - -/* - * PHY RF Bus grant register (?) - */ -#define AR5K_PHY_RFBUS_GRANT 0x9c20 - -/* - * PHY ADC test register - */ -#define AR5K_PHY_ADC_TEST 0x9c24 -#define AR5K_PHY_ADC_TEST_I 0x00000001 -#define AR5K_PHY_ADC_TEST_Q 0x00000200 - -/* - * PHY DAC test register - */ -#define AR5K_PHY_DAC_TEST 0x9c28 -#define AR5K_PHY_DAC_TEST_I 0x00000001 -#define AR5K_PHY_DAC_TEST_Q 0x00000200 - -/* - * PHY PTAT register (?) - */ -#define AR5K_PHY_PTAT 0x9c2c - -/* - * PHY Illegal TX rate register [5112+] - */ -#define AR5K_PHY_BAD_TX_RATE 0x9c30 - -/* - * PHY SPUR Power register [5112+] - */ -#define AR5K_PHY_SPUR_PWR 0x9c34 /* Register Address */ -#define AR5K_PHY_SPUR_PWR_I 0x00000001 /* SPUR Power estimate for I (field) */ -#define AR5K_PHY_SPUR_PWR_Q 0x00000100 /* SPUR Power estimate for Q (field) */ -#define AR5K_PHY_SPUR_PWR_FILT 0x00010000 /* Power with SPUR removed (field) */ - -/* - * PHY Channel status register [5112+] (?) - */ -#define AR5K_PHY_CHAN_STATUS 0x9c38 -#define AR5K_PHY_CHAN_STATUS_BT_ACT 0x00000001 -#define AR5K_PHY_CHAN_STATUS_RX_CLR_RAW 0x00000002 -#define AR5K_PHY_CHAN_STATUS_RX_CLR_MAC 0x00000004 -#define AR5K_PHY_CHAN_STATUS_RX_CLR_PAP 0x00000008 - -/* - * PHY PAPD I (power?) table (?) - * (92! entries) - */ -#define AR5K_PHY_PAPD_I_BASE 0xa000 -#define AR5K_PHY_PAPD_I(_n) (AR5K_PHY_PAPD_I_BASE + ((_n) << 2)) +#define AR5K_PHY_CURRENT_RSSI 0x9c1c /* * PHY PCDAC TX power table */ #define AR5K_PHY_PCDAC_TXPOWER_BASE_5211 0xa180 -#define AR5K_PHY_PCDAC_TXPOWER_BASE_2413 0xa280 -#define AR5K_PHY_PCDAC_TXPOWER_BASE (ah->ah_radio >= AR5K_RF2413 ? \ - AR5K_PHY_PCDAC_TXPOWER_BASE_2413 :\ +#define AR5K_PHY_PCDAC_TXPOWER_BASE_5413 0xa280 +#define AR5K_PHY_PCDAC_TXPOWER_BASE (ah->ah_radio >= AR5K_RF5413 ? \ + AR5K_PHY_PCDAC_TXPOWER_BASE_5413 :\ AR5K_PHY_PCDAC_TXPOWER_BASE_5211) #define AR5K_PHY_PCDAC_TXPOWER(_n) (AR5K_PHY_PCDAC_TXPOWER_BASE + ((_n) << 2)) /* * PHY mode register [5111+] */ -#define AR5K_PHY_MODE 0x0a200 /* Register Address */ -#define AR5K_PHY_MODE_MOD 0x00000001 /* PHY Modulation bit */ +#define AR5K_PHY_MODE 0x0a200 /* Register address */ +#define AR5K_PHY_MODE_MOD 0x00000001 /* PHY Modulation mask*/ #define AR5K_PHY_MODE_MOD_OFDM 0 #define AR5K_PHY_MODE_MOD_CCK 1 -#define AR5K_PHY_MODE_FREQ 0x00000002 /* Freq mode bit */ +#define AR5K_PHY_MODE_FREQ 0x00000002 /* Freq mode mask */ #define AR5K_PHY_MODE_FREQ_5GHZ 0 #define AR5K_PHY_MODE_FREQ_2GHZ 2 -#define AR5K_PHY_MODE_MOD_DYN 0x00000004 /* Enable Dynamic OFDM/CCK mode [5112+] */ +#define AR5K_PHY_MODE_MOD_DYN 0x00000004 /* Dynamic OFDM/CCK mode mask [5112+] */ #define AR5K_PHY_MODE_RAD 0x00000008 /* [5212+] */ #define AR5K_PHY_MODE_RAD_RF5111 0 #define AR5K_PHY_MODE_RAD_RF5112 8 -#define AR5K_PHY_MODE_XR 0x00000010 /* Enable XR mode [5112+] */ -#define AR5K_PHY_MODE_HALF_RATE 0x00000020 /* Enable Half rate (test) */ -#define AR5K_PHY_MODE_QUARTER_RATE 0x00000040 /* Enable Quarter rat (test) */ +#define AR5K_PHY_MODE_XR 0x00000010 /* [5112+] */ /* * PHY CCK transmit control register [5111+ (?)] @@ -2426,15 +1979,6 @@ after DFS is enabled */ #define AR5K_PHY_CCKTXCTL 0xa204 #define AR5K_PHY_CCKTXCTL_WORLD 0x00000000 #define AR5K_PHY_CCKTXCTL_JAPAN 0x00000010 -#define AR5K_PHY_CCKTXCTL_SCRAMBLER_DIS 0x00000001 -#define AR5K_PHY_CCKTXCTK_DAC_SCALE 0x00000004 - -/* - * PHY CCK Cross-correlator Barker RSSI threshold register [5212+] - */ -#define AR5K_PHY_CCK_CROSSCORR 0xa208 -#define AR5K_PHY_CCK_CROSSCORR_WEAK_SIG_THR 0x0000000f -#define AR5K_PHY_CCK_CROSSCORR_WEAK_SIG_THR_S 0 /* * PHY 2GHz gain register [5111+] diff --git a/trunk/drivers/net/wireless/ipw2200.c b/trunk/drivers/net/wireless/ipw2200.c index 36e8d2f6e7b4..846a7d051851 100644 --- a/trunk/drivers/net/wireless/ipw2200.c +++ b/trunk/drivers/net/wireless/ipw2200.c @@ -305,10 +305,9 @@ static inline void ipw_write_reg32(struct ipw_priv *a, u32 b, u32 c) #define _ipw_write8(ipw, ofs, val) writeb((val), (ipw)->hw_base + (ofs)) /* 8-bit direct write (for low 4K of SRAM/regs), with debug wrapper */ -#define ipw_write8(ipw, ofs, val) do { \ +#define ipw_write8(ipw, ofs, val) \ IPW_DEBUG_IO("%s %d: write_direct8(0x%08X, 0x%08X)\n", __FILE__, __LINE__, (u32)(ofs), (u32)(val)); \ - _ipw_write8(ipw, ofs, val); \ - } while (0) + _ipw_write8(ipw, ofs, val) /* 16-bit direct write (low 4K) */ #define _ipw_write16(ipw, ofs, val) writew((val), (ipw)->hw_base + (ofs)) diff --git a/trunk/drivers/net/wireless/iwlwifi/Kconfig b/trunk/drivers/net/wireless/iwlwifi/Kconfig index b0ac0ce3fb9f..82b66a3d3a5d 100644 --- a/trunk/drivers/net/wireless/iwlwifi/Kconfig +++ b/trunk/drivers/net/wireless/iwlwifi/Kconfig @@ -14,49 +14,18 @@ config IWLWIFI_LEDS default n config IWLWIFI_RFKILL - boolean "Iwlwifi RF kill support" + boolean "IWLWIFI RF kill support" depends on IWLCORE -config IWLWIFI_DEBUG - bool "Enable full debugging output in iwlagn driver" - depends on IWLCORE - ---help--- - This option will enable debug tracing output for the iwlwifi drivers - - This will result in the kernel module being ~100k larger. You can - control which debug output is sent to the kernel log by setting the - value in - - /sys/class/net/wlan0/device/debug_level - - This entry will only exist if this option is enabled. - - To set a value, simply echo an 8-byte hex value to the same file: - - % echo 0x43fff > /sys/class/net/wlan0/device/debug_level - - You can find the list of debug mask values in: - drivers/net/wireless/iwlwifi/iwl-debug.h - - If this is your first time using this driver, you should say Y here - as the debug information can assist others in helping you resolve - any problems you may encounter. - -config IWLWIFI_DEBUGFS - bool "Iwlwifi debugfs support" - depends on IWLCORE && IWLWIFI_DEBUG && MAC80211_DEBUGFS - ---help--- - Enable creation of debugfs files for the iwlwifi drivers. - -config IWLAGN - tristate "Intel Wireless WiFi Next Gen AGN" +config IWL4965 + tristate "Intel Wireless WiFi 4965AGN" depends on PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL select FW_LOADER select IWLCORE ---help--- Select to build the driver supporting the: - Intel Wireless WiFi Link Next-Gen AGN + Intel Wireless WiFi Link 4965AGN This driver uses the kernel's mac80211 subsystem. @@ -73,33 +42,60 @@ config IWLAGN If you want to compile the driver as a module ( = code which can be inserted in and removed from the running kernel whenever you want), say M here and read . The - module will be called iwlagn.ko. - -config IWLAGN_SPECTRUM_MEASUREMENT - bool "Enable Spectrum Measurement in iwlagn driver" - depends on IWLAGN - ---help--- - This option will enable spectrum measurement for the iwlagn driver. + module will be called iwl4965.ko. -config IWLAGN_LEDS - bool "Enable LEDS features in iwlagn driver" - depends on IWLAGN +config IWL4965_LEDS + bool "Enable LEDS features in iwl4965 driver" + depends on IWL4965 select IWLWIFI_LEDS ---help--- - This option enables LEDS for the iwlagn drivers + This option enables LEDS for the iwlwifi drivers -config IWL4965 - bool "Intel Wireless WiFi 4965AGN" - depends on IWLAGN +config IWL4965_SPECTRUM_MEASUREMENT + bool "Enable Spectrum Measurement in iwl4965 driver" + depends on IWL4965 + ---help--- + This option will enable spectrum measurement for the iwl4965 driver. + +config IWLWIFI_DEBUG + bool "Enable full debugging output in iwl4965 driver" + depends on IWL4965 ---help--- - This option enables support for Intel Wireless WiFi Link 4965AGN + This option will enable debug tracing output for the iwl4965 + driver. + + This will result in the kernel module being ~100k larger. You can + control which debug output is sent to the kernel log by setting the + value in + + /sys/class/net/wlan0/device/debug_level + + This entry will only exist if this option is enabled. + + To set a value, simply echo an 8-byte hex value to the same file: + + % echo 0x43fff > /sys/class/net/wlan0/device/debug_level + + You can find the list of debug mask values in: + drivers/net/wireless/iwlwifi/iwl-4965-debug.h + + If this is your first time using this driver, you should say Y here + as the debug information can assist others in helping you resolve + any problems you may encounter. config IWL5000 bool "Intel Wireless WiFi 5000AGN" - depends on IWLAGN + depends on IWL4965 ---help--- This option enables support for Intel Wireless WiFi Link 5000AGN Family + Dependency on 4965 is temporary + +config IWLWIFI_DEBUGFS + bool "Iwlwifi debugfs support" + depends on IWLCORE && IWLWIFI_DEBUG && MAC80211_DEBUGFS + ---help--- + Enable creation of debugfs files for the iwlwifi drivers. config IWL3945 tristate "Intel PRO/Wireless 3945ABG/BG Network Connection" diff --git a/trunk/drivers/net/wireless/iwlwifi/Makefile b/trunk/drivers/net/wireless/iwlwifi/Makefile index 47aa28f6a513..1f52b92f08b5 100644 --- a/trunk/drivers/net/wireless/iwlwifi/Makefile +++ b/trunk/drivers/net/wireless/iwlwifi/Makefile @@ -6,14 +6,15 @@ iwlcore-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o iwlcore-$(CONFIG_IWLWIFI_LEDS) += iwl-led.o iwlcore-$(CONFIG_IWLWIFI_RFKILL) += iwl-rfkill.o -obj-$(CONFIG_IWLAGN) += iwlagn.o -iwlagn-objs := iwl-agn.o iwl-agn-rs.o - -iwlagn-$(CONFIG_IWL4965) += iwl-4965.o -iwlagn-$(CONFIG_IWL5000) += iwl-5000.o - obj-$(CONFIG_IWL3945) += iwl3945.o iwl3945-objs := iwl3945-base.o iwl-3945.o iwl-3945-rs.o iwl3945-$(CONFIG_IWL3945_LEDS) += iwl-3945-led.o +obj-$(CONFIG_IWL4965) += iwl4965.o +iwl4965-objs := iwl4965-base.o iwl-4965.o iwl-4965-rs.o + +ifeq ($(CONFIG_IWL5000),y) + iwl4965-objs += iwl-5000.o +endif + diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-3945-led.c b/trunk/drivers/net/wireless/iwlwifi/iwl-3945-led.c index d3336966b6b5..6be1fe13fa57 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-3945-led.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-3945-led.c @@ -206,12 +206,12 @@ static void iwl3945_led_brightness_set(struct led_classdev *led_cdev, static int iwl3945_led_register_led(struct iwl3945_priv *priv, struct iwl3945_led *led, enum led_type type, u8 set_led, - char *trigger) + const char *name, char *trigger) { struct device *device = wiphy_dev(priv->hw->wiphy); int ret; - led->led_dev.name = led->name; + led->led_dev.name = name; led->led_dev.brightness_set = iwl3945_led_brightness_set; led->led_dev.default_trigger = trigger; @@ -308,6 +308,7 @@ void iwl3945_led_background(struct iwl3945_priv *priv) int iwl3945_led_register(struct iwl3945_priv *priv) { char *trigger; + char name[32]; int ret; priv->last_blink_rate = 0; @@ -317,8 +318,7 @@ int iwl3945_led_register(struct iwl3945_priv *priv) priv->allow_blinking = 0; trigger = ieee80211_get_radio_led_name(priv->hw); - snprintf(priv->led[IWL_LED_TRG_RADIO].name, - sizeof(priv->led[IWL_LED_TRG_RADIO].name), "iwl-%s:radio", + snprintf(name, sizeof(name), "iwl-%s:radio", wiphy_name(priv->hw->wiphy)); priv->led[IWL_LED_TRG_RADIO].led_on = iwl3945_led_on; @@ -327,20 +327,19 @@ int iwl3945_led_register(struct iwl3945_priv *priv) ret = iwl3945_led_register_led(priv, &priv->led[IWL_LED_TRG_RADIO], - IWL_LED_TRG_RADIO, 1, trigger); - + IWL_LED_TRG_RADIO, 1, + name, trigger); if (ret) goto exit_fail; trigger = ieee80211_get_assoc_led_name(priv->hw); - snprintf(priv->led[IWL_LED_TRG_ASSOC].name, - sizeof(priv->led[IWL_LED_TRG_ASSOC].name), "iwl-%s:assoc", + snprintf(name, sizeof(name), "iwl-%s:assoc", wiphy_name(priv->hw->wiphy)); ret = iwl3945_led_register_led(priv, &priv->led[IWL_LED_TRG_ASSOC], - IWL_LED_TRG_ASSOC, 0, trigger); - + IWL_LED_TRG_ASSOC, 0, + name, trigger); /* for assoc always turn led on */ priv->led[IWL_LED_TRG_ASSOC].led_on = iwl3945_led_on; priv->led[IWL_LED_TRG_ASSOC].led_off = iwl3945_led_on; @@ -350,13 +349,14 @@ int iwl3945_led_register(struct iwl3945_priv *priv) goto exit_fail; trigger = ieee80211_get_rx_led_name(priv->hw); - snprintf(priv->led[IWL_LED_TRG_RX].name, - sizeof(priv->led[IWL_LED_TRG_RX].name), "iwl-%s:RX", + snprintf(name, sizeof(name), "iwl-%s:RX", wiphy_name(priv->hw->wiphy)); + ret = iwl3945_led_register_led(priv, &priv->led[IWL_LED_TRG_RX], - IWL_LED_TRG_RX, 0, trigger); + IWL_LED_TRG_RX, 0, + name, trigger); priv->led[IWL_LED_TRG_RX].led_on = iwl3945_led_associated; priv->led[IWL_LED_TRG_RX].led_off = iwl3945_led_associated; @@ -366,14 +366,13 @@ int iwl3945_led_register(struct iwl3945_priv *priv) goto exit_fail; trigger = ieee80211_get_tx_led_name(priv->hw); - snprintf(priv->led[IWL_LED_TRG_TX].name, - sizeof(priv->led[IWL_LED_TRG_TX].name), "iwl-%s:TX", + snprintf(name, sizeof(name), "iwl-%s:TX", wiphy_name(priv->hw->wiphy)); ret = iwl3945_led_register_led(priv, &priv->led[IWL_LED_TRG_TX], - IWL_LED_TRG_TX, 0, trigger); - + IWL_LED_TRG_TX, 0, + name, trigger); priv->led[IWL_LED_TRG_TX].led_on = iwl3945_led_associated; priv->led[IWL_LED_TRG_TX].led_off = iwl3945_led_associated; priv->led[IWL_LED_TRG_TX].led_pattern = iwl3945_led_pattern; diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-3945-led.h b/trunk/drivers/net/wireless/iwlwifi/iwl-3945-led.h index 2fbd126c1347..47b7e0bac802 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-3945-led.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-3945-led.h @@ -50,7 +50,6 @@ enum led_type { struct iwl3945_led { struct iwl3945_priv *priv; struct led_classdev led_dev; - char name[32]; int (*led_on) (struct iwl3945_priv *priv, int led_id); int (*led_off) (struct iwl3945_priv *priv, int led_id); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-3945.c b/trunk/drivers/net/wireless/iwlwifi/iwl-3945.c index b3931f6135a4..a51e0eaa1334 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-3945.c @@ -710,7 +710,10 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv, return; } - + if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { + iwl3945_pass_packet_to_mac80211(priv, rxb, &rx_status); + return; + } /* Convert 3945's rssi indicator to dBm */ rx_status.signal = rx_stats->rssi - IWL_RSSI_OFFSET; @@ -772,11 +775,6 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv, priv->last_rx_noise = rx_status.noise; } - if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { - iwl3945_pass_packet_to_mac80211(priv, rxb, &rx_status); - return; - } - switch (le16_to_cpu(header->frame_control) & IEEE80211_FCTL_FTYPE) { case IEEE80211_FTYPE_MGMT: switch (le16_to_cpu(header->frame_control) & @@ -795,7 +793,8 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv, struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)header; __le32 *pos; - pos = (__le32 *)&mgmt->u.beacon. + pos = + (__le32 *) & mgmt->u.beacon. timestamp; priv->timestamp0 = le32_to_cpu(pos[0]); priv->timestamp1 = le32_to_cpu(pos[1]); @@ -1508,7 +1507,7 @@ static int iwl3945_hw_reg_adjust_power_by_temp(int new_reading, int old_reading) */ static inline int iwl3945_hw_reg_temp_out_of_range(int temperature) { - return ((temperature < -260) || (temperature > 25)) ? 1 : 0; + return (((temperature < -260) || (temperature > 25)) ? 1 : 0); } int iwl3945_hw_get_temperature(struct iwl3945_priv *priv) @@ -2629,7 +2628,7 @@ unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv, tx_beacon_cmd->tx.supp_rates[1] = (IWL_CCK_BASIC_RATES_MASK & 0xF); - return sizeof(struct iwl3945_tx_beacon_cmd) + frame_size; + return (sizeof(struct iwl3945_tx_beacon_cmd) + frame_size); } void iwl3945_hw_rx_handler_setup(struct iwl3945_priv *priv) diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/trunk/drivers/net/wireless/iwlwifi/iwl-4965-rs.c similarity index 89% rename from trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c rename to trunk/drivers/net/wireless/iwlwifi/iwl-4965-rs.c index 754fef5b592f..3ccb84aa5dbc 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-4965-rs.c @@ -42,7 +42,7 @@ #include "iwl-core.h" #include "iwl-helpers.h" -#define RS_NAME "iwl-agn-rs" +#define RS_NAME "iwl-4965-rs" #define NUM_TRY_BEFORE_ANT_TOGGLE 1 #define IWL_NUMBER_TRY 1 @@ -77,9 +77,9 @@ static const u8 ant_toggle_lookup[] = { }; /** - * struct iwl_rate_scale_data -- tx success history for one rate + * struct iwl4965_rate_scale_data -- tx success history for one rate */ -struct iwl_rate_scale_data { +struct iwl4965_rate_scale_data { u64 data; /* bitmap of successful frames */ s32 success_counter; /* number of frames successful */ s32 success_ratio; /* per-cent * 128 */ @@ -89,12 +89,12 @@ struct iwl_rate_scale_data { }; /** - * struct iwl_scale_tbl_info -- tx params and success history for all rates + * struct iwl4965_scale_tbl_info -- tx params and success history for all rates * - * There are two of these in struct iwl_lq_sta, + * There are two of these in struct iwl4965_lq_sta, * one for "active", and one for "search". */ -struct iwl_scale_tbl_info { +struct iwl4965_scale_tbl_info { enum iwl_table_type lq_type; u8 ant_type; u8 is_SGI; /* 1 = short guard interval */ @@ -103,10 +103,10 @@ struct iwl_scale_tbl_info { u8 action; /* change modulation; IWL_[LEGACY/SISO/MIMO]_SWITCH_* */ s32 *expected_tpt; /* throughput metrics; expected_tpt_G, etc. */ u32 current_rate; /* rate_n_flags, uCode API format */ - struct iwl_rate_scale_data win[IWL_RATE_COUNT]; /* rate histories */ + struct iwl4965_rate_scale_data win[IWL_RATE_COUNT]; /* rate histories */ }; -struct iwl_traffic_load { +struct iwl4965_traffic_load { unsigned long time_stamp; /* age of the oldest statistics */ u32 packet_count[TID_QUEUE_MAX_SIZE]; /* packet count in this time * slice */ @@ -118,11 +118,11 @@ struct iwl_traffic_load { }; /** - * struct iwl_lq_sta -- driver's rate scaling private structure + * struct iwl4965_lq_sta -- driver's rate scaling private structure * * Pointer to this gets passed back and forth between driver and mac80211. */ -struct iwl_lq_sta { +struct iwl4965_lq_sta { u8 active_tbl; /* index of active table, range 0-1 */ u8 enable_counter; /* indicates HT mode */ u8 stay_in_tbl; /* 1: disallow, 0: allow search for new mode */ @@ -153,8 +153,8 @@ struct iwl_lq_sta { u16 active_rate_basic; struct iwl_link_quality_cmd lq; - struct iwl_scale_tbl_info lq_info[LQ_SIZE]; /* "active", "search" */ - struct iwl_traffic_load load[TID_MAX_LOAD_COUNT]; + struct iwl4965_scale_tbl_info lq_info[LQ_SIZE]; /* "active", "search" */ + struct iwl4965_traffic_load load[TID_MAX_LOAD_COUNT]; u8 tx_agg_tid_en; #ifdef CONFIG_MAC80211_DEBUGFS struct dentry *rs_sta_dbgfs_scale_table_file; @@ -170,15 +170,16 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, struct ieee80211_hdr *hdr, struct sta_info *sta); static void rs_fill_link_cmd(const struct iwl_priv *priv, - struct iwl_lq_sta *lq_sta, u32 rate_n_flags); + struct iwl4965_lq_sta *lq_sta, + u32 rate_n_flags); #ifdef CONFIG_MAC80211_DEBUGFS -static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, - u32 *rate_n_flags, int index); +static void rs_dbgfs_set_mcs(struct iwl4965_lq_sta *lq_sta, + u32 *rate_n_flags, int index); #else -static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, - u32 *rate_n_flags, int index) +static void rs_dbgfs_set_mcs(struct iwl4965_lq_sta *lq_sta, + u32 *rate_n_flags, int index) {} #endif @@ -233,7 +234,7 @@ static inline u8 rs_extract_rate(u32 rate_n_flags) return (u8)(rate_n_flags & 0xFF); } -static void rs_rate_scale_clear_window(struct iwl_rate_scale_data *window) +static void rs_rate_scale_clear_window(struct iwl4965_rate_scale_data *window) { window->data = 0; window->success_counter = 0; @@ -245,14 +246,14 @@ static void rs_rate_scale_clear_window(struct iwl_rate_scale_data *window) static inline u8 rs_is_valid_ant(u8 valid_antenna, u8 ant_type) { - return (ant_type & valid_antenna) == ant_type; + return ((ant_type & valid_antenna) == ant_type); } /* * removes the old data from the statistics. All data that is older than * TID_MAX_TIME_DIFF, will be deleted. */ -static void rs_tl_rm_old_stats(struct iwl_traffic_load *tl, u32 curr_time) +static void rs_tl_rm_old_stats(struct iwl4965_traffic_load *tl, u32 curr_time) { /* The oldest age we want to keep */ u32 oldest_time = curr_time - TID_MAX_TIME_DIFF; @@ -273,13 +274,13 @@ static void rs_tl_rm_old_stats(struct iwl_traffic_load *tl, u32 curr_time) * increment traffic load value for tid and also remove * any old values if passed the certain time period */ -static u8 rs_tl_add_packet(struct iwl_lq_sta *lq_data, +static u8 rs_tl_add_packet(struct iwl4965_lq_sta *lq_data, struct ieee80211_hdr *hdr) { u32 curr_time = jiffies_to_msecs(jiffies); u32 time_diff; s32 index; - struct iwl_traffic_load *tl = NULL; + struct iwl4965_traffic_load *tl = NULL; __le16 fc = hdr->frame_control; u8 tid; @@ -324,12 +325,12 @@ static u8 rs_tl_add_packet(struct iwl_lq_sta *lq_data, /* get the traffic load value for tid */ -static u32 rs_tl_get_load(struct iwl_lq_sta *lq_data, u8 tid) +static u32 rs_tl_get_load(struct iwl4965_lq_sta *lq_data, u8 tid) { u32 curr_time = jiffies_to_msecs(jiffies); u32 time_diff; s32 index; - struct iwl_traffic_load *tl = NULL; + struct iwl4965_traffic_load *tl = NULL; if (tid >= TID_MAX_LOAD_COUNT) return 0; @@ -353,8 +354,8 @@ static u32 rs_tl_get_load(struct iwl_lq_sta *lq_data, u8 tid) } static void rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv, - struct iwl_lq_sta *lq_data, u8 tid, - struct sta_info *sta) + struct iwl4965_lq_sta *lq_data, u8 tid, + struct sta_info *sta) { unsigned long state; DECLARE_MAC_BUF(mac); @@ -372,8 +373,8 @@ static void rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv, } static void rs_tl_turn_on_agg(struct iwl_priv *priv, u8 tid, - struct iwl_lq_sta *lq_data, - struct sta_info *sta) + struct iwl4965_lq_sta *lq_data, + struct sta_info *sta) { if ((tid < TID_MAX_LOAD_COUNT)) rs_tl_turn_on_agg_for_tid(priv, lq_data, tid, sta); @@ -384,9 +385,9 @@ static void rs_tl_turn_on_agg(struct iwl_priv *priv, u8 tid, static inline int get_num_of_ant_from_rate(u32 rate_n_flags) { - return !!(rate_n_flags & RATE_MCS_ANT_A_MSK) + - !!(rate_n_flags & RATE_MCS_ANT_B_MSK) + - !!(rate_n_flags & RATE_MCS_ANT_C_MSK); + return (!!(rate_n_flags & RATE_MCS_ANT_A_MSK) + + !!(rate_n_flags & RATE_MCS_ANT_B_MSK) + + !!(rate_n_flags & RATE_MCS_ANT_C_MSK)); } /** @@ -396,11 +397,11 @@ static inline int get_num_of_ant_from_rate(u32 rate_n_flags) * at this rate. window->data contains the bitmask of successful * packets. */ -static int rs_collect_tx_data(struct iwl_rate_scale_data *windows, +static int rs_collect_tx_data(struct iwl4965_rate_scale_data *windows, int scale_index, s32 tpt, int retries, int successes) { - struct iwl_rate_scale_data *window = NULL; + struct iwl4965_rate_scale_data *window = NULL; static const u64 mask = (((u64)1) << (IWL_RATE_MAX_WINDOW - 1)); s32 fail_count; @@ -472,7 +473,7 @@ static int rs_collect_tx_data(struct iwl_rate_scale_data *windows, * Fill uCode API rate_n_flags field, based on "search" or "active" table. */ /* FIXME:RS:remove this function and put the flags statically in the table */ -static u32 rate_n_flags_from_tbl(struct iwl_scale_tbl_info *tbl, +static u32 rate_n_flags_from_tbl(struct iwl4965_scale_tbl_info *tbl, int index, u8 use_green) { u32 rate_n_flags = 0; @@ -529,7 +530,7 @@ static u32 rate_n_flags_from_tbl(struct iwl_scale_tbl_info *tbl, */ static int rs_get_tbl_info_from_mcs(const u32 rate_n_flags, enum ieee80211_band band, - struct iwl_scale_tbl_info *tbl, + struct iwl4965_scale_tbl_info *tbl, int *rate_idx) { u32 ant_msk = (rate_n_flags & RATE_MCS_ANT_ABC_MSK); @@ -590,7 +591,7 @@ static int rs_get_tbl_info_from_mcs(const u32 rate_n_flags, /* switch to another antenna/antennas and return 1 */ /* if no other valid antenna found, return 0 */ static int rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags, - struct iwl_scale_tbl_info *tbl) + struct iwl4965_scale_tbl_info *tbl) { u8 new_ant_type; @@ -620,9 +621,9 @@ static int rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags, #if 0 static inline u8 rs_use_green(struct iwl_priv *priv, struct ieee80211_conf *conf) { - return (conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) && + return ((conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) && priv->current_ht_config.is_green_field && - !priv->current_ht_config.non_GF_STA_present; + !priv->current_ht_config.non_GF_STA_present); } #endif static inline u8 rs_use_green(struct iwl_priv *priv, struct ieee80211_conf *conf) @@ -637,9 +638,9 @@ static inline u8 rs_use_green(struct iwl_priv *priv, struct ieee80211_conf *conf * basic available rates. * */ -static u16 rs_get_supported_rates(struct iwl_lq_sta *lq_sta, - struct ieee80211_hdr *hdr, - enum iwl_table_type rate_type) +static u16 rs_get_supported_rates(struct iwl4965_lq_sta *lq_sta, + struct ieee80211_hdr *hdr, + enum iwl_table_type rate_type) { if (hdr && is_multicast_ether_addr(hdr->addr1) && lq_sta->active_rate_basic) @@ -713,9 +714,9 @@ static u16 rs_get_adjacent_rate(struct iwl_priv *priv, u8 index, u16 rate_mask, return (high << 8) | low; } -static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta, - struct iwl_scale_tbl_info *tbl, - u8 scale_index, u8 ht_possible) +static u32 rs_get_lower_rate(struct iwl4965_lq_sta *lq_sta, + struct iwl4965_scale_tbl_info *tbl, u8 scale_index, + u8 ht_possible) { s32 low; u16 rate_mask; @@ -779,7 +780,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, int status; u8 retries; int rs_index, index = 0; - struct iwl_lq_sta *lq_sta; + struct iwl4965_lq_sta *lq_sta; struct iwl_link_quality_cmd *table; struct sta_info *sta; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; @@ -787,11 +788,11 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); struct ieee80211_hw *hw = local_to_hw(local); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - struct iwl_rate_scale_data *window = NULL; - struct iwl_rate_scale_data *search_win = NULL; + struct iwl4965_rate_scale_data *window = NULL; + struct iwl4965_rate_scale_data *search_win = NULL; u32 tx_rate; - struct iwl_scale_tbl_info tbl_type; - struct iwl_scale_tbl_info *curr_tbl, *search_tbl; + struct iwl4965_scale_tbl_info tbl_type; + struct iwl4965_scale_tbl_info *curr_tbl, *search_tbl; u8 active_index = 0; __le16 fc = hdr->frame_control; s32 tpt = 0; @@ -819,7 +820,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, goto out; - lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv; + lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv; if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && !lq_sta->ibss_sta_added) @@ -830,8 +831,10 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, curr_tbl = &(lq_sta->lq_info[active_index]); search_tbl = &(lq_sta->lq_info[(1 - active_index)]); - window = (struct iwl_rate_scale_data *)&(curr_tbl->win[0]); - search_win = (struct iwl_rate_scale_data *)&(search_tbl->win[0]); + window = (struct iwl4965_rate_scale_data *) + &(curr_tbl->win[0]); + search_win = (struct iwl4965_rate_scale_data *) + &(search_tbl->win[0]); /* * Ignore this Tx frame response if its initial rate doesn't match @@ -980,7 +983,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev, * searching for a new mode. */ static void rs_set_stay_in_table(struct iwl_priv *priv, u8 is_legacy, - struct iwl_lq_sta *lq_sta) + struct iwl4965_lq_sta *lq_sta) { IWL_DEBUG_RATE("we are staying in the same table\n"); lq_sta->stay_in_tbl = 1; /* only place this gets set */ @@ -1001,8 +1004,8 @@ static void rs_set_stay_in_table(struct iwl_priv *priv, u8 is_legacy, /* * Find correct throughput table for given mode of modulation */ -static void rs_set_expected_tpt_table(struct iwl_lq_sta *lq_sta, - struct iwl_scale_tbl_info *tbl) +static void rs_set_expected_tpt_table(struct iwl4965_lq_sta *lq_sta, + struct iwl4965_scale_tbl_info *tbl) { if (is_legacy(tbl->lq_type)) { if (!is_a_band(tbl->lq_type)) @@ -1047,12 +1050,12 @@ static void rs_set_expected_tpt_table(struct iwl_lq_sta *lq_sta, * bit rate will typically need to increase, but not if performance was bad. */ static s32 rs_get_best_rate(struct iwl_priv *priv, - struct iwl_lq_sta *lq_sta, - struct iwl_scale_tbl_info *tbl, /* "search" */ + struct iwl4965_lq_sta *lq_sta, + struct iwl4965_scale_tbl_info *tbl, /* "search" */ u16 rate_mask, s8 index) { /* "active" values */ - struct iwl_scale_tbl_info *active_tbl = + struct iwl4965_scale_tbl_info *active_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); s32 active_sr = active_tbl->win[index].success_ratio; s32 active_tpt = active_tbl->expected_tpt[index]; @@ -1140,10 +1143,10 @@ static s32 rs_get_best_rate(struct iwl_priv *priv, * Set up search table for MIMO */ static int rs_switch_to_mimo2(struct iwl_priv *priv, - struct iwl_lq_sta *lq_sta, + struct iwl4965_lq_sta *lq_sta, struct ieee80211_conf *conf, struct sta_info *sta, - struct iwl_scale_tbl_info *tbl, int index) + struct iwl4965_scale_tbl_info *tbl, int index) { u16 rate_mask; s32 rate; @@ -1207,10 +1210,10 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv, * Set up search table for SISO */ static int rs_switch_to_siso(struct iwl_priv *priv, - struct iwl_lq_sta *lq_sta, + struct iwl4965_lq_sta *lq_sta, struct ieee80211_conf *conf, struct sta_info *sta, - struct iwl_scale_tbl_info *tbl, int index) + struct iwl4965_scale_tbl_info *tbl, int index) { u16 rate_mask; u8 is_green = lq_sta->is_green; @@ -1267,17 +1270,18 @@ static int rs_switch_to_siso(struct iwl_priv *priv, * Try to switch to new modulation mode from legacy */ static int rs_move_legacy_other(struct iwl_priv *priv, - struct iwl_lq_sta *lq_sta, + struct iwl4965_lq_sta *lq_sta, struct ieee80211_conf *conf, struct sta_info *sta, int index) { - struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); - struct iwl_scale_tbl_info *search_tbl = - &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); - struct iwl_rate_scale_data *window = &(tbl->win[index]); - u32 sz = (sizeof(struct iwl_scale_tbl_info) - - (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); + struct iwl4965_scale_tbl_info *tbl = + &(lq_sta->lq_info[lq_sta->active_tbl]); + struct iwl4965_scale_tbl_info *search_tbl = + &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); + struct iwl4965_rate_scale_data *window = &(tbl->win[index]); + u32 sz = (sizeof(struct iwl4965_scale_tbl_info) - + (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT)); u8 start_action = tbl->action; u8 valid_tx_ant = priv->hw_params.valid_tx_ant; int ret = 0; @@ -1356,17 +1360,19 @@ static int rs_move_legacy_other(struct iwl_priv *priv, * Try to switch to new modulation mode from SISO */ static int rs_move_siso_to_other(struct iwl_priv *priv, - struct iwl_lq_sta *lq_sta, + struct iwl4965_lq_sta *lq_sta, struct ieee80211_conf *conf, - struct sta_info *sta, int index) + struct sta_info *sta, + int index) { u8 is_green = lq_sta->is_green; - struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); - struct iwl_scale_tbl_info *search_tbl = - &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); - struct iwl_rate_scale_data *window = &(tbl->win[index]); - u32 sz = (sizeof(struct iwl_scale_tbl_info) - - (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); + struct iwl4965_scale_tbl_info *tbl = + &(lq_sta->lq_info[lq_sta->active_tbl]); + struct iwl4965_scale_tbl_info *search_tbl = + &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); + struct iwl4965_rate_scale_data *window = &(tbl->win[index]); + u32 sz = (sizeof(struct iwl4965_scale_tbl_info) - + (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT)); u8 start_action = tbl->action; u8 valid_tx_ant = priv->hw_params.valid_tx_ant; int ret; @@ -1449,16 +1455,18 @@ static int rs_move_siso_to_other(struct iwl_priv *priv, * Try to switch to new modulation mode from MIMO */ static int rs_move_mimo_to_other(struct iwl_priv *priv, - struct iwl_lq_sta *lq_sta, + struct iwl4965_lq_sta *lq_sta, struct ieee80211_conf *conf, - struct sta_info *sta, int index) + struct sta_info *sta, + int index) { s8 is_green = lq_sta->is_green; - struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); - struct iwl_scale_tbl_info *search_tbl = - &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); - u32 sz = (sizeof(struct iwl_scale_tbl_info) - - (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); + struct iwl4965_scale_tbl_info *tbl = + &(lq_sta->lq_info[lq_sta->active_tbl]); + struct iwl4965_scale_tbl_info *search_tbl = + &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); + u32 sz = (sizeof(struct iwl4965_scale_tbl_info) - + (sizeof(struct iwl4965_rate_scale_data) * IWL_RATE_COUNT)); u8 start_action = tbl->action; /*u8 valid_tx_ant = priv->hw_params.valid_tx_ant;*/ int ret; @@ -1544,9 +1552,9 @@ static int rs_move_mimo_to_other(struct iwl_priv *priv, * 2) # times calling this function * 3) elapsed time in this mode (not used, for now) */ -static void rs_stay_in_table(struct iwl_lq_sta *lq_sta) +static void rs_stay_in_table(struct iwl4965_lq_sta *lq_sta) { - struct iwl_scale_tbl_info *tbl; + struct iwl4965_scale_tbl_info *tbl; int i; int active_tbl; int flush_interval_passed = 0; @@ -1634,7 +1642,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, int high = IWL_RATE_INVALID; int index; int i; - struct iwl_rate_scale_data *window = NULL; + struct iwl4965_rate_scale_data *window = NULL; int current_tpt = IWL_INVALID_VALUE; int low_tpt = IWL_INVALID_VALUE; int high_tpt = IWL_INVALID_VALUE; @@ -1643,8 +1651,8 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, __le16 fc; u16 rate_mask; u8 update_lq = 0; - struct iwl_lq_sta *lq_sta; - struct iwl_scale_tbl_info *tbl, *tbl1; + struct iwl4965_lq_sta *lq_sta; + struct iwl4965_scale_tbl_info *tbl, *tbl1; u16 rate_scale_index_msk = 0; u32 rate; u8 is_green = 0; @@ -1667,7 +1675,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv, if (!sta || !sta->rate_ctrl_priv) return; - lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv; + lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv; tid = rs_tl_add_packet(lq_sta, hdr); @@ -2022,8 +2030,8 @@ static void rs_initialize_lq(struct iwl_priv *priv, struct ieee80211_conf *conf, struct sta_info *sta) { - struct iwl_lq_sta *lq_sta; - struct iwl_scale_tbl_info *tbl; + struct iwl4965_lq_sta *lq_sta; + struct iwl4965_scale_tbl_info *tbl; int rate_idx; int i; u32 rate; @@ -2034,7 +2042,7 @@ static void rs_initialize_lq(struct iwl_priv *priv, if (!sta || !sta->rate_ctrl_priv) goto out; - lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv; + lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv; i = sta->last_txrate_idx; if ((lq_sta->lq.sta_id == 0xff) && @@ -2088,7 +2096,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, struct sta_info *sta; __le16 fc; struct iwl_priv *priv = (struct iwl_priv *)priv_rate; - struct iwl_lq_sta *lq_sta; + struct iwl4965_lq_sta *lq_sta; IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n"); @@ -2105,7 +2113,7 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, goto out; } - lq_sta = (struct iwl_lq_sta *)sta->rate_ctrl_priv; + lq_sta = (struct iwl4965_lq_sta *)sta->rate_ctrl_priv; i = sta->last_txrate_idx; if ((priv->iw_mode == IEEE80211_IF_TYPE_IBSS) && @@ -2141,14 +2149,14 @@ static void rs_get_rate(void *priv_rate, struct net_device *dev, static void *rs_alloc_sta(void *priv_rate, gfp_t gfp) { - struct iwl_lq_sta *lq_sta; + struct iwl4965_lq_sta *lq_sta; struct iwl_priv *priv; int i, j; priv = (struct iwl_priv *)priv_rate; IWL_DEBUG_RATE("create station rate scale window\n"); - lq_sta = kzalloc(sizeof(struct iwl_lq_sta), gfp); + lq_sta = kzalloc(sizeof(struct iwl4965_lq_sta), gfp); if (lq_sta == NULL) return NULL; @@ -2157,7 +2165,7 @@ static void *rs_alloc_sta(void *priv_rate, gfp_t gfp) for (j = 0; j < LQ_SIZE; j++) for (i = 0; i < IWL_RATE_COUNT; i++) - rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]); + rs_rate_scale_clear_window(&(lq_sta->lq_info[j].win[i])); return lq_sta; } @@ -2170,7 +2178,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, struct ieee80211_conf *conf = &local->hw.conf; struct ieee80211_supported_band *sband; struct iwl_priv *priv = (struct iwl_priv *)priv_rate; - struct iwl_lq_sta *lq_sta = priv_sta; + struct iwl4965_lq_sta *lq_sta = priv_sta; sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; @@ -2179,7 +2187,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, sta->txrate_idx = 3; for (j = 0; j < LQ_SIZE; j++) for (i = 0; i < IWL_RATE_COUNT; i++) - rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]); + rs_rate_scale_clear_window(&(lq_sta->lq_info[j].win[i])); IWL_DEBUG_RATE("LQ: *** rate scale global init ***\n"); /* TODO: what is a good starting rate for STA? About middle? Maybe not @@ -2263,9 +2271,10 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, } static void rs_fill_link_cmd(const struct iwl_priv *priv, - struct iwl_lq_sta *lq_sta, u32 new_rate) + struct iwl4965_lq_sta *lq_sta, + u32 new_rate) { - struct iwl_scale_tbl_info tbl_type; + struct iwl4965_scale_tbl_info tbl_type; int index = 0; int rate_idx; int repeat_rate = 0; @@ -2393,7 +2402,6 @@ static void rs_free(void *priv_rate) static void rs_clear(void *priv_rate) { -#ifdef CONFIG_IWLWIFI_DEBUG struct iwl_priv *priv = (struct iwl_priv *) priv_rate; IWL_DEBUG_RATE("enter\n"); @@ -2401,12 +2409,11 @@ static void rs_clear(void *priv_rate) /* TODO - add rate scale state reset */ IWL_DEBUG_RATE("leave\n"); -#endif /* CONFIG_IWLWIFI_DEBUG */ } static void rs_free_sta(void *priv_rate, void *priv_sta) { - struct iwl_lq_sta *lq_sta = priv_sta; + struct iwl4965_lq_sta *lq_sta = priv_sta; struct iwl_priv *priv; priv = (struct iwl_priv *)priv_rate; @@ -2422,8 +2429,8 @@ static int open_file_generic(struct inode *inode, struct file *file) file->private_data = inode->i_private; return 0; } -static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, - u32 *rate_n_flags, int index) +static void rs_dbgfs_set_mcs(struct iwl4965_lq_sta *lq_sta, + u32 *rate_n_flags, int index) { struct iwl_priv *priv; @@ -2446,7 +2453,7 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, static ssize_t rs_sta_dbgfs_scale_table_write(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { - struct iwl_lq_sta *lq_sta = file->private_data; + struct iwl4965_lq_sta *lq_sta = file->private_data; struct iwl_priv *priv; char buf[64]; int buf_size; @@ -2486,7 +2493,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file, int desc = 0; int i = 0; - struct iwl_lq_sta *lq_sta = file->private_data; + struct iwl4965_lq_sta *lq_sta = file->private_data; desc += sprintf(buff+desc, "sta_id %d\n", lq_sta->lq.sta_id); desc += sprintf(buff+desc, "failed=%d success=%d rate=0%X\n", @@ -2534,7 +2541,7 @@ static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file, int desc = 0; int i, j; - struct iwl_lq_sta *lq_sta = file->private_data; + struct iwl4965_lq_sta *lq_sta = file->private_data; for (i = 0; i < LQ_SIZE; i++) { desc += sprintf(buff+desc, "%s type=%d SGI=%d FAT=%d DUP=%d\n" "rate=0x%X\n", @@ -2563,7 +2570,7 @@ static const struct file_operations rs_sta_dbgfs_stats_table_ops = { static void rs_add_debugfs(void *priv, void *priv_sta, struct dentry *dir) { - struct iwl_lq_sta *lq_sta = priv_sta; + struct iwl4965_lq_sta *lq_sta = priv_sta; lq_sta->rs_sta_dbgfs_scale_table_file = debugfs_create_file("rate_scale_table", 0600, dir, lq_sta, &rs_sta_dbgfs_scale_table_ops); @@ -2578,7 +2585,7 @@ static void rs_add_debugfs(void *priv, void *priv_sta, static void rs_remove_debugfs(void *priv, void *priv_sta) { - struct iwl_lq_sta *lq_sta = priv_sta; + struct iwl4965_lq_sta *lq_sta = priv_sta; debugfs_remove(lq_sta->rs_sta_dbgfs_scale_table_file); debugfs_remove(lq_sta->rs_sta_dbgfs_stats_table_file); debugfs_remove(lq_sta->rs_sta_dbgfs_tx_agg_tid_en_file); @@ -2602,12 +2609,104 @@ static struct rate_control_ops rs_ops = { #endif }; -int iwlagn_rate_control_register(void) +int iwl4965_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id) +{ + struct ieee80211_local *local = hw_to_local(hw); + struct iwl_priv *priv = hw->priv; + struct iwl4965_lq_sta *lq_sta; + struct sta_info *sta; + int cnt = 0, i; + u32 samples = 0, success = 0, good = 0; + unsigned long now = jiffies; + u32 max_time = 0; + u8 lq_type, antenna; + + rcu_read_lock(); + + sta = sta_info_get(local, priv->stations[sta_id].sta.sta.addr); + if (!sta || !sta->rate_ctrl_priv) { + if (sta) + IWL_DEBUG_RATE("leave - no private rate data!\n"); + else + IWL_DEBUG_RATE("leave - no station!\n"); + rcu_read_unlock(); + return sprintf(buf, "station %d not found\n", sta_id); + } + + lq_sta = (void *)sta->rate_ctrl_priv; + + lq_type = lq_sta->lq_info[lq_sta->active_tbl].lq_type; + antenna = lq_sta->lq_info[lq_sta->active_tbl].ant_type; + + if (is_legacy(lq_type)) + i = IWL_RATE_54M_INDEX; + else + i = IWL_RATE_60M_INDEX; + while (1) { + u64 mask; + int j; + int active = lq_sta->active_tbl; + + cnt += + sprintf(&buf[cnt], " %2dMbs: ", iwl_rates[i].ieee / 2); + + mask = (1ULL << (IWL_RATE_MAX_WINDOW - 1)); + for (j = 0; j < IWL_RATE_MAX_WINDOW; j++, mask >>= 1) + buf[cnt++] = + (lq_sta->lq_info[active].win[i].data & mask) + ? '1' : '0'; + + samples += lq_sta->lq_info[active].win[i].counter; + good += lq_sta->lq_info[active].win[i].success_counter; + success += lq_sta->lq_info[active].win[i].success_counter * + iwl_rates[i].ieee; + + if (lq_sta->lq_info[active].win[i].stamp) { + int delta = + jiffies_to_msecs(now - + lq_sta->lq_info[active].win[i].stamp); + + if (delta > max_time) + max_time = delta; + + cnt += sprintf(&buf[cnt], "%5dms\n", delta); + } else + buf[cnt++] = '\n'; + + j = iwl4965_get_prev_ieee_rate(i); + if (j == i) + break; + i = j; + } + + /* + * Display the average rate of all samples taken. + * NOTE: We multiply # of samples by 2 since the IEEE measurement + * added from iwl_rates is actually 2X the rate. + */ + if (samples) + cnt += sprintf(&buf[cnt], + "\nAverage rate is %3d.%02dMbs over last %4dms\n" + "%3d%% success (%d good packets over %d tries)\n", + success / (2 * samples), (success * 5 / samples) % 10, + max_time, good * 100 / samples, good, samples); + else + cnt += sprintf(&buf[cnt], "\nAverage rate: 0Mbs\n"); + + cnt += sprintf(&buf[cnt], "\nrate scale type %d antenna %d " + "active_search %d rate index %d\n", lq_type, antenna, + lq_sta->search_better_tbl, sta->last_txrate_idx); + + rcu_read_unlock(); + return cnt; +} + +int iwl4965_rate_control_register(void) { return ieee80211_rate_control_register(&rs_ops); } -void iwlagn_rate_control_unregister(void) +void iwl4965_rate_control_unregister(void) { ieee80211_rate_control_unregister(&rs_ops); } diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.h b/trunk/drivers/net/wireless/iwlwifi/iwl-4965-rs.h similarity index 93% rename from trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.h rename to trunk/drivers/net/wireless/iwlwifi/iwl-4965-rs.h index 84d4d1e33755..9b9972885aa5 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-4965-rs.h @@ -24,8 +24,8 @@ * *****************************************************************************/ -#ifndef __iwl_agn_rs_h__ -#define __iwl_agn_rs_h__ +#ifndef __iwl_4965_rs_h__ +#define __iwl_4965_rs_h__ #include "iwl-dev.h" @@ -88,7 +88,7 @@ enum { #define IWL_RATE_5M_MASK (1 << IWL_RATE_5M_INDEX) #define IWL_RATE_11M_MASK (1 << IWL_RATE_11M_INDEX) -/* uCode API values for legacy bit rates, both OFDM and CCK */ +/* 4965 uCode API values for legacy bit rates, both OFDM and CCK */ enum { IWL_RATE_6M_PLCP = 13, IWL_RATE_9M_PLCP = 15, @@ -107,7 +107,7 @@ enum { /*FIXME:RS:add IWL_RATE_LEGACY_INVM_PLCP = 0,*/ }; -/* uCode API values for OFDM high-throughput (HT) bit rates */ +/* 4965 uCode API values for OFDM high-throughput (HT) bit rates */ enum { IWL_RATE_SISO_6M_PLCP = 0, IWL_RATE_SISO_12M_PLCP = 1, @@ -286,6 +286,15 @@ static inline u8 iwl4965_get_prev_ieee_rate(u8 rate_index) return rate; } +/** + * iwl4965_fill_rs_info - Fill an output text buffer with the rate representation + * + * NOTE: This is provided as a quick mechanism for a user to visualize + * the performance of the rate control algorithm and is not meant to be + * parsed software. + */ +extern int iwl4965_fill_rs_info(struct ieee80211_hw *, char *buf, u8 sta_id); + /** * iwl4965_rate_control_register - Register the rate control algorithm callbacks * @@ -296,7 +305,7 @@ static inline u8 iwl4965_get_prev_ieee_rate(u8 rate_index) * ieee80211_register_hw * */ -extern int iwlagn_rate_control_register(void); +extern int iwl4965_rate_control_register(void); /** * iwl4965_rate_control_unregister - Unregister the rate control callbacks @@ -304,6 +313,6 @@ extern int iwlagn_rate_control_register(void); * This should be called after calling ieee80211_unregister_hw, but before * the driver is unloaded. */ -extern void iwlagn_rate_control_unregister(void); +extern void iwl4965_rate_control_unregister(void); -#endif /* __iwl_agn__rs__ */ +#endif diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-4965.c b/trunk/drivers/net/wireless/iwlwifi/iwl-4965.c index 22bb26985c2e..ba2df1ba32d2 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-4965.c @@ -341,6 +341,39 @@ static int iwl4965_eeprom_check_version(struct iwl_priv *priv) return -EINVAL; } +int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src) +{ + int ret; + unsigned long flags; + + spin_lock_irqsave(&priv->lock, flags); + ret = iwl_grab_nic_access(priv); + if (ret) { + spin_unlock_irqrestore(&priv->lock, flags); + return ret; + } + + if (src == IWL_PWR_SRC_VAUX) { + u32 val; + ret = pci_read_config_dword(priv->pci_dev, PCI_POWER_SOURCE, + &val); + + if (val & PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT) { + iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG, + APMG_PS_CTRL_VAL_PWR_SRC_VAUX, + ~APMG_PS_CTRL_MSK_PWR_SRC); + } + } else { + iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG, + APMG_PS_CTRL_VAL_PWR_SRC_VMAIN, + ~APMG_PS_CTRL_MSK_PWR_SRC); + } + + iwl_release_nic_access(priv); + spin_unlock_irqrestore(&priv->lock, flags); + + return ret; +} /* * Activate/Deactivat Tx DMA/FIFO channels according tx fifos mask @@ -842,6 +875,18 @@ static int iwl4965_hw_set_hw_params(struct iwl_priv *priv) return 0; } +/* set card power command */ +static int iwl4965_set_power(struct iwl_priv *priv, + void *cmd) +{ + int ret = 0; + + ret = iwl_send_cmd_pdu_async(priv, POWER_TABLE_CMD, + sizeof(struct iwl4965_powertable_cmd), + cmd, NULL); + return ret; +} + static s32 iwl4965_math_div_round(s32 num, s32 denom, s32 *res) { s32 sign = 1; @@ -1515,11 +1560,11 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel, c, atten_value, power_index, tx_power.s.radio_tx_gain[c], tx_power.s.dsp_predis_atten[c]); - } /* for each chain */ + }/* for each chain */ tx_power_tbl->power_tbl[i].dw = cpu_to_le32(tx_power.dw); - } /* for each rate */ + }/* for each rate */ return 0; } @@ -1656,6 +1701,38 @@ static int iwl4965_shared_mem_rx_idx(struct iwl_priv *priv) return le32_to_cpu(s->rb_closed) & 0xFFF; } +unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv, + struct iwl_frame *frame, u8 rate) +{ + struct iwl4965_tx_beacon_cmd *tx_beacon_cmd; + unsigned int frame_size; + + tx_beacon_cmd = &frame->u.beacon; + memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd)); + + tx_beacon_cmd->tx.sta_id = priv->hw_params.bcast_sta_id; + tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; + + frame_size = iwl4965_fill_beacon_frame(priv, + tx_beacon_cmd->frame, + iwl_bcast_addr, + sizeof(frame->u) - sizeof(*tx_beacon_cmd)); + + BUG_ON(frame_size > MAX_MPDU_SIZE); + tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size); + + if ((rate == IWL_RATE_1M_PLCP) || (rate >= IWL_RATE_2M_PLCP)) + tx_beacon_cmd->tx.rate_n_flags = + iwl_hw_set_rate_n_flags(rate, RATE_MCS_CCK_MSK); + else + tx_beacon_cmd->tx.rate_n_flags = + iwl_hw_set_rate_n_flags(rate, 0); + + tx_beacon_cmd->tx.tx_flags = (TX_CMD_FLG_SEQ_CTL_MSK | + TX_CMD_FLG_TSF_MSK | TX_CMD_FLG_STA_RATE_MSK); + return (sizeof(*tx_beacon_cmd) + frame_size); +} + static int iwl4965_alloc_shared_mem(struct iwl_priv *priv) { priv->shared_virt = pci_alloc_consistent(priv->pci_dev, @@ -2002,6 +2079,39 @@ static int iwl4965_txq_agg_enable(struct iwl_priv *priv, int txq_id, return 0; } +int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, + enum ieee80211_ampdu_mlme_action action, + const u8 *addr, u16 tid, u16 *ssn) +{ + struct iwl_priv *priv = hw->priv; + DECLARE_MAC_BUF(mac); + + IWL_DEBUG_HT("A-MPDU action on addr %s tid %d\n", + print_mac(mac, addr), tid); + + if (!(priv->cfg->sku & IWL_SKU_N)) + return -EACCES; + + switch (action) { + case IEEE80211_AMPDU_RX_START: + IWL_DEBUG_HT("start Rx\n"); + return iwl_rx_agg_start(priv, addr, tid, *ssn); + case IEEE80211_AMPDU_RX_STOP: + IWL_DEBUG_HT("stop Rx\n"); + return iwl_rx_agg_stop(priv, addr, tid); + case IEEE80211_AMPDU_TX_START: + IWL_DEBUG_HT("start Tx\n"); + return iwl_tx_agg_start(priv, addr, tid, ssn); + case IEEE80211_AMPDU_TX_STOP: + IWL_DEBUG_HT("stop Tx\n"); + return iwl_tx_agg_stop(priv, addr, tid); + default: + IWL_DEBUG_HT("unknown\n"); + return -EINVAL; + break; + } + return 0; +} static u16 iwl4965_get_hcmd_size(u8 cmd_id, u16 len) { @@ -2130,9 +2240,9 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv, bitmap = bitmap << sh; sh = 0; } - bitmap |= 1ULL << sh; - IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%llx\n", - start, (unsigned long long)bitmap); + bitmap |= (1 << sh); + IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%x\n", + start, (u32)(bitmap & 0xFFFFFFFF)); } agg->bitmap = bitmap; @@ -2258,40 +2368,6 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv, IWL_ERROR("TODO: Implement Tx ABORT REQUIRED!!!\n"); } -static int iwl4965_calc_rssi(struct iwl_priv *priv, - struct iwl_rx_phy_res *rx_resp) -{ - /* data from PHY/DSP regarding signal strength, etc., - * contents are always there, not configurable by host. */ - struct iwl4965_rx_non_cfg_phy *ncphy = - (struct iwl4965_rx_non_cfg_phy *)rx_resp->non_cfg_phy_buf; - u32 agc = (le16_to_cpu(ncphy->agc_info) & IWL49_AGC_DB_MASK) - >> IWL49_AGC_DB_POS; - - u32 valid_antennae = - (le16_to_cpu(rx_resp->phy_flags) & IWL49_RX_PHY_FLAGS_ANTENNAE_MASK) - >> IWL49_RX_PHY_FLAGS_ANTENNAE_OFFSET; - u8 max_rssi = 0; - u32 i; - - /* Find max rssi among 3 possible receivers. - * These values are measured by the digital signal processor (DSP). - * They should stay fairly constant even as the signal strength varies, - * if the radio's automatic gain control (AGC) is working right. - * AGC value (see below) will provide the "interesting" info. */ - for (i = 0; i < 3; i++) - if (valid_antennae & (1 << i)) - max_rssi = max(ncphy->rssi_info[i << 1], max_rssi); - - IWL_DEBUG_STATS("Rssi In A %d B %d C %d Max %d AGC dB %d\n", - ncphy->rssi_info[0], ncphy->rssi_info[2], ncphy->rssi_info[4], - max_rssi, agc); - - /* dBm = max_rssi dB - agc dB - constant. - * Higher AGC (higher radio gain) means lower signal. */ - return max_rssi - agc - IWL_RSSI_OFFSET; -} - /* Set up 4965-specific Rx frame reply handlers */ static void iwl4965_rx_handler_setup(struct iwl_priv *priv) @@ -2323,7 +2399,6 @@ static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = { .chain_noise_reset = iwl4965_chain_noise_reset, .gain_computation = iwl4965_gain_computation, .rts_tx_cmd_flag = iwl4965_rts_tx_cmd_flag, - .calc_rssi = iwl4965_calc_rssi, }; static struct iwl_lib_ops iwl4965_lib = { @@ -2365,6 +2440,7 @@ static struct iwl_lib_ops iwl4965_lib = { .check_version = iwl4965_eeprom_check_version, .query_addr = iwlcore_eeprom_query_addr, }, + .set_power = iwl4965_set_power, .send_tx_power = iwl4965_send_tx_power, .update_chain_flags = iwl4965_update_chain_flags, .temperature = iwl4965_temperature_calib, diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-5000.c b/trunk/drivers/net/wireless/iwlwifi/iwl-5000.c index f3d139b663e6..878d6193b232 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-5000.c @@ -93,13 +93,6 @@ static int iwl5000_apm_init(struct iwl_priv *priv) iwl_set_bit(priv, CSR_GIO_CHICKEN_BITS, CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX); - /* Set FH wait treshold to maximum (HW error during stress W/A) */ - iwl_set_bit(priv, CSR_DBG_HPET_MEM_REG, CSR_DBG_HPET_MEM_REG_VAL); - - /* enable HAP INTA to move device L1a -> L0s */ - iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, - CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A); - iwl_set_bit(priv, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL); /* set "initialization complete" bit to move adapter @@ -237,16 +230,6 @@ static void iwl5000_nic_config(struct iwl_priv *priv) CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI | CSR_HW_IF_CONFIG_REG_BIT_MAC_SI); - /* W/A : NIC is stuck in a reset state after Early PCIe power off - * (PCIe power is lost before PERST# is asserted), - * causing ME FW to lose ownership and not being able to obtain it back. - */ - iwl_grab_nic_access(priv); - iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG, - APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS, - ~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS); - iwl_release_nic_access(priv); - spin_unlock_irqrestore(&priv->lock, flags); } @@ -941,8 +924,8 @@ static void iwl5000_txq_update_byte_cnt_tbl(struct iwl_priv *priv, len = byte_cnt + IWL_TX_CRC_SIZE + IWL_TX_DELIMITER_SIZE; if (txq_id != IWL_CMD_QUEUE_NUM) { - sta = txq->cmd[txq->q.write_ptr]->cmd.tx.sta_id; - sec_ctl = txq->cmd[txq->q.write_ptr]->cmd.tx.sec_ctl; + sta = txq->cmd[txq->q.write_ptr].cmd.tx.sta_id; + sec_ctl = txq->cmd[txq->q.write_ptr].cmd.tx.sec_ctl; switch (sec_ctl & TX_CMD_SEC_MSK) { case TX_CMD_SEC_CCM: @@ -981,7 +964,7 @@ static void iwl5000_txq_inval_byte_cnt_tbl(struct iwl_priv *priv, u8 sta = 0; if (txq_id != IWL_CMD_QUEUE_NUM) - sta = txq->cmd[txq->q.read_ptr]->cmd.tx.sta_id; + sta = txq->cmd[txq->q.read_ptr].cmd.tx.sta_id; shared_data->queues_byte_cnt_tbls[txq_id].tfd_offset[txq->q.read_ptr]. val = cpu_to_le16(1 | (sta << 12)); @@ -1148,7 +1131,7 @@ static void iwl5000_txq_set_sched(struct iwl_priv *priv, u32 mask) static inline u32 iwl5000_get_scd_ssn(struct iwl5000_tx_resp *tx_resp) { - return le32_to_cpup((__le32 *)&tx_resp->status + + return le32_to_cpup((__le32*)&tx_resp->status + tx_resp->frame_count) & MAX_SN; } @@ -1245,9 +1228,9 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, bitmap = bitmap << sh; sh = 0; } - bitmap |= 1ULL << sh; - IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%llx\n", - start, (unsigned long long)bitmap); + bitmap |= (1 << sh); + IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%x\n", + start, (u32)(bitmap & 0xFFFFFFFF)); } agg->bitmap = bitmap; @@ -1461,44 +1444,6 @@ static void iwl5000_temperature(struct iwl_priv *priv) priv->temperature = le32_to_cpu(priv->statistics.general.temperature); } -/* Calc max signal level (dBm) among 3 possible receivers */ -static int iwl5000_calc_rssi(struct iwl_priv *priv, - struct iwl_rx_phy_res *rx_resp) -{ - /* data from PHY/DSP regarding signal strength, etc., - * contents are always there, not configurable by host - */ - struct iwl5000_non_cfg_phy *ncphy = - (struct iwl5000_non_cfg_phy *)rx_resp->non_cfg_phy_buf; - u32 val, rssi_a, rssi_b, rssi_c, max_rssi; - u8 agc; - - val = le32_to_cpu(ncphy->non_cfg_phy[IWL50_RX_RES_AGC_IDX]); - agc = (val & IWL50_OFDM_AGC_MSK) >> IWL50_OFDM_AGC_BIT_POS; - - /* Find max rssi among 3 possible receivers. - * These values are measured by the digital signal processor (DSP). - * They should stay fairly constant even as the signal strength varies, - * if the radio's automatic gain control (AGC) is working right. - * AGC value (see below) will provide the "interesting" info. - */ - val = le32_to_cpu(ncphy->non_cfg_phy[IWL50_RX_RES_RSSI_AB_IDX]); - rssi_a = (val & IWL50_OFDM_RSSI_A_MSK) >> IWL50_OFDM_RSSI_A_BIT_POS; - rssi_b = (val & IWL50_OFDM_RSSI_B_MSK) >> IWL50_OFDM_RSSI_B_BIT_POS; - val = le32_to_cpu(ncphy->non_cfg_phy[IWL50_RX_RES_RSSI_C_IDX]); - rssi_c = (val & IWL50_OFDM_RSSI_C_MSK) >> IWL50_OFDM_RSSI_C_BIT_POS; - - max_rssi = max_t(u32, rssi_a, rssi_b); - max_rssi = max_t(u32, max_rssi, rssi_c); - - IWL_DEBUG_STATS("Rssi In A %d B %d C %d Max %d AGC dB %d\n", - rssi_a, rssi_b, rssi_c, max_rssi, agc); - - /* dBm = max_rssi dB - agc dB - constant. - * Higher AGC (higher radio gain) means lower signal. */ - return max_rssi - agc - IWL_RSSI_OFFSET; -} - static struct iwl_hcmd_ops iwl5000_hcmd = { .rxon_assoc = iwl5000_send_rxon_assoc, }; @@ -1509,7 +1454,6 @@ static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = { .gain_computation = iwl5000_gain_computation, .chain_noise_reset = iwl5000_chain_noise_reset, .rts_tx_cmd_flag = iwl5000_rts_tx_cmd_flag, - .calc_rssi = iwl5000_calc_rssi, }; static struct iwl_lib_ops iwl5000_lib = { @@ -1530,7 +1474,6 @@ static struct iwl_lib_ops iwl5000_lib = { .alive_notify = iwl5000_alive_notify, .send_tx_power = iwl5000_send_tx_power, .temperature = iwl5000_temperature, - .update_chain_flags = iwl4965_update_chain_flags, .apm_ops = { .init = iwl5000_apm_init, .reset = iwl5000_apm_reset, diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-commands.h b/trunk/drivers/net/wireless/iwlwifi/iwl-commands.h index 28b5b09996ed..e9bb1de0ce3f 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-commands.h @@ -666,7 +666,8 @@ struct iwl4965_rxon_assoc_cmd { __le16 reserved; } __attribute__ ((packed)); -#define IWL_CONN_MAX_LISTEN_INTERVAL 10 + + /* * REPLY_RXON_TIMING = 0x14 (command, has simple generic response) @@ -1075,12 +1076,10 @@ struct iwl4965_rx_frame { } __attribute__ ((packed)); /* Fixed (non-configurable) rx data from phy */ - -#define IWL49_RX_RES_PHY_CNT 14 -#define IWL49_RX_PHY_FLAGS_ANTENNAE_OFFSET (4) -#define IWL49_RX_PHY_FLAGS_ANTENNAE_MASK (0x70) -#define IWL49_AGC_DB_MASK (0x3f80) /* MASK(7,13) */ -#define IWL49_AGC_DB_POS (7) +#define RX_PHY_FLAGS_ANTENNAE_OFFSET (4) +#define RX_PHY_FLAGS_ANTENNAE_MASK (0x70) +#define IWL_AGC_DB_MASK (0x3f80) /* MASK(7,13) */ +#define IWL_AGC_DB_POS (7) struct iwl4965_rx_non_cfg_phy { __le16 ant_selection; /* ant A bit 4, ant B bit 5, ant C bit 6 */ __le16 agc_info; /* agc code 0:6, agc dB 7:13, reserved 14:15 */ @@ -1088,30 +1087,12 @@ struct iwl4965_rx_non_cfg_phy { u8 pad[0]; } __attribute__ ((packed)); - -#define IWL50_RX_RES_PHY_CNT 8 -#define IWL50_RX_RES_AGC_IDX 1 -#define IWL50_RX_RES_RSSI_AB_IDX 2 -#define IWL50_RX_RES_RSSI_C_IDX 3 -#define IWL50_OFDM_AGC_MSK 0xfe00 -#define IWL50_OFDM_AGC_BIT_POS 9 -#define IWL50_OFDM_RSSI_A_MSK 0x00ff -#define IWL50_OFDM_RSSI_A_BIT_POS 0 -#define IWL50_OFDM_RSSI_B_MSK 0xff0000 -#define IWL50_OFDM_RSSI_B_BIT_POS 16 -#define IWL50_OFDM_RSSI_C_MSK 0x00ff -#define IWL50_OFDM_RSSI_C_BIT_POS 0 - -struct iwl5000_non_cfg_phy { - __le32 non_cfg_phy[IWL50_RX_RES_PHY_CNT]; /* upto 8 phy entries */ -} __attribute__ ((packed)); - - /* * REPLY_RX = 0xc3 (response only, not a command) * Used only for legacy (non 11n) frames. */ -struct iwl_rx_phy_res { +#define RX_RES_PHY_CNT 14 +struct iwl4965_rx_phy_res { u8 non_cfg_phy_cnt; /* non configurable DSP phy data byte count */ u8 cfg_phy_cnt; /* configurable DSP phy data byte count */ u8 stat_id; /* configurable DSP phy data set ID */ @@ -1120,7 +1101,8 @@ struct iwl_rx_phy_res { __le32 beacon_time_stamp; /* beacon at on-air rise */ __le16 phy_flags; /* general phy flags: band, modulation, ... */ __le16 channel; /* channel number */ - u8 non_cfg_phy_buf[32]; /* for various implementations of non_cfg_phy */ + __le16 non_cfg_phy[RX_RES_PHY_CNT]; /* upto 14 phy entries */ + __le32 reserved2; __le32 rate_n_flags; /* RATE_MCS_* */ __le16 byte_count; /* frame's byte-count */ __le16 reserved3; @@ -2011,7 +1993,7 @@ struct iwl4965_spectrum_notification { *****************************************************************************/ /** - * struct iwl_powertable_cmd - Power Table Command + * struct iwl4965_powertable_cmd - Power Table Command * @flags: See below: * * POWER_TABLE_CMD = 0x77 (command, has simple generic response) @@ -2045,7 +2027,7 @@ struct iwl4965_spectrum_notification { #define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le16(1 << 3) #define IWL_POWER_FAST_PD __constant_cpu_to_le16(1 << 4) -struct iwl_powertable_cmd { +struct iwl4965_powertable_cmd { __le16 flags; u8 keep_alive_seconds; u8 debug_flags; @@ -2342,7 +2324,7 @@ struct iwl4965_beacon_notif { /* * REPLY_TX_BEACON = 0x91 (command, has simple generic response) */ -struct iwl_tx_beacon_cmd { +struct iwl4965_tx_beacon_cmd { struct iwl_tx_cmd tx; __le16 tim_idx; u8 tim_size; diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-core.c b/trunk/drivers/net/wireless/iwlwifi/iwl-core.c index 9bd61809129f..e3427c205ccf 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-core.c @@ -383,8 +383,8 @@ void iwl_reset_qos(struct iwl_priv *priv) } EXPORT_SYMBOL(iwl_reset_qos); -#define MAX_BIT_RATE_40_MHZ 0x96 /* 150 Mbps */ -#define MAX_BIT_RATE_20_MHZ 0x48 /* 72 Mbps */ +#define MAX_BIT_RATE_40_MHZ 0x96; /* 150 Mbps */ +#define MAX_BIT_RATE_20_MHZ 0x48; /* 72 Mbps */ static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv, struct ieee80211_ht_info *ht_info, enum ieee80211_band band) @@ -815,7 +815,7 @@ int iwl_setup_mac(struct iwl_priv *priv) { int ret; struct ieee80211_hw *hw = priv->hw; - hw->rate_control_algorithm = "iwl-agn-rs"; + hw->rate_control_algorithm = "iwl-4965-rs"; /* Tell mac80211 our characteristics */ hw->flags = IEEE80211_HW_SIGNAL_DBM | @@ -827,7 +827,6 @@ int iwl_setup_mac(struct iwl_priv *priv) hw->ampdu_queues = priv->cfg->mod_params->num_of_ampdu_queues; hw->conf.beacon_int = 100; - hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL; if (priv->bands[IEEE80211_BAND_2GHZ].n_channels) priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-core.h b/trunk/drivers/net/wireless/iwlwifi/iwl-core.h index 64f139e97444..db66114f1e56 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-core.h @@ -95,8 +95,6 @@ struct iwl_hcmd_utils_ops { void (*chain_noise_reset)(struct iwl_priv *priv); void (*rts_tx_cmd_flag)(struct ieee80211_tx_info *info, __le32 *tx_flags); - int (*calc_rssi)(struct iwl_priv *priv, - struct iwl_rx_phy_res *rx_resp); }; struct iwl_lib_ops { @@ -141,6 +139,7 @@ struct iwl_lib_ops { int (*set_pwr_src)(struct iwl_priv *priv, enum iwl_pwr_src src); } apm_ops; /* power */ + int (*set_power)(struct iwl_priv *priv, void *cmd); int (*send_tx_power) (struct iwl_priv *priv); void (*update_chain_flags)(struct iwl_priv *priv); void (*temperature) (struct iwl_priv *priv); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-csr.h b/trunk/drivers/net/wireless/iwlwifi/iwl-csr.h index 52629fbd835a..545ed692d889 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-csr.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-csr.h @@ -104,7 +104,6 @@ * 3-2: 0 = A, 1 = B, 2 = C, 3 = D step */ #define CSR_HW_REV_WA_REG (CSR_BASE+0x22C) -#define CSR_DBG_HPET_MEM_REG (CSR_BASE+0x240) /* Bits for CSR_HW_IF_CONFIG_REG */ #define CSR49_HW_IF_CONFIG_REG_BIT_4965_R (0x00000010) @@ -119,12 +118,7 @@ #define CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A (0x00000000) #define CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B (0x00001000) -#define CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A (0x00080000) -#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000) -#define CSR_HW_IF_CONFIG_REG_BIT_PCI_OWN_SEM (0x00400000) -#define CSR_HW_IF_CONFIG_REG_BIT_ME_OWN (0x02000000) -#define CSR_HW_IF_CONFIG_REG_BIT_WAKE_ME (0x08000000) - +#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000) /* interrupt flags in INTA, set by uCode or hardware (e.g. dma), * acknowledged (reset) by host writing "1" to flagged bits. */ @@ -242,8 +236,6 @@ #define CSR39_ANA_PLL_CFG_VAL (0x01000000) #define CSR50_ANA_PLL_CFG_VAL (0x00880300) -/* HPET MEM debug */ -#define CSR_DBG_HPET_MEM_REG_VAL (0xFFFF0000) /*=== HBUS (Host-side Bus) ===*/ #define HBUS_BASE (0x400) /* diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-debug.h b/trunk/drivers/net/wireless/iwlwifi/iwl-debug.h index b4ffd33ef98c..d6d729e86bdb 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-debug.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-debug.h @@ -33,12 +33,12 @@ #define IWL_DEBUG(level, fmt, args...) \ do { if (priv->debug_level & (level)) \ dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ - in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0) + in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) #define IWL_DEBUG_LIMIT(level, fmt, args...) \ do { if ((priv->debug_level & (level)) && net_ratelimit()) \ dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \ - in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0) + in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) #ifdef CONFIG_IWLWIFI_DEBUGFS struct iwl_debugfs { diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/trunk/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 20db0eb636a8..ed948dc59b3d 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-debugfs.c @@ -231,7 +231,7 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf, DECLARE_MAC_BUF(mac); buf = kmalloc(bufsz, GFP_KERNEL); - if (!buf) + if(!buf) return -ENOMEM; pos += scnprintf(buf + pos, bufsz - pos, "num of stations: %d\n\n", @@ -364,19 +364,16 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) { struct iwl_debugfs *dbgfs; struct dentry *phyd = priv->hw->wiphy->debugfsdir; - int ret = 0; dbgfs = kzalloc(sizeof(struct iwl_debugfs), GFP_KERNEL); if (!dbgfs) { - ret = -ENOMEM; goto err; } priv->dbgfs = dbgfs; dbgfs->name = name; dbgfs->dir_drv = debugfs_create_dir(name, phyd); - if (!dbgfs->dir_drv || IS_ERR(dbgfs->dir_drv)) { - ret = -ENOENT; + if (!dbgfs->dir_drv || IS_ERR(dbgfs->dir_drv)){ goto err; } @@ -397,7 +394,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) err: IWL_ERROR("Can't open the debugfs directory\n"); iwl_dbgfs_unregister(priv); - return ret; + return -ENOENT; } EXPORT_SYMBOL(iwl_dbgfs_register); @@ -407,7 +404,7 @@ EXPORT_SYMBOL(iwl_dbgfs_register); */ void iwl_dbgfs_unregister(struct iwl_priv *priv) { - if (!priv->dbgfs) + if (!(priv->dbgfs)) return; DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_eeprom); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-dev.h b/trunk/drivers/net/wireless/iwlwifi/iwl-dev.h index c19db438306c..4d789e353e3a 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-dev.h @@ -36,7 +36,7 @@ #include #include -#define DRV_NAME "iwlagn" +#define DRV_NAME "iwl4965" #include "iwl-rfkill.h" #include "iwl-eeprom.h" #include "iwl-4965-hw.h" @@ -45,7 +45,6 @@ #include "iwl-debug.h" #include "iwl-led.h" #include "iwl-power.h" -#include "iwl-agn-rs.h" /* configuration for the iwl4965 */ extern struct iwl_cfg iwl4965_agn_cfg; @@ -135,7 +134,8 @@ struct iwl_tx_info { struct iwl_tx_queue { struct iwl_queue q; struct iwl_tfd_frame *bd; - struct iwl_cmd *cmd[TFD_TX_CMD_SLOTS]; + struct iwl_cmd *cmd; + dma_addr_t dma_addr_cmd; struct iwl_tx_info *txb; int need_update; int sched_retry; @@ -191,6 +191,7 @@ struct iwl4965_clip_group { const s8 clip_powers[IWL_MAX_RATES]; }; +#include "iwl-4965-rs.h" #define IWL_TX_FIFO_AC0 0 #define IWL_TX_FIFO_AC1 1 @@ -218,7 +219,7 @@ enum iwl_pwr_src { struct iwl_frame { union { struct ieee80211_hdr frame; - struct iwl_tx_beacon_cmd beacon; + struct iwl4965_tx_beacon_cmd beacon; u8 raw[IEEE80211_FRAME_LEN]; u8 cmd[360]; } u; @@ -282,9 +283,10 @@ struct iwl_cmd { u32 val32; struct iwl4965_bt_cmd bt; struct iwl4965_rxon_time_cmd rxon_time; - struct iwl_powertable_cmd powertable; + struct iwl4965_powertable_cmd powertable; struct iwl_qosparam_cmd qosparam; struct iwl_tx_cmd tx; + struct iwl4965_tx_beacon_cmd tx_beacon; struct iwl4965_rxon_assoc_cmd rxon_assoc; struct iwl_rem_sta_cmd rm_sta; u8 *indirect; @@ -588,7 +590,6 @@ extern unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv, const u8 *dest, int left); extern void iwl4965_update_chain_flags(struct iwl_priv *priv); int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src); -extern int iwl4965_set_power(struct iwl_priv *priv, void *cmd); extern const u8 iwl_bcast_addr[ETH_ALEN]; @@ -641,6 +642,10 @@ struct iwl_priv; * Forward declare iwl-4965.c functions for iwl-base.c */ extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv); + +int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, + enum ieee80211_ampdu_mlme_action action, + const u8 *addr, u16 tid, u16 *ssn); int iwl4965_check_empty_hw_queue(struct iwl_priv *priv, int sta_id, u8 tid, int txq_id); @@ -807,11 +812,14 @@ struct iwl_chain_noise_data { #define EEPROM_SEM_RETRY_LIMIT 1000 /* number of attempts (not time) */ +#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT + enum { MEASUREMENT_READY = (1 << 0), MEASUREMENT_ACTIVE = (1 << 1), }; +#endif #define IWL_MAX_NUM_QUEUES 20 /* FIXME: do dynamic allocation */ @@ -836,7 +844,7 @@ struct iwl_priv { struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; -#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT +#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT /* spectrum measurement report caching */ struct iwl4965_spectrum_notification measure_report; u8 measurement_status; diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/trunk/drivers/net/wireless/iwlwifi/iwl-eeprom.c index bce53830b301..4a08a1b50979 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-eeprom.c @@ -273,7 +273,8 @@ EXPORT_SYMBOL(iwl_eeprom_init); void iwl_eeprom_free(struct iwl_priv *priv) { - kfree(priv->eeprom); + if(priv->eeprom) + kfree(priv->eeprom); priv->eeprom = NULL; } EXPORT_SYMBOL(iwl_eeprom_free); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c index 6512834bb916..8fa991b7202a 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-hcmd.c @@ -228,7 +228,7 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd) * TX cmd queue. Otherwise in case the cmd comes * in later, it will possibly set an invalid * address (cmd->meta.source). */ - qcmd = priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_idx]; + qcmd = &priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_idx]; qcmd->meta.flags &= ~CMD_WANT_SKB; } fail: diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-led.c b/trunk/drivers/net/wireless/iwlwifi/iwl-led.c index cb11c4a4d691..61250e6a7d1b 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-led.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-led.c @@ -161,31 +161,11 @@ int iwl4965_led_off(struct iwl_priv *priv, int led_id) /* Set led register off */ static int iwl4965_led_off_reg(struct iwl_priv *priv, int led_id) { - IWL_DEBUG_LED("LED Reg off\n"); + IWL_DEBUG_LED("radio off\n"); iwl_write32(priv, CSR_LED_REG, CSR_LED_REG_TRUN_OFF); return 0; } -/* - * Set led register in case of disassociation according to rfkill state - */ -static int iwl_led_associate(struct iwl_priv *priv, int led_id) -{ - IWL_DEBUG_LED("Associated\n"); - priv->allow_blinking = 1; - return iwl4965_led_on_reg(priv, led_id); -} -static int iwl_led_disassociate(struct iwl_priv *priv, int led_id) -{ - priv->allow_blinking = 0; - if (iwl_is_rfkill(priv)) - iwl4965_led_off_reg(priv, led_id); - else - iwl4965_led_on_reg(priv, led_id); - - return 0; -} - /* * brightness call back function for Tx/Rx LED */ @@ -219,10 +199,16 @@ static void iwl_led_brightness_set(struct led_classdev *led_cdev, led_type_str[led->type], brightness); switch (brightness) { case LED_FULL: + if (led->type == IWL_LED_TRG_ASSOC) + priv->allow_blinking = 1; + if (led->led_on) led->led_on(priv, IWL_LED_LINK); break; case LED_OFF: + if (led->type == IWL_LED_TRG_ASSOC) + priv->allow_blinking = 0; + if (led->led_off) led->led_off(priv, IWL_LED_LINK); break; @@ -242,12 +228,12 @@ static void iwl_led_brightness_set(struct led_classdev *led_cdev, */ static int iwl_leds_register_led(struct iwl_priv *priv, struct iwl_led *led, enum led_type type, u8 set_led, - char *trigger) + const char *name, char *trigger) { struct device *device = wiphy_dev(priv->hw->wiphy); int ret; - led->led_dev.name = led->name; + led->led_dev.name = name; led->led_dev.brightness_set = iwl_led_brightness_set; led->led_dev.default_trigger = trigger; @@ -298,6 +284,12 @@ static int iwl_get_blink_rate(struct iwl_priv *priv) return i; } +static inline int is_rf_kill(struct iwl_priv *priv) +{ + return test_bit(STATUS_RF_KILL_HW, &priv->status) || + test_bit(STATUS_RF_KILL_SW, &priv->status); +} + /* * this function called from handler. Since setting Led command can * happen very frequent we postpone led command to be called from @@ -311,7 +303,7 @@ void iwl_leds_background(struct iwl_priv *priv) priv->last_blink_time = 0; return; } - if (iwl_is_rfkill(priv)) { + if (is_rf_kill(priv)) { priv->last_blink_time = 0; return; } @@ -345,6 +337,7 @@ EXPORT_SYMBOL(iwl_leds_background); int iwl_leds_register(struct iwl_priv *priv) { char *trigger; + char name[32]; int ret; priv->last_blink_rate = 0; @@ -353,8 +346,7 @@ int iwl_leds_register(struct iwl_priv *priv) priv->allow_blinking = 0; trigger = ieee80211_get_radio_led_name(priv->hw); - snprintf(priv->led[IWL_LED_TRG_RADIO].name, - sizeof(priv->led[IWL_LED_TRG_RADIO].name), "iwl-%s:radio", + snprintf(name, sizeof(name), "iwl-%s:radio", wiphy_name(priv->hw->wiphy)); priv->led[IWL_LED_TRG_RADIO].led_on = iwl4965_led_on_reg; @@ -362,33 +354,31 @@ int iwl_leds_register(struct iwl_priv *priv) priv->led[IWL_LED_TRG_RADIO].led_pattern = NULL; ret = iwl_leds_register_led(priv, &priv->led[IWL_LED_TRG_RADIO], - IWL_LED_TRG_RADIO, 1, trigger); + IWL_LED_TRG_RADIO, 1, name, trigger); if (ret) goto exit_fail; trigger = ieee80211_get_assoc_led_name(priv->hw); - snprintf(priv->led[IWL_LED_TRG_ASSOC].name, - sizeof(priv->led[IWL_LED_TRG_ASSOC].name), "iwl-%s:assoc", + snprintf(name, sizeof(name), "iwl-%s:assoc", wiphy_name(priv->hw->wiphy)); ret = iwl_leds_register_led(priv, &priv->led[IWL_LED_TRG_ASSOC], - IWL_LED_TRG_ASSOC, 0, trigger); + IWL_LED_TRG_ASSOC, 0, name, trigger); /* for assoc always turn led on */ - priv->led[IWL_LED_TRG_ASSOC].led_on = iwl_led_associate; - priv->led[IWL_LED_TRG_ASSOC].led_off = iwl_led_disassociate; + priv->led[IWL_LED_TRG_ASSOC].led_on = iwl4965_led_on_reg; + priv->led[IWL_LED_TRG_ASSOC].led_off = iwl4965_led_on_reg; priv->led[IWL_LED_TRG_ASSOC].led_pattern = NULL; if (ret) goto exit_fail; trigger = ieee80211_get_rx_led_name(priv->hw); - snprintf(priv->led[IWL_LED_TRG_RX].name, - sizeof(priv->led[IWL_LED_TRG_RX].name), "iwl-%s:RX", - wiphy_name(priv->hw->wiphy)); + snprintf(name, sizeof(name), "iwl-%s:RX", wiphy_name(priv->hw->wiphy)); + ret = iwl_leds_register_led(priv, &priv->led[IWL_LED_TRG_RX], - IWL_LED_TRG_RX, 0, trigger); + IWL_LED_TRG_RX, 0, name, trigger); priv->led[IWL_LED_TRG_RX].led_on = iwl_led_associated; priv->led[IWL_LED_TRG_RX].led_off = iwl_led_associated; @@ -398,12 +388,9 @@ int iwl_leds_register(struct iwl_priv *priv) goto exit_fail; trigger = ieee80211_get_tx_led_name(priv->hw); - snprintf(priv->led[IWL_LED_TRG_TX].name, - sizeof(priv->led[IWL_LED_TRG_TX].name), "iwl-%s:TX", - wiphy_name(priv->hw->wiphy)); - + snprintf(name, sizeof(name), "iwl-%s:TX", wiphy_name(priv->hw->wiphy)); ret = iwl_leds_register_led(priv, &priv->led[IWL_LED_TRG_TX], - IWL_LED_TRG_TX, 0, trigger); + IWL_LED_TRG_TX, 0, name, trigger); priv->led[IWL_LED_TRG_TX].led_on = iwl_led_associated; priv->led[IWL_LED_TRG_TX].led_off = iwl_led_associated; diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-led.h b/trunk/drivers/net/wireless/iwlwifi/iwl-led.h index 588c9ad20e83..1980ae5a7e82 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-led.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-led.h @@ -52,7 +52,6 @@ enum led_type { struct iwl_led { struct iwl_priv *priv; struct led_classdev led_dev; - char name[32]; int (*led_on) (struct iwl_priv *priv, int led_id); int (*led_off) (struct iwl_priv *priv, int led_id); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-power.c b/trunk/drivers/net/wireless/iwlwifi/iwl-power.c index 028e3053c0ca..2e71803e09ba 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-power.c @@ -82,7 +82,7 @@ /* default power management (not Tx power) table values */ /* for tim 0-10 */ -static struct iwl_power_vec_entry range_0[IWL_POWER_MAX] = { +static struct iwl_power_vec_entry range_0[IWL_POWER_AC] = { {{NOSLP, SLP_TOUT(0), SLP_TOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0}, {{SLP, SLP_TOUT(200), SLP_TOUT(500), SLP_VEC(1, 2, 2, 2, 0xFF)}, 0}, {{SLP, SLP_TOUT(200), SLP_TOUT(300), SLP_VEC(1, 2, 2, 2, 0xFF)}, 0}, @@ -93,7 +93,7 @@ static struct iwl_power_vec_entry range_0[IWL_POWER_MAX] = { /* for tim = 3-10 */ -static struct iwl_power_vec_entry range_1[IWL_POWER_MAX] = { +static struct iwl_power_vec_entry range_1[IWL_POWER_AC] = { {{NOSLP, SLP_TOUT(0), SLP_TOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0}, {{SLP, SLP_TOUT(200), SLP_TOUT(500), SLP_VEC(1, 2, 3, 4, 4)}, 0}, {{SLP, SLP_TOUT(200), SLP_TOUT(300), SLP_VEC(1, 2, 3, 4, 7)}, 0}, @@ -103,7 +103,7 @@ static struct iwl_power_vec_entry range_1[IWL_POWER_MAX] = { }; /* for tim > 11 */ -static struct iwl_power_vec_entry range_2[IWL_POWER_MAX] = { +static struct iwl_power_vec_entry range_2[IWL_POWER_AC] = { {{NOSLP, SLP_TOUT(0), SLP_TOUT(0), SLP_VEC(0, 0, 0, 0, 0)}, 0}, {{SLP, SLP_TOUT(200), SLP_TOUT(500), SLP_VEC(1, 2, 3, 4, 0xFF)}, 0}, {{SLP, SLP_TOUT(200), SLP_TOUT(300), SLP_VEC(2, 4, 6, 7, 0xFF)}, 0}, @@ -112,19 +112,12 @@ static struct iwl_power_vec_entry range_2[IWL_POWER_MAX] = { {{SLP, SLP_TOUT(25), SLP_TOUT(25), SLP_VEC(4, 7, 10, 10, 0xFF)}, 0} }; -/* set card power command */ -static int iwl_set_power(struct iwl_priv *priv, void *cmd) -{ - return iwl_send_cmd_pdu_async(priv, POWER_TABLE_CMD, - sizeof(struct iwl_powertable_cmd), - cmd, NULL); -} /* decide the right power level according to association status * and battery status */ static u16 iwl_get_auto_power_mode(struct iwl_priv *priv) { - u16 mode; + u16 mode = priv->power_data.user_power_setting; switch (priv->power_data.user_power_setting) { case IWL_POWER_AUTO: @@ -136,16 +129,12 @@ static u16 iwl_get_auto_power_mode(struct iwl_priv *priv) else mode = IWL_POWER_ON_AC_DISASSOC; break; - /* FIXME: remove battery and ac from here */ case IWL_POWER_BATTERY: mode = IWL_POWER_INDEX_3; break; case IWL_POWER_AC: mode = IWL_POWER_MODE_CAM; break; - default: - mode = priv->power_data.user_power_setting; - break; } return mode; } @@ -155,7 +144,7 @@ static int iwl_power_init_handle(struct iwl_priv *priv) { int ret = 0, i; struct iwl_power_mgr *pow_data; - int size = sizeof(struct iwl_power_vec_entry) * IWL_POWER_MAX; + int size = sizeof(struct iwl_power_vec_entry) * IWL_POWER_AC; u16 pci_pm; IWL_DEBUG_POWER("Initialize power \n"); @@ -173,11 +162,11 @@ static int iwl_power_init_handle(struct iwl_priv *priv) if (ret != 0) return 0; else { - struct iwl_powertable_cmd *cmd; + struct iwl4965_powertable_cmd *cmd; IWL_DEBUG_POWER("adjust power command flags\n"); - for (i = 0; i < IWL_POWER_MAX; i++) { + for (i = 0; i < IWL_POWER_AC; i++) { cmd = &pow_data->pwr_range_0[i].cmd; if (pci_pm & 0x1) @@ -191,7 +180,7 @@ static int iwl_power_init_handle(struct iwl_priv *priv) /* adjust power command according to dtim period and power level*/ static int iwl_update_power_command(struct iwl_priv *priv, - struct iwl_powertable_cmd *cmd, + struct iwl4965_powertable_cmd *cmd, u16 mode) { int ret = 0, i; @@ -215,7 +204,7 @@ static int iwl_update_power_command(struct iwl_priv *priv, range = &pow_data->pwr_range_2[0]; period = pow_data->dtim_period; - memcpy(cmd, &range[mode].cmd, sizeof(struct iwl_powertable_cmd)); + memcpy(cmd, &range[mode].cmd, sizeof(struct iwl4965_powertable_cmd)); if (period == 0) { period = 1; @@ -269,18 +258,17 @@ int iwl_power_update_mode(struct iwl_priv *priv, u8 refresh) * else user level */ switch (setting->system_power_setting) { - case IWL_POWER_SYS_AUTO: + case IWL_POWER_AUTO: final_mode = iwl_get_auto_power_mode(priv); break; - case IWL_POWER_SYS_BATTERY: + case IWL_POWER_BATTERY: final_mode = IWL_POWER_INDEX_3; break; - case IWL_POWER_SYS_AC: + case IWL_POWER_AC: final_mode = IWL_POWER_MODE_CAM; break; default: - final_mode = IWL_POWER_INDEX_3; - WARN_ON(1); + final_mode = setting->system_power_setting; } if (setting->critical_power_setting > final_mode) @@ -292,7 +280,7 @@ int iwl_power_update_mode(struct iwl_priv *priv, u8 refresh) if (!iwl_is_rfkill(priv) && !setting->power_disabled && ((setting->power_mode != final_mode) || refresh)) { - struct iwl_powertable_cmd cmd; + struct iwl4965_powertable_cmd cmd; if (final_mode != IWL_POWER_MODE_CAM) set_bit(STATUS_POWER_PMI, &priv->status); @@ -303,7 +291,8 @@ int iwl_power_update_mode(struct iwl_priv *priv, u8 refresh) if (final_mode == IWL_POWER_INDEX_5) cmd.flags |= IWL_POWER_FAST_PD; - ret = iwl_set_power(priv, &cmd); + if (priv->cfg->ops->lib->set_power) + ret = priv->cfg->ops->lib->set_power(priv, &cmd); if (final_mode == IWL_POWER_MODE_CAM) clear_bit(STATUS_POWER_PMI, &priv->status); @@ -399,7 +388,7 @@ void iwl_power_initialize(struct iwl_priv *priv) iwl_power_init_handle(priv); priv->power_data.user_power_setting = IWL_POWER_AUTO; priv->power_data.power_disabled = 0; - priv->power_data.system_power_setting = IWL_POWER_SYS_AUTO; + priv->power_data.system_power_setting = IWL_POWER_AUTO; priv->power_data.is_battery_active = 0; priv->power_data.power_disabled = 0; priv->power_data.critical_power_setting = 0; diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-power.h b/trunk/drivers/net/wireless/iwlwifi/iwl-power.h index abcbbf96a84e..b066724a1c2b 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-power.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-power.h @@ -33,25 +33,12 @@ struct iwl_priv; -enum { - IWL_POWER_MODE_CAM, /* Continuously Aware Mode, always on */ - IWL_POWER_INDEX_1, - IWL_POWER_INDEX_2, - IWL_POWER_INDEX_3, - IWL_POWER_INDEX_4, - IWL_POWER_INDEX_5, - IWL_POWER_AUTO, - IWL_POWER_MAX = IWL_POWER_AUTO, - IWL_POWER_AC, - IWL_POWER_BATTERY, -}; - -enum { - IWL_POWER_SYS_AUTO, - IWL_POWER_SYS_AC, - IWL_POWER_SYS_BATTERY, -}; - +#define IWL_POWER_MODE_CAM 0x00 /* Continuously Aware Mode, always on */ +#define IWL_POWER_INDEX_3 0x03 +#define IWL_POWER_INDEX_5 0x05 +#define IWL_POWER_AC 0x06 +#define IWL_POWER_BATTERY 0x07 +#define IWL_POWER_AUTO 0x08 #define IWL_POWER_LIMIT 0x08 #define IWL_POWER_MASK 0x0F #define IWL_POWER_ENABLED 0x10 @@ -59,15 +46,15 @@ enum { /* Power management (not Tx power) structures */ struct iwl_power_vec_entry { - struct iwl_powertable_cmd cmd; + struct iwl4965_powertable_cmd cmd; u8 no_dtim; }; struct iwl_power_mgr { spinlock_t lock; - struct iwl_power_vec_entry pwr_range_0[IWL_POWER_MAX]; - struct iwl_power_vec_entry pwr_range_1[IWL_POWER_MAX]; - struct iwl_power_vec_entry pwr_range_2[IWL_POWER_MAX]; + struct iwl_power_vec_entry pwr_range_0[IWL_POWER_AC]; + struct iwl_power_vec_entry pwr_range_1[IWL_POWER_AC]; + struct iwl_power_vec_entry pwr_range_2[IWL_POWER_AC]; u32 dtim_period; /* final power level that used to calculate final power command */ u8 power_mode; diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-prph.h b/trunk/drivers/net/wireless/iwlwifi/iwl-prph.h index ee5afd48d3af..70d9c7568b98 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-prph.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-prph.h @@ -84,16 +84,14 @@ #define APMG_CLK_VAL_DMA_CLK_RQT (0x00000200) #define APMG_CLK_VAL_BSM_CLK_RQT (0x00000800) +#define APMG_PS_CTRL_VAL_RESET_REQ (0x04000000) -#define APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS (0x00400000) -#define APMG_PS_CTRL_VAL_RESET_REQ (0x04000000) -#define APMG_PS_CTRL_MSK_PWR_SRC (0x03000000) -#define APMG_PS_CTRL_VAL_PWR_SRC_VMAIN (0x00000000) -#define APMG_PS_CTRL_VAL_PWR_SRC_MAX (0x01000000) /* 3945 only */ -#define APMG_PS_CTRL_VAL_PWR_SRC_VAUX (0x02000000) +#define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800) +#define APMG_PS_CTRL_MSK_PWR_SRC (0x03000000) +#define APMG_PS_CTRL_VAL_PWR_SRC_VMAIN (0x00000000) +#define APMG_PS_CTRL_VAL_PWR_SRC_VAUX (0x01000000) -#define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800) /** * BSM (Bootstrap State Machine) diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c b/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c index f3f6ea49fdd2..e2d9afba38a5 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c @@ -791,7 +791,7 @@ static inline void iwl_dbg_report_frame(struct iwl_priv *priv, static void iwl_add_radiotap(struct iwl_priv *priv, struct sk_buff *skb, - struct iwl_rx_phy_res *rx_start, + struct iwl4965_rx_phy_res *rx_start, struct ieee80211_rx_status *stats, u32 ampdu_status) { @@ -1010,8 +1010,8 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv, struct ieee80211_rx_status *stats) { struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; - struct iwl_rx_phy_res *rx_start = (include_phy) ? - (struct iwl_rx_phy_res *)&(pkt->u.raw[0]) : NULL; + struct iwl4965_rx_phy_res *rx_start = (include_phy) ? + (struct iwl4965_rx_phy_res *)&(pkt->u.raw[0]) : NULL; struct ieee80211_hdr *hdr; u16 len; __le32 *rx_end; @@ -1020,7 +1020,7 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv, u32 ampdu_status_legacy; if (!include_phy && priv->last_phy_res[0]) - rx_start = (struct iwl_rx_phy_res *)&priv->last_phy_res[1]; + rx_start = (struct iwl4965_rx_phy_res *)&priv->last_phy_res[1]; if (!rx_start) { IWL_ERROR("MPDU frame without a PHY data\n"); @@ -1032,8 +1032,8 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv, len = le16_to_cpu(rx_start->byte_count); - rx_end = (__le32 *)((u8 *) &pkt->u.raw[0] + - sizeof(struct iwl_rx_phy_res) + + rx_end = (__le32 *) ((u8 *) &pkt->u.raw[0] + + sizeof(struct iwl4965_rx_phy_res) + rx_start->cfg_phy_cnt + len); } else { @@ -1084,13 +1084,40 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv, } /* Calc max signal level (dBm) among 3 possible receivers */ -static inline int iwl_calc_rssi(struct iwl_priv *priv, - struct iwl_rx_phy_res *rx_resp) +static int iwl_calc_rssi(struct iwl_priv *priv, + struct iwl4965_rx_phy_res *rx_resp) { - return priv->cfg->ops->utils->calc_rssi(priv, rx_resp); + /* data from PHY/DSP regarding signal strength, etc., + * contents are always there, not configurable by host. */ + struct iwl4965_rx_non_cfg_phy *ncphy = + (struct iwl4965_rx_non_cfg_phy *)rx_resp->non_cfg_phy; + u32 agc = (le16_to_cpu(ncphy->agc_info) & IWL_AGC_DB_MASK) + >> IWL_AGC_DB_POS; + + u32 valid_antennae = + (le16_to_cpu(rx_resp->phy_flags) & RX_PHY_FLAGS_ANTENNAE_MASK) + >> RX_PHY_FLAGS_ANTENNAE_OFFSET; + u8 max_rssi = 0; + u32 i; + + /* Find max rssi among 3 possible receivers. + * These values are measured by the digital signal processor (DSP). + * They should stay fairly constant even as the signal strength varies, + * if the radio's automatic gain control (AGC) is working right. + * AGC value (see below) will provide the "interesting" info. */ + for (i = 0; i < 3; i++) + if (valid_antennae & (1 << i)) + max_rssi = max(ncphy->rssi_info[i << 1], max_rssi); + + IWL_DEBUG_STATS("Rssi In A %d B %d C %d Max %d AGC dB %d\n", + ncphy->rssi_info[0], ncphy->rssi_info[2], ncphy->rssi_info[4], + max_rssi, agc); + + /* dBm = max_rssi dB - agc dB - constant. + * Higher AGC (higher radio gain) means lower signal. */ + return max_rssi - agc - IWL_RSSI_OFFSET; } - static void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id) { unsigned long flags; @@ -1153,9 +1180,9 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, * this rx packet for legacy frames, * or phy data cached from REPLY_RX_PHY_CMD for HT frames. */ int include_phy = (pkt->hdr.cmd == REPLY_RX); - struct iwl_rx_phy_res *rx_start = (include_phy) ? - (struct iwl_rx_phy_res *)&(pkt->u.raw[0]) : - (struct iwl_rx_phy_res *)&priv->last_phy_res[1]; + struct iwl4965_rx_phy_res *rx_start = (include_phy) ? + (struct iwl4965_rx_phy_res *)&(pkt->u.raw[0]) : + (struct iwl4965_rx_phy_res *)&priv->last_phy_res[1]; __le32 *rx_end; unsigned int len = 0; u16 fc; @@ -1183,7 +1210,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, if (!include_phy) { if (priv->last_phy_res[0]) - rx_start = (struct iwl_rx_phy_res *) + rx_start = (struct iwl4965_rx_phy_res *) &priv->last_phy_res[1]; else rx_start = NULL; @@ -1200,7 +1227,7 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, len = le16_to_cpu(rx_start->byte_count); rx_end = (__le32 *)(pkt->u.raw + rx_start->cfg_phy_cnt + - sizeof(struct iwl_rx_phy_res) + len); + sizeof(struct iwl4965_rx_phy_res) + len); } else { struct iwl4965_rx_mpdu_res_start *amsdu = (struct iwl4965_rx_mpdu_res_start *)pkt->u.raw; @@ -1289,6 +1316,6 @@ void iwl_rx_reply_rx_phy(struct iwl_priv *priv, struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; priv->last_phy_res[0] = 1; memcpy(&priv->last_phy_res[1], &(pkt->u.raw[0]), - sizeof(struct iwl_rx_phy_res)); + sizeof(struct iwl4965_rx_phy_res)); } EXPORT_SYMBOL(iwl_rx_reply_rx_phy); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-scan.c b/trunk/drivers/net/wireless/iwlwifi/iwl-scan.c index 9bb6adb28b73..5a00ac23e2d0 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-scan.c @@ -202,7 +202,6 @@ static int iwl_send_scan_abort(struct iwl_priv *priv) clear_bit(STATUS_SCAN_HW, &priv->status); } - priv->alloc_rxb_skb--; dev_kfree_skb_any(cmd.meta.u.skb); return ret; diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-sta.c b/trunk/drivers/net/wireless/iwlwifi/iwl-sta.c index 60a6e0106036..6d1467d0bd9d 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-sta.c @@ -823,7 +823,7 @@ int iwl_send_lq_cmd(struct iwl_priv *priv, if (lq->sta_id == 0xFF) lq->sta_id = IWL_AP_ID; - iwl_dump_lq_cmd(priv, lq); + iwl_dump_lq_cmd(priv,lq); if (iwl_is_associated(priv) && priv->assoc_station_added) return iwl_send_cmd(priv, &cmd); @@ -839,7 +839,7 @@ EXPORT_SYMBOL(iwl_send_lq_cmd); * for automatic fallback during transmission. * * NOTE: This sets up a default set of values. These will be replaced later - * if the driver's iwl-agn-rs rate scaling algorithm is used, instead of + * if the driver's iwl-4965-rs rate scaling algorithm is used, instead of * rc80211_simple. * * NOTE: Run REPLY_ADD_STA command to set up station table entry, before diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-tx.c b/trunk/drivers/net/wireless/iwlwifi/iwl-tx.c index aa98c76d8195..f72cd0bf6aa3 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-tx.c @@ -208,12 +208,11 @@ EXPORT_SYMBOL(iwl_txq_update_write_ptr); * Free all buffers. * 0-fill, but do not free "txq" descriptor structure. */ -static void iwl_tx_queue_free(struct iwl_priv *priv, int txq_id) +static void iwl_tx_queue_free(struct iwl_priv *priv, struct iwl_tx_queue *txq) { - struct iwl_tx_queue *txq = &priv->txq[txq_id]; struct iwl_queue *q = &txq->q; struct pci_dev *dev = priv->pci_dev; - int i, slots_num, len; + int len; if (q->n_bd == 0) return; @@ -228,12 +227,7 @@ static void iwl_tx_queue_free(struct iwl_priv *priv, int txq_id) len += IWL_MAX_SCAN_SIZE; /* De-alloc array of command/tx buffers */ - slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ? - TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; - for (i = 0; i < slots_num; i++) - kfree(txq->cmd[i]); - if (txq_id == IWL_CMD_QUEUE_NUM) - kfree(txq->cmd[slots_num]); + pci_free_consistent(dev, len, txq->cmd, txq->dma_addr_cmd); /* De-alloc circular buffer of TFDs */ if (txq->q.n_bd) @@ -406,7 +400,8 @@ static int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq, int slots_num, u32 txq_id) { - int i, len; + struct pci_dev *dev = priv->pci_dev; + int len; int rc = 0; /* @@ -417,25 +412,17 @@ static int iwl_tx_queue_init(struct iwl_priv *priv, * For normal Tx queues (all other queues), no super-size command * space is needed. */ - len = sizeof(struct iwl_cmd); - for (i = 0; i <= slots_num; i++) { - if (i == slots_num) { - if (txq_id == IWL_CMD_QUEUE_NUM) - len += IWL_MAX_SCAN_SIZE; - else - continue; - } - - txq->cmd[i] = kmalloc(len, GFP_KERNEL | GFP_DMA); - if (!txq->cmd[i]) - return -ENOMEM; - } + len = sizeof(struct iwl_cmd) * slots_num; + if (txq_id == IWL_CMD_QUEUE_NUM) + len += IWL_MAX_SCAN_SIZE; + txq->cmd = pci_alloc_consistent(dev, len, &txq->dma_addr_cmd); + if (!txq->cmd) + return -ENOMEM; /* Alloc driver data array and TFD circular buffer */ rc = iwl_tx_queue_alloc(priv, txq, txq_id); if (rc) { - for (i = 0; i < slots_num; i++) - kfree(txq->cmd[i]); + pci_free_consistent(dev, len, txq->cmd, txq->dma_addr_cmd); return -ENOMEM; } @@ -464,7 +451,7 @@ void iwl_hw_txq_ctx_free(struct iwl_priv *priv) /* Tx queues */ for (txq_id = 0; txq_id < priv->hw_params.max_txq_num; txq_id++) - iwl_tx_queue_free(priv, txq_id); + iwl_tx_queue_free(priv, &priv->txq[txq_id]); /* Keep-warm buffer */ iwl_kw_free(priv); @@ -872,7 +859,7 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) txq->txb[q->write_ptr].skb[0] = skb; /* Set up first empty entry in queue's array of Tx/cmd buffers */ - out_cmd = txq->cmd[idx]; + out_cmd = &txq->cmd[idx]; tx_cmd = &out_cmd->cmd.tx; memset(&out_cmd->hdr, 0, sizeof(out_cmd->hdr)); memset(tx_cmd, 0, sizeof(struct iwl_tx_cmd)); @@ -912,9 +899,8 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) /* Physical address of this Tx command's header (not MAC header!), * within command buffer array. */ - txcmd_phys = pci_map_single(priv->pci_dev, out_cmd, - sizeof(struct iwl_cmd), PCI_DMA_TODEVICE); - txcmd_phys += offsetof(struct iwl_cmd, hdr); + txcmd_phys = txq->dma_addr_cmd + sizeof(struct iwl_cmd) * idx + + offsetof(struct iwl_cmd, hdr); /* Add buffer containing Tx command and MAC(!) header to TFD's * first entry */ @@ -976,16 +962,16 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) if (ret) return ret; - if ((iwl_queue_space(q) < q->high_mark) && priv->mac80211_registered) { + if ((iwl_queue_space(q) < q->high_mark) + && priv->mac80211_registered) { if (wait_write_ptr) { spin_lock_irqsave(&priv->lock, flags); txq->need_update = 1; iwl_txq_update_write_ptr(priv, txq); spin_unlock_irqrestore(&priv->lock, flags); - } else { - ieee80211_stop_queue(priv->hw, - skb_get_queue_mapping(skb)); } + + ieee80211_stop_queue(priv->hw, skb_get_queue_mapping(skb)); } return 0; @@ -1018,7 +1004,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) u32 idx; u16 fix_size; dma_addr_t phys_addr; - int len, ret; + int ret; unsigned long flags; cmd->len = priv->cfg->ops->utils->get_hcmd_size(cmd->id, cmd->len); @@ -1048,7 +1034,7 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) control_flags = (u32 *) tfd; idx = get_cmd_index(q, q->write_ptr, cmd->meta.flags & CMD_SIZE_HUGE); - out_cmd = txq->cmd[idx]; + out_cmd = &txq->cmd[idx]; out_cmd->hdr.cmd = cmd->id; memcpy(&out_cmd->meta, &cmd->meta, sizeof(cmd->meta)); @@ -1062,11 +1048,9 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd) INDEX_TO_SEQ(q->write_ptr)); if (out_cmd->meta.flags & CMD_SIZE_HUGE) out_cmd->hdr.sequence |= cpu_to_le16(SEQ_HUGE_FRAME); - len = (idx == TFD_CMD_SLOTS) ? - IWL_MAX_SCAN_SIZE : sizeof(struct iwl_cmd); - phys_addr = pci_map_single(priv->pci_dev, out_cmd, len, - PCI_DMA_TODEVICE); - phys_addr += offsetof(struct iwl_cmd, hdr); + + phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx + + offsetof(struct iwl_cmd, hdr); iwl_hw_txq_attach_buf_to_tfd(priv, tfd, phys_addr, fix_size); IWL_DEBUG_HC("Sending command %s (#%x), seq: 0x%04X, " @@ -1131,9 +1115,6 @@ static void iwl_hcmd_queue_reclaim(struct iwl_priv *priv, int txq_id, int index) { struct iwl_tx_queue *txq = &priv->txq[txq_id]; struct iwl_queue *q = &txq->q; - struct iwl_tfd_frame *bd = &txq->bd[index]; - dma_addr_t dma_addr; - int is_odd, buf_len; int nfreed = 0; if ((index >= q->n_bd) || (iwl_queue_used(q, index) == 0)) { @@ -1151,19 +1132,6 @@ static void iwl_hcmd_queue_reclaim(struct iwl_priv *priv, int txq_id, int index) q->write_ptr, q->read_ptr); queue_work(priv->workqueue, &priv->restart); } - is_odd = (index/2) & 0x1; - if (is_odd) { - dma_addr = IWL_GET_BITS(bd->pa[index], tb2_addr_lo16) | - (IWL_GET_BITS(bd->pa[index], - tb2_addr_hi20) << 16); - buf_len = IWL_GET_BITS(bd->pa[index], tb2_len); - } else { - dma_addr = le32_to_cpu(bd->pa[index].tb1_addr); - buf_len = IWL_GET_BITS(bd->pa[index], tb1_len); - } - - pci_unmap_single(priv->pci_dev, dma_addr, buf_len, - PCI_DMA_TODEVICE); nfreed++; } } @@ -1195,7 +1163,7 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) BUG_ON(txq_id != IWL_CMD_QUEUE_NUM); cmd_index = get_cmd_index(&priv->txq[IWL_CMD_QUEUE_NUM].q, index, huge); - cmd = priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_index]; + cmd = &priv->txq[IWL_CMD_QUEUE_NUM].cmd[cmd_index]; /* Input error checking is done when commands are added to queue. */ if (cmd->meta.flags & CMD_WANT_SKB) { @@ -1423,7 +1391,7 @@ static int iwl_tx_status_reply_compressed_ba(struct iwl_priv *priv, /* For each frame attempted in aggregation, * update driver's record of tx frame's status. */ for (i = 0; i < agg->frame_count ; i++) { - ack = bitmap & (1ULL << i); + ack = bitmap & (1 << i); successes += !!ack; IWL_DEBUG_TX_REPLY("%s ON i=%d idx=%d raw=%d\n", ack? "ACK":"NACK", i, (agg->start_idx + i) & 0xff, diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c b/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c index 444847ab1b5a..7c82ecfa30a4 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c @@ -275,8 +275,10 @@ static int iwl3945_tx_queue_alloc(struct iwl3945_priv *priv, return 0; error: - kfree(txq->txb); - txq->txb = NULL; + if (txq->txb) { + kfree(txq->txb); + txq->txb = NULL; + } return -ENOMEM; } @@ -363,8 +365,10 @@ void iwl3945_tx_queue_free(struct iwl3945_priv *priv, struct iwl3945_tx_queue *t txq->q.n_bd, txq->bd, txq->q.dma_addr); /* De-alloc array of per-TFD driver data */ - kfree(txq->txb); - txq->txb = NULL; + if (txq->txb) { + kfree(txq->txb); + txq->txb = NULL; + } /* 0-fill queue descriptor structure */ memset(txq, 0, sizeof(*txq)); @@ -2699,8 +2703,9 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb) if (!ieee80211_has_morefrags(hdr->frame_control)) { txq->need_update = 1; - if (qc) + if (qc) { priv->stations[sta_id].tid[tid].seq_number = seq_number; + } } else { wait_write_ptr = 1; txq->need_update = 0; @@ -3808,7 +3813,7 @@ int iwl3945_calc_db_from_ratio(int sig_ratio) /* 100:1 or higher, divide by 10 and use table, * add 20 dB to make up for divide by 10 */ if (sig_ratio >= 100) - return 20 + (int)ratio2dB[sig_ratio/10]; + return (20 + (int)ratio2dB[sig_ratio/10]); /* We shouldn't see this */ if (sig_ratio < 1) @@ -5083,7 +5088,7 @@ static void iwl3945_dealloc_ucode_pci(struct iwl3945_priv *priv) * iwl3945_verify_inst_full - verify runtime uCode image in card vs. host, * looking at all data. */ -static int iwl3945_verify_inst_full(struct iwl3945_priv *priv, __le32 *image, u32 len) +static int iwl3945_verify_inst_full(struct iwl3945_priv *priv, __le32 * image, u32 len) { u32 val; u32 save_len = len; @@ -5232,7 +5237,7 @@ static int iwl3945_verify_bsm(struct iwl3945_priv *priv) val = iwl3945_read_prph(priv, BSM_WR_DWCOUNT_REG); for (reg = BSM_SRAM_LOWER_BOUND; reg < BSM_SRAM_LOWER_BOUND + len; - reg += sizeof(u32), image++) { + reg += sizeof(u32), image ++) { val = iwl3945_read_prph(priv, reg); if (val != le32_to_cpu(*image)) { IWL_ERROR("BSM uCode verification failed at " @@ -6331,7 +6336,7 @@ static void iwl3945_bg_post_associate(struct work_struct *data) DECLARE_MAC_BUF(mac); if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { - IWL_ERROR("%s Should not be called in AP mode\n", __func__); + IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__); return; } @@ -6412,7 +6417,7 @@ static void iwl3945_bg_post_associate(struct work_struct *data) default: IWL_ERROR("%s Should not be called in %d mode\n", - __func__, priv->iw_mode); + __FUNCTION__, priv->iw_mode); break; } @@ -6589,6 +6594,12 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) IWL_DEBUG_MAC80211("enter\n"); + if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) { + IWL_DEBUG_MAC80211("leave - monitor\n"); + dev_kfree_skb_any(skb); + return 0; + } + IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); @@ -7445,7 +7456,7 @@ static ssize_t show_measurement(struct device *d, struct iwl3945_priv *priv = dev_get_drvdata(d); struct iwl3945_spectrum_notification measure_report; u32 size = sizeof(measure_report), len = 0, ofs = 0; - u8 *data = (u8 *)&measure_report; + u8 *data = (u8 *) & measure_report; unsigned long flags; spin_lock_irqsave(&priv->lock, flags); @@ -7616,7 +7627,7 @@ static ssize_t show_power_level(struct device *d, else p += sprintf(p, " \n"); - return p - buf + 1; + return (p - buf + 1); } @@ -7638,7 +7649,7 @@ static ssize_t show_statistics(struct device *d, struct iwl3945_priv *priv = dev_get_drvdata(d); u32 size = sizeof(struct iwl3945_notif_statistics); u32 len = 0, ofs = 0; - u8 *data = (u8 *)&priv->statistics; + u8 *data = (u8 *) & priv->statistics; int rc = 0; if (!iwl3945_is_alive(priv)) @@ -7992,16 +8003,16 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e /* nic init */ iwl3945_set_bit(priv, CSR_GIO_CHICKEN_BITS, - CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); - - iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); - err = iwl3945_poll_bit(priv, CSR_GP_CNTRL, - CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, - CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); - if (err < 0) { - IWL_DEBUG_INFO("Failed to init the card\n"); + CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); + + iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); + err = iwl3945_poll_bit(priv, CSR_GP_CNTRL, + CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, + CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); + if (err < 0) { + IWL_DEBUG_INFO("Failed to init the card\n"); goto out_remove_sysfs; - } + } /* Read the EEPROM */ err = iwl3945_eeprom_init(priv); if (err) { @@ -8103,8 +8114,9 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev) iwl3945_unset_hw_setting(priv); iwl3945_clear_stations_table(priv); - if (priv->mac80211_registered) + if (priv->mac80211_registered) { ieee80211_unregister_hw(priv->hw); + } /*netif_stop_queue(dev); */ flush_workqueue(priv->workqueue); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-agn.c b/trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c similarity index 96% rename from trunk/drivers/net/wireless/iwlwifi/iwl-agn.c rename to trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c index b8407d5704a1..71f5da3fe5c4 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c @@ -65,7 +65,7 @@ * NOTE: DRV_NAME is defined in iwlwifi.h for use by iwl-debug.h and printk */ -#define DRV_DESCRIPTION "Intel(R) Wireless WiFi Link AGN driver for Linux" +#define DRV_DESCRIPTION "Intel(R) Wireless WiFi Link 4965AGN driver for Linux" #ifdef CONFIG_IWLWIFI_DEBUG #define VD "d" @@ -73,7 +73,7 @@ #define VD #endif -#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT +#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT #define VS "s" #else #define VS @@ -86,7 +86,6 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_VERSION(DRV_VERSION); MODULE_AUTHOR(DRV_COPYRIGHT); MODULE_LICENSE("GPL"); -MODULE_ALIAS("iwl4965"); /*************** STATION TABLE MANAGEMENT **** * mac80211 should be examined to determine if sta_info is duplicating @@ -445,10 +444,11 @@ static void iwl_free_frame(struct iwl_priv *priv, struct iwl_frame *frame) list_add(&frame->list, &priv->free_frames); } -static unsigned int iwl_fill_beacon_frame(struct iwl_priv *priv, - struct ieee80211_hdr *hdr, - const u8 *dest, int left) +unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv, + struct ieee80211_hdr *hdr, + const u8 *dest, int left) { + if (!iwl_is_associated(priv) || !priv->ibss_beacon || ((priv->iw_mode != IEEE80211_IF_TYPE_IBSS) && (priv->iw_mode != IEEE80211_IF_TYPE_AP))) @@ -487,38 +487,6 @@ static u8 iwl4965_rate_get_lowest_plcp(struct iwl_priv *priv) return IWL_RATE_6M_PLCP; } -unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv, - struct iwl_frame *frame, u8 rate) -{ - struct iwl_tx_beacon_cmd *tx_beacon_cmd; - unsigned int frame_size; - - tx_beacon_cmd = &frame->u.beacon; - memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd)); - - tx_beacon_cmd->tx.sta_id = priv->hw_params.bcast_sta_id; - tx_beacon_cmd->tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; - - frame_size = iwl_fill_beacon_frame(priv, tx_beacon_cmd->frame, - iwl_bcast_addr, - sizeof(frame->u) - sizeof(*tx_beacon_cmd)); - - BUG_ON(frame_size > MAX_MPDU_SIZE); - tx_beacon_cmd->tx.len = cpu_to_le16((u16)frame_size); - - if ((rate == IWL_RATE_1M_PLCP) || (rate >= IWL_RATE_2M_PLCP)) - tx_beacon_cmd->tx.rate_n_flags = - iwl_hw_set_rate_n_flags(rate, RATE_MCS_CCK_MSK); - else - tx_beacon_cmd->tx.rate_n_flags = - iwl_hw_set_rate_n_flags(rate, 0); - - tx_beacon_cmd->tx.tx_flags = TX_CMD_FLG_SEQ_CTL_MSK | - TX_CMD_FLG_TSF_MSK | - TX_CMD_FLG_STA_RATE_MSK; - - return sizeof(*tx_beacon_cmd) + frame_size; -} static int iwl4965_send_beacon_cmd(struct iwl_priv *priv) { struct iwl_frame *frame; @@ -640,6 +608,7 @@ static void iwl_activate_qos(struct iwl_priv *priv, u8 force) } #define MAX_UCODE_BEACON_INTERVAL 4096 +#define INTEL_CONN_LISTEN_INTERVAL __constant_cpu_to_le16(0xA) static __le16 iwl4965_adjust_beacon_interval(u16 beacon_val) { @@ -669,7 +638,7 @@ static void iwl4965_setup_rxon_timing(struct iwl_priv *priv) priv->rxon_timing.timestamp.dw[0] = cpu_to_le32(priv->timestamp & 0xFFFFFFFF); - priv->rxon_timing.listen_interval = cpu_to_le16(conf->listen_interval); + priv->rxon_timing.listen_interval = INTEL_CONN_LISTEN_INTERVAL; tsf = priv->timestamp; @@ -884,7 +853,7 @@ static void iwl4965_set_rate(struct iwl_priv *priv) (IWL_OFDM_BASIC_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF; } -#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT +#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT #include "iwl-spectrum.h" @@ -1088,7 +1057,7 @@ static void iwl4965_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) static void iwl4965_rx_spectrum_measure_notif(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) { -#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT +#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; struct iwl4965_spectrum_notification *report = &(pkt->u.spectrum_notif); @@ -1262,37 +1231,6 @@ static void iwl4965_rx_card_state_notif(struct iwl_priv *priv, wake_up_interruptible(&priv->wait_command_queue); } -int iwl4965_set_pwr_src(struct iwl_priv *priv, enum iwl_pwr_src src) -{ - int ret; - unsigned long flags; - - spin_lock_irqsave(&priv->lock, flags); - ret = iwl_grab_nic_access(priv); - if (ret) - goto err; - - if (src == IWL_PWR_SRC_VAUX) { - u32 val; - ret = pci_read_config_dword(priv->pci_dev, PCI_POWER_SOURCE, - &val); - - if (val & PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT) - iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG, - APMG_PS_CTRL_VAL_PWR_SRC_VAUX, - ~APMG_PS_CTRL_MSK_PWR_SRC); - } else { - iwl_set_bits_mask_prph(priv, APMG_PS_CTRL_REG, - APMG_PS_CTRL_VAL_PWR_SRC_VMAIN, - ~APMG_PS_CTRL_MSK_PWR_SRC); - } - - iwl_release_nic_access(priv); -err: - spin_unlock_irqrestore(&priv->lock, flags); - return ret; -} - /** * iwl4965_setup_rx_handlers - Initialize Rx handler callbacks * @@ -2232,16 +2170,17 @@ static int __iwl4965_up(struct iwl_priv *priv) } /* If platform's RF_KILL switch is NOT set to KILL */ - if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW) + if (iwl_read32(priv, CSR_GP_CNTRL) & + CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW) clear_bit(STATUS_RF_KILL_HW, &priv->status); else set_bit(STATUS_RF_KILL_HW, &priv->status); - if (iwl_is_rfkill(priv)) { - iwl4965_enable_interrupts(priv); + if (!test_bit(STATUS_IN_SUSPEND, &priv->status) && + iwl_is_rfkill(priv)) { IWL_WARNING("Radio disabled by %s RF Kill switch\n", test_bit(STATUS_RF_KILL_HW, &priv->status) ? "HW" : "SW"); - return 0; + return -ENODEV; } iwl_write32(priv, CSR_INT, 0xFFFFFFFF); @@ -2277,6 +2216,11 @@ static int __iwl4965_up(struct iwl_priv *priv) memcpy(priv->ucode_data_backup.v_addr, priv->ucode_data.v_addr, priv->ucode_data.len); + /* We return success when we resume from suspend and rf_kill is on. */ + if (test_bit(STATUS_RF_KILL_HW, &priv->status) || + test_bit(STATUS_RF_KILL_SW, &priv->status)) + return 0; + for (i = 0; i < MAX_HW_RESTARTS; i++) { iwl_clear_stations_table(priv); @@ -2471,7 +2415,7 @@ static void iwl4965_post_associate(struct iwl_priv *priv) unsigned long flags; if (priv->iw_mode == IEEE80211_IF_TYPE_AP) { - IWL_ERROR("%s Should not be called in AP mode\n", __func__); + IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__); return; } @@ -2547,7 +2491,7 @@ static void iwl4965_post_associate(struct iwl_priv *priv) default: IWL_ERROR("%s Should not be called in %d mode\n", - __func__, priv->iw_mode); + __FUNCTION__, priv->iw_mode); break; } @@ -2645,9 +2589,6 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw) if (ret) goto out_release_irq; - if (iwl_is_rfkill(priv)) - goto out; - IWL_DEBUG_INFO("Start UP work done.\n"); if (test_bit(STATUS_IN_SUSPEND, &priv->status)) @@ -2667,7 +2608,6 @@ static int iwl4965_mac_start(struct ieee80211_hw *hw) } } -out: priv->is_open = 1; IWL_DEBUG_MAC80211("leave\n"); return 0; @@ -2833,7 +2773,6 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co spin_lock_irqsave(&priv->lock, flags); - /* if we are switching from ht to 2.4 clear flags * from any ht related info since 2.4 does not * support ht */ @@ -3163,7 +3102,6 @@ static void iwl4965_bss_info_changed(struct ieee80211_hw *hw, if (bss_conf->assoc) { priv->assoc_id = bss_conf->aid; priv->beacon_int = bss_conf->beacon_int; - priv->power_data.dtim_period = bss_conf->dtim_period; priv->timestamp = bss_conf->timestamp; priv->assoc_capability = bss_conf->assoc_capability; priv->next_scan_jiffies = jiffies + @@ -3407,39 +3345,6 @@ static int iwl4965_mac_conf_tx(struct ieee80211_hw *hw, u16 queue, return 0; } -static int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, - enum ieee80211_ampdu_mlme_action action, - const u8 *addr, u16 tid, u16 *ssn) -{ - struct iwl_priv *priv = hw->priv; - DECLARE_MAC_BUF(mac); - - IWL_DEBUG_HT("A-MPDU action on addr %s tid %d\n", - print_mac(mac, addr), tid); - - if (!(priv->cfg->sku & IWL_SKU_N)) - return -EACCES; - - switch (action) { - case IEEE80211_AMPDU_RX_START: - IWL_DEBUG_HT("start Rx\n"); - return iwl_rx_agg_start(priv, addr, tid, *ssn); - case IEEE80211_AMPDU_RX_STOP: - IWL_DEBUG_HT("stop Rx\n"); - return iwl_rx_agg_stop(priv, addr, tid); - case IEEE80211_AMPDU_TX_START: - IWL_DEBUG_HT("start Tx\n"); - return iwl_tx_agg_start(priv, addr, tid, ssn); - case IEEE80211_AMPDU_TX_STOP: - IWL_DEBUG_HT("stop Tx\n"); - return iwl_tx_agg_stop(priv, addr, tid); - default: - IWL_DEBUG_HT("unknown\n"); - return -EINVAL; - break; - } - return 0; -} static int iwl4965_mac_get_tx_stats(struct ieee80211_hw *hw, struct ieee80211_tx_queue_stats *stats) { @@ -3687,6 +3592,15 @@ static ssize_t show_temperature(struct device *d, static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL); +static ssize_t show_rs_window(struct device *d, + struct device_attribute *attr, + char *buf) +{ + struct iwl_priv *priv = d->driver_data; + return iwl4965_fill_rs_info(priv->hw, buf, IWL_AP_ID); +} +static DEVICE_ATTR(rs_window, S_IRUGO, show_rs_window, NULL); + static ssize_t show_tx_power(struct device *d, struct device_attribute *attr, char *buf) { @@ -3785,7 +3699,7 @@ static ssize_t store_filter_flags(struct device *d, static DEVICE_ATTR(filter_flags, S_IWUSR | S_IRUGO, show_filter_flags, store_filter_flags); -#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT +#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT static ssize_t show_measurement(struct device *d, struct device_attribute *attr, char *buf) @@ -3793,7 +3707,7 @@ static ssize_t show_measurement(struct device *d, struct iwl_priv *priv = dev_get_drvdata(d); struct iwl4965_spectrum_notification measure_report; u32 size = sizeof(measure_report), len = 0, ofs = 0; - u8 *data = (u8 *)&measure_report; + u8 *data = (u8 *) & measure_report; unsigned long flags; spin_lock_irqsave(&priv->lock, flags); @@ -3856,7 +3770,7 @@ static ssize_t store_measurement(struct device *d, static DEVICE_ATTR(measurement, S_IRUSR | S_IWUSR, show_measurement, store_measurement); -#endif /* CONFIG_IWLAGN_SPECTRUM_MEASUREMENT */ +#endif /* CONFIG_IWL4965_SPECTRUM_MEASUREMENT */ static ssize_t store_retry_rate(struct device *d, struct device_attribute *attr, @@ -3886,54 +3800,77 @@ static ssize_t store_power_level(struct device *d, const char *buf, size_t count) { struct iwl_priv *priv = dev_get_drvdata(d); - int ret; + int rc; int mode; mode = simple_strtoul(buf, NULL, 0); mutex_lock(&priv->mutex); if (!iwl_is_ready(priv)) { - ret = -EAGAIN; + rc = -EAGAIN; goto out; } - ret = iwl_power_set_user_mode(priv, mode); - if (ret) { + rc = iwl_power_set_user_mode(priv, mode); + if (rc) { IWL_DEBUG_MAC80211("failed setting power mode.\n"); goto out; } - ret = count; + rc = count; out: mutex_unlock(&priv->mutex); - return ret; + return rc; } +#define MAX_WX_STRING 80 + +/* Values are in microsecond */ +static const s32 timeout_duration[] = { + 350000, + 250000, + 75000, + 37000, + 25000, +}; +static const s32 period_duration[] = { + 400000, + 700000, + 1000000, + 1000000, + 1000000 +}; + static ssize_t show_power_level(struct device *d, struct device_attribute *attr, char *buf) { struct iwl_priv *priv = dev_get_drvdata(d); - int mode = priv->power_data.user_power_setting; - int system = priv->power_data.system_power_setting; int level = priv->power_data.power_mode; char *p = buf; - switch (system) { - case IWL_POWER_SYS_AUTO: - p += sprintf(p, "SYSTEM:auto"); + p += sprintf(p, "%d ", level); + switch (level) { + case IWL_POWER_MODE_CAM: + case IWL_POWER_AC: + p += sprintf(p, "(AC)"); break; - case IWL_POWER_SYS_AC: - p += sprintf(p, "SYSTEM:ac"); - break; - case IWL_POWER_SYS_BATTERY: - p += sprintf(p, "SYSTEM:battery"); + case IWL_POWER_BATTERY: + p += sprintf(p, "(BATTERY)"); break; + default: + p += sprintf(p, + "(Timeout %dms, Period %dms)", + timeout_duration[level - 1] / 1000, + period_duration[level - 1] / 1000); } - - p += sprintf(p, "\tMODE:%s", (mode < IWL_POWER_AUTO)?"fixed":"auto"); - p += sprintf(p, "\tINDEX:%d", level); - p += sprintf(p, "\n"); - return p - buf + 1; +/* + if (!(priv->power_mode & IWL_POWER_ENABLED)) + p += sprintf(p, " OFF\n"); + else + p += sprintf(p, " \n"); +*/ + p += sprintf(p, " \n"); + return (p - buf + 1); } static DEVICE_ATTR(power_level, S_IWUSR | S_IRUSR, show_power_level, @@ -4008,7 +3945,7 @@ static ssize_t show_statistics(struct device *d, struct iwl_priv *priv = dev_get_drvdata(d); u32 size = sizeof(struct iwl_notif_statistics); u32 len = 0, ofs = 0; - u8 *data = (u8 *)&priv->statistics; + u8 *data = (u8 *) & priv->statistics; int rc = 0; if (!iwl_is_alive(priv)) @@ -4104,11 +4041,12 @@ static struct attribute *iwl4965_sysfs_entries[] = { &dev_attr_channels.attr, &dev_attr_flags.attr, &dev_attr_filter_flags.attr, -#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT +#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT &dev_attr_measurement.attr, #endif &dev_attr_power_level.attr, &dev_attr_retry_rate.attr, + &dev_attr_rs_window.attr, &dev_attr_statistics.attr, &dev_attr_status.attr, &dev_attr_temperature.attr, @@ -4456,10 +4394,8 @@ static int iwl4965_pci_resume(struct pci_dev *pdev) /* Hardware specific file defines the PCI IDs table for that hardware module */ static struct pci_device_id iwl_hw_card_ids[] = { -#ifdef CONFIG_IWL4965 {IWL_PCI_DEVICE(0x4229, PCI_ANY_ID, iwl4965_agn_cfg)}, {IWL_PCI_DEVICE(0x4230, PCI_ANY_ID, iwl4965_agn_cfg)}, -#endif /* CONFIG_IWL4965 */ #ifdef CONFIG_IWL5000 {IWL_PCI_DEVICE(0x4232, 0x1205, iwl5100_bg_cfg)}, {IWL_PCI_DEVICE(0x4232, 0x1305, iwl5100_bg_cfg)}, @@ -4495,7 +4431,7 @@ static int __init iwl4965_init(void) printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n"); printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n"); - ret = iwlagn_rate_control_register(); + ret = iwl4965_rate_control_register(); if (ret) { IWL_ERROR("Unable to register rate control algorithm: %d\n", ret); return ret; @@ -4510,14 +4446,14 @@ static int __init iwl4965_init(void) return ret; error_register: - iwlagn_rate_control_unregister(); + iwl4965_rate_control_unregister(); return ret; } static void __exit iwl4965_exit(void) { pci_unregister_driver(&iwl_driver); - iwlagn_rate_control_unregister(); + iwl4965_rate_control_unregister(); } module_exit(iwl4965_exit); diff --git a/trunk/drivers/net/wireless/libertas/main.c b/trunk/drivers/net/wireless/libertas/main.c index bd32ac0b4e07..14d5d61cec4c 100644 --- a/trunk/drivers/net/wireless/libertas/main.c +++ b/trunk/drivers/net/wireless/libertas/main.c @@ -297,7 +297,9 @@ static ssize_t lbs_rtap_set(struct device *dev, lbs_add_rtap(priv); } priv->monitormode = monitor_mode; - } else { + } + + else { if (!priv->monitormode) return strlen(buf); priv->monitormode = 0; @@ -1240,6 +1242,8 @@ int lbs_start_card(struct lbs_private *priv) lbs_pr_err("cannot register ethX device\n"); goto done; } + if (device_create_file(&dev->dev, &dev_attr_lbs_rtap)) + lbs_pr_err("cannot register lbs_rtap attribute\n"); lbs_update_channel(priv); @@ -1271,13 +1275,6 @@ int lbs_start_card(struct lbs_private *priv) if (device_create_file(&dev->dev, &dev_attr_lbs_mesh)) lbs_pr_err("cannot register lbs_mesh attribute\n"); - - /* While rtap isn't related to mesh, only mesh-enabled - * firmware implements the rtap functionality via - * CMD_802_11_MONITOR_MODE. - */ - if (device_create_file(&dev->dev, &dev_attr_lbs_rtap)) - lbs_pr_err("cannot register lbs_rtap attribute\n"); } } @@ -1309,9 +1306,9 @@ void lbs_stop_card(struct lbs_private *priv) netif_carrier_off(priv->dev); lbs_debugfs_remove_one(priv); + device_remove_file(&dev->dev, &dev_attr_lbs_rtap); if (priv->mesh_tlv) { device_remove_file(&dev->dev, &dev_attr_lbs_mesh); - device_remove_file(&dev->dev, &dev_attr_lbs_rtap); } /* Flush pending command nodes */ diff --git a/trunk/drivers/net/wireless/p54/p54.h b/trunk/drivers/net/wireless/p54/p54.h index cac9a515b82d..c6f27b9022f9 100644 --- a/trunk/drivers/net/wireless/p54/p54.h +++ b/trunk/drivers/net/wireless/p54/p54.h @@ -52,7 +52,6 @@ struct p54_common { int (*open)(struct ieee80211_hw *dev); void (*stop)(struct ieee80211_hw *dev); int mode; - struct mutex conf_mutex; u8 mac_addr[ETH_ALEN]; u8 bssid[ETH_ALEN]; struct pda_iq_autocal_entry *iq_autocal; diff --git a/trunk/drivers/net/wireless/p54/p54common.c b/trunk/drivers/net/wireless/p54/p54common.c index 4da89ea9b561..ffaf7a6b6810 100644 --- a/trunk/drivers/net/wireless/p54/p54common.c +++ b/trunk/drivers/net/wireless/p54/p54common.c @@ -886,12 +886,9 @@ static void p54_remove_interface(struct ieee80211_hw *dev, static int p54_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) { int ret; - struct p54_common *priv = dev->priv; - mutex_lock(&priv->conf_mutex); ret = p54_set_freq(dev, cpu_to_le16(conf->channel->center_freq)); p54_set_vdcf(dev); - mutex_unlock(&priv->conf_mutex); return ret; } @@ -901,12 +898,10 @@ static int p54_config_interface(struct ieee80211_hw *dev, { struct p54_common *priv = dev->priv; - mutex_lock(&priv->conf_mutex); p54_set_filter(dev, 0, priv->mac_addr, conf->bssid, 0, 1, 0, 0xF642); p54_set_filter(dev, 0, priv->mac_addr, conf->bssid, 2, 0, 0, 0); p54_set_leds(dev, 1, !is_multicast_ether_addr(conf->bssid), 0); memcpy(priv->bssid, conf->bssid, ETH_ALEN); - mutex_unlock(&priv->conf_mutex); return 0; } @@ -1014,7 +1009,6 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len) } p54_init_vdcf(dev); - mutex_init(&priv->conf_mutex); return dev; } diff --git a/trunk/drivers/net/wireless/prism54/isl_ioctl.c b/trunk/drivers/net/wireless/prism54/isl_ioctl.c index 3d75a7137d3c..97fa14e0a479 100644 --- a/trunk/drivers/net/wireless/prism54/isl_ioctl.c +++ b/trunk/drivers/net/wireless/prism54/isl_ioctl.c @@ -2518,7 +2518,7 @@ enum { #define PRISM2_HOSTAPD_MAX_BUF_SIZE 1024 #define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \ - offsetof(struct prism2_hostapd_param, u.generic_elem.data) +((int) (&((struct prism2_hostapd_param *) 0)->u.generic_elem.data)) /* Maximum length for algorithm names (-1 for nul termination) * used in ioctl() */ diff --git a/trunk/drivers/net/wireless/rt2x00/rt2500pci.c b/trunk/drivers/net/wireless/rt2x00/rt2500pci.c index 181a146b4768..aa6dfb811c71 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2500pci.c @@ -1220,7 +1220,6 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev, rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); - rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len); rt2x00_set_field32(&word, TXD_W0_CIPHER_ALG, CIPHER_NONE); rt2x00_desc_write(txd, 0, word); } diff --git a/trunk/drivers/net/wireless/rt2x00/rt2500usb.c b/trunk/drivers/net/wireless/rt2x00/rt2500usb.c index cd5af656932d..3078417b326b 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2500usb.c @@ -633,16 +633,6 @@ static void rt2500usb_reset_tuner(struct rt2x00_dev *rt2x00dev) rt2x00dev->link.vgc_level = value; } -/* - * NOTE: This function is directly ported from legacy driver, but - * despite it being declared it was never called. Although link tuning - * sounds like a good idea, and usually works well for the other drivers, - * it does _not_ work with rt2500usb. Enabling this function will result - * in TX capabilities only until association kicks in. Immediately - * after the successful association all TX frames will be kept in the - * hardware queue and never transmitted. - */ -#if 0 static void rt2500usb_link_tuner(struct rt2x00_dev *rt2x00dev) { int rssi = rt2x00_get_link_rssi(&rt2x00dev->link); @@ -762,9 +752,6 @@ static void rt2500usb_link_tuner(struct rt2x00_dev *rt2x00dev) rt2x00dev->link.vgc_level = r17; } } -#else -#define rt2500usb_link_tuner NULL -#endif /* * Initialization functions. @@ -1389,9 +1376,6 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCLOWER, bbp); rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_VGC, word); EEPROM(rt2x00dev, "BBPtune vgc: 0x%04x\n", word); - } else { - rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCLOWER, bbp); - rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_VGC, word); } rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R17, &word); @@ -1400,6 +1384,9 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) rt2x00_set_field16(&word, EEPROM_BBPTUNE_R17_HIGH, 0x41); rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_R17, word); EEPROM(rt2x00dev, "BBPtune r17: 0x%04x\n", word); + } else { + rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCLOWER, bbp); + rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_VGC, word); } rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R24, &word); @@ -1750,7 +1737,6 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); __set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags); __set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags); - __set_bit(CONFIG_DISABLE_LINK_TUNING, &rt2x00dev->flags); /* * Set the rssi offset. diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00.h b/trunk/drivers/net/wireless/rt2x00/rt2x00.h index 8b10ea41b204..db2dc976d831 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00.h +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00.h @@ -368,12 +368,6 @@ struct rt2x00_intf { #define DELAYED_CONFIG_ERP 0x00000002 #define DELAYED_LED_ASSOC 0x00000004 - /* - * Software sequence counter, this is only required - * for hardware which doesn't support hardware - * sequence counting. - */ - spinlock_t seqlock; u16 seqno; }; diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00config.c b/trunk/drivers/net/wireless/rt2x00/rt2x00config.c index d134c3be539a..3f89516e8332 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00config.c @@ -254,8 +254,6 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, libconf.ant.rx = default_ant->rx; else if (active_ant->rx == ANTENNA_SW_DIVERSITY) libconf.ant.rx = ANTENNA_B; - else - libconf.ant.rx = active_ant->rx; if (conf->antenna_sel_tx) libconf.ant.tx = conf->antenna_sel_tx; @@ -263,8 +261,6 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, libconf.ant.tx = default_ant->tx; else if (active_ant->tx == ANTENNA_SW_DIVERSITY) libconf.ant.tx = ANTENNA_B; - else - libconf.ant.tx = active_ant->tx; } if (flags & CONFIG_UPDATE_SLOT_TIME) { diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00debug.c b/trunk/drivers/net/wireless/rt2x00/rt2x00debug.c index 6bee1d611bbf..300cf061035f 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00debug.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00debug.c @@ -372,6 +372,9 @@ static ssize_t rt2x00debug_write_##__name(struct file *file, \ if (*offset) \ return 0; \ \ + if (!capable(CAP_NET_ADMIN)) \ + return -EPERM; \ + \ if (intf->offset_##__name >= debug->__name.word_count) \ return -EINVAL; \ \ @@ -451,7 +454,7 @@ static struct dentry *rt2x00debug_create_file_driver(const char *name, data += sprintf(data, "compiled: %s %s\n", __DATE__, __TIME__); blob->size = strlen(blob->data); - return debugfs_create_blob(name, S_IRUSR, intf->driver_folder, blob); + return debugfs_create_blob(name, S_IRUGO, intf->driver_folder, blob); } static struct dentry *rt2x00debug_create_file_chipset(const char *name, @@ -479,7 +482,7 @@ static struct dentry *rt2x00debug_create_file_chipset(const char *name, data += sprintf(data, "rf length: %d\n", debug->rf.word_count); blob->size = strlen(blob->data); - return debugfs_create_blob(name, S_IRUSR, intf->driver_folder, blob); + return debugfs_create_blob(name, S_IRUGO, intf->driver_folder, blob); } void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) @@ -514,7 +517,7 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) if (IS_ERR(intf->chipset_entry)) goto exit; - intf->dev_flags = debugfs_create_file("dev_flags", S_IRUSR, + intf->dev_flags = debugfs_create_file("dev_flags", S_IRUGO, intf->driver_folder, intf, &rt2x00debug_fop_dev_flags); if (IS_ERR(intf->dev_flags)) @@ -529,7 +532,7 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) ({ \ (__intf)->__name##_off_entry = \ debugfs_create_u32(__stringify(__name) "_offset", \ - S_IRUSR | S_IWUSR, \ + S_IRUGO | S_IWUSR, \ (__intf)->register_folder, \ &(__intf)->offset_##__name); \ if (IS_ERR((__intf)->__name##_off_entry)) \ @@ -537,7 +540,7 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) \ (__intf)->__name##_val_entry = \ debugfs_create_file(__stringify(__name) "_value", \ - S_IRUSR | S_IWUSR, \ + S_IRUGO | S_IWUSR, \ (__intf)->register_folder, \ (__intf), &rt2x00debug_fop_##__name);\ if (IS_ERR((__intf)->__name##_val_entry)) \ @@ -557,7 +560,7 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) goto exit; intf->queue_frame_dump_entry = - debugfs_create_file("dump", S_IRUSR, intf->queue_folder, + debugfs_create_file("dump", S_IRUGO, intf->queue_folder, intf, &rt2x00debug_fop_queue_dump); if (IS_ERR(intf->queue_frame_dump_entry)) goto exit; @@ -566,7 +569,7 @@ void rt2x00debug_register(struct rt2x00_dev *rt2x00dev) init_waitqueue_head(&intf->frame_dump_waitqueue); intf->queue_stats_entry = - debugfs_create_file("queue", S_IRUSR, intf->queue_folder, + debugfs_create_file("queue", S_IRUGO, intf->queue_folder, intf, &rt2x00debug_fop_queue_stats); return; diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00mac.c b/trunk/drivers/net/wireless/rt2x00/rt2x00mac.c index bd422fd6a894..c3ee4ecba792 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00mac.c @@ -247,7 +247,6 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw, rt2x00dev->intf_sta_count++; spin_lock_init(&intf->lock); - spin_lock_init(&intf->seqlock); intf->beacon = entry; if (conf->type == IEEE80211_IF_TYPE_AP) diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c b/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c index 898cdd7f57d9..3b27f6aa860c 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00queue.c @@ -128,7 +128,6 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, unsigned int data_length; unsigned int duration; unsigned int residual; - unsigned long irqflags; memset(txdesc, 0, sizeof(*txdesc)); @@ -214,14 +213,14 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, * sequence counter given by mac80211. */ if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { - spin_lock_irqsave(&intf->seqlock, irqflags); + spin_lock(&intf->lock); if (test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)) intf->seqno += 0x10; hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); hdr->seq_ctrl |= cpu_to_le16(intf->seqno); - spin_unlock_irqrestore(&intf->seqlock, irqflags); + spin_unlock(&intf->lock); __set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags); } diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c b/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c index 8d76bb2e0312..933e6cc9359d 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c @@ -124,7 +124,7 @@ EXPORT_SYMBOL_GPL(rt2x00usb_vendor_request_buff); int rt2x00usb_vendor_request_large_buff(struct rt2x00_dev *rt2x00dev, const u8 request, const u8 requesttype, - const u16 offset, const void *buffer, + const u16 offset, void *buffer, const u16 buffer_length, const int timeout) { @@ -134,7 +134,7 @@ int rt2x00usb_vendor_request_large_buff(struct rt2x00_dev *rt2x00dev, mutex_lock(&rt2x00dev->usb_cache_mutex); - tb = (char *)buffer; + tb = buffer; off = offset; len = buffer_length; while (len && !status) { diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00usb.h b/trunk/drivers/net/wireless/rt2x00/rt2x00usb.h index 3b4a67417f95..ee3875f894aa 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt2x00usb.h +++ b/trunk/drivers/net/wireless/rt2x00/rt2x00usb.h @@ -185,7 +185,7 @@ int rt2x00usb_vendor_req_buff_lock(struct rt2x00_dev *rt2x00dev, */ int rt2x00usb_vendor_request_large_buff(struct rt2x00_dev *rt2x00dev, const u8 request, const u8 requesttype, - const u16 offset, const void *buffer, + const u16 offset, void *buffer, const u16 buffer_length, const int timeout); diff --git a/trunk/drivers/net/wireless/rt2x00/rt61pci.c b/trunk/drivers/net/wireless/rt2x00/rt61pci.c index 087e90b328cd..fbe2a652e014 100644 --- a/trunk/drivers/net/wireless/rt2x00/rt61pci.c +++ b/trunk/drivers/net/wireless/rt2x00/rt61pci.c @@ -1003,11 +1003,6 @@ static int rt61pci_load_firmware(struct rt2x00_dev *rt2x00dev, const void *data, return -EBUSY; } - /* - * Hardware needs another millisecond before it is ready. - */ - msleep(1); - /* * Reset MAC and BBP registers. */ diff --git a/trunk/drivers/net/wireless/rtl8187.h b/trunk/drivers/net/wireless/rtl8187.h index 5a9515c99960..1b0d750f6623 100644 --- a/trunk/drivers/net/wireless/rtl8187.h +++ b/trunk/drivers/net/wireless/rtl8187.h @@ -94,10 +94,6 @@ struct rtl8187_priv { const struct rtl818x_rf_ops *rf; struct ieee80211_vif *vif; int mode; - /* The mutex protects the TX loopback state. - * Any attempt to set channels concurrently locks the device. - */ - struct mutex conf_mutex; /* rtl8187 specific */ struct ieee80211_channel channels[14]; diff --git a/trunk/drivers/net/wireless/rtl8187_dev.c b/trunk/drivers/net/wireless/rtl8187_dev.c index 57376fb993ed..177988efd660 100644 --- a/trunk/drivers/net/wireless/rtl8187_dev.c +++ b/trunk/drivers/net/wireless/rtl8187_dev.c @@ -31,8 +31,6 @@ MODULE_DESCRIPTION("RTL8187/RTL8187B USB wireless driver"); MODULE_LICENSE("GPL"); static struct usb_device_id rtl8187_table[] __devinitdata = { - /* Asus */ - {USB_DEVICE(0x0b05, 0x171d), .driver_info = DEVICE_RTL8187}, /* Realtek */ {USB_DEVICE(0x0bda, 0x8187), .driver_info = DEVICE_RTL8187}, {USB_DEVICE(0x0bda, 0x8189), .driver_info = DEVICE_RTL8187B}, @@ -728,7 +726,6 @@ static int rtl8187_start(struct ieee80211_hw *dev) if (ret) return ret; - mutex_lock(&priv->conf_mutex); if (priv->is_rtl8187b) { reg = RTL818X_RX_CONF_MGMT | RTL818X_RX_CONF_DATA | @@ -750,7 +747,6 @@ static int rtl8187_start(struct ieee80211_hw *dev) (7 << 0 /* long retry limit */) | (7 << 21 /* MAX TX DMA */)); rtl8187_init_urbs(dev); - mutex_unlock(&priv->conf_mutex); return 0; } @@ -794,7 +790,6 @@ static int rtl8187_start(struct ieee80211_hw *dev) reg |= RTL818X_CMD_TX_ENABLE; reg |= RTL818X_CMD_RX_ENABLE; rtl818x_iowrite8(priv, &priv->map->CMD, reg); - mutex_unlock(&priv->conf_mutex); return 0; } @@ -806,7 +801,6 @@ static void rtl8187_stop(struct ieee80211_hw *dev) struct sk_buff *skb; u32 reg; - mutex_lock(&priv->conf_mutex); rtl818x_iowrite16(priv, &priv->map->INT_MASK, 0); reg = rtl818x_ioread8(priv, &priv->map->CMD); @@ -826,7 +820,7 @@ static void rtl8187_stop(struct ieee80211_hw *dev) usb_kill_urb(info->urb); kfree_skb(skb); } - mutex_unlock(&priv->conf_mutex); + return; } static int rtl8187_add_interface(struct ieee80211_hw *dev, @@ -846,7 +840,6 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev, return -EOPNOTSUPP; } - mutex_lock(&priv->conf_mutex); priv->vif = conf->vif; rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); @@ -855,7 +848,6 @@ static int rtl8187_add_interface(struct ieee80211_hw *dev, ((u8 *)conf->mac_addr)[i]); rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); - mutex_unlock(&priv->conf_mutex); return 0; } @@ -863,10 +855,8 @@ static void rtl8187_remove_interface(struct ieee80211_hw *dev, struct ieee80211_if_init_conf *conf) { struct rtl8187_priv *priv = dev->priv; - mutex_lock(&priv->conf_mutex); priv->mode = IEEE80211_IF_TYPE_MNTR; priv->vif = NULL; - mutex_unlock(&priv->conf_mutex); } static int rtl8187_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) @@ -874,7 +864,6 @@ static int rtl8187_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) struct rtl8187_priv *priv = dev->priv; u32 reg; - mutex_lock(&priv->conf_mutex); reg = rtl818x_ioread32(priv, &priv->map->TX_CONF); /* Enable TX loopback on MAC level to avoid TX during channel * changes, as this has be seen to causes problems and the @@ -907,7 +896,6 @@ static int rtl8187_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf) rtl818x_iowrite16(priv, &priv->map->ATIMTR_INTERVAL, 100); rtl818x_iowrite16(priv, &priv->map->BEACON_INTERVAL, 100); rtl818x_iowrite16(priv, &priv->map->BEACON_INTERVAL_TIME, 100); - mutex_unlock(&priv->conf_mutex); return 0; } @@ -919,7 +907,6 @@ static int rtl8187_config_interface(struct ieee80211_hw *dev, int i; u8 reg; - mutex_lock(&priv->conf_mutex); for (i = 0; i < ETH_ALEN; i++) rtl818x_iowrite8(priv, &priv->map->BSSID[i], conf->bssid[i]); @@ -933,7 +920,6 @@ static int rtl8187_config_interface(struct ieee80211_hw *dev, rtl818x_iowrite8(priv, &priv->map->MSR, reg); } - mutex_unlock(&priv->conf_mutex); return 0; } @@ -1201,7 +1187,6 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, printk(KERN_ERR "rtl8187: Cannot register device\n"); goto err_free_dev; } - mutex_init(&priv->conf_mutex); printk(KERN_INFO "%s: hwaddr %s, %s V%d + %s\n", wiphy_name(dev->wiphy), print_mac(mac, dev->wiphy->perm_addr), diff --git a/trunk/drivers/pcmcia/rsrc_nonstatic.c b/trunk/drivers/pcmcia/rsrc_nonstatic.c index 203e579ebbd2..d0c1d63d1891 100644 --- a/trunk/drivers/pcmcia/rsrc_nonstatic.c +++ b/trunk/drivers/pcmcia/rsrc_nonstatic.c @@ -275,7 +275,7 @@ static int readable(struct pcmcia_socket *s, struct resource *res, destroy_cis_cache(s); } s->cis_mem.res = NULL; - if ((ret != 0) || (*count == 0)) + if ((ret != 0) || (count == 0)) return 0; return 1; } diff --git a/trunk/drivers/rtc/rtc-bfin.c b/trunk/drivers/rtc/rtc-bfin.c index a1af4c27939b..8624f55d0560 100644 --- a/trunk/drivers/rtc/rtc-bfin.c +++ b/trunk/drivers/rtc/rtc-bfin.c @@ -2,7 +2,7 @@ * Blackfin On-Chip Real Time Clock Driver * Supports BF52[257]/BF53[123]/BF53[467]/BF54[24789] * - * Copyright 2004-2008 Analog Devices Inc. + * Copyright 2004-2007 Analog Devices Inc. * * Enter bugs at http://blackfin.uclinux.org/ * @@ -32,15 +32,6 @@ * writes to clear status registers complete immediately. */ -/* It may seem odd that there is no SWCNT code in here (which would be exposed - * via the periodic interrupt event, or PIE). Since the Blackfin RTC peripheral - * runs in units of seconds (N/HZ) but the Linux framework runs in units of HZ - * (2^N HZ), there is no point in keeping code that only provides 1 HZ PIEs. - * The same exact behavior can be accomplished by using the update interrupt - * event (UIE). Maybe down the line the RTC peripheral will suck less in which - * case we can re-introduce PIE support. - */ - #include #include #include @@ -153,13 +144,14 @@ static void bfin_rtc_sync_pending(struct device *dev) * Initialize the RTC. Enable pre-scaler to scale RTC clock * to 1Hz and clear interrupt/status registers. */ -static void bfin_rtc_reset(struct device *dev, u16 rtc_ictl) +static void bfin_rtc_reset(struct device *dev) { struct bfin_rtc *rtc = dev_get_drvdata(dev); dev_dbg_stamp(dev); bfin_rtc_sync_pending(dev); bfin_write_RTC_PREN(0x1); - bfin_write_RTC_ICTL(rtc_ictl); + bfin_write_RTC_ICTL(RTC_ISTAT_WRITE_COMPLETE); + bfin_write_RTC_SWCNT(0); bfin_write_RTC_ALARM(0); bfin_write_RTC_ISTAT(0xFFFF); rtc->rtc_wrote_regs = 0; @@ -202,6 +194,14 @@ static irqreturn_t bfin_rtc_interrupt(int irq, void *dev_id) } } + if (rtc_ictl & RTC_ISTAT_STOPWATCH) { + if (rtc_istat & RTC_ISTAT_STOPWATCH) { + bfin_write_RTC_ISTAT(RTC_ISTAT_STOPWATCH); + events |= RTC_PF | RTC_IRQF; + bfin_write_RTC_SWCNT(rtc->rtc_dev->irq_freq); + } + } + if (rtc_ictl & RTC_ISTAT_SEC) { if (rtc_istat & RTC_ISTAT_SEC) { bfin_write_RTC_ISTAT(RTC_ISTAT_SEC); @@ -226,7 +226,7 @@ static int bfin_rtc_open(struct device *dev) ret = request_irq(IRQ_RTC, bfin_rtc_interrupt, IRQF_SHARED, to_platform_device(dev)->name, dev); if (!ret) - bfin_rtc_reset(dev, RTC_ISTAT_WRITE_COMPLETE); + bfin_rtc_reset(dev); return ret; } @@ -234,16 +234,16 @@ static int bfin_rtc_open(struct device *dev) static void bfin_rtc_release(struct device *dev) { dev_dbg_stamp(dev); - bfin_rtc_reset(dev, 0); + bfin_rtc_reset(dev); free_irq(IRQ_RTC, dev); } -static void bfin_rtc_int_set(u16 rtc_int) +static void bfin_rtc_int_set(struct bfin_rtc *rtc, u16 rtc_int) { bfin_write_RTC_ISTAT(rtc_int); bfin_write_RTC_ICTL(bfin_read_RTC_ICTL() | rtc_int); } -static void bfin_rtc_int_clear(u16 rtc_int) +static void bfin_rtc_int_clear(struct bfin_rtc *rtc, u16 rtc_int) { bfin_write_RTC_ICTL(bfin_read_RTC_ICTL() & rtc_int); } @@ -252,7 +252,7 @@ static void bfin_rtc_int_set_alarm(struct bfin_rtc *rtc) /* Blackfin has different bits for whether the alarm is * more than 24 hours away. */ - bfin_rtc_int_set(rtc->rtc_alarm.tm_yday == -1 ? RTC_ISTAT_ALARM : RTC_ISTAT_ALARM_DAY); + bfin_rtc_int_set(rtc, (rtc->rtc_alarm.tm_yday == -1 ? RTC_ISTAT_ALARM : RTC_ISTAT_ALARM_DAY)); } static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) { @@ -264,13 +264,23 @@ static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long ar bfin_rtc_sync_pending(dev); switch (cmd) { + case RTC_PIE_ON: + dev_dbg_stamp(dev); + bfin_rtc_int_set(rtc, RTC_ISTAT_STOPWATCH); + bfin_write_RTC_SWCNT(rtc->rtc_dev->irq_freq); + break; + case RTC_PIE_OFF: + dev_dbg_stamp(dev); + bfin_rtc_int_clear(rtc, ~RTC_ISTAT_STOPWATCH); + break; + case RTC_UIE_ON: dev_dbg_stamp(dev); - bfin_rtc_int_set(RTC_ISTAT_SEC); + bfin_rtc_int_set(rtc, RTC_ISTAT_SEC); break; case RTC_UIE_OFF: dev_dbg_stamp(dev); - bfin_rtc_int_clear(~RTC_ISTAT_SEC); + bfin_rtc_int_clear(rtc, ~RTC_ISTAT_SEC); break; case RTC_AIE_ON: @@ -279,7 +289,7 @@ static int bfin_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long ar break; case RTC_AIE_OFF: dev_dbg_stamp(dev); - bfin_rtc_int_clear(~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)); + bfin_rtc_int_clear(rtc, ~(RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)); break; default: @@ -361,14 +371,30 @@ static int bfin_rtc_proc(struct device *dev, struct seq_file *seq) seq_printf(seq, "alarm_IRQ\t: %s\n" "wkalarm_IRQ\t: %s\n" - "seconds_IRQ\t: %s\n", + "seconds_IRQ\t: %s\n" + "periodic_IRQ\t: %s\n", yesno(ictl & RTC_ISTAT_ALARM), yesno(ictl & RTC_ISTAT_ALARM_DAY), - yesno(ictl & RTC_ISTAT_SEC)); + yesno(ictl & RTC_ISTAT_SEC), + yesno(ictl & RTC_ISTAT_STOPWATCH)); return 0; #undef yesno } +/** + * bfin_irq_set_freq - make sure hardware supports requested freq + * @dev: pointer to RTC device structure + * @freq: requested frequency rate + * + * The Blackfin RTC can only generate periodic events at 1 per + * second (1 Hz), so reject any attempt at changing it. + */ +static int bfin_irq_set_freq(struct device *dev, int freq) +{ + dev_dbg_stamp(dev); + return -ENOTTY; +} + static struct rtc_class_ops bfin_rtc_ops = { .open = bfin_rtc_open, .release = bfin_rtc_release, @@ -378,6 +404,7 @@ static struct rtc_class_ops bfin_rtc_ops = { .read_alarm = bfin_rtc_read_alarm, .set_alarm = bfin_rtc_set_alarm, .proc = bfin_rtc_proc, + .irq_set_freq = bfin_irq_set_freq, }; static int __devinit bfin_rtc_probe(struct platform_device *pdev) @@ -396,14 +423,10 @@ static int __devinit bfin_rtc_probe(struct platform_device *pdev) ret = PTR_ERR(rtc->rtc_dev); goto err; } - - /* see comment at top of file about stopwatch/PIE */ - bfin_write_RTC_SWCNT(0); + rtc->rtc_dev->irq_freq = 1; platform_set_drvdata(pdev, rtc); - device_init_wakeup(&pdev->dev, 1); - return 0; err: @@ -422,32 +445,6 @@ static int __devexit bfin_rtc_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM -static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) -{ - if (device_may_wakeup(&pdev->dev)) { - enable_irq_wake(IRQ_RTC); - bfin_rtc_sync_pending(&pdev->dev); - } else - bfin_rtc_int_clear(-1); - - return 0; -} - -static int bfin_rtc_resume(struct platform_device *pdev) -{ - if (device_may_wakeup(&pdev->dev)) - disable_irq_wake(IRQ_RTC); - else - bfin_write_RTC_ISTAT(-1); - - return 0; -} -#else -# define bfin_rtc_suspend NULL -# define bfin_rtc_resume NULL -#endif - static struct platform_driver bfin_rtc_driver = { .driver = { .name = "rtc-bfin", @@ -455,8 +452,6 @@ static struct platform_driver bfin_rtc_driver = { }, .probe = bfin_rtc_probe, .remove = __devexit_p(bfin_rtc_remove), - .suspend = bfin_rtc_suspend, - .resume = bfin_rtc_resume, }; static int __init bfin_rtc_init(void) diff --git a/trunk/drivers/scsi/hptiop.c b/trunk/drivers/scsi/hptiop.c index a48e4990fe12..da876d3924be 100644 --- a/trunk/drivers/scsi/hptiop.c +++ b/trunk/drivers/scsi/hptiop.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1248,13 +1249,6 @@ static struct pci_device_id hptiop_id_table[] = { { PCI_VDEVICE(TTI, 0x3522), (kernel_ulong_t)&hptiop_itl_ops }, { PCI_VDEVICE(TTI, 0x3410), (kernel_ulong_t)&hptiop_itl_ops }, { PCI_VDEVICE(TTI, 0x3540), (kernel_ulong_t)&hptiop_itl_ops }, - { PCI_VDEVICE(TTI, 0x3530), (kernel_ulong_t)&hptiop_itl_ops }, - { PCI_VDEVICE(TTI, 0x3560), (kernel_ulong_t)&hptiop_itl_ops }, - { PCI_VDEVICE(TTI, 0x4322), (kernel_ulong_t)&hptiop_itl_ops }, - { PCI_VDEVICE(TTI, 0x4210), (kernel_ulong_t)&hptiop_itl_ops }, - { PCI_VDEVICE(TTI, 0x4211), (kernel_ulong_t)&hptiop_itl_ops }, - { PCI_VDEVICE(TTI, 0x4310), (kernel_ulong_t)&hptiop_itl_ops }, - { PCI_VDEVICE(TTI, 0x4311), (kernel_ulong_t)&hptiop_itl_ops }, { PCI_VDEVICE(TTI, 0x3120), (kernel_ulong_t)&hptiop_mv_ops }, { PCI_VDEVICE(TTI, 0x3122), (kernel_ulong_t)&hptiop_mv_ops }, { PCI_VDEVICE(TTI, 0x3020), (kernel_ulong_t)&hptiop_mv_ops }, diff --git a/trunk/drivers/scsi/ide-scsi.c b/trunk/drivers/scsi/ide-scsi.c index 461331d3dc45..b40a673985aa 100644 --- a/trunk/drivers/scsi/ide-scsi.c +++ b/trunk/drivers/scsi/ide-scsi.c @@ -102,10 +102,11 @@ static struct ide_scsi_obj *ide_scsi_get(struct gendisk *disk) mutex_lock(&idescsi_ref_mutex); scsi = ide_scsi_g(disk); if (scsi) { - if (ide_device_get(scsi->drive)) + scsi_host_get(scsi->host); + if (ide_device_get(scsi->drive)) { + scsi_host_put(scsi->host); scsi = NULL; - else - scsi_host_get(scsi->host); + } } mutex_unlock(&idescsi_ref_mutex); return scsi; @@ -113,11 +114,9 @@ static struct ide_scsi_obj *ide_scsi_get(struct gendisk *disk) static void ide_scsi_put(struct ide_scsi_obj *scsi) { - ide_drive_t *drive = scsi->drive; - mutex_lock(&idescsi_ref_mutex); + ide_device_put(scsi->drive); scsi_host_put(scsi->host); - ide_device_put(drive); mutex_unlock(&idescsi_ref_mutex); } diff --git a/trunk/drivers/scsi/scsi_transport_spi.c b/trunk/drivers/scsi/scsi_transport_spi.c index b29360ed0bdc..75a64a6cae8c 100644 --- a/trunk/drivers/scsi/scsi_transport_spi.c +++ b/trunk/drivers/scsi/scsi_transport_spi.c @@ -366,14 +366,12 @@ spi_transport_rd_attr(rti, "%d\n"); spi_transport_rd_attr(pcomp_en, "%d\n"); spi_transport_rd_attr(hold_mcs, "%d\n"); -/* we only care about the first child device that's a real SCSI device - * so we return 1 to terminate the iteration when we find it */ +/* we only care about the first child device so we return 1 */ static int child_iter(struct device *dev, void *data) { - if (!scsi_is_sdev_device(dev)) - return 0; + struct scsi_device *sdev = to_scsi_device(dev); - spi_dv_device(to_scsi_device(dev)); + spi_dv_device(sdev); return 1; } diff --git a/trunk/drivers/scsi/ses.c b/trunk/drivers/scsi/ses.c index 1bcf3c33d7ff..0fe031f003e7 100644 --- a/trunk/drivers/scsi/ses.c +++ b/trunk/drivers/scsi/ses.c @@ -345,14 +345,14 @@ static int ses_enclosure_find_by_addr(struct enclosure_device *edev, return 0; } -#define VPD_INQUIRY_SIZE 36 +#define VPD_INQUIRY_SIZE 512 static void ses_match_to_enclosure(struct enclosure_device *edev, struct scsi_device *sdev) { unsigned char *buf = kmalloc(VPD_INQUIRY_SIZE, GFP_KERNEL); unsigned char *desc; - u16 vpd_len; + int len; struct efd efd = { .addr = 0, }; @@ -372,19 +372,9 @@ static void ses_match_to_enclosure(struct enclosure_device *edev, VPD_INQUIRY_SIZE, NULL, SES_TIMEOUT, SES_RETRIES)) goto free; - vpd_len = (buf[2] << 8) + buf[3]; - kfree(buf); - buf = kmalloc(vpd_len, GFP_KERNEL); - if (!buf) - return; - cmd[3] = vpd_len >> 8; - cmd[4] = vpd_len & 0xff; - if (scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, - vpd_len, NULL, SES_TIMEOUT, SES_RETRIES)) - goto free; - + len = (buf[2] << 8) + buf[3]; desc = buf + 4; - while (desc < buf + vpd_len) { + while (desc < buf + len) { enum scsi_protocol proto = desc[0] >> 4; u8 code_set = desc[0] & 0x0f; u8 piv = desc[1] & 0x80; diff --git a/trunk/drivers/scsi/sg.c b/trunk/drivers/scsi/sg.c index 3d36270a8b4d..d3b8ebb83776 100644 --- a/trunk/drivers/scsi/sg.c +++ b/trunk/drivers/scsi/sg.c @@ -1747,7 +1747,7 @@ st_map_user_pages(struct scatterlist *sgl, const unsigned int max_pages, */ flush_dcache_page(pages[i]); /* ?? Is locking needed? I don't think so */ - /* if (!trylock_page(pages[i])) + /* if (TestSetPageLocked(pages[i])) goto out_unlock; */ } diff --git a/trunk/drivers/serial/bfin_5xx.c b/trunk/drivers/serial/bfin_5xx.c index efcd44344fb1..9d8543762a30 100644 --- a/trunk/drivers/serial/bfin_5xx.c +++ b/trunk/drivers/serial/bfin_5xx.c @@ -817,7 +817,7 @@ static void bfin_serial_set_ldisc(struct uart_port *port) if (line >= port->info->port.tty->driver->num) return; - switch (port->info->port.tty->termios->c_line) { + switch (port->info->port.tty->ldisc.num) { case N_IRDA: val = UART_GET_GCTL(&bfin_serial_ports[line]); val |= (IREN | RPOLC); diff --git a/trunk/drivers/serial/crisv10.c b/trunk/drivers/serial/crisv10.c index bf94a770bb44..8249ac490559 100644 --- a/trunk/drivers/serial/crisv10.c +++ b/trunk/drivers/serial/crisv10.c @@ -234,7 +234,7 @@ unsigned long r_alt_ser_baudrate_shadow = 0; static struct e100_serial rs_table[] = { { .baud = DEF_BAUD, - .ioport = (unsigned char *)R_SERIAL0_CTRL, + .port = (unsigned char *)R_SERIAL0_CTRL, .irq = 1U << 12, /* uses DMA 6 and 7 */ .oclrintradr = R_DMA_CH6_CLR_INTR, .ofirstadr = R_DMA_CH6_FIRST, @@ -288,7 +288,7 @@ static struct e100_serial rs_table[] = { }, /* ttyS0 */ #ifndef CONFIG_SVINTO_SIM { .baud = DEF_BAUD, - .ioport = (unsigned char *)R_SERIAL1_CTRL, + .port = (unsigned char *)R_SERIAL1_CTRL, .irq = 1U << 16, /* uses DMA 8 and 9 */ .oclrintradr = R_DMA_CH8_CLR_INTR, .ofirstadr = R_DMA_CH8_FIRST, @@ -344,7 +344,7 @@ static struct e100_serial rs_table[] = { }, /* ttyS1 */ { .baud = DEF_BAUD, - .ioport = (unsigned char *)R_SERIAL2_CTRL, + .port = (unsigned char *)R_SERIAL2_CTRL, .irq = 1U << 4, /* uses DMA 2 and 3 */ .oclrintradr = R_DMA_CH2_CLR_INTR, .ofirstadr = R_DMA_CH2_FIRST, @@ -398,7 +398,7 @@ static struct e100_serial rs_table[] = { }, /* ttyS2 */ { .baud = DEF_BAUD, - .ioport = (unsigned char *)R_SERIAL3_CTRL, + .port = (unsigned char *)R_SERIAL3_CTRL, .irq = 1U << 8, /* uses DMA 4 and 5 */ .oclrintradr = R_DMA_CH4_CLR_INTR, .ofirstadr = R_DMA_CH4_FIRST, @@ -939,7 +939,7 @@ static const struct control_pins e100_modem_pins[NR_PORTS] = /* Output */ #define E100_RTS_GET(info) ((info)->rx_ctrl & E100_RTS_MASK) /* Input */ -#define E100_CTS_GET(info) ((info)->ioport[REG_STATUS] & E100_CTS_MASK) +#define E100_CTS_GET(info) ((info)->port[REG_STATUS] & E100_CTS_MASK) /* These are typically PA or PB and 0 means 0V, 1 means 3.3V */ /* Is an output */ @@ -1092,7 +1092,7 @@ e100_rts(struct e100_serial *info, int set) local_irq_save(flags); info->rx_ctrl &= ~E100_RTS_MASK; info->rx_ctrl |= (set ? 0 : E100_RTS_MASK); /* RTS is active low */ - info->ioport[REG_REC_CTRL] = info->rx_ctrl; + info->port[REG_REC_CTRL] = info->rx_ctrl; local_irq_restore(flags); #ifdef SERIAL_DEBUG_IO printk("ser%i rts %i\n", info->line, set); @@ -1142,7 +1142,7 @@ e100_disable_rx(struct e100_serial *info) { #ifndef CONFIG_SVINTO_SIM /* disable the receiver */ - info->ioport[REG_REC_CTRL] = + info->port[REG_REC_CTRL] = (info->rx_ctrl &= ~IO_MASK(R_SERIAL0_REC_CTRL, rec_enable)); #endif } @@ -1152,7 +1152,7 @@ e100_enable_rx(struct e100_serial *info) { #ifndef CONFIG_SVINTO_SIM /* enable the receiver */ - info->ioport[REG_REC_CTRL] = + info->port[REG_REC_CTRL] = (info->rx_ctrl |= IO_MASK(R_SERIAL0_REC_CTRL, rec_enable)); #endif } @@ -1490,7 +1490,7 @@ rs_stop(struct tty_struct *tty) xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); } - *((unsigned long *)&info->ioport[REG_XOFF]) = xoff; + *((unsigned long *)&info->port[REG_XOFF]) = xoff; local_irq_restore(flags); } } @@ -1513,7 +1513,7 @@ rs_start(struct tty_struct *tty) xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); } - *((unsigned long *)&info->ioport[REG_XOFF]) = xoff; + *((unsigned long *)&info->port[REG_XOFF]) = xoff; if (!info->uses_dma_out && info->xmit.head != info->xmit.tail && info->xmit.buf) e100_enable_serial_tx_ready_irq(info); @@ -1888,7 +1888,7 @@ static void receive_chars_dma(struct e100_serial *info) handle_all_descr_data(info); /* Read the status register to detect errors */ - rstat = info->ioport[REG_STATUS]; + rstat = info->port[REG_STATUS]; if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) { DFLOW(DEBUG_LOG(info->line, "XOFF detect stat %x\n", rstat)); } @@ -1897,7 +1897,7 @@ static void receive_chars_dma(struct e100_serial *info) /* If we got an error, we must reset it by reading the * data_in field */ - unsigned char data = info->ioport[REG_DATA]; + unsigned char data = info->port[REG_DATA]; PROCSTAT(ser_stat[info->line].errors_cnt++); DEBUG_LOG(info->line, "#dERR: s d 0x%04X\n", @@ -2077,7 +2077,7 @@ static int force_eop_if_needed(struct e100_serial *info) /* We check data_avail bit to determine if data has * arrived since last time */ - unsigned char rstat = info->ioport[REG_STATUS]; + unsigned char rstat = info->port[REG_STATUS]; /* error or datavail? */ if (rstat & SER_ERROR_MASK) { @@ -2096,7 +2096,7 @@ static int force_eop_if_needed(struct e100_serial *info) TIMERD(DEBUG_LOG(info->line, "timeout: rstat 0x%03X\n", rstat | (info->line << 8))); /* Read data to clear status flags */ - (void)info->ioport[REG_DATA]; + (void)info->port[REG_DATA]; info->forced_eop = 0; START_FLUSH_FAST_TIMER(info, "magic"); @@ -2296,7 +2296,7 @@ struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info) } /* Read data and status at the same time */ - data_read = *((unsigned long *)&info->ioport[REG_DATA_STATUS32]); + data_read = *((unsigned long *)&info->port[REG_DATA_STATUS32]); more_data: if (data_read & IO_MASK(R_SERIAL0_READ, xoff_detect) ) { DFLOW(DEBUG_LOG(info->line, "XOFF detect\n", 0)); @@ -2391,7 +2391,7 @@ struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info) info->icount.rx++; - data_read = *((unsigned long *)&info->ioport[REG_DATA_STATUS32]); + data_read = *((unsigned long *)&info->port[REG_DATA_STATUS32]); if (data_read & IO_MASK(R_SERIAL0_READ, data_avail)) { DEBUG_LOG(info->line, "ser_rx %c in loop\n", IO_EXTRACT(R_SERIAL0_READ, data_in, data_read)); goto more_data; @@ -2413,7 +2413,7 @@ static struct e100_serial* handle_ser_rx_interrupt(struct e100_serial *info) return handle_ser_rx_interrupt_no_dma(info); } /* DMA is used */ - rstat = info->ioport[REG_STATUS]; + rstat = info->port[REG_STATUS]; if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) { DFLOW(DEBUG_LOG(info->line, "XOFF detect\n", 0)); } @@ -2426,7 +2426,7 @@ static struct e100_serial* handle_ser_rx_interrupt(struct e100_serial *info) /* If we got an error, we must reset it by reading the * data_in field */ - data = info->ioport[REG_DATA]; + data = info->port[REG_DATA]; DINTR1(DEBUG_LOG(info->line, "ser_rx! %c\n", data)); DINTR1(DEBUG_LOG(info->line, "ser_rx err stat %02X\n", rstat)); if (!data && (rstat & SER_FRAMING_ERR_MASK)) { @@ -2528,10 +2528,10 @@ static void handle_ser_tx_interrupt(struct e100_serial *info) unsigned char rstat; DFLOW(DEBUG_LOG(info->line, "tx_int: xchar 0x%02X\n", info->x_char)); local_irq_save(flags); - rstat = info->ioport[REG_STATUS]; + rstat = info->port[REG_STATUS]; DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat)); - info->ioport[REG_TR_DATA] = info->x_char; + info->port[REG_TR_DATA] = info->x_char; info->icount.tx++; info->x_char = 0; /* We must enable since it is disabled in ser_interrupt */ @@ -2545,7 +2545,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info) /* We only use normal tx interrupt when sending x_char */ DFLOW(DEBUG_LOG(info->line, "tx_int: xchar sent\n", 0)); local_irq_save(flags); - rstat = info->ioport[REG_STATUS]; + rstat = info->port[REG_STATUS]; DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat)); e100_disable_serial_tx_ready_irq(info); if (info->port.tty->stopped) @@ -2573,7 +2573,7 @@ static void handle_ser_tx_interrupt(struct e100_serial *info) DINTR2(DEBUG_LOG(info->line, "tx_int %c\n", info->xmit.buf[info->xmit.tail])); /* Send a byte, rs485 timing is critical so turn of ints */ local_irq_save(flags); - info->ioport[REG_TR_DATA] = info->xmit.buf[info->xmit.tail]; + info->port[REG_TR_DATA] = info->xmit.buf[info->xmit.tail]; info->xmit.tail = (info->xmit.tail + 1) & (SERIAL_XMIT_SIZE-1); info->icount.tx++; if (info->xmit.head == info->xmit.tail) { @@ -2848,7 +2848,7 @@ startup(struct e100_serial * info) /* dummy read to reset any serial errors */ - (void)info->ioport[REG_DATA]; + (void)info->port[REG_DATA]; /* enable the interrupts */ if (info->uses_dma_out) @@ -2897,7 +2897,7 @@ shutdown(struct e100_serial * info) /* shut down the transmitter and receiver */ DFLOW(DEBUG_LOG(info->line, "shutdown %i\n", info->line)); e100_disable_rx(info); - info->ioport[REG_TR_CTRL] = (info->tx_ctrl &= ~0x40); + info->port[REG_TR_CTRL] = (info->tx_ctrl &= ~0x40); /* disable interrupts, reset dma channels */ if (info->uses_dma_in) { @@ -2968,7 +2968,7 @@ change_speed(struct e100_serial *info) if (!info->port.tty || !info->port.tty->termios) return; - if (!info->ioport) + if (!info->port) return; cflag = info->port.tty->termios->c_cflag; @@ -3037,7 +3037,7 @@ change_speed(struct e100_serial *info) info->baud = cflag_to_baud(cflag); #ifndef CONFIG_SVINTO_SIM - info->ioport[REG_BAUD] = cflag_to_etrax_baud(cflag); + info->port[REG_BAUD] = cflag_to_etrax_baud(cflag); #endif /* CONFIG_SVINTO_SIM */ } @@ -3097,8 +3097,8 @@ change_speed(struct e100_serial *info) /* actually write the control regs to the hardware */ - info->ioport[REG_TR_CTRL] = info->tx_ctrl; - info->ioport[REG_REC_CTRL] = info->rx_ctrl; + info->port[REG_TR_CTRL] = info->tx_ctrl; + info->port[REG_REC_CTRL] = info->rx_ctrl; xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->port.tty)); xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable); if (info->port.tty->termios->c_iflag & IXON ) { @@ -3107,7 +3107,7 @@ change_speed(struct e100_serial *info) xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); } - *((unsigned long *)&info->ioport[REG_XOFF]) = xoff; + *((unsigned long *)&info->port[REG_XOFF]) = xoff; local_irq_restore(flags); #endif /* !CONFIG_SVINTO_SIM */ @@ -3156,7 +3156,7 @@ static int rs_raw_write(struct tty_struct *tty, #ifdef SERIAL_DEBUG_DATA if (info->line == SERIAL_DEBUG_LINE) printk("rs_raw_write (%d), status %d\n", - count, info->ioport[REG_STATUS]); + count, info->port[REG_STATUS]); #endif #ifdef CONFIG_SVINTO_SIM @@ -3427,7 +3427,7 @@ get_serial_info(struct e100_serial * info, memset(&tmp, 0, sizeof(tmp)); tmp.type = info->type; tmp.line = info->line; - tmp.port = (int)info->ioport; + tmp.port = (int)info->port; tmp.irq = info->irq; tmp.flags = info->flags; tmp.baud_base = info->baud_base; @@ -3557,14 +3557,14 @@ char *get_control_state_str(int MLines, char *s) } #endif -static int +static void rs_break(struct tty_struct *tty, int break_state) { struct e100_serial *info = (struct e100_serial *)tty->driver_data; unsigned long flags; - if (!info->ioport) - return -EIO; + if (!info->port) + return; local_irq_save(flags); if (break_state == -1) { @@ -3575,9 +3575,8 @@ rs_break(struct tty_struct *tty, int break_state) /* Set bit 7 (txd) and 6 (tr_enable) */ info->tx_ctrl |= (0x80 | 0x40); } - info->ioport[REG_TR_CTRL] = info->tx_ctrl; + info->port[REG_TR_CTRL] = info->tx_ctrl; local_irq_restore(flags); - return 0; } static int @@ -4232,9 +4231,9 @@ static int line_info(char *buf, struct e100_serial *info) unsigned long tmp; ret = sprintf(buf, "%d: uart:E100 port:%lX irq:%d", - info->line, (unsigned long)info->ioport, info->irq); + info->line, (unsigned long)info->port, info->irq); - if (!info->ioport || (info->type == PORT_UNKNOWN)) { + if (!info->port || (info->type == PORT_UNKNOWN)) { ret += sprintf(buf+ret, "\n"); return ret; } @@ -4282,7 +4281,7 @@ static int line_info(char *buf, struct e100_serial *info) } { - unsigned char rstat = info->ioport[REG_STATUS]; + unsigned char rstat = info->port[REG_STATUS]; if (rstat & IO_MASK(R_SERIAL0_STATUS, xoff_detect) ) ret += sprintf(buf+ret, " xoff_detect:1"); } @@ -4503,7 +4502,7 @@ rs_init(void) if (info->enabled) { printk(KERN_INFO "%s%d at 0x%x is a builtin UART with DMA\n", - serial_driver->name, info->line, (unsigned int)info->ioport); + serial_driver->name, info->line, (unsigned int)info->port); } } #ifdef CONFIG_ETRAX_FAST_TIMER diff --git a/trunk/drivers/serial/crisv10.h b/trunk/drivers/serial/crisv10.h index e3c5c8c3c09b..ccd0f32b7372 100644 --- a/trunk/drivers/serial/crisv10.h +++ b/trunk/drivers/serial/crisv10.h @@ -36,9 +36,8 @@ struct etrax_recv_buffer { }; struct e100_serial { - struct tty_port port; int baud; - volatile u8 *ioport; /* R_SERIALx_CTRL */ + volatile u8 *port; /* R_SERIALx_CTRL */ u32 irq; /* bitnr in R_IRQ_MASK2 for dmaX_descr */ /* Output registers */ diff --git a/trunk/drivers/sh/maple/maple.c b/trunk/drivers/sh/maple/maple.c index d1812d32f47d..be97789fa5fd 100644 --- a/trunk/drivers/sh/maple/maple.c +++ b/trunk/drivers/sh/maple/maple.c @@ -2,7 +2,6 @@ * Core maple bus functionality * * Copyright (C) 2007, 2008 Adrian McMenamin - * Copyright (C) 2001 - 2008 Paul Mundt * * Based on 2.4 code by: * @@ -32,7 +31,7 @@ #include #include -MODULE_AUTHOR("Yaegashi Takeshi, Paul Mundt, M. R. Brown, Adrian McMenamin"); +MODULE_AUTHOR("Yaegshi Takeshi, Paul Mundt, M.R. Brown, Adrian McMenamin"); MODULE_DESCRIPTION("Maple bus driver for Dreamcast"); MODULE_LICENSE("GPL v2"); MODULE_SUPPORTED_DEVICE("{{SEGA, Dreamcast/Maple}}"); @@ -66,36 +65,19 @@ static bool checked[4]; static struct maple_device *baseunits[4]; /** - * maple_driver_register - register a maple driver - * @drv: maple driver to be registered. - * - * Registers the passed in @drv, while updating the bus type. - * Devices with matching function IDs will be automatically probed. + * maple_driver_register - register a device driver + * automatically makes the driver bus a maple bus + * @drv: the driver to be registered */ -int maple_driver_register(struct maple_driver *drv) +int maple_driver_register(struct device_driver *drv) { if (!drv) return -EINVAL; - - drv->drv.bus = &maple_bus_type; - - return driver_register(&drv->drv); + drv->bus = &maple_bus_type; + return driver_register(drv); } EXPORT_SYMBOL_GPL(maple_driver_register); -/** - * maple_driver_unregister - unregister a maple driver. - * @drv: maple driver to unregister. - * - * Cleans up after maple_driver_register(). To be invoked in the exit - * path of any module drivers. - */ -void maple_driver_unregister(struct maple_driver *drv) -{ - driver_unregister(&drv->drv); -} -EXPORT_SYMBOL_GPL(maple_driver_unregister); - /* set hardware registers to enable next round of dma */ static void maplebus_dma_reset(void) { @@ -147,13 +129,13 @@ static void maple_release_device(struct device *dev) kfree(mdev); } -/** +/* * maple_add_packet - add a single instruction to the queue - * @mdev: maple device - * @function: function on device being queried - * @command: maple command to add - * @length: length of command string (in 32 bit words) - * @data: remainder of command string + * @mdev - maple device + * @function - function on device being queried + * @command - maple command to add + * @length - length of command string (in 32 bit words) + * @data - remainder of command string */ int maple_add_packet(struct maple_device *mdev, u32 function, u32 command, size_t length, void *data) @@ -194,15 +176,14 @@ int maple_add_packet(struct maple_device *mdev, u32 function, u32 command, } EXPORT_SYMBOL_GPL(maple_add_packet); -/** +/* * maple_add_packet_sleeps - add a single instruction to the queue - * @mdev: maple device - * @function: function on device being queried - * @command: maple command to add - * @length: length of command string (in 32 bit words) - * @data: remainder of command string - * - * Same as maple_add_packet(), but waits for the lock to become free. + * - waits for lock to be free + * @mdev - maple device + * @function - function on device being queried + * @command - maple command to add + * @length - length of command string (in 32 bit words) + * @data - remainder of command string */ int maple_add_packet_sleeps(struct maple_device *mdev, u32 function, u32 command, size_t length, void *data) @@ -743,9 +724,11 @@ static int maple_get_dma_buffer(void) static int match_maple_bus_driver(struct device *devptr, struct device_driver *drvptr) { - struct maple_driver *maple_drv = to_maple_driver(drvptr); - struct maple_device *maple_dev = to_maple_dev(devptr); + struct maple_driver *maple_drv; + struct maple_device *maple_dev; + maple_drv = container_of(drvptr, struct maple_driver, drv); + maple_dev = container_of(devptr, struct maple_device, dev); /* Trap empty port case */ if (maple_dev->devinfo.function == 0xFFFFFFFF) return 0; diff --git a/trunk/drivers/spi/Kconfig b/trunk/drivers/spi/Kconfig index b9d0efb6803f..2303521b4f09 100644 --- a/trunk/drivers/spi/Kconfig +++ b/trunk/drivers/spi/Kconfig @@ -149,12 +149,6 @@ config SPI_OMAP24XX SPI master controller for OMAP24xx/OMAP34xx Multichannel SPI (McSPI) modules. -config SPI_ORION - tristate "Orion SPI master (EXPERIMENTAL)" - depends on PLAT_ORION && EXPERIMENTAL - help - This enables using the SPI master controller on the Orion chips. - config SPI_PXA2XX tristate "PXA2xx SSP SPI master" depends on ARCH_PXA && EXPERIMENTAL diff --git a/trunk/drivers/spi/Makefile b/trunk/drivers/spi/Makefile index ccf18de34e1e..7fca043ce723 100644 --- a/trunk/drivers/spi/Makefile +++ b/trunk/drivers/spi/Makefile @@ -21,7 +21,6 @@ obj-$(CONFIG_SPI_LM70_LLP) += spi_lm70llp.o obj-$(CONFIG_SPI_PXA2XX) += pxa2xx_spi.o obj-$(CONFIG_SPI_OMAP_UWIRE) += omap_uwire.o obj-$(CONFIG_SPI_OMAP24XX) += omap2_mcspi.o -obj-$(CONFIG_SPI_ORION) += orion_spi.o obj-$(CONFIG_SPI_MPC52xx_PSC) += mpc52xx_psc_spi.o obj-$(CONFIG_SPI_MPC83xx) += spi_mpc83xx.o obj-$(CONFIG_SPI_S3C24XX_GPIO) += spi_s3c24xx_gpio.o diff --git a/trunk/drivers/spi/atmel_spi.c b/trunk/drivers/spi/atmel_spi.c index 95190c619c10..0c7165660853 100644 --- a/trunk/drivers/spi/atmel_spi.c +++ b/trunk/drivers/spi/atmel_spi.c @@ -184,8 +184,7 @@ static void atmel_spi_next_xfer(struct spi_master *master, { struct atmel_spi *as = spi_master_get_devdata(master); struct spi_transfer *xfer; - u32 len, remaining; - u32 ieval; + u32 len, remaining, total; dma_addr_t tx_dma, rx_dma; if (!as->current_transfer) @@ -198,8 +197,6 @@ static void atmel_spi_next_xfer(struct spi_master *master, xfer = NULL; if (xfer) { - spi_writel(as, PTCR, SPI_BIT(RXTDIS) | SPI_BIT(TXTDIS)); - len = xfer->len; atmel_spi_next_xfer_data(master, xfer, &tx_dma, &rx_dma, &len); remaining = xfer->len - len; @@ -237,8 +234,6 @@ static void atmel_spi_next_xfer(struct spi_master *master, as->next_transfer = xfer; if (xfer) { - u32 total; - total = len; atmel_spi_next_xfer_data(master, xfer, &tx_dma, &rx_dma, &len); as->next_remaining_bytes = total - len; @@ -255,11 +250,9 @@ static void atmel_spi_next_xfer(struct spi_master *master, " next xfer %p: len %u tx %p/%08x rx %p/%08x\n", xfer, xfer->len, xfer->tx_buf, xfer->tx_dma, xfer->rx_buf, xfer->rx_dma); - ieval = SPI_BIT(ENDRX) | SPI_BIT(OVRES); } else { spi_writel(as, RNCR, 0); spi_writel(as, TNCR, 0); - ieval = SPI_BIT(RXBUFF) | SPI_BIT(ENDRX) | SPI_BIT(OVRES); } /* REVISIT: We're waiting for ENDRX before we start the next @@ -272,7 +265,7 @@ static void atmel_spi_next_xfer(struct spi_master *master, * * It should be doable, though. Just not now... */ - spi_writel(as, IER, ieval); + spi_writel(as, IER, SPI_BIT(ENDRX) | SPI_BIT(OVRES)); spi_writel(as, PTCR, SPI_BIT(TXTEN) | SPI_BIT(RXTEN)); } @@ -403,7 +396,7 @@ atmel_spi_interrupt(int irq, void *dev_id) ret = IRQ_HANDLED; - spi_writel(as, IDR, (SPI_BIT(RXBUFF) | SPI_BIT(ENDRX) + spi_writel(as, IDR, (SPI_BIT(ENDTX) | SPI_BIT(ENDRX) | SPI_BIT(OVRES))); /* @@ -425,7 +418,7 @@ atmel_spi_interrupt(int irq, void *dev_id) if (xfer->delay_usecs) udelay(xfer->delay_usecs); - dev_warn(master->dev.parent, "overrun (%u/%u remaining)\n", + dev_warn(master->dev.parent, "fifo overrun (%u/%u remaining)\n", spi_readl(as, TCR), spi_readl(as, RCR)); /* @@ -449,7 +442,7 @@ atmel_spi_interrupt(int irq, void *dev_id) spi_readl(as, SR); atmel_spi_msg_done(master, as, msg, -EIO, 0); - } else if (pending & (SPI_BIT(RXBUFF) | SPI_BIT(ENDRX))) { + } else if (pending & SPI_BIT(ENDRX)) { ret = IRQ_HANDLED; spi_writel(as, IDR, pending); diff --git a/trunk/drivers/spi/orion_spi.c b/trunk/drivers/spi/orion_spi.c deleted file mode 100644 index c4eaacd6e553..000000000000 --- a/trunk/drivers/spi/orion_spi.c +++ /dev/null @@ -1,574 +0,0 @@ -/* - * orion_spi.c -- Marvell Orion SPI controller driver - * - * Author: Shadi Ammouri - * Copyright (C) 2007-2008 Marvell Ltd. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define DRIVER_NAME "orion_spi" - -#define ORION_NUM_CHIPSELECTS 1 /* only one slave is supported*/ -#define ORION_SPI_WAIT_RDY_MAX_LOOP 2000 /* in usec */ - -#define ORION_SPI_IF_CTRL_REG 0x00 -#define ORION_SPI_IF_CONFIG_REG 0x04 -#define ORION_SPI_DATA_OUT_REG 0x08 -#define ORION_SPI_DATA_IN_REG 0x0c -#define ORION_SPI_INT_CAUSE_REG 0x10 - -#define ORION_SPI_IF_8_16_BIT_MODE (1 << 5) -#define ORION_SPI_CLK_PRESCALE_MASK 0x1F - -struct orion_spi { - struct work_struct work; - - /* Lock access to transfer list. */ - spinlock_t lock; - - struct list_head msg_queue; - struct spi_master *master; - void __iomem *base; - unsigned int max_speed; - unsigned int min_speed; - struct orion_spi_info *spi_info; -}; - -static struct workqueue_struct *orion_spi_wq; - -static inline void __iomem *spi_reg(struct orion_spi *orion_spi, u32 reg) -{ - return orion_spi->base + reg; -} - -static inline void -orion_spi_setbits(struct orion_spi *orion_spi, u32 reg, u32 mask) -{ - void __iomem *reg_addr = spi_reg(orion_spi, reg); - u32 val; - - val = readl(reg_addr); - val |= mask; - writel(val, reg_addr); -} - -static inline void -orion_spi_clrbits(struct orion_spi *orion_spi, u32 reg, u32 mask) -{ - void __iomem *reg_addr = spi_reg(orion_spi, reg); - u32 val; - - val = readl(reg_addr); - val &= ~mask; - writel(val, reg_addr); -} - -static int orion_spi_set_transfer_size(struct orion_spi *orion_spi, int size) -{ - if (size == 16) { - orion_spi_setbits(orion_spi, ORION_SPI_IF_CONFIG_REG, - ORION_SPI_IF_8_16_BIT_MODE); - } else if (size == 8) { - orion_spi_clrbits(orion_spi, ORION_SPI_IF_CONFIG_REG, - ORION_SPI_IF_8_16_BIT_MODE); - } else { - pr_debug("Bad bits per word value %d (only 8 or 16 are " - "allowed).\n", size); - return -EINVAL; - } - - return 0; -} - -static int orion_spi_baudrate_set(struct spi_device *spi, unsigned int speed) -{ - u32 tclk_hz; - u32 rate; - u32 prescale; - u32 reg; - struct orion_spi *orion_spi; - - orion_spi = spi_master_get_devdata(spi->master); - - tclk_hz = orion_spi->spi_info->tclk; - - /* - * the supported rates are: 4,6,8...30 - * round up as we look for equal or less speed - */ - rate = DIV_ROUND_UP(tclk_hz, speed); - rate = roundup(rate, 2); - - /* check if requested speed is too small */ - if (rate > 30) - return -EINVAL; - - if (rate < 4) - rate = 4; - - /* Convert the rate to SPI clock divisor value. */ - prescale = 0x10 + rate/2; - - reg = readl(spi_reg(orion_spi, ORION_SPI_IF_CONFIG_REG)); - reg = ((reg & ~ORION_SPI_CLK_PRESCALE_MASK) | prescale); - writel(reg, spi_reg(orion_spi, ORION_SPI_IF_CONFIG_REG)); - - return 0; -} - -/* - * called only when no transfer is active on the bus - */ -static int -orion_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) -{ - struct orion_spi *orion_spi; - unsigned int speed = spi->max_speed_hz; - unsigned int bits_per_word = spi->bits_per_word; - int rc; - - orion_spi = spi_master_get_devdata(spi->master); - - if ((t != NULL) && t->speed_hz) - speed = t->speed_hz; - - if ((t != NULL) && t->bits_per_word) - bits_per_word = t->bits_per_word; - - rc = orion_spi_baudrate_set(spi, speed); - if (rc) - return rc; - - return orion_spi_set_transfer_size(orion_spi, bits_per_word); -} - -static void orion_spi_set_cs(struct orion_spi *orion_spi, int enable) -{ - if (enable) - orion_spi_setbits(orion_spi, ORION_SPI_IF_CTRL_REG, 0x1); - else - orion_spi_clrbits(orion_spi, ORION_SPI_IF_CTRL_REG, 0x1); -} - -static inline int orion_spi_wait_till_ready(struct orion_spi *orion_spi) -{ - int i; - - for (i = 0; i < ORION_SPI_WAIT_RDY_MAX_LOOP; i++) { - if (readl(spi_reg(orion_spi, ORION_SPI_INT_CAUSE_REG))) - return 1; - else - udelay(1); - } - - return -1; -} - -static inline int -orion_spi_write_read_8bit(struct spi_device *spi, - const u8 **tx_buf, u8 **rx_buf) -{ - void __iomem *tx_reg, *rx_reg, *int_reg; - struct orion_spi *orion_spi; - - orion_spi = spi_master_get_devdata(spi->master); - tx_reg = spi_reg(orion_spi, ORION_SPI_DATA_OUT_REG); - rx_reg = spi_reg(orion_spi, ORION_SPI_DATA_IN_REG); - int_reg = spi_reg(orion_spi, ORION_SPI_INT_CAUSE_REG); - - /* clear the interrupt cause register */ - writel(0x0, int_reg); - - if (tx_buf && *tx_buf) - writel(*(*tx_buf)++, tx_reg); - else - writel(0, tx_reg); - - if (orion_spi_wait_till_ready(orion_spi) < 0) { - dev_err(&spi->dev, "TXS timed out\n"); - return -1; - } - - if (rx_buf && *rx_buf) - *(*rx_buf)++ = readl(rx_reg); - - return 1; -} - -static inline int -orion_spi_write_read_16bit(struct spi_device *spi, - const u16 **tx_buf, u16 **rx_buf) -{ - void __iomem *tx_reg, *rx_reg, *int_reg; - struct orion_spi *orion_spi; - - orion_spi = spi_master_get_devdata(spi->master); - tx_reg = spi_reg(orion_spi, ORION_SPI_DATA_OUT_REG); - rx_reg = spi_reg(orion_spi, ORION_SPI_DATA_IN_REG); - int_reg = spi_reg(orion_spi, ORION_SPI_INT_CAUSE_REG); - - /* clear the interrupt cause register */ - writel(0x0, int_reg); - - if (tx_buf && *tx_buf) - writel(__cpu_to_le16(get_unaligned((*tx_buf)++)), tx_reg); - else - writel(0, tx_reg); - - if (orion_spi_wait_till_ready(orion_spi) < 0) { - dev_err(&spi->dev, "TXS timed out\n"); - return -1; - } - - if (rx_buf && *rx_buf) - put_unaligned(__le16_to_cpu(readl(rx_reg)), (*rx_buf)++); - - return 1; -} - -static unsigned int -orion_spi_write_read(struct spi_device *spi, struct spi_transfer *xfer) -{ - struct orion_spi *orion_spi; - unsigned int count; - int word_len; - - orion_spi = spi_master_get_devdata(spi->master); - word_len = spi->bits_per_word; - count = xfer->len; - - if (word_len == 8) { - const u8 *tx = xfer->tx_buf; - u8 *rx = xfer->rx_buf; - - do { - if (orion_spi_write_read_8bit(spi, &tx, &rx) < 0) - goto out; - count--; - } while (count); - } else if (word_len == 16) { - const u16 *tx = xfer->tx_buf; - u16 *rx = xfer->rx_buf; - - do { - if (orion_spi_write_read_16bit(spi, &tx, &rx) < 0) - goto out; - count -= 2; - } while (count); - } - -out: - return xfer->len - count; -} - - -static void orion_spi_work(struct work_struct *work) -{ - struct orion_spi *orion_spi = - container_of(work, struct orion_spi, work); - - spin_lock_irq(&orion_spi->lock); - while (!list_empty(&orion_spi->msg_queue)) { - struct spi_message *m; - struct spi_device *spi; - struct spi_transfer *t = NULL; - int par_override = 0; - int status = 0; - int cs_active = 0; - - m = container_of(orion_spi->msg_queue.next, struct spi_message, - queue); - - list_del_init(&m->queue); - spin_unlock_irq(&orion_spi->lock); - - spi = m->spi; - - /* Load defaults */ - status = orion_spi_setup_transfer(spi, NULL); - - if (status < 0) - goto msg_done; - - list_for_each_entry(t, &m->transfers, transfer_list) { - if (par_override || t->speed_hz || t->bits_per_word) { - par_override = 1; - status = orion_spi_setup_transfer(spi, t); - if (status < 0) - break; - if (!t->speed_hz && !t->bits_per_word) - par_override = 0; - } - - if (!cs_active) { - orion_spi_set_cs(orion_spi, 1); - cs_active = 1; - } - - if (t->len) - m->actual_length += - orion_spi_write_read(spi, t); - - if (t->delay_usecs) - udelay(t->delay_usecs); - - if (t->cs_change) { - orion_spi_set_cs(orion_spi, 0); - cs_active = 0; - } - } - -msg_done: - if (cs_active) - orion_spi_set_cs(orion_spi, 0); - - m->status = status; - m->complete(m->context); - - spin_lock_irq(&orion_spi->lock); - } - - spin_unlock_irq(&orion_spi->lock); -} - -static int __init orion_spi_reset(struct orion_spi *orion_spi) -{ - /* Verify that the CS is deasserted */ - orion_spi_set_cs(orion_spi, 0); - - return 0; -} - -static int orion_spi_setup(struct spi_device *spi) -{ - struct orion_spi *orion_spi; - - orion_spi = spi_master_get_devdata(spi->master); - - if (spi->mode) { - dev_err(&spi->dev, "setup: unsupported mode bits %x\n", - spi->mode); - return -EINVAL; - } - - if (spi->bits_per_word == 0) - spi->bits_per_word = 8; - - if ((spi->max_speed_hz == 0) - || (spi->max_speed_hz > orion_spi->max_speed)) - spi->max_speed_hz = orion_spi->max_speed; - - if (spi->max_speed_hz < orion_spi->min_speed) { - dev_err(&spi->dev, "setup: requested speed too low %d Hz\n", - spi->max_speed_hz); - return -EINVAL; - } - - /* - * baudrate & width will be set orion_spi_setup_transfer - */ - return 0; -} - -static int orion_spi_transfer(struct spi_device *spi, struct spi_message *m) -{ - struct orion_spi *orion_spi; - struct spi_transfer *t = NULL; - unsigned long flags; - - m->actual_length = 0; - m->status = 0; - - /* reject invalid messages and transfers */ - if (list_empty(&m->transfers) || !m->complete) - return -EINVAL; - - orion_spi = spi_master_get_devdata(spi->master); - - list_for_each_entry(t, &m->transfers, transfer_list) { - unsigned int bits_per_word = spi->bits_per_word; - - if (t->tx_buf == NULL && t->rx_buf == NULL && t->len) { - dev_err(&spi->dev, - "message rejected : " - "invalid transfer data buffers\n"); - goto msg_rejected; - } - - if ((t != NULL) && t->bits_per_word) - bits_per_word = t->bits_per_word; - - if ((bits_per_word != 8) && (bits_per_word != 16)) { - dev_err(&spi->dev, - "message rejected : " - "invalid transfer bits_per_word (%d bits)\n", - bits_per_word); - goto msg_rejected; - } - /*make sure buffer length is even when working in 16 bit mode*/ - if ((t != NULL) && (t->bits_per_word == 16) && (t->len & 1)) { - dev_err(&spi->dev, - "message rejected : " - "odd data length (%d) while in 16 bit mode\n", - t->len); - goto msg_rejected; - } - - if (t->speed_hz < orion_spi->min_speed) { - dev_err(&spi->dev, - "message rejected : " - "device min speed (%d Hz) exceeds " - "required transfer speed (%d Hz)\n", - orion_spi->min_speed, t->speed_hz); - goto msg_rejected; - } - } - - - spin_lock_irqsave(&orion_spi->lock, flags); - list_add_tail(&m->queue, &orion_spi->msg_queue); - queue_work(orion_spi_wq, &orion_spi->work); - spin_unlock_irqrestore(&orion_spi->lock, flags); - - return 0; -msg_rejected: - /* Message rejected and not queued */ - m->status = -EINVAL; - if (m->complete) - m->complete(m->context); - return -EINVAL; -} - -static int __init orion_spi_probe(struct platform_device *pdev) -{ - struct spi_master *master; - struct orion_spi *spi; - struct resource *r; - struct orion_spi_info *spi_info; - int status = 0; - - spi_info = pdev->dev.platform_data; - - master = spi_alloc_master(&pdev->dev, sizeof *spi); - if (master == NULL) { - dev_dbg(&pdev->dev, "master allocation failed\n"); - return -ENOMEM; - } - - if (pdev->id != -1) - master->bus_num = pdev->id; - - master->setup = orion_spi_setup; - master->transfer = orion_spi_transfer; - master->num_chipselect = ORION_NUM_CHIPSELECTS; - - dev_set_drvdata(&pdev->dev, master); - - spi = spi_master_get_devdata(master); - spi->master = master; - spi->spi_info = spi_info; - - spi->max_speed = DIV_ROUND_UP(spi_info->tclk, 4); - spi->min_speed = DIV_ROUND_UP(spi_info->tclk, 30); - - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (r == NULL) { - status = -ENODEV; - goto out; - } - - if (!request_mem_region(r->start, (r->end - r->start) + 1, - pdev->dev.bus_id)) { - status = -EBUSY; - goto out; - } - spi->base = ioremap(r->start, SZ_1K); - - INIT_WORK(&spi->work, orion_spi_work); - - spin_lock_init(&spi->lock); - INIT_LIST_HEAD(&spi->msg_queue); - - if (orion_spi_reset(spi) < 0) - goto out_rel_mem; - - status = spi_register_master(master); - if (status < 0) - goto out_rel_mem; - - return status; - -out_rel_mem: - release_mem_region(r->start, (r->end - r->start) + 1); - -out: - spi_master_put(master); - return status; -} - - -static int __exit orion_spi_remove(struct platform_device *pdev) -{ - struct spi_master *master; - struct orion_spi *spi; - struct resource *r; - - master = dev_get_drvdata(&pdev->dev); - spi = spi_master_get_devdata(master); - - cancel_work_sync(&spi->work); - - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); - release_mem_region(r->start, (r->end - r->start) + 1); - - spi_unregister_master(master); - - return 0; -} - -MODULE_ALIAS("platform:" DRIVER_NAME); - -static struct platform_driver orion_spi_driver = { - .driver = { - .name = DRIVER_NAME, - .owner = THIS_MODULE, - }, - .remove = __exit_p(orion_spi_remove), -}; - -static int __init orion_spi_init(void) -{ - orion_spi_wq = create_singlethread_workqueue( - orion_spi_driver.driver.name); - if (orion_spi_wq == NULL) - return -ENOMEM; - - return platform_driver_probe(&orion_spi_driver, orion_spi_probe); -} -module_init(orion_spi_init); - -static void __exit orion_spi_exit(void) -{ - flush_workqueue(orion_spi_wq); - platform_driver_unregister(&orion_spi_driver); - - destroy_workqueue(orion_spi_wq); -} -module_exit(orion_spi_exit); - -MODULE_DESCRIPTION("Orion SPI driver"); -MODULE_AUTHOR("Shadi Ammouri "); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/spi/spi_s3c24xx.c b/trunk/drivers/spi/spi_s3c24xx.c index 21661c7959c8..1c643c9e1f15 100644 --- a/trunk/drivers/spi/spi_s3c24xx.c +++ b/trunk/drivers/spi/spi_s3c24xx.c @@ -236,19 +236,6 @@ static irqreturn_t s3c24xx_spi_irq(int irq, void *dev) return IRQ_HANDLED; } -static void s3c24xx_spi_initialsetup(struct s3c24xx_spi *hw) -{ - /* for the moment, permanently enable the clock */ - - clk_enable(hw->clk); - - /* program defaults into the registers */ - - writeb(0xff, hw->regs + S3C2410_SPPRE); - writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN); - writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON); -} - static int __init s3c24xx_spi_probe(struct platform_device *pdev) { struct s3c2410_spi_info *pdata; @@ -340,7 +327,15 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev) goto err_no_clk; } - s3c24xx_spi_initialsetup(hw); + /* for the moment, permanently enable the clock */ + + clk_enable(hw->clk); + + /* program defaults into the registers */ + + writeb(0xff, hw->regs + S3C2410_SPPRE); + writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN); + writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON); /* setup any gpio we can */ @@ -420,7 +415,7 @@ static int s3c24xx_spi_resume(struct platform_device *pdev) { struct s3c24xx_spi *hw = platform_get_drvdata(pdev); - s3c24xx_spi_initialsetup(hw); + clk_enable(hw->clk); return 0; } diff --git a/trunk/drivers/usb/core/message.c b/trunk/drivers/usb/core/message.c index 586d6f1376cf..2fcc06eb5e60 100644 --- a/trunk/drivers/usb/core/message.c +++ b/trunk/drivers/usb/core/message.c @@ -389,6 +389,7 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, if (io->entries <= 0) return io->entries; + io->count = io->entries; io->urbs = kmalloc(io->entries * sizeof *io->urbs, mem_flags); if (!io->urbs) goto nomem; @@ -457,7 +458,6 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, io->urbs[--i]->transfer_flags &= ~URB_NO_INTERRUPT; /* transaction state */ - io->count = io->entries; io->status = 0; io->bytes = 0; init_completion(&io->complete); diff --git a/trunk/drivers/usb/storage/freecom.c b/trunk/drivers/usb/storage/freecom.c index 73ac7262239e..7a4d45677227 100644 --- a/trunk/drivers/usb/storage/freecom.c +++ b/trunk/drivers/usb/storage/freecom.c @@ -26,6 +26,8 @@ * (http://www.freecom.de/) */ +#include + #include #include diff --git a/trunk/drivers/video/arkfb.c b/trunk/drivers/video/arkfb.c index 4bd569e479a7..38a1e8308c83 100644 --- a/trunk/drivers/video/arkfb.c +++ b/trunk/drivers/video/arkfb.c @@ -958,20 +958,20 @@ static int __devinit ark_pci_probe(struct pci_dev *dev, const struct pci_device_ /* Prepare PCI device */ rc = pci_enable_device(dev); if (rc < 0) { - dev_err(info->device, "cannot enable PCI device\n"); + dev_err(info->dev, "cannot enable PCI device\n"); goto err_enable_device; } rc = pci_request_regions(dev, "arkfb"); if (rc < 0) { - dev_err(info->device, "cannot reserve framebuffer region\n"); + dev_err(info->dev, "cannot reserve framebuffer region\n"); goto err_request_regions; } par->dac = ics5342_init(ark_dac_read_regs, ark_dac_write_regs, info); if (! par->dac) { rc = -ENOMEM; - dev_err(info->device, "RAMDAC initialization failed\n"); + dev_err(info->dev, "RAMDAC initialization failed\n"); goto err_dac; } @@ -982,7 +982,7 @@ static int __devinit ark_pci_probe(struct pci_dev *dev, const struct pci_device_ info->screen_base = pci_iomap(dev, 0, 0); if (! info->screen_base) { rc = -ENOMEM; - dev_err(info->device, "iomap for framebuffer failed\n"); + dev_err(info->dev, "iomap for framebuffer failed\n"); goto err_iomap; } @@ -1004,19 +1004,19 @@ static int __devinit ark_pci_probe(struct pci_dev *dev, const struct pci_device_ rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8); if (! ((rc == 1) || (rc == 2))) { rc = -EINVAL; - dev_err(info->device, "mode %s not found\n", mode_option); + dev_err(info->dev, "mode %s not found\n", mode_option); goto err_find_mode; } rc = fb_alloc_cmap(&info->cmap, 256, 0); if (rc < 0) { - dev_err(info->device, "cannot allocate colormap\n"); + dev_err(info->dev, "cannot allocate colormap\n"); goto err_alloc_cmap; } rc = register_framebuffer(info); if (rc < 0) { - dev_err(info->device, "cannot register framebugger\n"); + dev_err(info->dev, "cannot register framebugger\n"); goto err_reg_fb; } @@ -1090,7 +1090,7 @@ static int ark_pci_suspend (struct pci_dev* dev, pm_message_t state) struct fb_info *info = pci_get_drvdata(dev); struct arkfb_info *par = info->par; - dev_info(info->device, "suspend\n"); + dev_info(info->dev, "suspend\n"); acquire_console_sem(); mutex_lock(&(par->open_lock)); @@ -1121,7 +1121,7 @@ static int ark_pci_resume (struct pci_dev* dev) struct fb_info *info = pci_get_drvdata(dev); struct arkfb_info *par = info->par; - dev_info(info->device, "resume\n"); + dev_info(info->dev, "resume\n"); acquire_console_sem(); mutex_lock(&(par->open_lock)); diff --git a/trunk/drivers/video/aty/atyfb_base.c b/trunk/drivers/video/aty/atyfb_base.c index cc6b470073da..620ba8120368 100644 --- a/trunk/drivers/video/aty/atyfb_base.c +++ b/trunk/drivers/video/aty/atyfb_base.c @@ -244,7 +244,7 @@ static int atyfb_sync(struct fb_info *info); */ static int aty_init(struct fb_info *info); - +static void aty_resume_chip(struct fb_info *info); #ifdef CONFIG_ATARI static int store_video_par(char *videopar, unsigned char m64_num); #endif @@ -2023,20 +2023,6 @@ static int atyfb_pci_suspend(struct pci_dev *pdev, pm_message_t state) return 0; } -static void aty_resume_chip(struct fb_info *info) -{ - struct atyfb_par *par = info->par; - - aty_st_le32(MEM_CNTL, par->mem_cntl, par); - - if (par->pll_ops->resume_pll) - par->pll_ops->resume_pll(info, &par->pll); - - if (par->aux_start) - aty_st_le32(BUS_CNTL, - aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par); -} - static int atyfb_pci_resume(struct pci_dev *pdev) { struct fb_info *info = pci_get_drvdata(pdev); @@ -2673,6 +2659,19 @@ static int __devinit aty_init(struct fb_info *info) return ret; } +static void aty_resume_chip(struct fb_info *info) +{ + struct atyfb_par *par = info->par; + + aty_st_le32(MEM_CNTL, par->mem_cntl, par); + + if (par->pll_ops->resume_pll) + par->pll_ops->resume_pll(info, &par->pll); + + if (par->aux_start) + aty_st_le32(BUS_CNTL, aty_ld_le32(BUS_CNTL, par) | BUS_APER_REG_DIS, par); +} + #ifdef CONFIG_ATARI static int __devinit store_video_par(char *video_str, unsigned char m64_num) { diff --git a/trunk/drivers/video/aty/radeon_accel.c b/trunk/drivers/video/aty/radeon_accel.c index 4d13f68436e6..3ca27cb13caa 100644 --- a/trunk/drivers/video/aty/radeon_accel.c +++ b/trunk/drivers/video/aty/radeon_accel.c @@ -241,8 +241,8 @@ void radeonfb_engine_reset(struct radeonfb_info *rinfo) INREG(HOST_PATH_CNTL); OUTREG(HOST_PATH_CNTL, host_path_cntl); - if (rinfo->family != CHIP_FAMILY_R300 && - rinfo->family != CHIP_FAMILY_R350 && + if (rinfo->family != CHIP_FAMILY_R300 || + rinfo->family != CHIP_FAMILY_R350 || rinfo->family != CHIP_FAMILY_RV350) OUTREG(RBBM_SOFT_RESET, rbbm_soft_reset); diff --git a/trunk/drivers/video/aty/radeon_i2c.c b/trunk/drivers/video/aty/radeon_i2c.c index 8c8fa35f1b7c..f9e7c29ad9bf 100644 --- a/trunk/drivers/video/aty/radeon_i2c.c +++ b/trunk/drivers/video/aty/radeon_i2c.c @@ -69,8 +69,7 @@ static int radeon_setup_i2c_bus(struct radeon_i2c_chan *chan, const char *name) { int rc; - snprintf(chan->adapter.name, sizeof(chan->adapter.name), - "radeonfb %s", name); + strcpy(chan->adapter.name, name); chan->adapter.owner = THIS_MODULE; chan->adapter.id = I2C_HW_B_RADEON; chan->adapter.algo_data = &chan->algo; diff --git a/trunk/drivers/video/backlight/pwm_bl.c b/trunk/drivers/video/backlight/pwm_bl.c index ea07258565f0..6338d0e2fe07 100644 --- a/trunk/drivers/video/backlight/pwm_bl.c +++ b/trunk/drivers/video/backlight/pwm_bl.c @@ -68,10 +68,8 @@ static int pwm_backlight_probe(struct platform_device *pdev) struct pwm_bl_data *pb; int ret; - if (!data) { - dev_err(&pdev->dev, "failed to find platform data\n"); + if (!data) return -EINVAL; - } if (data->init) { ret = data->init(&pdev->dev); @@ -81,7 +79,6 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb = kzalloc(sizeof(*pb), GFP_KERNEL); if (!pb) { - dev_err(&pdev->dev, "no memory for state\n"); ret = -ENOMEM; goto err_alloc; } @@ -94,8 +91,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) dev_err(&pdev->dev, "unable to request PWM for backlight\n"); ret = PTR_ERR(pb->pwm); goto err_pwm; - } else - dev_dbg(&pdev->dev, "got pwm for backlight\n"); + } bl = backlight_device_register(pdev->name, &pdev->dev, pb, &pwm_backlight_ops); @@ -187,5 +183,3 @@ module_exit(pwm_backlight_exit); MODULE_DESCRIPTION("PWM based Backlight Driver"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:pwm-backlight"); - diff --git a/trunk/drivers/video/console/fbcon.c b/trunk/drivers/video/console/fbcon.c index 33859934a8e4..3ccfa76d9b2a 100644 --- a/trunk/drivers/video/console/fbcon.c +++ b/trunk/drivers/video/console/fbcon.c @@ -1311,9 +1311,6 @@ static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height, if (!height || !width) return; - if (sy < vc->vc_top && vc->vc_top == logo_lines) - vc->vc_top = 0; - /* Split blits that cross physical y_wrap boundary */ y_break = p->vrows - p->yscroll; diff --git a/trunk/drivers/video/fsl-diu-fb.c b/trunk/drivers/video/fsl-diu-fb.c index bd320a2bfb7c..9cd36c223d33 100644 --- a/trunk/drivers/video/fsl-diu-fb.c +++ b/trunk/drivers/video/fsl-diu-fb.c @@ -1649,10 +1649,8 @@ static int __init fsl_diu_init(void) } prop = of_get_property(np, "d-cache-size", NULL); - if (prop == NULL) { - of_node_put(np); + if (prop == NULL) return -ENODEV; - } /* Freescale PLRU requires 13/8 times the cache size to do a proper displacement flush @@ -1661,10 +1659,8 @@ static int __init fsl_diu_init(void) coherence_data_size /= 8; prop = of_get_property(np, "d-cache-line-size", NULL); - if (prop == NULL) { - of_node_put(np); + if (prop == NULL) return -ENODEV; - } d_cache_line_size = *prop; of_node_put(np); diff --git a/trunk/drivers/video/s3fb.c b/trunk/drivers/video/s3fb.c index 8361bd0e3df1..2972f112dbed 100644 --- a/trunk/drivers/video/s3fb.c +++ b/trunk/drivers/video/s3fb.c @@ -903,13 +903,13 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i /* Prepare PCI device */ rc = pci_enable_device(dev); if (rc < 0) { - dev_err(info->device, "cannot enable PCI device\n"); + dev_err(info->dev, "cannot enable PCI device\n"); goto err_enable_device; } rc = pci_request_regions(dev, "s3fb"); if (rc < 0) { - dev_err(info->device, "cannot reserve framebuffer region\n"); + dev_err(info->dev, "cannot reserve framebuffer region\n"); goto err_request_regions; } @@ -921,7 +921,7 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i info->screen_base = pci_iomap(dev, 0, 0); if (! info->screen_base) { rc = -ENOMEM; - dev_err(info->device, "iomap for framebuffer failed\n"); + dev_err(info->dev, "iomap for framebuffer failed\n"); goto err_iomap; } @@ -965,19 +965,19 @@ static int __devinit s3_pci_probe(struct pci_dev *dev, const struct pci_device_i rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8); if (! ((rc == 1) || (rc == 2))) { rc = -EINVAL; - dev_err(info->device, "mode %s not found\n", mode_option); + dev_err(info->dev, "mode %s not found\n", mode_option); goto err_find_mode; } rc = fb_alloc_cmap(&info->cmap, 256, 0); if (rc < 0) { - dev_err(info->device, "cannot allocate colormap\n"); + dev_err(info->dev, "cannot allocate colormap\n"); goto err_alloc_cmap; } rc = register_framebuffer(info); if (rc < 0) { - dev_err(info->device, "cannot register framebuffer\n"); + dev_err(info->dev, "cannot register framebuffer\n"); goto err_reg_fb; } @@ -1053,7 +1053,7 @@ static int s3_pci_suspend(struct pci_dev* dev, pm_message_t state) struct fb_info *info = pci_get_drvdata(dev); struct s3fb_info *par = info->par; - dev_info(info->device, "suspend\n"); + dev_info(info->dev, "suspend\n"); acquire_console_sem(); mutex_lock(&(par->open_lock)); @@ -1085,7 +1085,7 @@ static int s3_pci_resume(struct pci_dev* dev) struct s3fb_info *par = info->par; int err; - dev_info(info->device, "resume\n"); + dev_info(info->dev, "resume\n"); acquire_console_sem(); mutex_lock(&(par->open_lock)); @@ -1102,7 +1102,7 @@ static int s3_pci_resume(struct pci_dev* dev) if (err) { mutex_unlock(&(par->open_lock)); release_console_sem(); - dev_err(info->device, "error %d enabling device for resume\n", err); + dev_err(info->dev, "error %d enabling device for resume\n", err); return err; } pci_set_master(dev); diff --git a/trunk/drivers/video/vt8623fb.c b/trunk/drivers/video/vt8623fb.c index 34aae7a2a62b..4a484ee98f8a 100644 --- a/trunk/drivers/video/vt8623fb.c +++ b/trunk/drivers/video/vt8623fb.c @@ -677,13 +677,13 @@ static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_devi rc = pci_enable_device(dev); if (rc < 0) { - dev_err(info->device, "cannot enable PCI device\n"); + dev_err(info->dev, "cannot enable PCI device\n"); goto err_enable_device; } rc = pci_request_regions(dev, "vt8623fb"); if (rc < 0) { - dev_err(info->device, "cannot reserve framebuffer region\n"); + dev_err(info->dev, "cannot reserve framebuffer region\n"); goto err_request_regions; } @@ -696,14 +696,14 @@ static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_devi info->screen_base = pci_iomap(dev, 0, 0); if (! info->screen_base) { rc = -ENOMEM; - dev_err(info->device, "iomap for framebuffer failed\n"); + dev_err(info->dev, "iomap for framebuffer failed\n"); goto err_iomap_1; } par->mmio_base = pci_iomap(dev, 1, 0); if (! par->mmio_base) { rc = -ENOMEM; - dev_err(info->device, "iomap for MMIO failed\n"); + dev_err(info->dev, "iomap for MMIO failed\n"); goto err_iomap_2; } @@ -714,7 +714,7 @@ static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_devi if ((16 <= memsize1) && (memsize1 <= 64) && (memsize1 == memsize2)) info->screen_size = memsize1 << 20; else { - dev_err(info->device, "memory size detection failed (%x %x), suppose 16 MB\n", memsize1, memsize2); + dev_err(info->dev, "memory size detection failed (%x %x), suppose 16 MB\n", memsize1, memsize2); info->screen_size = 16 << 20; } @@ -731,19 +731,19 @@ static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_devi rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8); if (! ((rc == 1) || (rc == 2))) { rc = -EINVAL; - dev_err(info->device, "mode %s not found\n", mode_option); + dev_err(info->dev, "mode %s not found\n", mode_option); goto err_find_mode; } rc = fb_alloc_cmap(&info->cmap, 256, 0); if (rc < 0) { - dev_err(info->device, "cannot allocate colormap\n"); + dev_err(info->dev, "cannot allocate colormap\n"); goto err_alloc_cmap; } rc = register_framebuffer(info); if (rc < 0) { - dev_err(info->device, "cannot register framebugger\n"); + dev_err(info->dev, "cannot register framebugger\n"); goto err_reg_fb; } @@ -817,7 +817,7 @@ static int vt8623_pci_suspend(struct pci_dev* dev, pm_message_t state) struct fb_info *info = pci_get_drvdata(dev); struct vt8623fb_info *par = info->par; - dev_info(info->device, "suspend\n"); + dev_info(info->dev, "suspend\n"); acquire_console_sem(); mutex_lock(&(par->open_lock)); @@ -848,7 +848,7 @@ static int vt8623_pci_resume(struct pci_dev* dev) struct fb_info *info = pci_get_drvdata(dev); struct vt8623fb_info *par = info->par; - dev_info(info->device, "resume\n"); + dev_info(info->dev, "resume\n"); acquire_console_sem(); mutex_lock(&(par->open_lock)); diff --git a/trunk/drivers/watchdog/ar7_wdt.c b/trunk/drivers/watchdog/ar7_wdt.c index ef7b0d67095e..2eb48c0df32c 100644 --- a/trunk/drivers/watchdog/ar7_wdt.c +++ b/trunk/drivers/watchdog/ar7_wdt.c @@ -69,8 +69,7 @@ struct ar7_wdt { u32 prescale; }; -static unsigned long wdt_is_open; -static spinlock_t wdt_lock; +static struct semaphore open_semaphore; static unsigned expect_close; /* XXX currently fixed, allows max margin ~68.72 secs */ @@ -155,10 +154,8 @@ static void ar7_wdt_update_margin(int new_margin) u32 change; change = new_margin * (ar7_vbus_freq() / prescale_value); - if (change < 1) - change = 1; - if (change > 0xffff) - change = 0xffff; + if (change < 1) change = 1; + if (change > 0xffff) change = 0xffff; ar7_wdt_change(change); margin = change * prescale_value / ar7_vbus_freq(); printk(KERN_INFO DRVNAME @@ -182,7 +179,7 @@ static void ar7_wdt_disable_wdt(void) static int ar7_wdt_open(struct inode *inode, struct file *file) { /* only allow one at a time */ - if (test_and_set_bit(0, &wdt_is_open)) + if (down_trylock(&open_semaphore)) return -EBUSY; ar7_wdt_enable_wdt(); expect_close = 0; @@ -198,7 +195,9 @@ static int ar7_wdt_release(struct inode *inode, struct file *file) "will not disable the watchdog timer\n"); else if (!nowayout) ar7_wdt_disable_wdt(); - clear_bit(0, &wdt_is_open); + + up(&open_semaphore); + return 0; } @@ -223,9 +222,7 @@ static ssize_t ar7_wdt_write(struct file *file, const char *data, if (len) { size_t i; - spin_lock(&wdt_lock); ar7_wdt_kick(1); - spin_unlock(&wdt_lock); expect_close = 0; for (i = 0; i < len; ++i) { @@ -240,8 +237,8 @@ static ssize_t ar7_wdt_write(struct file *file, const char *data, return len; } -static long ar7_wdt_ioctl(struct file *file, - unsigned int cmd, unsigned long arg) +static int ar7_wdt_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { static struct watchdog_info ident = { .identity = LONGNAME, @@ -272,10 +269,8 @@ static long ar7_wdt_ioctl(struct file *file, if (new_margin < 1) return -EINVAL; - spin_lock(&wdt_lock); ar7_wdt_update_margin(new_margin); ar7_wdt_kick(1); - spin_unlock(&wdt_lock); case WDIOC_GETTIMEOUT: if (put_user(margin, (int *)arg)) @@ -287,7 +282,7 @@ static long ar7_wdt_ioctl(struct file *file, static const struct file_operations ar7_wdt_fops = { .owner = THIS_MODULE, .write = ar7_wdt_write, - .unlocked_ioctl = ar7_wdt_ioctl, + .ioctl = ar7_wdt_ioctl, .open = ar7_wdt_open, .release = ar7_wdt_release, }; @@ -302,8 +297,6 @@ static int __init ar7_wdt_init(void) { int rc; - spin_lock_init(&wdt_lock); - ar7_wdt_get_regs(); if (!request_mem_region(ar7_regs_wdt, sizeof(struct ar7_wdt), @@ -319,6 +312,8 @@ static int __init ar7_wdt_init(void) ar7_wdt_prescale(prescale_value); ar7_wdt_update_margin(margin); + sema_init(&open_semaphore, 1); + rc = register_reboot_notifier(&ar7_wdt_notifier); if (rc) { printk(KERN_ERR DRVNAME diff --git a/trunk/drivers/watchdog/it8712f_wdt.c b/trunk/drivers/watchdog/it8712f_wdt.c index 51bfd5721833..445b7e812112 100644 --- a/trunk/drivers/watchdog/it8712f_wdt.c +++ b/trunk/drivers/watchdog/it8712f_wdt.c @@ -30,8 +30,9 @@ #include #include #include -#include -#include + +#include +#include #define NAME "it8712f_wdt" @@ -49,7 +50,7 @@ static int nowayout = WATCHDOG_NOWAYOUT; module_param(nowayout, int, 0); MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); -static unsigned long wdt_open; +static struct semaphore it8712f_wdt_sem; static unsigned expect_close; static spinlock_t io_lock; static unsigned char revision; @@ -85,19 +86,22 @@ static unsigned short address; #define WDT_OUT_PWROK 0x10 #define WDT_OUT_KRST 0x40 -static int superio_inb(int reg) +static int +superio_inb(int reg) { outb(reg, REG); return inb(VAL); } -static void superio_outb(int val, int reg) +static void +superio_outb(int val, int reg) { outb(reg, REG); outb(val, VAL); } -static int superio_inw(int reg) +static int +superio_inw(int reg) { int val; outb(reg++, REG); @@ -107,13 +111,15 @@ static int superio_inw(int reg) return val; } -static inline void superio_select(int ldn) +static inline void +superio_select(int ldn) { outb(LDN, REG); outb(ldn, VAL); } -static inline void superio_enter(void) +static inline void +superio_enter(void) { spin_lock(&io_lock); outb(0x87, REG); @@ -122,19 +128,22 @@ static inline void superio_enter(void) outb(0x55, REG); } -static inline void superio_exit(void) +static inline void +superio_exit(void) { outb(0x02, REG); outb(0x02, VAL); spin_unlock(&io_lock); } -static inline void it8712f_wdt_ping(void) +static inline void +it8712f_wdt_ping(void) { inb(address); } -static void it8712f_wdt_update_margin(void) +static void +it8712f_wdt_update_margin(void) { int config = WDT_OUT_KRST | WDT_OUT_PWROK; int units = margin; @@ -156,7 +165,8 @@ static void it8712f_wdt_update_margin(void) superio_outb(units, WDT_TIMEOUT); } -static int it8712f_wdt_get_status(void) +static int +it8712f_wdt_get_status(void) { if (superio_inb(WDT_CONTROL) & 0x01) return WDIOF_CARDRESET; @@ -164,7 +174,8 @@ static int it8712f_wdt_get_status(void) return 0; } -static void it8712f_wdt_enable(void) +static void +it8712f_wdt_enable(void) { printk(KERN_DEBUG NAME ": enabling watchdog timer\n"); superio_enter(); @@ -179,7 +190,8 @@ static void it8712f_wdt_enable(void) it8712f_wdt_ping(); } -static void it8712f_wdt_disable(void) +static void +it8712f_wdt_disable(void) { printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); @@ -195,7 +207,8 @@ static void it8712f_wdt_disable(void) superio_exit(); } -static int it8712f_wdt_notify(struct notifier_block *this, +static int +it8712f_wdt_notify(struct notifier_block *this, unsigned long code, void *unused) { if (code == SYS_HALT || code == SYS_POWER_OFF) @@ -209,8 +222,9 @@ static struct notifier_block it8712f_wdt_notifier = { .notifier_call = it8712f_wdt_notify, }; -static ssize_t it8712f_wdt_write(struct file *file, const char __user *data, - size_t len, loff_t *ppos) +static ssize_t +it8712f_wdt_write(struct file *file, const char __user *data, + size_t len, loff_t *ppos) { /* check for a magic close character */ if (len) { @@ -231,8 +245,9 @@ static ssize_t it8712f_wdt_write(struct file *file, const char __user *data, return len; } -static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) +static int +it8712f_wdt_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { void __user *argp = (void __user *)arg; int __user *p = argp; @@ -287,16 +302,19 @@ static long it8712f_wdt_ioctl(struct file *file, unsigned int cmd, } } -static int it8712f_wdt_open(struct inode *inode, struct file *file) +static int +it8712f_wdt_open(struct inode *inode, struct file *file) { /* only allow one at a time */ - if (test_and_set_bit(0, &wdt_open)) + if (down_trylock(&it8712f_wdt_sem)) return -EBUSY; it8712f_wdt_enable(); + return nonseekable_open(inode, file); } -static int it8712f_wdt_release(struct inode *inode, struct file *file) +static int +it8712f_wdt_release(struct inode *inode, struct file *file) { if (expect_close != 42) { printk(KERN_WARNING NAME @@ -306,7 +324,7 @@ static int it8712f_wdt_release(struct inode *inode, struct file *file) it8712f_wdt_disable(); } expect_close = 0; - clear_bit(0, &wdt_open); + up(&it8712f_wdt_sem); return 0; } @@ -315,7 +333,7 @@ static const struct file_operations it8712f_wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = it8712f_wdt_write, - .unlocked_ioctl = it8712f_wdt_ioctl, + .ioctl = it8712f_wdt_ioctl, .open = it8712f_wdt_open, .release = it8712f_wdt_release, }; @@ -326,7 +344,8 @@ static struct miscdevice it8712f_wdt_miscdev = { .fops = &it8712f_wdt_fops, }; -static int __init it8712f_wdt_find(unsigned short *address) +static int __init +it8712f_wdt_find(unsigned short *address) { int err = -ENODEV; int chip_type; @@ -368,7 +387,8 @@ static int __init it8712f_wdt_find(unsigned short *address) return err; } -static int __init it8712f_wdt_init(void) +static int __init +it8712f_wdt_init(void) { int err = 0; @@ -384,6 +404,8 @@ static int __init it8712f_wdt_init(void) it8712f_wdt_disable(); + sema_init(&it8712f_wdt_sem, 1); + err = register_reboot_notifier(&it8712f_wdt_notifier); if (err) { printk(KERN_ERR NAME ": unable to register reboot notifier\n"); @@ -408,7 +430,8 @@ static int __init it8712f_wdt_init(void) return err; } -static void __exit it8712f_wdt_exit(void) +static void __exit +it8712f_wdt_exit(void) { misc_deregister(&it8712f_wdt_miscdev); unregister_reboot_notifier(&it8712f_wdt_notifier); diff --git a/trunk/drivers/watchdog/s3c2410_wdt.c b/trunk/drivers/watchdog/s3c2410_wdt.c index 97b4a2e8eb09..98532c0e0689 100644 --- a/trunk/drivers/watchdog/s3c2410_wdt.c +++ b/trunk/drivers/watchdog/s3c2410_wdt.c @@ -46,8 +46,9 @@ #include #include #include -#include -#include + +#include +#include #include @@ -64,8 +65,8 @@ static int nowayout = WATCHDOG_NOWAYOUT; static int tmr_margin = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME; static int tmr_atboot = CONFIG_S3C2410_WATCHDOG_ATBOOT; -static int soft_noboot; -static int debug; +static int soft_noboot = 0; +static int debug = 0; module_param(tmr_margin, int, 0); module_param(tmr_atboot, int, 0); @@ -73,23 +74,24 @@ module_param(nowayout, int, 0); module_param(soft_noboot, int, 0); module_param(debug, int, 0); -MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default=" - __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")"); -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(tmr_margin, "Watchdog tmr_margin in seconds. default=" __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")"); + +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(soft_noboot, "Watchdog action, set to 1 to ignore reboots, 0 to reboot (default depends on ONLY_TESTING)"); + MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug, (default 0)"); typedef enum close_state { CLOSE_STATE_NOT, - CLOSE_STATE_ALLOW = 0x4021 + CLOSE_STATE_ALLOW=0x4021 } close_state_t; -static unsigned long open_lock; +static DECLARE_MUTEX(open_lock); + static struct device *wdt_dev; /* platform device attached to */ static struct resource *wdt_mem; static struct resource *wdt_irq; @@ -97,58 +99,38 @@ static struct clk *wdt_clock; static void __iomem *wdt_base; static unsigned int wdt_count; static close_state_t allow_close; -static DEFINE_SPINLOCK(wdt_lock); /* watchdog control routines */ #define DBG(msg...) do { \ if (debug) \ printk(KERN_INFO msg); \ - } while (0) + } while(0) /* functions */ -static void s3c2410wdt_keepalive(void) +static int s3c2410wdt_keepalive(void) { - spin_lock(&wdt_lock); writel(wdt_count, wdt_base + S3C2410_WTCNT); - spin_unlock(&wdt_lock); -} - -static void __s3c2410wdt_stop(void) -{ - unsigned long wtcon; - - spin_lock(&wdt_lock); - wtcon = readl(wdt_base + S3C2410_WTCON); - wtcon &= ~(S3C2410_WTCON_ENABLE | S3C2410_WTCON_RSTEN); - writel(wtcon, wdt_base + S3C2410_WTCON); - spin_unlock(&wdt_lock); + return 0; } -static void __s3c2410wdt_stop(void) +static int s3c2410wdt_stop(void) { unsigned long wtcon; wtcon = readl(wdt_base + S3C2410_WTCON); wtcon &= ~(S3C2410_WTCON_ENABLE | S3C2410_WTCON_RSTEN); writel(wtcon, wdt_base + S3C2410_WTCON); -} -static void s3c2410wdt_stop(void) -{ - spin_lock(&wdt_lock); - __s3c2410wdt_stop(); - spin_unlock(&wdt_lock); + return 0; } -static void s3c2410wdt_start(void) +static int s3c2410wdt_start(void) { unsigned long wtcon; - spin_lock(&wdt_lock); - - __s3c2410wdt_stop(); + s3c2410wdt_stop(); wtcon = readl(wdt_base + S3C2410_WTCON); wtcon |= S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128; @@ -167,7 +149,6 @@ static void s3c2410wdt_start(void) writel(wdt_count, wdt_base + S3C2410_WTDAT); writel(wdt_count, wdt_base + S3C2410_WTCNT); writel(wtcon, wdt_base + S3C2410_WTCON); - spin_unlock(&wdt_lock); return 0; } @@ -230,7 +211,7 @@ static int s3c2410wdt_set_heartbeat(int timeout) static int s3c2410wdt_open(struct inode *inode, struct file *file) { - if (test_and_set_bit(0, &open_lock)) + if(down_trylock(&open_lock)) return -EBUSY; if (nowayout) @@ -250,14 +231,15 @@ static int s3c2410wdt_release(struct inode *inode, struct file *file) * Lock it in if it's a module and we set nowayout */ - if (allow_close == CLOSE_STATE_ALLOW) + if (allow_close == CLOSE_STATE_ALLOW) { s3c2410wdt_stop(); - else { + } else { dev_err(wdt_dev, "Unexpected close, not stopping watchdog\n"); s3c2410wdt_keepalive(); } + allow_close = CLOSE_STATE_NOT; - clear_bit(0, &open_lock); + up(&open_lock); return 0; } @@ -267,7 +249,7 @@ static ssize_t s3c2410wdt_write(struct file *file, const char __user *data, /* * Refresh the timer. */ - if (len) { + if(len) { if (!nowayout) { size_t i; @@ -283,6 +265,7 @@ static ssize_t s3c2410wdt_write(struct file *file, const char __user *data, allow_close = CLOSE_STATE_ALLOW; } } + s3c2410wdt_keepalive(); } return len; @@ -290,41 +273,48 @@ static ssize_t s3c2410wdt_write(struct file *file, const char __user *data, #define OPTIONS WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE -static const struct watchdog_info s3c2410_wdt_ident = { +static struct watchdog_info s3c2410_wdt_ident = { .options = OPTIONS, .firmware_version = 0, .identity = "S3C2410 Watchdog", }; -static long s3c2410wdt_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) +static int s3c2410wdt_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { void __user *argp = (void __user *)arg; int __user *p = argp; int new_margin; switch (cmd) { - default: - return -ENOTTY; - case WDIOC_GETSUPPORT: - return copy_to_user(argp, &s3c2410_wdt_ident, - sizeof(s3c2410_wdt_ident)) ? -EFAULT : 0; - case WDIOC_GETSTATUS: - case WDIOC_GETBOOTSTATUS: - return put_user(0, p); - case WDIOC_KEEPALIVE: - s3c2410wdt_keepalive(); - return 0; - case WDIOC_SETTIMEOUT: - if (get_user(new_margin, p)) - return -EFAULT; - if (s3c2410wdt_set_heartbeat(new_margin)) - return -EINVAL; - s3c2410wdt_keepalive(); - return put_user(tmr_margin, p); - case WDIOC_GETTIMEOUT: - return put_user(tmr_margin, p); + default: + return -ENOTTY; + + case WDIOC_GETSUPPORT: + return copy_to_user(argp, &s3c2410_wdt_ident, + sizeof(s3c2410_wdt_ident)) ? -EFAULT : 0; + + case WDIOC_GETSTATUS: + case WDIOC_GETBOOTSTATUS: + return put_user(0, p); + + case WDIOC_KEEPALIVE: + s3c2410wdt_keepalive(); + return 0; + + case WDIOC_SETTIMEOUT: + if (get_user(new_margin, p)) + return -EFAULT; + + if (s3c2410wdt_set_heartbeat(new_margin)) + return -EINVAL; + + s3c2410wdt_keepalive(); + return put_user(tmr_margin, p); + + case WDIOC_GETTIMEOUT: + return put_user(tmr_margin, p); } } @@ -334,7 +324,7 @@ static const struct file_operations s3c2410wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = s3c2410wdt_write, - .unlocked_ioctl = s3c2410wdt_ioctl, + .ioctl = s3c2410wdt_ioctl, .open = s3c2410wdt_open, .release = s3c2410wdt_release, }; @@ -421,15 +411,14 @@ static int s3c2410wdt_probe(struct platform_device *pdev) * not, try the default value */ if (s3c2410wdt_set_heartbeat(tmr_margin)) { - started = s3c2410wdt_set_heartbeat( - CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME); + started = s3c2410wdt_set_heartbeat(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME); - if (started == 0) - dev_info(dev, - "tmr_margin value out of range, default %d used\n", + if (started == 0) { + dev_info(dev,"tmr_margin value out of range, default %d used\n", CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME); - else + } else { dev_info(dev, "default timer value is out of range, cannot start\n"); + } } ret = misc_register(&s3c2410wdt_miscdev); @@ -458,7 +447,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev) (wtcon & S3C2410_WTCON_ENABLE) ? "" : "in", (wtcon & S3C2410_WTCON_RSTEN) ? "" : "dis", (wtcon & S3C2410_WTCON_INTEN) ? "" : "en"); - + return 0; err_clk: @@ -498,7 +487,7 @@ static int s3c2410wdt_remove(struct platform_device *dev) static void s3c2410wdt_shutdown(struct platform_device *dev) { - s3c2410wdt_stop(); + s3c2410wdt_stop(); } #ifdef CONFIG_PM @@ -551,8 +540,7 @@ static struct platform_driver s3c2410wdt_driver = { }; -static char banner[] __initdata = - KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n"; +static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n"; static int __init watchdog_init(void) { diff --git a/trunk/drivers/watchdog/sc1200wdt.c b/trunk/drivers/watchdog/sc1200wdt.c index 621ebad56d86..35cddff7020f 100644 --- a/trunk/drivers/watchdog/sc1200wdt.c +++ b/trunk/drivers/watchdog/sc1200wdt.c @@ -15,18 +15,14 @@ * * Changelog: * 20020220 Zwane Mwaikambo Code based on datasheet, no hardware. - * 20020221 Zwane Mwaikambo Cleanups as suggested by Jeff Garzik - * and Alan Cox. + * 20020221 Zwane Mwaikambo Cleanups as suggested by Jeff Garzik and Alan Cox. * 20020222 Zwane Mwaikambo Added probing. * 20020225 Zwane Mwaikambo Added ISAPNP support. * 20020412 Rob Radez Broke out start/stop functions - * Return proper status instead of - * temperature warning - * Add WDIOC_GETBOOTSTATUS and - * WDIOC_SETOPTIONS ioctls + * Return proper status instead of temperature warning + * Add WDIOC_GETBOOTSTATUS and WDIOC_SETOPTIONS ioctls * Fix CONFIG_WATCHDOG_NOWAYOUT - * 20020530 Joel Becker Add Matt Domsch's nowayout module - * option + * 20020530 Joel Becker Add Matt Domsch's nowayout module option * 20030116 Adam Belay Updated to the latest pnp code * */ @@ -43,8 +39,9 @@ #include #include #include -#include -#include + +#include +#include #define SC1200_MODULE_VER "build 20020303" #define SC1200_MODULE_NAME "sc1200wdt" @@ -75,7 +72,7 @@ static char banner[] __initdata = KERN_INFO PFX SC1200_MODULE_VER; static int timeout = 1; static int io = -1; static int io_len = 2; /* for non plug and play */ -static unsigned long open_flag; +static struct semaphore open_sem; static char expect_close; static DEFINE_SPINLOCK(sc1200wdt_lock); /* io port access serialisation */ @@ -84,8 +81,7 @@ static int isapnp = 1; static struct pnp_dev *wdt_dev; module_param(isapnp, int, 0); -MODULE_PARM_DESC(isapnp, - "When set to 0 driver ISA PnP support will be disabled"); +MODULE_PARM_DESC(isapnp, "When set to 0 driver ISA PnP support will be disabled"); #endif module_param(io, int, 0); @@ -95,40 +91,26 @@ 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=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); /* Read from Data Register */ -static inline void __sc1200wdt_read_data(unsigned char index, - unsigned char *data) +static inline void sc1200wdt_read_data(unsigned char index, unsigned char *data) { + spin_lock(&sc1200wdt_lock); outb_p(index, PMIR); *data = inb(PMDR); -} - -static void sc1200wdt_read_data(unsigned char index, unsigned char *data) -{ - spin_lock(&sc1200wdt_lock); - __sc1200wdt_read_data(index, data); spin_unlock(&sc1200wdt_lock); } + /* Write to Data Register */ -static inline void __sc1200wdt_write_data(unsigned char index, - unsigned char data) +static inline void sc1200wdt_write_data(unsigned char index, unsigned char data) { + spin_lock(&sc1200wdt_lock); outb_p(index, PMIR); outb(data, PMDR); -} - -static inline void sc1200wdt_write_data(unsigned char index, - unsigned char data) -{ - spin_lock(&sc1200wdt_lock); - __sc1200wdt_write_data(index, data); spin_unlock(&sc1200wdt_lock); } @@ -136,23 +118,22 @@ static inline void sc1200wdt_write_data(unsigned char index, static void sc1200wdt_start(void) { unsigned char reg; - spin_lock(&sc1200wdt_lock); - __sc1200wdt_read_data(WDCF, ®); + sc1200wdt_read_data(WDCF, ®); /* assert WDO when any of the following interrupts are triggered too */ reg |= (KBC_IRQ | MSE_IRQ | UART1_IRQ | UART2_IRQ); - __sc1200wdt_write_data(WDCF, reg); + sc1200wdt_write_data(WDCF, reg); /* set the timeout and get the ball rolling */ - __sc1200wdt_write_data(WDTO, timeout); - - spin_unlock(&sc1200wdt_lock); + sc1200wdt_write_data(WDTO, timeout); } + static void sc1200wdt_stop(void) { sc1200wdt_write_data(WDTO, 0); } + /* This returns the status of the WDO signal, inactive high. */ static inline int sc1200wdt_status(void) { @@ -163,13 +144,14 @@ static inline int sc1200wdt_status(void) * KEEPALIVEPING which is a bit of a kludge because there's nothing * else for enabled/disabled status */ - return (ret & 0x01) ? 0 : WDIOF_KEEPALIVEPING; + return (ret & 0x01) ? 0 : WDIOF_KEEPALIVEPING; /* bits 1 - 7 are undefined */ } + static int sc1200wdt_open(struct inode *inode, struct file *file) { /* allow one at a time */ - if (test_and_set_bit(0, &open_flag)) + if (down_trylock(&open_sem)) return -EBUSY; if (timeout > MAX_TIMEOUT) @@ -182,71 +164,71 @@ static int sc1200wdt_open(struct inode *inode, struct file *file) } -static long sc1200wdt_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) +static int sc1200wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { int new_timeout; void __user *argp = (void __user *)arg; int __user *p = argp; - static const struct watchdog_info ident = { - .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | - WDIOF_MAGICCLOSE, + static struct watchdog_info ident = { + .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, .firmware_version = 0, .identity = "PC87307/PC97307", }; switch (cmd) { + default: + return -ENOTTY; - case WDIOC_GETSUPPORT: - if (copy_to_user(argp, &ident, sizeof ident)) - return -EFAULT; - return 0; + case WDIOC_GETSUPPORT: + if (copy_to_user(argp, &ident, sizeof ident)) + return -EFAULT; + return 0; - case WDIOC_GETSTATUS: - return put_user(sc1200wdt_status(), p); + case WDIOC_GETSTATUS: + return put_user(sc1200wdt_status(), p); - case WDIOC_GETBOOTSTATUS: - return put_user(0, p); + case WDIOC_GETBOOTSTATUS: + return put_user(0, p); - case WDIOC_KEEPALIVE: - sc1200wdt_write_data(WDTO, timeout); - return 0; - - case WDIOC_SETTIMEOUT: - if (get_user(new_timeout, p)) - return -EFAULT; - /* the API states this is given in secs */ - new_timeout /= 60; - if (new_timeout < 0 || new_timeout > MAX_TIMEOUT) - return -EINVAL; - timeout = new_timeout; - sc1200wdt_write_data(WDTO, timeout); - /* fall through and return the new timeout */ + case WDIOC_KEEPALIVE: + sc1200wdt_write_data(WDTO, timeout); + return 0; - case WDIOC_GETTIMEOUT: - return put_user(timeout * 60, p); + case WDIOC_SETTIMEOUT: + if (get_user(new_timeout, p)) + return -EFAULT; - case WDIOC_SETOPTIONS: - { - int options, retval = -EINVAL; + /* the API states this is given in secs */ + new_timeout /= 60; + if (new_timeout < 0 || new_timeout > MAX_TIMEOUT) + return -EINVAL; - if (get_user(options, p)) - return -EFAULT; + timeout = new_timeout; + sc1200wdt_write_data(WDTO, timeout); + /* fall through and return the new timeout */ - if (options & WDIOS_DISABLECARD) { - sc1200wdt_stop(); - retval = 0; - } + case WDIOC_GETTIMEOUT: + return put_user(timeout * 60, p); - if (options & WDIOS_ENABLECARD) { - sc1200wdt_start(); - retval = 0; - } + case WDIOC_SETOPTIONS: + { + int options, retval = -EINVAL; - return retval; - } - default: - return -ENOTTY; + if (get_user(options, p)) + return -EFAULT; + + if (options & WDIOS_DISABLECARD) { + sc1200wdt_stop(); + retval = 0; + } + + if (options & WDIOS_ENABLECARD) { + sc1200wdt_start(); + retval = 0; + } + + return retval; + } } } @@ -258,18 +240,16 @@ static int sc1200wdt_release(struct inode *inode, struct file *file) printk(KERN_INFO PFX "Watchdog disabled\n"); } else { sc1200wdt_write_data(WDTO, timeout); - printk(KERN_CRIT PFX - "Unexpected close!, timeout = %d min(s)\n", timeout); + printk(KERN_CRIT PFX "Unexpected close!, timeout = %d min(s)\n", timeout); } - clear_bit(0, &open_flag); + up(&open_sem); expect_close = 0; return 0; } -static ssize_t sc1200wdt_write(struct file *file, const char __user *data, - size_t len, loff_t *ppos) +static ssize_t sc1200wdt_write(struct file *file, const char __user *data, size_t len, loff_t *ppos) { if (len) { if (!nowayout) { @@ -295,8 +275,7 @@ static ssize_t sc1200wdt_write(struct file *file, const char __user *data, } -static int sc1200wdt_notify_sys(struct notifier_block *this, - unsigned long code, void *unused) +static int sc1200wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused) { if (code == SYS_DOWN || code == SYS_HALT) sc1200wdt_stop(); @@ -305,20 +284,23 @@ static int sc1200wdt_notify_sys(struct notifier_block *this, } -static struct notifier_block sc1200wdt_notifier = { +static struct notifier_block sc1200wdt_notifier = +{ .notifier_call = sc1200wdt_notify_sys, }; -static const struct file_operations sc1200wdt_fops = { +static const struct file_operations sc1200wdt_fops = +{ .owner = THIS_MODULE, .llseek = no_llseek, .write = sc1200wdt_write, - .unlocked_ioctl = sc1200wdt_ioctl, + .ioctl = sc1200wdt_ioctl, .open = sc1200wdt_open, .release = sc1200wdt_release, }; -static struct miscdevice sc1200wdt_miscdev = { +static struct miscdevice sc1200wdt_miscdev = +{ .minor = WATCHDOG_MINOR, .name = "watchdog", .fops = &sc1200wdt_fops, @@ -330,14 +312,14 @@ static int __init sc1200wdt_probe(void) /* The probe works by reading the PMC3 register's default value of 0x0e * there is one caveat, if the device disables the parallel port or any * of the UARTs we won't be able to detect it. - * NB. This could be done with accuracy by reading the SID registers, - * but we don't have access to those io regions. + * Nb. This could be done with accuracy by reading the SID registers, but + * we don't have access to those io regions. */ unsigned char reg; sc1200wdt_read_data(PMC3, ®); - reg &= 0x0f; /* we don't want the UART busy bits */ + reg &= 0x0f; /* we don't want the UART busy bits */ return (reg == 0x0e) ? 0 : -ENODEV; } @@ -350,8 +332,7 @@ static struct pnp_device_id scl200wdt_pnp_devices[] = { {.id = ""}, }; -static int scl200wdt_pnp_probe(struct pnp_dev *dev, - const struct pnp_device_id *dev_id) +static int scl200wdt_pnp_probe(struct pnp_dev * dev, const struct pnp_device_id *dev_id) { /* this driver only supports one card at a time */ if (wdt_dev || !isapnp) @@ -366,14 +347,13 @@ static int scl200wdt_pnp_probe(struct pnp_dev *dev, return -EBUSY; } - printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n", - io, io_len); + printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n", io, io_len); return 0; } -static void scl200wdt_pnp_remove(struct pnp_dev *dev) +static void scl200wdt_pnp_remove(struct pnp_dev * dev) { - if (wdt_dev) { + if (wdt_dev){ release_region(io, io_len); wdt_dev = NULL; } @@ -395,6 +375,8 @@ static int __init sc1200wdt_init(void) printk("%s\n", banner); + sema_init(&open_sem, 1); + #if defined CONFIG_PNP if (isapnp) { ret = pnp_register_driver(&scl200wdt_pnp_driver); @@ -428,16 +410,13 @@ static int __init sc1200wdt_init(void) ret = register_reboot_notifier(&sc1200wdt_notifier); if (ret) { - printk(KERN_ERR PFX - "Unable to register reboot notifier err = %d\n", ret); + printk(KERN_ERR PFX "Unable to register reboot notifier err = %d\n", ret); goto out_io; } ret = misc_register(&sc1200wdt_miscdev); if (ret) { - printk(KERN_ERR PFX - "Unable to register miscdev on minor %d\n", - WATCHDOG_MINOR); + printk(KERN_ERR PFX "Unable to register miscdev on minor %d\n", WATCHDOG_MINOR); goto out_rbt; } @@ -467,7 +446,7 @@ static void __exit sc1200wdt_exit(void) unregister_reboot_notifier(&sc1200wdt_notifier); #if defined CONFIG_PNP - if (isapnp) + if(isapnp) pnp_unregister_driver(&scl200wdt_pnp_driver); else #endif diff --git a/trunk/drivers/watchdog/wdt.c b/trunk/drivers/watchdog/wdt.c index 53a6b18bcb9a..756fb15fdce7 100644 --- a/trunk/drivers/watchdog/wdt.c +++ b/trunk/drivers/watchdog/wdt.c @@ -24,10 +24,9 @@ * Matt Crocker). * Alan Cox : Added wdt= boot option * Alan Cox : Cleaned up copy/user stuff - * Tim Hockin : Added insmod parameters, comment - * cleanup, parameterized timeout - * Tigran Aivazian : Restructured wdt_init() to handle - * failures + * Tim Hockin : Added insmod parameters, comment cleanup + * Parameterized timeout + * Tigran Aivazian : Restructured wdt_init() to handle failures * Joel Becker : Added WDIOC_GET/SETTIMEOUT * Matt Domsch : Added nowayout module option */ @@ -43,9 +42,9 @@ #include #include #include -#include -#include +#include +#include #include #include "wd501p.h" @@ -61,19 +60,15 @@ static char expect_close; static int heartbeat = WD_TIMO; static int wd_heartbeat; module_param(heartbeat, int, 0); -MODULE_PARM_DESC(heartbeat, - "Watchdog heartbeat in seconds. (0 < heartbeat < 65536, default=" - __MODULE_STRING(WD_TIMO) ")"); +MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0 65535) + if ((t < 1) || (t > 65535)) return -EINVAL; heartbeat = t; @@ -211,7 +200,7 @@ static int wdt_get_status(int *status) new_status = inb_p(WDT_SR); spin_unlock_irqrestore(&wdt_lock, flags); - *status = 0; + *status=0; if (new_status & WDC_SR_ISOI0) *status |= WDIOF_EXTERN1; if (new_status & WDC_SR_ISII1) @@ -277,7 +266,7 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id) #ifdef CONFIG_WDT_501 if (!(status & WDC_SR_TGOOD)) - printk(KERN_CRIT "Overheat alarm.(%d)\n", inb_p(WDT_RT)); + printk(KERN_CRIT "Overheat alarm.(%d)\n",inb_p(WDT_RT)); if (!(status & WDC_SR_PSUOVER)) printk(KERN_CRIT "PSU over voltage.\n"); if (!(status & WDC_SR_PSUUNDR)) @@ -315,10 +304,9 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id) * write of data will do, as we we don't define content meaning. */ -static ssize_t wdt_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) +static ssize_t wdt_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { - if (count) { + if(count) { if (!nowayout) { size_t i; @@ -340,6 +328,7 @@ static ssize_t wdt_write(struct file *file, const char __user *buf, /** * wdt_ioctl: + * @inode: inode of the device * @file: file handle to the device * @cmd: watchdog command * @arg: argument pointer @@ -349,7 +338,8 @@ static ssize_t wdt_write(struct file *file, const char __user *buf, * querying capabilities and current status. */ -static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) { void __user *argp = (void __user *)arg; int __user *p = argp; @@ -372,28 +362,32 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ident.options |= WDIOF_FANFAULT; #endif /* CONFIG_WDT_501 */ - switch (cmd) { - default: - return -ENOTTY; - case WDIOC_GETSUPPORT: - return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; - case WDIOC_GETSTATUS: - wdt_get_status(&status); - return put_user(status, p); - case WDIOC_GETBOOTSTATUS: - return put_user(0, p); - case WDIOC_KEEPALIVE: - wdt_ping(); - return 0; - case WDIOC_SETTIMEOUT: - if (get_user(new_heartbeat, p)) - return -EFAULT; - if (wdt_set_heartbeat(new_heartbeat)) - return -EINVAL; - wdt_ping(); - /* Fall */ - case WDIOC_GETTIMEOUT: - return put_user(heartbeat, p); + switch(cmd) + { + default: + return -ENOTTY; + case WDIOC_GETSUPPORT: + return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0; + + case WDIOC_GETSTATUS: + wdt_get_status(&status); + return put_user(status, p); + case WDIOC_GETBOOTSTATUS: + return put_user(0, p); + case WDIOC_KEEPALIVE: + wdt_ping(); + return 0; + case WDIOC_SETTIMEOUT: + if (get_user(new_heartbeat, p)) + return -EFAULT; + + if (wdt_set_heartbeat(new_heartbeat)) + return -EINVAL; + + wdt_ping(); + /* Fall */ + case WDIOC_GETTIMEOUT: + return put_user(heartbeat, p); } } @@ -411,7 +405,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) static int wdt_open(struct inode *inode, struct file *file) { - if (test_and_set_bit(0, &wdt_is_open)) + if(test_and_set_bit(0, &wdt_is_open)) return -EBUSY; /* * Activate @@ -438,8 +432,7 @@ static int wdt_release(struct inode *inode, struct file *file) wdt_stop(); clear_bit(0, &wdt_is_open); } else { - printk(KERN_CRIT - "wdt: WDT device closed unexpectedly. WDT will not stop!\n"); + printk(KERN_CRIT "wdt: WDT device closed unexpectedly. WDT will not stop!\n"); wdt_ping(); } expect_close = 0; @@ -458,15 +451,14 @@ static int wdt_release(struct inode *inode, struct file *file) * farenheit. It was designed by an imperial measurement luddite. */ -static ssize_t wdt_temp_read(struct file *file, char __user *buf, - size_t count, loff_t *ptr) +static ssize_t wdt_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr) { int temperature; if (wdt_get_temperature(&temperature)) return -EFAULT; - if (copy_to_user(buf, &temperature, 1)) + if (copy_to_user (buf, &temperature, 1)) return -EFAULT; return 1; @@ -514,8 +506,10 @@ static int wdt_temp_release(struct inode *inode, struct file *file) static int wdt_notify_sys(struct notifier_block *this, unsigned long code, void *unused) { - if (code == SYS_DOWN || code == SYS_HALT) + if(code==SYS_DOWN || code==SYS_HALT) { + /* Turn the card off */ wdt_stop(); + } return NOTIFY_DONE; } @@ -528,7 +522,7 @@ static const struct file_operations wdt_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = wdt_write, - .unlocked_ioctl = wdt_ioctl, + .ioctl = wdt_ioctl, .open = wdt_open, .release = wdt_release, }; @@ -582,7 +576,7 @@ static void __exit wdt_exit(void) #endif /* CONFIG_WDT_501 */ unregister_reboot_notifier(&wdt_notifier); free_irq(irq, NULL); - release_region(io, 8); + release_region(io,8); } /** @@ -597,49 +591,44 @@ static int __init wdt_init(void) { int ret; - /* Check that the heartbeat value is within it's range; - if not reset to the default */ + /* Check that the heartbeat value is within it's range ; if not reset to the default */ if (wdt_set_heartbeat(heartbeat)) { wdt_set_heartbeat(WD_TIMO); - printk(KERN_INFO "wdt: heartbeat value must be 0 < heartbeat < 65536, using %d\n", + printk(KERN_INFO "wdt: heartbeat value must be 0 #include #include -#include #include #include #include #include #include -#include -#include +#include +#include #include #define WDT_IS_PCI @@ -76,7 +73,7 @@ /* We can only use 1 card due to the /dev/watchdog restriction */ static int dev_count; -static unsigned long open_lock; +static struct semaphore open_sem; static DEFINE_SPINLOCK(wdtpci_lock); static char expect_close; @@ -89,23 +86,18 @@ static int irq; static int heartbeat = WD_TIMO; static int wd_heartbeat; module_param(heartbeat, int, 0); -MODULE_PARM_DESC(heartbeat, - "Watchdog heartbeat in seconds. (0> 8, WDT_COUNT0 + ctr); - udelay(8); + outb_p(val&0xFF, WDT_COUNT0+ctr); + outb_p(val>>8, WDT_COUNT0+ctr); } /** @@ -145,35 +134,23 @@ static int wdtpci_start(void) * "pet" the watchdog, as Access says. * This resets the clock outputs. */ - inb(WDT_DC); /* Disable watchdog */ - udelay(8); - wdtpci_ctr_mode(2, 0); /* Program CTR2 for Mode 0: - Pulse on Terminal Count */ - outb(0, WDT_DC); /* Enable watchdog */ - udelay(8); - inb(WDT_DC); /* Disable watchdog */ - udelay(8); - outb(0, WDT_CLOCK); /* 2.0833MHz clock */ - udelay(8); - inb(WDT_BUZZER); /* disable */ - udelay(8); - inb(WDT_OPTONOTRST); /* disable */ - udelay(8); - inb(WDT_OPTORST); /* disable */ - udelay(8); - inb(WDT_PROGOUT); /* disable */ - udelay(8); - wdtpci_ctr_mode(0, 3); /* Program CTR0 for Mode 3: - Square Wave Generator */ - wdtpci_ctr_mode(1, 2); /* Program CTR1 for Mode 2: - Rate Generator */ - wdtpci_ctr_mode(2, 1); /* Program CTR2 for Mode 1: - Retriggerable One-Shot */ - wdtpci_ctr_load(0, 20833); /* count at 100Hz */ - wdtpci_ctr_load(1, wd_heartbeat);/* Heartbeat */ + inb_p(WDT_DC); /* Disable watchdog */ + wdtpci_ctr_mode(2,0); /* Program CTR2 for Mode 0: Pulse on Terminal Count */ + outb_p(0, WDT_DC); /* Enable watchdog */ + + inb_p(WDT_DC); /* Disable watchdog */ + outb_p(0, WDT_CLOCK); /* 2.0833MHz clock */ + inb_p(WDT_BUZZER); /* disable */ + inb_p(WDT_OPTONOTRST); /* disable */ + inb_p(WDT_OPTORST); /* disable */ + inb_p(WDT_PROGOUT); /* disable */ + wdtpci_ctr_mode(0,3); /* Program CTR0 for Mode 3: Square Wave Generator */ + wdtpci_ctr_mode(1,2); /* Program CTR1 for Mode 2: Rate Generator */ + wdtpci_ctr_mode(2,1); /* Program CTR2 for Mode 1: Retriggerable One-Shot */ + wdtpci_ctr_load(0,20833); /* count at 100Hz */ + wdtpci_ctr_load(1,wd_heartbeat);/* Heartbeat */ /* DO NOT LOAD CTR2 on PCI card! -- JPN */ - outb(0, WDT_DC); /* Enable watchdog */ - udelay(8); + outb_p(0, WDT_DC); /* Enable watchdog */ spin_unlock_irqrestore(&wdtpci_lock, flags); return 0; @@ -185,15 +162,14 @@ static int wdtpci_start(void) * Stop the watchdog driver. */ -static int wdtpci_stop(void) +static int wdtpci_stop (void) { unsigned long flags; /* Turn the card off */ spin_lock_irqsave(&wdtpci_lock, flags); - inb(WDT_DC); /* Disable watchdog */ - udelay(8); - wdtpci_ctr_load(2, 0); /* 0 length reset pulses now */ + inb_p(WDT_DC); /* Disable watchdog */ + wdtpci_ctr_load(2,0); /* 0 length reset pulses now */ spin_unlock_irqrestore(&wdtpci_lock, flags); return 0; } @@ -201,23 +177,20 @@ static int wdtpci_stop(void) /** * wdtpci_ping: * - * Reload counter one with the watchdog heartbeat. We don't bother - * reloading the cascade counter. + * Reload counter one with the watchdog heartbeat. We don't bother reloading + * the cascade counter. */ static int wdtpci_ping(void) { unsigned long flags; - spin_lock_irqsave(&wdtpci_lock, flags); /* Write a watchdog value */ - inb(WDT_DC); /* Disable watchdog */ - udelay(8); - wdtpci_ctr_mode(1, 2); /* Re-Program CTR1 for Mode 2: - Rate Generator */ - wdtpci_ctr_load(1, wd_heartbeat);/* Heartbeat */ - outb(0, WDT_DC); /* Enable watchdog */ - udelay(8); + spin_lock_irqsave(&wdtpci_lock, flags); + inb_p(WDT_DC); /* Disable watchdog */ + wdtpci_ctr_mode(1,2); /* Re-Program CTR1 for Mode 2: Rate Generator */ + wdtpci_ctr_load(1,wd_heartbeat);/* Heartbeat */ + outb_p(0, WDT_DC); /* Enable watchdog */ spin_unlock_irqrestore(&wdtpci_lock, flags); return 0; } @@ -226,14 +199,14 @@ static int wdtpci_ping(void) * wdtpci_set_heartbeat: * @t: the new heartbeat value that needs to be set. * - * Set a new heartbeat value for the watchdog device. If the heartbeat - * value is incorrect we keep the old value and return -EINVAL. - * If successful we return 0. + * Set a new heartbeat value for the watchdog device. If the heartbeat value is + * incorrect we keep the old value and return -EINVAL. If successfull we + * return 0. */ static int wdtpci_set_heartbeat(int t) { /* Arbitrary, can't find the card's limits */ - if (t < 1 || t > 65535) + if ((t < 1) || (t > 65535)) return -EINVAL; heartbeat = t; @@ -254,14 +227,9 @@ static int wdtpci_set_heartbeat(int t) static int wdtpci_get_status(int *status) { - unsigned char new_status; - unsigned long flags; - - spin_lock_irqsave(&wdtpci_lock, flags); - new_status = inb(WDT_SR); - spin_unlock_irqrestore(&wdtpci_lock, flags); + unsigned char new_status=inb_p(WDT_SR); - *status = 0; + *status=0; if (new_status & WDC_SR_ISOI0) *status |= WDIOF_EXTERN1; if (new_status & WDC_SR_ISII1) @@ -291,12 +259,8 @@ static int wdtpci_get_status(int *status) static int wdtpci_get_temperature(int *temperature) { - unsigned short c; - unsigned long flags; - spin_lock_irqsave(&wdtpci_lock, flags); - c = inb(WDT_RT); - udelay(8); - spin_unlock_irqrestore(&wdtpci_lock, flags); + unsigned short c=inb_p(WDT_RT); + *temperature = (c * 11 / 15) + 7; return 0; } @@ -318,25 +282,17 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id) * Read the status register see what is up and * then printk it. */ - unsigned char status; - - spin_lock(&wdtpci_lock); - - status = inb(WDT_SR); - udelay(8); + unsigned char status=inb_p(WDT_SR); printk(KERN_CRIT PFX "status %d\n", status); #ifdef CONFIG_WDT_501_PCI - if (!(status & WDC_SR_TGOOD)) { - u8 alarm = inb(WDT_RT); - printk(KERN_CRIT PFX "Overheat alarm.(%d)\n", alarm); - udelay(8); - } + if (!(status & WDC_SR_TGOOD)) + printk(KERN_CRIT PFX "Overheat alarm.(%d)\n",inb_p(WDT_RT)); if (!(status & WDC_SR_PSUOVER)) - printk(KERN_CRIT PFX "PSU over voltage.\n"); + printk(KERN_CRIT PFX "PSU over voltage.\n"); if (!(status & WDC_SR_PSUUNDR)) - printk(KERN_CRIT PFX "PSU under voltage.\n"); + printk(KERN_CRIT PFX "PSU under voltage.\n"); if (tachometer) { if (!(status & WDC_SR_FANGOOD)) printk(KERN_CRIT PFX "Possible fan fault.\n"); @@ -354,7 +310,6 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id) printk(KERN_CRIT PFX "Reset in 5ms.\n"); #endif } - spin_unlock(&wdtpci_lock); return IRQ_HANDLED; } @@ -370,8 +325,7 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id) * write of data will do, as we we don't define content meaning. */ -static ssize_t wdtpci_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) +static ssize_t wdtpci_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { if (count) { if (!nowayout) { @@ -381,7 +335,7 @@ static ssize_t wdtpci_write(struct file *file, const char __user *buf, for (i = 0; i != count; i++) { char c; - if (get_user(c, buf+i)) + if(get_user(c, buf+i)) return -EFAULT; if (c == 'V') expect_close = 42; @@ -389,11 +343,13 @@ static ssize_t wdtpci_write(struct file *file, const char __user *buf, } wdtpci_ping(); } + return count; } /** * wdtpci_ioctl: + * @inode: inode of the device * @file: file handle to the device * @cmd: watchdog command * @arg: argument pointer @@ -403,8 +359,8 @@ static ssize_t wdtpci_write(struct file *file, const char __user *buf, * querying capabilities and current status. */ -static long wdtpci_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) +static int wdtpci_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) { int new_heartbeat; int status; @@ -427,29 +383,33 @@ static long wdtpci_ioctl(struct file *file, unsigned int cmd, ident.options |= WDIOF_FANFAULT; #endif /* CONFIG_WDT_501_PCI */ - switch (cmd) { - default: - return -ENOTTY; - case WDIOC_GETSUPPORT: - return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0; - case WDIOC_GETSTATUS: - wdtpci_get_status(&status); - return put_user(status, p); - case WDIOC_GETBOOTSTATUS: - return put_user(0, p); - case WDIOC_KEEPALIVE: - wdtpci_ping(); - return 0; - case WDIOC_SETTIMEOUT: - if (get_user(new_heartbeat, p)) - return -EFAULT; - if (wdtpci_set_heartbeat(new_heartbeat)) - return -EINVAL; - wdtpci_ping(); - /* Fall */ - case WDIOC_GETTIMEOUT: - return put_user(heartbeat, p); - } + switch(cmd) + { + default: + return -ENOTTY; + case WDIOC_GETSUPPORT: + return copy_to_user(argp, &ident, sizeof(ident))?-EFAULT:0; + + case WDIOC_GETSTATUS: + wdtpci_get_status(&status); + return put_user(status, p); + case WDIOC_GETBOOTSTATUS: + return put_user(0, p); + case WDIOC_KEEPALIVE: + wdtpci_ping(); + return 0; + case WDIOC_SETTIMEOUT: + if (get_user(new_heartbeat, p)) + return -EFAULT; + + if (wdtpci_set_heartbeat(new_heartbeat)) + return -EINVAL; + + wdtpci_ping(); + /* Fall */ + case WDIOC_GETTIMEOUT: + return put_user(heartbeat, p); + } } /** @@ -466,11 +426,12 @@ static long wdtpci_ioctl(struct file *file, unsigned int cmd, static int wdtpci_open(struct inode *inode, struct file *file) { - if (test_and_set_bit(0, &open_lock)) + if (down_trylock(&open_sem)) return -EBUSY; - if (nowayout) + if (nowayout) { __module_get(THIS_MODULE); + } /* * Activate */ @@ -499,7 +460,7 @@ static int wdtpci_release(struct inode *inode, struct file *file) wdtpci_ping(); } expect_close = 0; - clear_bit(0, &open_lock); + up(&open_sem); return 0; } @@ -515,15 +476,14 @@ static int wdtpci_release(struct inode *inode, struct file *file) * fahrenheit. It was designed by an imperial measurement luddite. */ -static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, - size_t count, loff_t *ptr) +static ssize_t wdtpci_temp_read(struct file *file, char __user *buf, size_t count, loff_t *ptr) { int temperature; if (wdtpci_get_temperature(&temperature)) return -EFAULT; - if (copy_to_user(buf, &temperature, 1)) + if (copy_to_user (buf, &temperature, 1)) return -EFAULT; return 1; @@ -569,10 +529,12 @@ static int wdtpci_temp_release(struct inode *inode, struct file *file) */ static int wdtpci_notify_sys(struct notifier_block *this, unsigned long code, - void *unused) + void *unused) { - if (code == SYS_DOWN || code == SYS_HALT) + if (code==SYS_DOWN || code==SYS_HALT) { + /* Turn the card off */ wdtpci_stop(); + } return NOTIFY_DONE; } @@ -585,7 +547,7 @@ static const struct file_operations wdtpci_fops = { .owner = THIS_MODULE, .llseek = no_llseek, .write = wdtpci_write, - .unlocked_ioctl = wdtpci_ioctl, + .ioctl = wdtpci_ioctl, .open = wdtpci_open, .release = wdtpci_release, }; @@ -622,85 +584,80 @@ static struct notifier_block wdtpci_notifier = { }; -static int __devinit wdtpci_init_one(struct pci_dev *dev, - const struct pci_device_id *ent) +static int __devinit wdtpci_init_one (struct pci_dev *dev, + const struct pci_device_id *ent) { int ret = -EIO; dev_count++; if (dev_count > 1) { - printk(KERN_ERR PFX "This driver only supports one device\n"); + printk (KERN_ERR PFX "this driver only supports 1 device\n"); return -ENODEV; } - if (pci_enable_device(dev)) { - printk(KERN_ERR PFX "Not possible to enable PCI Device\n"); + if (pci_enable_device (dev)) { + printk (KERN_ERR PFX "Not possible to enable PCI Device\n"); return -ENODEV; } - if (pci_resource_start(dev, 2) == 0x0000) { - printk(KERN_ERR PFX "No I/O-Address for card detected\n"); + if (pci_resource_start (dev, 2) == 0x0000) { + printk (KERN_ERR PFX "No I/O-Address for card detected\n"); ret = -ENODEV; goto out_pci; } + sema_init(&open_sem, 1); + irq = dev->irq; - io = pci_resource_start(dev, 2); + io = pci_resource_start (dev, 2); - if (request_region(io, 16, "wdt_pci") == NULL) { - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", io); + if (request_region (io, 16, "wdt_pci") == NULL) { + printk (KERN_ERR PFX "I/O address 0x%04x already in use\n", io); goto out_pci; } - if (request_irq(irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED, + if (request_irq (irq, wdtpci_interrupt, IRQF_DISABLED | IRQF_SHARED, "wdt_pci", &wdtpci_miscdev)) { - printk(KERN_ERR PFX "IRQ %d is not free\n", irq); + printk (KERN_ERR PFX "IRQ %d is not free\n", irq); goto out_reg; } - printk(KERN_INFO - "PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%04x (Interrupt %d)\n", - io, irq); + printk ("PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%04x (Interrupt %d)\n", + io, irq); - /* Check that the heartbeat value is within its range; - if not reset to the default */ + /* Check that the heartbeat value is within it's range ; if not reset to the default */ if (wdtpci_set_heartbeat(heartbeat)) { wdtpci_set_heartbeat(WD_TIMO); - printk(KERN_INFO PFX - "heartbeat value must be 0 < heartbeat < 65536, using %d\n", - WD_TIMO); + printk(KERN_INFO PFX "heartbeat value must be 0len + 9) & ~3; p->addr = htonl(p->addr); - p->len = htons(p->len); + p->len = htonl(p->len); write(outfd, &p->addr, writelen); p = p->next; } /* EOF record is zero length, since we don't bother to represent the type field in the binary version */ - write(outfd, zeroes, 6); + write(outfd, zeroes, 5); return 0; } diff --git a/trunk/fs/afs/write.c b/trunk/fs/afs/write.c index 065b4e10681a..9a849ad3c489 100644 --- a/trunk/fs/afs/write.c +++ b/trunk/fs/afs/write.c @@ -404,7 +404,7 @@ static int afs_write_back_from_locked_page(struct afs_writeback *wb, page = pages[loop]; if (page->index > wb->last) break; - if (!trylock_page(page)) + if (TestSetPageLocked(page)) break; if (!PageDirty(page) || page_private(page) != (unsigned long) wb) { diff --git a/trunk/fs/buffer.c b/trunk/fs/buffer.c index 38653e36e225..4dbe52948e8f 100644 --- a/trunk/fs/buffer.c +++ b/trunk/fs/buffer.c @@ -1720,7 +1720,7 @@ static int __block_write_full_page(struct inode *inode, struct page *page, */ if (wbc->sync_mode != WB_SYNC_NONE || !wbc->nonblocking) { lock_buffer(bh); - } else if (!trylock_buffer(bh)) { + } else if (test_set_buffer_locked(bh)) { redirty_page_for_writepage(wbc, page); continue; } @@ -3000,7 +3000,7 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhs[]) if (rw == SWRITE || rw == SWRITE_SYNC) lock_buffer(bh); - else if (!trylock_buffer(bh)) + else if (test_set_buffer_locked(bh)) continue; if (rw == WRITE || rw == SWRITE || rw == SWRITE_SYNC) { diff --git a/trunk/fs/cifs/file.c b/trunk/fs/cifs/file.c index e692c42f24b5..0aac824371a5 100644 --- a/trunk/fs/cifs/file.c +++ b/trunk/fs/cifs/file.c @@ -1280,7 +1280,7 @@ static int cifs_writepages(struct address_space *mapping, if (first < 0) lock_page(page); - else if (!trylock_page(page)) + else if (TestSetPageLocked(page)) break; if (unlikely(page->mapping != mapping)) { diff --git a/trunk/fs/jbd/commit.c b/trunk/fs/jbd/commit.c index ae08c057e751..2eccbfaa1d48 100644 --- a/trunk/fs/jbd/commit.c +++ b/trunk/fs/jbd/commit.c @@ -63,7 +63,7 @@ static void release_buffer_page(struct buffer_head *bh) goto nope; /* OK, it's a truncated page */ - if (!trylock_page(page)) + if (TestSetPageLocked(page)) goto nope; page_cache_get(page); @@ -221,7 +221,7 @@ static int journal_submit_data_buffers(journal_t *journal, * blocking lock_buffer(). */ if (buffer_dirty(bh)) { - if (!trylock_buffer(bh)) { + if (test_set_buffer_locked(bh)) { BUFFER_TRACE(bh, "needs blocking lock"); spin_unlock(&journal->j_list_lock); /* Write out all data to prevent deadlocks */ @@ -446,7 +446,7 @@ void journal_commit_transaction(journal_t *journal) spin_lock(&journal->j_list_lock); } if (unlikely(!buffer_uptodate(bh))) { - if (!trylock_page(bh->b_page)) { + if (TestSetPageLocked(bh->b_page)) { spin_unlock(&journal->j_list_lock); lock_page(bh->b_page); spin_lock(&journal->j_list_lock); diff --git a/trunk/fs/jbd2/commit.c b/trunk/fs/jbd2/commit.c index f2ad061e95ec..adf0395f318e 100644 --- a/trunk/fs/jbd2/commit.c +++ b/trunk/fs/jbd2/commit.c @@ -67,7 +67,7 @@ static void release_buffer_page(struct buffer_head *bh) goto nope; /* OK, it's a truncated page */ - if (!trylock_page(page)) + if (TestSetPageLocked(page)) goto nope; page_cache_get(page); diff --git a/trunk/fs/nfs/nfsroot.c b/trunk/fs/nfs/nfsroot.c index 46763d1cd397..8478fc25daee 100644 --- a/trunk/fs/nfs/nfsroot.c +++ b/trunk/fs/nfs/nfsroot.c @@ -127,7 +127,7 @@ enum { Opt_err }; -static match_table_t __initdata tokens = { +static match_table_t __initconst tokens = { {Opt_port, "port=%u"}, {Opt_rsize, "rsize=%u"}, {Opt_wsize, "wsize=%u"}, diff --git a/trunk/fs/ntfs/aops.c b/trunk/fs/ntfs/aops.c index b38f944f0667..00e9ccde8e42 100644 --- a/trunk/fs/ntfs/aops.c +++ b/trunk/fs/ntfs/aops.c @@ -1194,7 +1194,7 @@ static int ntfs_write_mst_block(struct page *page, tbh = bhs[i]; if (!tbh) continue; - if (!trylock_buffer(tbh)) + if (unlikely(test_set_buffer_locked(tbh))) BUG(); /* The buffer dirty state is now irrelevant, just clean it. */ clear_buffer_dirty(tbh); diff --git a/trunk/fs/ntfs/compress.c b/trunk/fs/ntfs/compress.c index 9669541d0119..33ff314cc507 100644 --- a/trunk/fs/ntfs/compress.c +++ b/trunk/fs/ntfs/compress.c @@ -665,7 +665,7 @@ int ntfs_read_compressed_block(struct page *page) for (i = 0; i < nr_bhs; i++) { struct buffer_head *tbh = bhs[i]; - if (!trylock_buffer(tbh)) + if (unlikely(test_set_buffer_locked(tbh))) continue; if (unlikely(buffer_uptodate(tbh))) { unlock_buffer(tbh); diff --git a/trunk/fs/ntfs/mft.c b/trunk/fs/ntfs/mft.c index 17d32ca6bc35..790defb847e7 100644 --- a/trunk/fs/ntfs/mft.c +++ b/trunk/fs/ntfs/mft.c @@ -586,7 +586,7 @@ int ntfs_sync_mft_mirror(ntfs_volume *vol, const unsigned long mft_no, for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) { struct buffer_head *tbh = bhs[i_bhs]; - if (!trylock_buffer(tbh)) + if (unlikely(test_set_buffer_locked(tbh))) BUG(); BUG_ON(!buffer_uptodate(tbh)); clear_buffer_dirty(tbh); @@ -779,7 +779,7 @@ int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync) for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) { struct buffer_head *tbh = bhs[i_bhs]; - if (!trylock_buffer(tbh)) + if (unlikely(test_set_buffer_locked(tbh))) BUG(); BUG_ON(!buffer_uptodate(tbh)); clear_buffer_dirty(tbh); diff --git a/trunk/fs/omfs/inode.c b/trunk/fs/omfs/inode.c index a95fe5984f4b..d865f5535436 100644 --- a/trunk/fs/omfs/inode.c +++ b/trunk/fs/omfs/inode.c @@ -492,8 +492,7 @@ static int omfs_fill_super(struct super_block *sb, void *data, int silent) if (sbi->s_num_blocks != be64_to_cpu(omfs_rb->r_num_blocks)) { printk(KERN_ERR "omfs: block count discrepancy between " "super and root blocks (%llx, %llx)\n", - (unsigned long long)sbi->s_num_blocks, - (unsigned long long)be64_to_cpu(omfs_rb->r_num_blocks)); + sbi->s_num_blocks, be64_to_cpu(omfs_rb->r_num_blocks)); goto out_brelse_bh2; } diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c index a28840b11b89..01ed610f9b87 100644 --- a/trunk/fs/proc/base.c +++ b/trunk/fs/proc/base.c @@ -2423,13 +2423,10 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) "read_bytes: %llu\n" "write_bytes: %llu\n" "cancelled_write_bytes: %llu\n", - (unsigned long long)acct.rchar, - (unsigned long long)acct.wchar, - (unsigned long long)acct.syscr, - (unsigned long long)acct.syscw, - (unsigned long long)acct.read_bytes, - (unsigned long long)acct.write_bytes, - (unsigned long long)acct.cancelled_write_bytes); + acct.rchar, acct.wchar, + acct.syscr, acct.syscw, + acct.read_bytes, acct.write_bytes, + acct.cancelled_write_bytes); } static int proc_tid_io_accounting(struct task_struct *task, char *buffer) diff --git a/trunk/fs/reiserfs/inode.c b/trunk/fs/reiserfs/inode.c index 5699171212ae..192269698a8a 100644 --- a/trunk/fs/reiserfs/inode.c +++ b/trunk/fs/reiserfs/inode.c @@ -2435,7 +2435,7 @@ static int reiserfs_write_full_page(struct page *page, if (wbc->sync_mode != WB_SYNC_NONE || !wbc->nonblocking) { lock_buffer(bh); } else { - if (!trylock_buffer(bh)) { + if (test_set_buffer_locked(bh)) { redirty_page_for_writepage(wbc, page); continue; } diff --git a/trunk/fs/reiserfs/journal.c b/trunk/fs/reiserfs/journal.c index c21df71943a6..c8f60ee183b5 100644 --- a/trunk/fs/reiserfs/journal.c +++ b/trunk/fs/reiserfs/journal.c @@ -627,7 +627,7 @@ static int journal_list_still_alive(struct super_block *s, static void release_buffer_page(struct buffer_head *bh) { struct page *page = bh->b_page; - if (!page->mapping && trylock_page(page)) { + if (!page->mapping && !TestSetPageLocked(page)) { page_cache_get(page); put_bh(bh); if (!page->mapping) @@ -855,7 +855,7 @@ static int write_ordered_buffers(spinlock_t * lock, jh = JH_ENTRY(list->next); bh = jh->bh; get_bh(bh); - if (!trylock_buffer(bh)) { + if (test_set_buffer_locked(bh)) { if (!buffer_dirty(bh)) { list_move(&jh->list, &tmp); goto loop_next; @@ -3871,7 +3871,7 @@ int reiserfs_prepare_for_journal(struct super_block *p_s_sb, { PROC_INFO_INC(p_s_sb, journal.prepare); - if (!trylock_buffer(bh)) { + if (test_set_buffer_locked(bh)) { if (!wait) return 0; lock_buffer(bh); diff --git a/trunk/fs/splice.c b/trunk/fs/splice.c index 1bbc6f4bb09c..b30311ba8af6 100644 --- a/trunk/fs/splice.c +++ b/trunk/fs/splice.c @@ -371,7 +371,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, * for an in-flight io page */ if (flags & SPLICE_F_NONBLOCK) { - if (!trylock_page(page)) { + if (TestSetPageLocked(page)) { error = -EAGAIN; break; } diff --git a/trunk/fs/ufs/super.c b/trunk/fs/ufs/super.c index 3141969b456d..3e30e40aa24d 100644 --- a/trunk/fs/ufs/super.c +++ b/trunk/fs/ufs/super.c @@ -1233,7 +1233,7 @@ static int ufs_show_options(struct seq_file *seq, struct vfsmount *vfs) { struct ufs_sb_info *sbi = UFS_SB(vfs->mnt_sb); unsigned mval = sbi->s_mount_opt & UFS_MOUNT_UFSTYPE; - struct match_token *tp = tokens; + const struct match_token *tp = tokens; while (tp->token != Opt_onerror_panic && tp->token != mval) ++tp; diff --git a/trunk/fs/xfs/linux-2.6/xfs_aops.c b/trunk/fs/xfs/linux-2.6/xfs_aops.c index fa47e43b8b41..0b211cba1909 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_aops.c +++ b/trunk/fs/xfs/linux-2.6/xfs_aops.c @@ -675,7 +675,7 @@ xfs_probe_cluster( } else pg_offset = PAGE_CACHE_SIZE; - if (page->index == tindex && trylock_page(page)) { + if (page->index == tindex && !TestSetPageLocked(page)) { pg_len = xfs_probe_page(page, pg_offset, mapped); unlock_page(page); } @@ -759,7 +759,7 @@ xfs_convert_page( if (page->index != tindex) goto fail; - if (!trylock_page(page)) + if (TestSetPageLocked(page)) goto fail; if (PageWriteback(page)) goto fail_unlock_page; @@ -1104,7 +1104,7 @@ xfs_page_state_convert( * that we are writing into for the first time. */ type = IOMAP_NEW; - if (trylock_buffer(bh)) { + if (!test_and_set_bit(BH_Lock, &bh->b_state)) { ASSERT(buffer_mapped(bh)); if (iomap_valid) all_bh = 1; diff --git a/trunk/include/asm-m68k/contregs.h b/trunk/include/asm-m68k/contregs.h index d1ea750bddfe..1e233e7d191e 100644 --- a/trunk/include/asm-m68k/contregs.h +++ b/trunk/include/asm-m68k/contregs.h @@ -1,53 +1,4 @@ #ifndef _M68K_CONTREGS_H #define _M68K_CONTREGS_H - -/* contregs.h: Addresses of registers in the ASI_CONTROL alternate address - * space. These are for the mmu's context register, etc. - * - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) - */ - -/* 3=sun3 - 4=sun4 (as in sun4 sysmaint student book) - c=sun4c (according to davem) */ - -#define AC_IDPROM 0x00000000 /* 34 ID PROM, R/O, byte, 32 bytes */ -#define AC_PAGEMAP 0x10000000 /* 3 Pagemap R/W, long */ -#define AC_SEGMAP 0x20000000 /* 3 Segment map, byte */ -#define AC_CONTEXT 0x30000000 /* 34c current mmu-context */ -#define AC_SENABLE 0x40000000 /* 34c system dvma/cache/reset enable reg*/ -#define AC_UDVMA_ENB 0x50000000 /* 34 Not used on Sun boards, byte */ -#define AC_BUS_ERROR 0x60000000 /* 34 Not cleared on read, byte. */ -#define AC_SYNC_ERR 0x60000000 /* c fault type */ -#define AC_SYNC_VA 0x60000004 /* c fault virtual address */ -#define AC_ASYNC_ERR 0x60000008 /* c asynchronous fault type */ -#define AC_ASYNC_VA 0x6000000c /* c async fault virtual address */ -#define AC_LEDS 0x70000000 /* 34 Zero turns on LEDs, byte */ -#define AC_CACHETAGS 0x80000000 /* 34c direct access to the VAC tags */ -#define AC_CACHEDDATA 0x90000000 /* 3 c direct access to the VAC data */ -#define AC_UDVMA_MAP 0xD0000000 /* 4 Not used on Sun boards, byte */ -#define AC_VME_VECTOR 0xE0000000 /* 4 For non-Autovector VME, byte */ -#define AC_BOOT_SCC 0xF0000000 /* 34 bypass to access Zilog 8530. byte.*/ - -/* s=Swift, h=Ross_HyperSPARC, v=TI_Viking, t=Tsunami, r=Ross_Cypress */ -#define AC_M_PCR 0x0000 /* shv Processor Control Reg */ -#define AC_M_CTPR 0x0100 /* shv Context Table Pointer Reg */ -#define AC_M_CXR 0x0200 /* shv Context Register */ -#define AC_M_SFSR 0x0300 /* shv Synchronous Fault Status Reg */ -#define AC_M_SFAR 0x0400 /* shv Synchronous Fault Address Reg */ -#define AC_M_AFSR 0x0500 /* hv Asynchronous Fault Status Reg */ -#define AC_M_AFAR 0x0600 /* hv Asynchronous Fault Address Reg */ -#define AC_M_RESET 0x0700 /* hv Reset Reg */ -#define AC_M_RPR 0x1000 /* hv Root Pointer Reg */ -#define AC_M_TSUTRCR 0x1000 /* s TLB Replacement Ctrl Reg */ -#define AC_M_IAPTP 0x1100 /* hv Instruction Access PTP */ -#define AC_M_DAPTP 0x1200 /* hv Data Access PTP */ -#define AC_M_ITR 0x1300 /* hv Index Tag Register */ -#define AC_M_TRCR 0x1400 /* hv TLB Replacement Control Reg */ -#define AC_M_SFSRX 0x1300 /* s Synch Fault Status Reg prim */ -#define AC_M_SFARX 0x1400 /* s Synch Fault Address Reg prim */ -#define AC_M_RPR1 0x1500 /* h Root Pointer Reg (entry 2) */ -#define AC_M_IAPTP1 0x1600 /* h Instruction Access PTP (entry 2) */ -#define AC_M_DAPTP1 0x1700 /* h Data Access PTP (entry 2) */ - +#include #endif /* _M68K_CONTREGS_H */ diff --git a/trunk/include/asm-m68k/fbio.h b/trunk/include/asm-m68k/fbio.h index b9215a0907d3..c17edf8c7bc4 100644 --- a/trunk/include/asm-m68k/fbio.h +++ b/trunk/include/asm-m68k/fbio.h @@ -1,330 +1 @@ -#ifndef __LINUX_FBIO_H -#define __LINUX_FBIO_H - -#include -#include - -/* Constants used for fbio SunOS compatibility */ -/* (C) 1996 Miguel de Icaza */ - -/* Frame buffer types */ -#define FBTYPE_NOTYPE -1 -#define FBTYPE_SUN1BW 0 /* mono */ -#define FBTYPE_SUN1COLOR 1 -#define FBTYPE_SUN2BW 2 -#define FBTYPE_SUN2COLOR 3 -#define FBTYPE_SUN2GP 4 -#define FBTYPE_SUN5COLOR 5 -#define FBTYPE_SUN3COLOR 6 -#define FBTYPE_MEMCOLOR 7 -#define FBTYPE_SUN4COLOR 8 - -#define FBTYPE_NOTSUN1 9 -#define FBTYPE_NOTSUN2 10 -#define FBTYPE_NOTSUN3 11 - -#define FBTYPE_SUNFAST_COLOR 12 /* cg6 */ -#define FBTYPE_SUNROP_COLOR 13 -#define FBTYPE_SUNFB_VIDEO 14 -#define FBTYPE_SUNGIFB 15 -#define FBTYPE_SUNGPLAS 16 -#define FBTYPE_SUNGP3 17 -#define FBTYPE_SUNGT 18 -#define FBTYPE_SUNLEO 19 /* zx Leo card */ -#define FBTYPE_MDICOLOR 20 /* cg14 */ -#define FBTYPE_TCXCOLOR 21 /* SUNW,tcx card */ - -#define FBTYPE_LASTPLUSONE 21 /* This is not last + 1 in fact... */ - -/* Does not seem to be listed in the Sun file either */ -#define FBTYPE_CREATOR 22 -#define FBTYPE_PCI_IGA1682 23 -#define FBTYPE_P9100COLOR 24 - -#define FBTYPE_PCI_GENERIC 1000 -#define FBTYPE_PCI_MACH64 1001 - -/* fbio ioctls */ -/* Returned by FBIOGTYPE */ -struct fbtype { - int fb_type; /* fb type, see above */ - int fb_height; /* pixels */ - int fb_width; /* pixels */ - int fb_depth; - int fb_cmsize; /* color map entries */ - int fb_size; /* fb size in bytes */ -}; -#define FBIOGTYPE _IOR('F', 0, struct fbtype) - -struct fbcmap { - int index; /* first element (0 origin) */ - int count; - unsigned char __user *red; - unsigned char __user *green; - unsigned char __user *blue; -}; - -#ifdef __KERNEL__ -#define FBIOPUTCMAP_SPARC _IOW('F', 3, struct fbcmap) -#define FBIOGETCMAP_SPARC _IOW('F', 4, struct fbcmap) -#else -#define FBIOPUTCMAP _IOW('F', 3, struct fbcmap) -#define FBIOGETCMAP _IOW('F', 4, struct fbcmap) -#endif - -/* # of device specific values */ -#define FB_ATTR_NDEVSPECIFIC 8 -/* # of possible emulations */ -#define FB_ATTR_NEMUTYPES 4 - -struct fbsattr { - int flags; - int emu_type; /* -1 if none */ - int dev_specific[FB_ATTR_NDEVSPECIFIC]; -}; - -struct fbgattr { - int real_type; /* real frame buffer type */ - int owner; /* unknown */ - struct fbtype fbtype; /* real frame buffer fbtype */ - struct fbsattr sattr; - int emu_types[FB_ATTR_NEMUTYPES]; /* supported emulations */ -}; -#define FBIOSATTR _IOW('F', 5, struct fbgattr) /* Unsupported: */ -#define FBIOGATTR _IOR('F', 6, struct fbgattr) /* supported */ - -#define FBIOSVIDEO _IOW('F', 7, int) -#define FBIOGVIDEO _IOR('F', 8, int) - -struct fbcursor { - short set; /* what to set, choose from the list above */ - short enable; /* cursor on/off */ - struct fbcurpos pos; /* cursor position */ - struct fbcurpos hot; /* cursor hot spot */ - struct fbcmap cmap; /* color map info */ - struct fbcurpos size; /* cursor bit map size */ - char __user *image; /* cursor image bits */ - char __user *mask; /* cursor mask bits */ -}; - -/* set/get cursor attributes/shape */ -#define FBIOSCURSOR _IOW('F', 24, struct fbcursor) -#define FBIOGCURSOR _IOWR('F', 25, struct fbcursor) - -/* set/get cursor position */ -#define FBIOSCURPOS _IOW('F', 26, struct fbcurpos) -#define FBIOGCURPOS _IOW('F', 27, struct fbcurpos) - -/* get max cursor size */ -#define FBIOGCURMAX _IOR('F', 28, struct fbcurpos) - -/* wid manipulation */ -struct fb_wid_alloc { -#define FB_WID_SHARED_8 0 -#define FB_WID_SHARED_24 1 -#define FB_WID_DBL_8 2 -#define FB_WID_DBL_24 3 - __u32 wa_type; - __s32 wa_index; /* Set on return */ - __u32 wa_count; -}; -struct fb_wid_item { - __u32 wi_type; - __s32 wi_index; - __u32 wi_attrs; - __u32 wi_values[32]; -}; -struct fb_wid_list { - __u32 wl_flags; - __u32 wl_count; - struct fb_wid_item *wl_list; -}; - -#define FBIO_WID_ALLOC _IOWR('F', 30, struct fb_wid_alloc) -#define FBIO_WID_FREE _IOW('F', 31, struct fb_wid_alloc) -#define FBIO_WID_PUT _IOW('F', 32, struct fb_wid_list) -#define FBIO_WID_GET _IOWR('F', 33, struct fb_wid_list) - -/* Creator ioctls */ -#define FFB_IOCTL ('F'<<8) -#define FFB_SYS_INFO (FFB_IOCTL|80) -#define FFB_CLUTREAD (FFB_IOCTL|81) -#define FFB_CLUTPOST (FFB_IOCTL|82) -#define FFB_SETDIAGMODE (FFB_IOCTL|83) -#define FFB_GETMONITORID (FFB_IOCTL|84) -#define FFB_GETVIDEOMODE (FFB_IOCTL|85) -#define FFB_SETVIDEOMODE (FFB_IOCTL|86) -#define FFB_SETSERVER (FFB_IOCTL|87) -#define FFB_SETOVCTL (FFB_IOCTL|88) -#define FFB_GETOVCTL (FFB_IOCTL|89) -#define FFB_GETSAXNUM (FFB_IOCTL|90) -#define FFB_FBDEBUG (FFB_IOCTL|91) - -/* Cg14 ioctls */ -#define MDI_IOCTL ('M'<<8) -#define MDI_RESET (MDI_IOCTL|1) -#define MDI_GET_CFGINFO (MDI_IOCTL|2) -#define MDI_SET_PIXELMODE (MDI_IOCTL|3) -# define MDI_32_PIX 32 -# define MDI_16_PIX 16 -# define MDI_8_PIX 8 - -struct mdi_cfginfo { - int mdi_ncluts; /* Number of implemented CLUTs in this MDI */ - int mdi_type; /* FBTYPE name */ - int mdi_height; /* height */ - int mdi_width; /* widht */ - int mdi_size; /* available ram */ - int mdi_mode; /* 8bpp, 16bpp or 32bpp */ - int mdi_pixfreq; /* pixel clock (from PROM) */ -}; - -/* SparcLinux specific ioctl for the MDI, should be replaced for - * the SET_XLUT/SET_CLUTn ioctls instead - */ -#define MDI_CLEAR_XLUT (MDI_IOCTL|9) - -/* leo & ffb ioctls */ -struct fb_clut_alloc { - __u32 clutid; /* Set on return */ - __u32 flag; - __u32 index; -}; - -struct fb_clut { -#define FB_CLUT_WAIT 0x00000001 /* Not yet implemented */ - __u32 flag; - __u32 clutid; - __u32 offset; - __u32 count; - char * red; - char * green; - char * blue; -}; - -struct fb_clut32 { - __u32 flag; - __u32 clutid; - __u32 offset; - __u32 count; - __u32 red; - __u32 green; - __u32 blue; -}; - -#define LEO_CLUTALLOC _IOWR('L', 53, struct fb_clut_alloc) -#define LEO_CLUTFREE _IOW('L', 54, struct fb_clut_alloc) -#define LEO_CLUTREAD _IOW('L', 55, struct fb_clut) -#define LEO_CLUTPOST _IOW('L', 56, struct fb_clut) -#define LEO_SETGAMMA _IOW('L', 68, int) /* Not yet implemented */ -#define LEO_GETGAMMA _IOR('L', 69, int) /* Not yet implemented */ - -#ifdef __KERNEL__ -/* Addresses on the fd of a cgsix that are mappable */ -#define CG6_FBC 0x70000000 -#define CG6_TEC 0x70001000 -#define CG6_BTREGS 0x70002000 -#define CG6_FHC 0x70004000 -#define CG6_THC 0x70005000 -#define CG6_ROM 0x70006000 -#define CG6_RAM 0x70016000 -#define CG6_DHC 0x80000000 - -#define CG3_MMAP_OFFSET 0x4000000 - -/* Addresses on the fd of a tcx that are mappable */ -#define TCX_RAM8BIT 0x00000000 -#define TCX_RAM24BIT 0x01000000 -#define TCX_UNK3 0x10000000 -#define TCX_UNK4 0x20000000 -#define TCX_CONTROLPLANE 0x28000000 -#define TCX_UNK6 0x30000000 -#define TCX_UNK7 0x38000000 -#define TCX_TEC 0x70000000 -#define TCX_BTREGS 0x70002000 -#define TCX_THC 0x70004000 -#define TCX_DHC 0x70008000 -#define TCX_ALT 0x7000a000 -#define TCX_SYNC 0x7000e000 -#define TCX_UNK2 0x70010000 - -/* CG14 definitions */ - -/* Offsets into the OBIO space: */ -#define CG14_REGS 0 /* registers */ -#define CG14_CURSORREGS 0x1000 /* cursor registers */ -#define CG14_DACREGS 0x2000 /* DAC registers */ -#define CG14_XLUT 0x3000 /* X Look Up Table -- ??? */ -#define CG14_CLUT1 0x4000 /* Color Look Up Table */ -#define CG14_CLUT2 0x5000 /* Color Look Up Table */ -#define CG14_CLUT3 0x6000 /* Color Look Up Table */ -#define CG14_AUTO 0xf000 - -#endif /* KERNEL */ - -/* These are exported to userland for applications to use */ -/* Mappable offsets for the cg14: control registers */ -#define MDI_DIRECT_MAP 0x10000000 -#define MDI_CTLREG_MAP 0x20000000 -#define MDI_CURSOR_MAP 0x30000000 -#define MDI_SHDW_VRT_MAP 0x40000000 - -/* Mappable offsets for the cg14: frame buffer resolutions */ -/* 32 bits */ -#define MDI_CHUNKY_XBGR_MAP 0x50000000 -#define MDI_CHUNKY_BGR_MAP 0x60000000 - -/* 16 bits */ -#define MDI_PLANAR_X16_MAP 0x70000000 -#define MDI_PLANAR_C16_MAP 0x80000000 - -/* 8 bit is done as CG3 MMAP offset */ -/* 32 bits, planar */ -#define MDI_PLANAR_X32_MAP 0x90000000 -#define MDI_PLANAR_B32_MAP 0xa0000000 -#define MDI_PLANAR_G32_MAP 0xb0000000 -#define MDI_PLANAR_R32_MAP 0xc0000000 - -/* Mappable offsets on leo */ -#define LEO_SS0_MAP 0x00000000 -#define LEO_LC_SS0_USR_MAP 0x00800000 -#define LEO_LD_SS0_MAP 0x00801000 -#define LEO_LX_CURSOR_MAP 0x00802000 -#define LEO_SS1_MAP 0x00803000 -#define LEO_LC_SS1_USR_MAP 0x01003000 -#define LEO_LD_SS1_MAP 0x01004000 -#define LEO_UNK_MAP 0x01005000 -#define LEO_LX_KRN_MAP 0x01006000 -#define LEO_LC_SS0_KRN_MAP 0x01007000 -#define LEO_LC_SS1_KRN_MAP 0x01008000 -#define LEO_LD_GBL_MAP 0x01009000 -#define LEO_UNK2_MAP 0x0100a000 - -#ifdef __KERNEL__ -struct fbcmap32 { - int index; /* first element (0 origin) */ - int count; - u32 red; - u32 green; - u32 blue; -}; - -#define FBIOPUTCMAP32 _IOW('F', 3, struct fbcmap32) -#define FBIOGETCMAP32 _IOW('F', 4, struct fbcmap32) - -struct fbcursor32 { - short set; /* what to set, choose from the list above */ - short enable; /* cursor on/off */ - struct fbcurpos pos; /* cursor position */ - struct fbcurpos hot; /* cursor hot spot */ - struct fbcmap32 cmap; /* color map info */ - struct fbcurpos size; /* cursor bit map size */ - u32 image; /* cursor image bits */ - u32 mask; /* cursor mask bits */ -}; - -#define FBIOSCURSOR32 _IOW('F', 24, struct fbcursor32) -#define FBIOGCURSOR32 _IOW('F', 25, struct fbcursor32) -#endif - -#endif /* __LINUX_FBIO_H */ +#include diff --git a/trunk/include/asm-m68k/idprom.h b/trunk/include/asm-m68k/idprom.h index 160616a89e05..4349eaf3cfe4 100644 --- a/trunk/include/asm-m68k/idprom.h +++ b/trunk/include/asm-m68k/idprom.h @@ -1,25 +1,6 @@ #ifndef _M68K_IDPROM_H #define _M68K_IDPROM_H -/* - * idprom.h: Macros and defines for idprom routines - * - * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu) - */ - -#include - -struct idprom { - u8 id_format; /* Format identifier (always 0x01) */ - u8 id_machtype; /* Machine type */ - u8 id_ethaddr[6]; /* Hardware ethernet address */ - s32 id_date; /* Date of manufacture */ - u32 id_sernum:24; /* Unique serial number */ - u8 id_cksum; /* Checksum - xor of the data bytes */ - u8 reserved[16]; -}; - -extern struct idprom *idprom; -extern void idprom_init(void); +#include /* Sun3: in control space */ #define SUN3_IDPROM_BASE 0x00000000 diff --git a/trunk/arch/powerpc/include/asm/8253pit.h b/trunk/include/asm-powerpc/8253pit.h similarity index 100% rename from trunk/arch/powerpc/include/asm/8253pit.h rename to trunk/include/asm-powerpc/8253pit.h diff --git a/trunk/arch/powerpc/include/asm/8xx_immap.h b/trunk/include/asm-powerpc/8xx_immap.h similarity index 100% rename from trunk/arch/powerpc/include/asm/8xx_immap.h rename to trunk/include/asm-powerpc/8xx_immap.h diff --git a/trunk/arch/powerpc/include/asm/Kbuild b/trunk/include/asm-powerpc/Kbuild similarity index 100% rename from trunk/arch/powerpc/include/asm/Kbuild rename to trunk/include/asm-powerpc/Kbuild diff --git a/trunk/arch/powerpc/include/asm/a.out.h b/trunk/include/asm-powerpc/a.out.h similarity index 100% rename from trunk/arch/powerpc/include/asm/a.out.h rename to trunk/include/asm-powerpc/a.out.h diff --git a/trunk/arch/powerpc/include/asm/abs_addr.h b/trunk/include/asm-powerpc/abs_addr.h similarity index 100% rename from trunk/arch/powerpc/include/asm/abs_addr.h rename to trunk/include/asm-powerpc/abs_addr.h diff --git a/trunk/arch/powerpc/include/asm/agp.h b/trunk/include/asm-powerpc/agp.h similarity index 100% rename from trunk/arch/powerpc/include/asm/agp.h rename to trunk/include/asm-powerpc/agp.h diff --git a/trunk/arch/powerpc/include/asm/asm-compat.h b/trunk/include/asm-powerpc/asm-compat.h similarity index 100% rename from trunk/arch/powerpc/include/asm/asm-compat.h rename to trunk/include/asm-powerpc/asm-compat.h diff --git a/trunk/arch/powerpc/include/asm/atomic.h b/trunk/include/asm-powerpc/atomic.h similarity index 100% rename from trunk/arch/powerpc/include/asm/atomic.h rename to trunk/include/asm-powerpc/atomic.h diff --git a/trunk/arch/powerpc/include/asm/auxvec.h b/trunk/include/asm-powerpc/auxvec.h similarity index 100% rename from trunk/arch/powerpc/include/asm/auxvec.h rename to trunk/include/asm-powerpc/auxvec.h diff --git a/trunk/arch/powerpc/include/asm/backlight.h b/trunk/include/asm-powerpc/backlight.h similarity index 100% rename from trunk/arch/powerpc/include/asm/backlight.h rename to trunk/include/asm-powerpc/backlight.h diff --git a/trunk/arch/powerpc/include/asm/bitops.h b/trunk/include/asm-powerpc/bitops.h similarity index 100% rename from trunk/arch/powerpc/include/asm/bitops.h rename to trunk/include/asm-powerpc/bitops.h diff --git a/trunk/arch/powerpc/include/asm/bootx.h b/trunk/include/asm-powerpc/bootx.h similarity index 100% rename from trunk/arch/powerpc/include/asm/bootx.h rename to trunk/include/asm-powerpc/bootx.h diff --git a/trunk/arch/powerpc/include/asm/btext.h b/trunk/include/asm-powerpc/btext.h similarity index 100% rename from trunk/arch/powerpc/include/asm/btext.h rename to trunk/include/asm-powerpc/btext.h diff --git a/trunk/arch/powerpc/include/asm/bug.h b/trunk/include/asm-powerpc/bug.h similarity index 100% rename from trunk/arch/powerpc/include/asm/bug.h rename to trunk/include/asm-powerpc/bug.h diff --git a/trunk/arch/powerpc/include/asm/bugs.h b/trunk/include/asm-powerpc/bugs.h similarity index 100% rename from trunk/arch/powerpc/include/asm/bugs.h rename to trunk/include/asm-powerpc/bugs.h diff --git a/trunk/arch/powerpc/include/asm/byteorder.h b/trunk/include/asm-powerpc/byteorder.h similarity index 100% rename from trunk/arch/powerpc/include/asm/byteorder.h rename to trunk/include/asm-powerpc/byteorder.h diff --git a/trunk/arch/powerpc/include/asm/cache.h b/trunk/include/asm-powerpc/cache.h similarity index 100% rename from trunk/arch/powerpc/include/asm/cache.h rename to trunk/include/asm-powerpc/cache.h diff --git a/trunk/arch/powerpc/include/asm/cacheflush.h b/trunk/include/asm-powerpc/cacheflush.h similarity index 100% rename from trunk/arch/powerpc/include/asm/cacheflush.h rename to trunk/include/asm-powerpc/cacheflush.h diff --git a/trunk/arch/powerpc/include/asm/cell-pmu.h b/trunk/include/asm-powerpc/cell-pmu.h similarity index 100% rename from trunk/arch/powerpc/include/asm/cell-pmu.h rename to trunk/include/asm-powerpc/cell-pmu.h diff --git a/trunk/arch/powerpc/include/asm/cell-regs.h b/trunk/include/asm-powerpc/cell-regs.h similarity index 100% rename from trunk/arch/powerpc/include/asm/cell-regs.h rename to trunk/include/asm-powerpc/cell-regs.h diff --git a/trunk/arch/powerpc/include/asm/checksum.h b/trunk/include/asm-powerpc/checksum.h similarity index 100% rename from trunk/arch/powerpc/include/asm/checksum.h rename to trunk/include/asm-powerpc/checksum.h diff --git a/trunk/arch/powerpc/include/asm/clk_interface.h b/trunk/include/asm-powerpc/clk_interface.h similarity index 100% rename from trunk/arch/powerpc/include/asm/clk_interface.h rename to trunk/include/asm-powerpc/clk_interface.h diff --git a/trunk/arch/powerpc/include/asm/code-patching.h b/trunk/include/asm-powerpc/code-patching.h similarity index 100% rename from trunk/arch/powerpc/include/asm/code-patching.h rename to trunk/include/asm-powerpc/code-patching.h diff --git a/trunk/arch/powerpc/include/asm/compat.h b/trunk/include/asm-powerpc/compat.h similarity index 100% rename from trunk/arch/powerpc/include/asm/compat.h rename to trunk/include/asm-powerpc/compat.h diff --git a/trunk/arch/powerpc/include/asm/cpm.h b/trunk/include/asm-powerpc/cpm.h similarity index 100% rename from trunk/arch/powerpc/include/asm/cpm.h rename to trunk/include/asm-powerpc/cpm.h diff --git a/trunk/arch/powerpc/include/asm/cpm1.h b/trunk/include/asm-powerpc/cpm1.h similarity index 100% rename from trunk/arch/powerpc/include/asm/cpm1.h rename to trunk/include/asm-powerpc/cpm1.h diff --git a/trunk/arch/powerpc/include/asm/cpm2.h b/trunk/include/asm-powerpc/cpm2.h similarity index 100% rename from trunk/arch/powerpc/include/asm/cpm2.h rename to trunk/include/asm-powerpc/cpm2.h diff --git a/trunk/arch/powerpc/include/asm/cputable.h b/trunk/include/asm-powerpc/cputable.h similarity index 100% rename from trunk/arch/powerpc/include/asm/cputable.h rename to trunk/include/asm-powerpc/cputable.h diff --git a/trunk/arch/powerpc/include/asm/cputhreads.h b/trunk/include/asm-powerpc/cputhreads.h similarity index 100% rename from trunk/arch/powerpc/include/asm/cputhreads.h rename to trunk/include/asm-powerpc/cputhreads.h diff --git a/trunk/arch/powerpc/include/asm/cputime.h b/trunk/include/asm-powerpc/cputime.h similarity index 100% rename from trunk/arch/powerpc/include/asm/cputime.h rename to trunk/include/asm-powerpc/cputime.h diff --git a/trunk/arch/powerpc/include/asm/current.h b/trunk/include/asm-powerpc/current.h similarity index 100% rename from trunk/arch/powerpc/include/asm/current.h rename to trunk/include/asm-powerpc/current.h diff --git a/trunk/arch/powerpc/include/asm/dbdma.h b/trunk/include/asm-powerpc/dbdma.h similarity index 100% rename from trunk/arch/powerpc/include/asm/dbdma.h rename to trunk/include/asm-powerpc/dbdma.h diff --git a/trunk/arch/powerpc/include/asm/dcr-generic.h b/trunk/include/asm-powerpc/dcr-generic.h similarity index 100% rename from trunk/arch/powerpc/include/asm/dcr-generic.h rename to trunk/include/asm-powerpc/dcr-generic.h diff --git a/trunk/arch/powerpc/include/asm/dcr-mmio.h b/trunk/include/asm-powerpc/dcr-mmio.h similarity index 100% rename from trunk/arch/powerpc/include/asm/dcr-mmio.h rename to trunk/include/asm-powerpc/dcr-mmio.h diff --git a/trunk/arch/powerpc/include/asm/dcr-native.h b/trunk/include/asm-powerpc/dcr-native.h similarity index 100% rename from trunk/arch/powerpc/include/asm/dcr-native.h rename to trunk/include/asm-powerpc/dcr-native.h diff --git a/trunk/arch/powerpc/include/asm/dcr-regs.h b/trunk/include/asm-powerpc/dcr-regs.h similarity index 100% rename from trunk/arch/powerpc/include/asm/dcr-regs.h rename to trunk/include/asm-powerpc/dcr-regs.h diff --git a/trunk/arch/powerpc/include/asm/dcr.h b/trunk/include/asm-powerpc/dcr.h similarity index 94% rename from trunk/arch/powerpc/include/asm/dcr.h rename to trunk/include/asm-powerpc/dcr.h index d13fb68bb5c0..53b283050ab3 100644 --- a/trunk/arch/powerpc/include/asm/dcr.h +++ b/trunk/include/asm-powerpc/dcr.h @@ -65,13 +65,17 @@ typedef dcr_host_mmio_t dcr_host_t; #endif /* defined(CONFIG_PPC_DCR_NATIVE) && defined(CONFIG_PPC_DCR_MMIO) */ /* - * additional helpers to read the DCR * base from the device-tree + * On CONFIG_PPC_MERGE, we have additional helpers to read the DCR + * base from the device-tree */ +#ifdef CONFIG_PPC_MERGE struct device_node; extern unsigned int dcr_resource_start(struct device_node *np, unsigned int index); extern unsigned int dcr_resource_len(struct device_node *np, unsigned int index); +#endif /* CONFIG_PPC_MERGE */ + #endif /* CONFIG_PPC_DCR */ #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/trunk/arch/powerpc/include/asm/delay.h b/trunk/include/asm-powerpc/delay.h similarity index 100% rename from trunk/arch/powerpc/include/asm/delay.h rename to trunk/include/asm-powerpc/delay.h diff --git a/trunk/arch/powerpc/include/asm/device.h b/trunk/include/asm-powerpc/device.h similarity index 100% rename from trunk/arch/powerpc/include/asm/device.h rename to trunk/include/asm-powerpc/device.h diff --git a/trunk/arch/powerpc/include/asm/div64.h b/trunk/include/asm-powerpc/div64.h similarity index 100% rename from trunk/arch/powerpc/include/asm/div64.h rename to trunk/include/asm-powerpc/div64.h diff --git a/trunk/arch/powerpc/include/asm/dma-mapping.h b/trunk/include/asm-powerpc/dma-mapping.h similarity index 100% rename from trunk/arch/powerpc/include/asm/dma-mapping.h rename to trunk/include/asm-powerpc/dma-mapping.h diff --git a/trunk/arch/powerpc/include/asm/dma.h b/trunk/include/asm-powerpc/dma.h similarity index 100% rename from trunk/arch/powerpc/include/asm/dma.h rename to trunk/include/asm-powerpc/dma.h diff --git a/trunk/arch/powerpc/include/asm/edac.h b/trunk/include/asm-powerpc/edac.h similarity index 100% rename from trunk/arch/powerpc/include/asm/edac.h rename to trunk/include/asm-powerpc/edac.h diff --git a/trunk/arch/powerpc/include/asm/eeh.h b/trunk/include/asm-powerpc/eeh.h similarity index 100% rename from trunk/arch/powerpc/include/asm/eeh.h rename to trunk/include/asm-powerpc/eeh.h diff --git a/trunk/arch/powerpc/include/asm/eeh_event.h b/trunk/include/asm-powerpc/eeh_event.h similarity index 100% rename from trunk/arch/powerpc/include/asm/eeh_event.h rename to trunk/include/asm-powerpc/eeh_event.h diff --git a/trunk/arch/powerpc/include/asm/elf.h b/trunk/include/asm-powerpc/elf.h similarity index 100% rename from trunk/arch/powerpc/include/asm/elf.h rename to trunk/include/asm-powerpc/elf.h diff --git a/trunk/arch/powerpc/include/asm/emergency-restart.h b/trunk/include/asm-powerpc/emergency-restart.h similarity index 100% rename from trunk/arch/powerpc/include/asm/emergency-restart.h rename to trunk/include/asm-powerpc/emergency-restart.h diff --git a/trunk/arch/powerpc/include/asm/errno.h b/trunk/include/asm-powerpc/errno.h similarity index 100% rename from trunk/arch/powerpc/include/asm/errno.h rename to trunk/include/asm-powerpc/errno.h diff --git a/trunk/arch/powerpc/include/asm/exception.h b/trunk/include/asm-powerpc/exception.h similarity index 100% rename from trunk/arch/powerpc/include/asm/exception.h rename to trunk/include/asm-powerpc/exception.h diff --git a/trunk/arch/powerpc/include/asm/fb.h b/trunk/include/asm-powerpc/fb.h similarity index 100% rename from trunk/arch/powerpc/include/asm/fb.h rename to trunk/include/asm-powerpc/fb.h diff --git a/trunk/arch/powerpc/include/asm/fcntl.h b/trunk/include/asm-powerpc/fcntl.h similarity index 100% rename from trunk/arch/powerpc/include/asm/fcntl.h rename to trunk/include/asm-powerpc/fcntl.h diff --git a/trunk/arch/powerpc/include/asm/feature-fixups.h b/trunk/include/asm-powerpc/feature-fixups.h similarity index 100% rename from trunk/arch/powerpc/include/asm/feature-fixups.h rename to trunk/include/asm-powerpc/feature-fixups.h diff --git a/trunk/arch/powerpc/include/asm/firmware.h b/trunk/include/asm-powerpc/firmware.h similarity index 100% rename from trunk/arch/powerpc/include/asm/firmware.h rename to trunk/include/asm-powerpc/firmware.h diff --git a/trunk/arch/powerpc/include/asm/fixmap.h b/trunk/include/asm-powerpc/fixmap.h similarity index 100% rename from trunk/arch/powerpc/include/asm/fixmap.h rename to trunk/include/asm-powerpc/fixmap.h diff --git a/trunk/arch/powerpc/include/asm/floppy.h b/trunk/include/asm-powerpc/floppy.h similarity index 100% rename from trunk/arch/powerpc/include/asm/floppy.h rename to trunk/include/asm-powerpc/floppy.h diff --git a/trunk/arch/powerpc/include/asm/fs_pd.h b/trunk/include/asm-powerpc/fs_pd.h similarity index 100% rename from trunk/arch/powerpc/include/asm/fs_pd.h rename to trunk/include/asm-powerpc/fs_pd.h diff --git a/trunk/arch/powerpc/include/asm/fsl_gtm.h b/trunk/include/asm-powerpc/fsl_gtm.h similarity index 100% rename from trunk/arch/powerpc/include/asm/fsl_gtm.h rename to trunk/include/asm-powerpc/fsl_gtm.h diff --git a/trunk/arch/powerpc/include/asm/fsl_lbc.h b/trunk/include/asm-powerpc/fsl_lbc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/fsl_lbc.h rename to trunk/include/asm-powerpc/fsl_lbc.h diff --git a/trunk/arch/powerpc/include/asm/ftrace.h b/trunk/include/asm-powerpc/ftrace.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ftrace.h rename to trunk/include/asm-powerpc/ftrace.h diff --git a/trunk/arch/powerpc/include/asm/futex.h b/trunk/include/asm-powerpc/futex.h similarity index 100% rename from trunk/arch/powerpc/include/asm/futex.h rename to trunk/include/asm-powerpc/futex.h diff --git a/trunk/arch/powerpc/include/asm/gpio.h b/trunk/include/asm-powerpc/gpio.h similarity index 100% rename from trunk/arch/powerpc/include/asm/gpio.h rename to trunk/include/asm-powerpc/gpio.h diff --git a/trunk/arch/powerpc/include/asm/grackle.h b/trunk/include/asm-powerpc/grackle.h similarity index 100% rename from trunk/arch/powerpc/include/asm/grackle.h rename to trunk/include/asm-powerpc/grackle.h diff --git a/trunk/arch/powerpc/include/asm/hardirq.h b/trunk/include/asm-powerpc/hardirq.h similarity index 100% rename from trunk/arch/powerpc/include/asm/hardirq.h rename to trunk/include/asm-powerpc/hardirq.h diff --git a/trunk/arch/powerpc/include/asm/heathrow.h b/trunk/include/asm-powerpc/heathrow.h similarity index 100% rename from trunk/arch/powerpc/include/asm/heathrow.h rename to trunk/include/asm-powerpc/heathrow.h diff --git a/trunk/arch/powerpc/include/asm/highmem.h b/trunk/include/asm-powerpc/highmem.h similarity index 100% rename from trunk/arch/powerpc/include/asm/highmem.h rename to trunk/include/asm-powerpc/highmem.h diff --git a/trunk/arch/powerpc/include/asm/hugetlb.h b/trunk/include/asm-powerpc/hugetlb.h similarity index 100% rename from trunk/arch/powerpc/include/asm/hugetlb.h rename to trunk/include/asm-powerpc/hugetlb.h diff --git a/trunk/arch/powerpc/include/asm/hvcall.h b/trunk/include/asm-powerpc/hvcall.h similarity index 100% rename from trunk/arch/powerpc/include/asm/hvcall.h rename to trunk/include/asm-powerpc/hvcall.h diff --git a/trunk/arch/powerpc/include/asm/hvconsole.h b/trunk/include/asm-powerpc/hvconsole.h similarity index 100% rename from trunk/arch/powerpc/include/asm/hvconsole.h rename to trunk/include/asm-powerpc/hvconsole.h diff --git a/trunk/arch/powerpc/include/asm/hvcserver.h b/trunk/include/asm-powerpc/hvcserver.h similarity index 100% rename from trunk/arch/powerpc/include/asm/hvcserver.h rename to trunk/include/asm-powerpc/hvcserver.h diff --git a/trunk/arch/powerpc/include/asm/hw_irq.h b/trunk/include/asm-powerpc/hw_irq.h similarity index 100% rename from trunk/arch/powerpc/include/asm/hw_irq.h rename to trunk/include/asm-powerpc/hw_irq.h diff --git a/trunk/arch/powerpc/include/asm/hydra.h b/trunk/include/asm-powerpc/hydra.h similarity index 100% rename from trunk/arch/powerpc/include/asm/hydra.h rename to trunk/include/asm-powerpc/hydra.h diff --git a/trunk/arch/powerpc/include/asm/i8259.h b/trunk/include/asm-powerpc/i8259.h similarity index 71% rename from trunk/arch/powerpc/include/asm/i8259.h rename to trunk/include/asm-powerpc/i8259.h index 105ade297aad..db1362f8c603 100644 --- a/trunk/arch/powerpc/include/asm/i8259.h +++ b/trunk/include/asm-powerpc/i8259.h @@ -4,9 +4,14 @@ #include +#ifdef CONFIG_PPC_MERGE extern void i8259_init(struct device_node *node, unsigned long intack_addr); extern unsigned int i8259_irq(void); extern struct irq_host *i8259_get_host(void); +#else +extern void i8259_init(unsigned long intack_addr, int offset); +extern int i8259_irq(void); +#endif #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_I8259_H */ diff --git a/trunk/arch/powerpc/include/asm/ibmebus.h b/trunk/include/asm-powerpc/ibmebus.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ibmebus.h rename to trunk/include/asm-powerpc/ibmebus.h diff --git a/trunk/arch/powerpc/include/asm/ide.h b/trunk/include/asm-powerpc/ide.h similarity index 98% rename from trunk/arch/powerpc/include/asm/ide.h rename to trunk/include/asm-powerpc/ide.h index 048480e340f2..1aaf27be8741 100644 --- a/trunk/arch/powerpc/include/asm/ide.h +++ b/trunk/include/asm-powerpc/ide.h @@ -20,6 +20,7 @@ #define __ide_mm_outsl(p, a, c) writesl((void __iomem *)(p), (a), (c)) #ifndef __powerpc64__ +#include #include /* FIXME: use ide_platform host driver */ diff --git a/trunk/arch/powerpc/include/asm/immap_86xx.h b/trunk/include/asm-powerpc/immap_86xx.h similarity index 100% rename from trunk/arch/powerpc/include/asm/immap_86xx.h rename to trunk/include/asm-powerpc/immap_86xx.h diff --git a/trunk/arch/powerpc/include/asm/immap_cpm2.h b/trunk/include/asm-powerpc/immap_cpm2.h similarity index 100% rename from trunk/arch/powerpc/include/asm/immap_cpm2.h rename to trunk/include/asm-powerpc/immap_cpm2.h diff --git a/trunk/arch/powerpc/include/asm/immap_qe.h b/trunk/include/asm-powerpc/immap_qe.h similarity index 99% rename from trunk/arch/powerpc/include/asm/immap_qe.h rename to trunk/include/asm-powerpc/immap_qe.h index 3c2fced3ac22..7b6f411db3e6 100644 --- a/trunk/arch/powerpc/include/asm/immap_qe.h +++ b/trunk/include/asm-powerpc/immap_qe.h @@ -1,4 +1,6 @@ /* + * include/asm-powerpc/immap_qe.h + * * QUICC Engine (QE) Internal Memory Map. * The Internal Memory Map for devices with QE on them. This * is the superset of all QE devices (8360, etc.). diff --git a/trunk/arch/powerpc/include/asm/io-defs.h b/trunk/include/asm-powerpc/io-defs.h similarity index 100% rename from trunk/arch/powerpc/include/asm/io-defs.h rename to trunk/include/asm-powerpc/io-defs.h diff --git a/trunk/arch/powerpc/include/asm/io.h b/trunk/include/asm-powerpc/io.h similarity index 100% rename from trunk/arch/powerpc/include/asm/io.h rename to trunk/include/asm-powerpc/io.h diff --git a/trunk/arch/powerpc/include/asm/ioctl.h b/trunk/include/asm-powerpc/ioctl.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ioctl.h rename to trunk/include/asm-powerpc/ioctl.h diff --git a/trunk/arch/powerpc/include/asm/ioctls.h b/trunk/include/asm-powerpc/ioctls.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ioctls.h rename to trunk/include/asm-powerpc/ioctls.h diff --git a/trunk/arch/powerpc/include/asm/iommu.h b/trunk/include/asm-powerpc/iommu.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iommu.h rename to trunk/include/asm-powerpc/iommu.h diff --git a/trunk/arch/powerpc/include/asm/ipcbuf.h b/trunk/include/asm-powerpc/ipcbuf.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ipcbuf.h rename to trunk/include/asm-powerpc/ipcbuf.h diff --git a/trunk/arch/powerpc/include/asm/ipic.h b/trunk/include/asm-powerpc/ipic.h similarity index 93% rename from trunk/arch/powerpc/include/asm/ipic.h rename to trunk/include/asm-powerpc/ipic.h index fb59829983b8..8ff08be00146 100644 --- a/trunk/arch/powerpc/include/asm/ipic.h +++ b/trunk/include/asm-powerpc/ipic.h @@ -1,4 +1,6 @@ /* + * include/asm-powerpc/ipic.h + * * IPIC external definitions and structure. * * Maintainer: Kumar Gala @@ -77,8 +79,15 @@ extern void ipic_disable_mcp(enum ipic_mcp_irq mcp_irq); extern u32 ipic_get_mcp_status(void); extern void ipic_clear_mcp_status(u32 mask); +#ifdef CONFIG_PPC_MERGE extern struct ipic * ipic_init(struct device_node *node, unsigned int flags); extern unsigned int ipic_get_irq(void); +#else +extern void ipic_init(phys_addr_t phys_addr, unsigned int flags, + unsigned int irq_offset, + unsigned char *senses, unsigned int senses_count); +extern int ipic_get_irq(void); +#endif #endif /* __ASM_IPIC_H__ */ #endif /* __KERNEL__ */ diff --git a/trunk/arch/powerpc/include/asm/irq.h b/trunk/include/asm-powerpc/irq.h similarity index 58% rename from trunk/arch/powerpc/include/asm/irq.h rename to trunk/include/asm-powerpc/irq.h index a372f76836c2..1ef8e304e0ea 100644 --- a/trunk/arch/powerpc/include/asm/irq.h +++ b/trunk/include/asm-powerpc/irq.h @@ -25,6 +25,8 @@ extern atomic_t ppc_n_lost_interrupts; +#ifdef CONFIG_PPC_MERGE + /* This number is used when no interrupt has been assigned */ #define NO_IRQ (0) @@ -324,6 +326,292 @@ static __inline__ int irq_canonicalize(int irq) return irq; } + +#else /* CONFIG_PPC_MERGE */ + +/* This number is used when no interrupt has been assigned */ +#define NO_IRQ (-1) +#define NO_IRQ_IGNORE (-2) + + +/* + * These constants are used for passing information about interrupt + * signal polarity and level/edge sensing to the low-level PIC chip + * drivers. + */ +#define IRQ_SENSE_MASK 0x1 +#define IRQ_SENSE_LEVEL 0x1 /* interrupt on active level */ +#define IRQ_SENSE_EDGE 0x0 /* interrupt triggered by edge */ + +#define IRQ_POLARITY_MASK 0x2 +#define IRQ_POLARITY_POSITIVE 0x2 /* high level or low->high edge */ +#define IRQ_POLARITY_NEGATIVE 0x0 /* low level or high->low edge */ + + +#if defined(CONFIG_40x) +#include + +#ifndef NR_BOARD_IRQS +#define NR_BOARD_IRQS 0 +#endif + +#ifndef UIC_WIDTH /* Number of interrupts per device */ +#define UIC_WIDTH 32 +#endif + +#ifndef NR_UICS /* number of UIC devices */ +#define NR_UICS 1 +#endif + +#if defined (CONFIG_403) +/* + * The PowerPC 403 cores' Asynchronous Interrupt Controller (AIC) has + * 32 possible interrupts, a majority of which are not implemented on + * all cores. There are six configurable, external interrupt pins and + * there are eight internal interrupts for the on-chip serial port + * (SPU), DMA controller, and JTAG controller. + * + */ + +#define NR_AIC_IRQS 32 +#define NR_IRQS (NR_AIC_IRQS + NR_BOARD_IRQS) + +#elif !defined (CONFIG_403) + +/* + * The PowerPC 405 cores' Universal Interrupt Controller (UIC) has 32 + * possible interrupts as well. There are seven, configurable external + * interrupt pins and there are 17 internal interrupts for the on-chip + * serial port, DMA controller, on-chip Ethernet controller, PCI, etc. + * + */ + + +#define NR_UIC_IRQS UIC_WIDTH +#define NR_IRQS ((NR_UIC_IRQS * NR_UICS) + NR_BOARD_IRQS) +#endif + +#elif defined(CONFIG_44x) +#include + +#define NR_UIC_IRQS 32 +#define NR_IRQS ((NR_UIC_IRQS * NR_UICS) + NR_BOARD_IRQS) + +#elif defined(CONFIG_8xx) + +/* Now include the board configuration specific associations. +*/ +#include + +/* The MPC8xx cores have 16 possible interrupts. There are eight + * possible level sensitive interrupts assigned and generated internally + * from such devices as CPM, PCMCIA, RTC, PIT, TimeBase and Decrementer. + * There are eight external interrupts (IRQs) that can be configured + * as either level or edge sensitive. + * + * On some implementations, there is also the possibility of an 8259 + * through the PCI and PCI-ISA bridges. + * + * We are "flattening" the interrupt vectors of the cascaded CPM + * and 8259 interrupt controllers so that we can uniquely identify + * any interrupt source with a single integer. + */ +#define NR_SIU_INTS 16 +#define NR_CPM_INTS 32 +#ifndef NR_8259_INTS +#define NR_8259_INTS 0 +#endif + +#define SIU_IRQ_OFFSET 0 +#define CPM_IRQ_OFFSET (SIU_IRQ_OFFSET + NR_SIU_INTS) +#define I8259_IRQ_OFFSET (CPM_IRQ_OFFSET + NR_CPM_INTS) + +#define NR_IRQS (NR_SIU_INTS + NR_CPM_INTS + NR_8259_INTS) + +/* These values must be zero-based and map 1:1 with the SIU configuration. + * They are used throughout the 8xx I/O subsystem to generate + * interrupt masks, flags, and other control patterns. This is why the + * current kernel assumption of the 8259 as the base controller is such + * a pain in the butt. + */ +#define SIU_IRQ0 (0) /* Highest priority */ +#define SIU_LEVEL0 (1) +#define SIU_IRQ1 (2) +#define SIU_LEVEL1 (3) +#define SIU_IRQ2 (4) +#define SIU_LEVEL2 (5) +#define SIU_IRQ3 (6) +#define SIU_LEVEL3 (7) +#define SIU_IRQ4 (8) +#define SIU_LEVEL4 (9) +#define SIU_IRQ5 (10) +#define SIU_LEVEL5 (11) +#define SIU_IRQ6 (12) +#define SIU_LEVEL6 (13) +#define SIU_IRQ7 (14) +#define SIU_LEVEL7 (15) + +#define MPC8xx_INT_FEC1 SIU_LEVEL1 +#define MPC8xx_INT_FEC2 SIU_LEVEL3 + +#define MPC8xx_INT_SCC1 (CPM_IRQ_OFFSET + CPMVEC_SCC1) +#define MPC8xx_INT_SCC2 (CPM_IRQ_OFFSET + CPMVEC_SCC2) +#define MPC8xx_INT_SCC3 (CPM_IRQ_OFFSET + CPMVEC_SCC3) +#define MPC8xx_INT_SCC4 (CPM_IRQ_OFFSET + CPMVEC_SCC4) +#define MPC8xx_INT_SMC1 (CPM_IRQ_OFFSET + CPMVEC_SMC1) +#define MPC8xx_INT_SMC2 (CPM_IRQ_OFFSET + CPMVEC_SMC2) + +/* The internal interrupts we can configure as we see fit. + * My personal preference is CPM at level 2, which puts it above the + * MBX PCI/ISA/IDE interrupts. + */ +#ifndef PIT_INTERRUPT +#define PIT_INTERRUPT SIU_LEVEL0 +#endif +#ifndef CPM_INTERRUPT +#define CPM_INTERRUPT SIU_LEVEL2 +#endif +#ifndef PCMCIA_INTERRUPT +#define PCMCIA_INTERRUPT SIU_LEVEL6 +#endif +#ifndef DEC_INTERRUPT +#define DEC_INTERRUPT SIU_LEVEL7 +#endif + +/* Some internal interrupt registers use an 8-bit mask for the interrupt + * level instead of a number. + */ +#define mk_int_int_mask(IL) (1 << (7 - (IL/2))) + +#else /* CONFIG_40x + CONFIG_8xx */ +/* + * this is the # irq's for all ppc arch's (pmac/chrp/prep) + * so it is the max of them all + */ +#define NR_IRQS 256 +#define __DO_IRQ_CANON 1 + +#ifndef CONFIG_8260 + +#define NUM_8259_INTERRUPTS 16 + +#else /* CONFIG_8260 */ + +/* The 8260 has an internal interrupt controller with a maximum of + * 64 IRQs. We will use NR_IRQs from above since it is large enough. + * Don't be confused by the 8260 documentation where they list an + * "interrupt number" and "interrupt vector". We are only interested + * in the interrupt vector. There are "reserved" holes where the + * vector number increases, but the interrupt number in the table does not. + * (Document errata updates have fixed this...make sure you have up to + * date processor documentation -- Dan). + */ + +#ifndef CPM_IRQ_OFFSET +#define CPM_IRQ_OFFSET 0 +#endif + +#define NR_CPM_INTS 64 + +#define SIU_INT_ERROR ((uint)0x00 + CPM_IRQ_OFFSET) +#define SIU_INT_I2C ((uint)0x01 + CPM_IRQ_OFFSET) +#define SIU_INT_SPI ((uint)0x02 + CPM_IRQ_OFFSET) +#define SIU_INT_RISC ((uint)0x03 + CPM_IRQ_OFFSET) +#define SIU_INT_SMC1 ((uint)0x04 + CPM_IRQ_OFFSET) +#define SIU_INT_SMC2 ((uint)0x05 + CPM_IRQ_OFFSET) +#define SIU_INT_IDMA1 ((uint)0x06 + CPM_IRQ_OFFSET) +#define SIU_INT_IDMA2 ((uint)0x07 + CPM_IRQ_OFFSET) +#define SIU_INT_IDMA3 ((uint)0x08 + CPM_IRQ_OFFSET) +#define SIU_INT_IDMA4 ((uint)0x09 + CPM_IRQ_OFFSET) +#define SIU_INT_SDMA ((uint)0x0a + CPM_IRQ_OFFSET) +#define SIU_INT_USB ((uint)0x0b + CPM_IRQ_OFFSET) +#define SIU_INT_TIMER1 ((uint)0x0c + CPM_IRQ_OFFSET) +#define SIU_INT_TIMER2 ((uint)0x0d + CPM_IRQ_OFFSET) +#define SIU_INT_TIMER3 ((uint)0x0e + CPM_IRQ_OFFSET) +#define SIU_INT_TIMER4 ((uint)0x0f + CPM_IRQ_OFFSET) +#define SIU_INT_TMCNT ((uint)0x10 + CPM_IRQ_OFFSET) +#define SIU_INT_PIT ((uint)0x11 + CPM_IRQ_OFFSET) +#define SIU_INT_PCI ((uint)0x12 + CPM_IRQ_OFFSET) +#define SIU_INT_IRQ1 ((uint)0x13 + CPM_IRQ_OFFSET) +#define SIU_INT_IRQ2 ((uint)0x14 + CPM_IRQ_OFFSET) +#define SIU_INT_IRQ3 ((uint)0x15 + CPM_IRQ_OFFSET) +#define SIU_INT_IRQ4 ((uint)0x16 + CPM_IRQ_OFFSET) +#define SIU_INT_IRQ5 ((uint)0x17 + CPM_IRQ_OFFSET) +#define SIU_INT_IRQ6 ((uint)0x18 + CPM_IRQ_OFFSET) +#define SIU_INT_IRQ7 ((uint)0x19 + CPM_IRQ_OFFSET) +#define SIU_INT_FCC1 ((uint)0x20 + CPM_IRQ_OFFSET) +#define SIU_INT_FCC2 ((uint)0x21 + CPM_IRQ_OFFSET) +#define SIU_INT_FCC3 ((uint)0x22 + CPM_IRQ_OFFSET) +#define SIU_INT_MCC1 ((uint)0x24 + CPM_IRQ_OFFSET) +#define SIU_INT_MCC2 ((uint)0x25 + CPM_IRQ_OFFSET) +#define SIU_INT_SCC1 ((uint)0x28 + CPM_IRQ_OFFSET) +#define SIU_INT_SCC2 ((uint)0x29 + CPM_IRQ_OFFSET) +#define SIU_INT_SCC3 ((uint)0x2a + CPM_IRQ_OFFSET) +#define SIU_INT_SCC4 ((uint)0x2b + CPM_IRQ_OFFSET) +#define SIU_INT_PC15 ((uint)0x30 + CPM_IRQ_OFFSET) +#define SIU_INT_PC14 ((uint)0x31 + CPM_IRQ_OFFSET) +#define SIU_INT_PC13 ((uint)0x32 + CPM_IRQ_OFFSET) +#define SIU_INT_PC12 ((uint)0x33 + CPM_IRQ_OFFSET) +#define SIU_INT_PC11 ((uint)0x34 + CPM_IRQ_OFFSET) +#define SIU_INT_PC10 ((uint)0x35 + CPM_IRQ_OFFSET) +#define SIU_INT_PC9 ((uint)0x36 + CPM_IRQ_OFFSET) +#define SIU_INT_PC8 ((uint)0x37 + CPM_IRQ_OFFSET) +#define SIU_INT_PC7 ((uint)0x38 + CPM_IRQ_OFFSET) +#define SIU_INT_PC6 ((uint)0x39 + CPM_IRQ_OFFSET) +#define SIU_INT_PC5 ((uint)0x3a + CPM_IRQ_OFFSET) +#define SIU_INT_PC4 ((uint)0x3b + CPM_IRQ_OFFSET) +#define SIU_INT_PC3 ((uint)0x3c + CPM_IRQ_OFFSET) +#define SIU_INT_PC2 ((uint)0x3d + CPM_IRQ_OFFSET) +#define SIU_INT_PC1 ((uint)0x3e + CPM_IRQ_OFFSET) +#define SIU_INT_PC0 ((uint)0x3f + CPM_IRQ_OFFSET) + +#endif /* CONFIG_8260 */ + +#endif /* Whatever way too big #ifdef */ + +#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) +/* pedantic: these are long because they are used with set_bit --RR */ +extern unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; + +/* + * Because many systems have two overlapping names spaces for + * interrupts (ISA and XICS for example), and the ISA interrupts + * have historically not been easy to renumber, we allow ISA + * interrupts to take values 0 - 15, and shift up the remaining + * interrupts by 0x10. + */ +#define NUM_ISA_INTERRUPTS 0x10 +extern int __irq_offset_value; + +static inline int irq_offset_up(int irq) +{ + return(irq + __irq_offset_value); +} + +static inline int irq_offset_down(int irq) +{ + return(irq - __irq_offset_value); +} + +static inline int irq_offset_value(void) +{ + return __irq_offset_value; +} + +#ifdef __DO_IRQ_CANON +extern int ppc_do_canonicalize_irqs; +#else +#define ppc_do_canonicalize_irqs 0 +#endif + +static __inline__ int irq_canonicalize(int irq) +{ + if (ppc_do_canonicalize_irqs && irq == 2) + irq = 9; + return irq; +} +#endif /* CONFIG_PPC_MERGE */ + extern int distribute_irqs; struct irqaction; diff --git a/trunk/arch/powerpc/include/asm/irq_regs.h b/trunk/include/asm-powerpc/irq_regs.h similarity index 100% rename from trunk/arch/powerpc/include/asm/irq_regs.h rename to trunk/include/asm-powerpc/irq_regs.h diff --git a/trunk/arch/powerpc/include/asm/irqflags.h b/trunk/include/asm-powerpc/irqflags.h similarity index 93% rename from trunk/arch/powerpc/include/asm/irqflags.h rename to trunk/include/asm-powerpc/irqflags.h index 17ba3a881bfd..cc6fdba33660 100644 --- a/trunk/arch/powerpc/include/asm/irqflags.h +++ b/trunk/include/asm-powerpc/irqflags.h @@ -1,4 +1,6 @@ /* + * include/asm-powerpc/irqflags.h + * * IRQ flags handling */ #ifndef _ASM_IRQFLAGS_H @@ -8,7 +10,7 @@ /* * Get definitions for raw_local_save_flags(x), etc. */ -#include +#include #else #ifdef CONFIG_TRACE_IRQFLAGS diff --git a/trunk/arch/powerpc/include/asm/iseries/alpaca.h b/trunk/include/asm-powerpc/iseries/alpaca.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/alpaca.h rename to trunk/include/asm-powerpc/iseries/alpaca.h diff --git a/trunk/arch/powerpc/include/asm/iseries/hv_call.h b/trunk/include/asm-powerpc/iseries/hv_call.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/hv_call.h rename to trunk/include/asm-powerpc/iseries/hv_call.h diff --git a/trunk/arch/powerpc/include/asm/iseries/hv_call_event.h b/trunk/include/asm-powerpc/iseries/hv_call_event.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/hv_call_event.h rename to trunk/include/asm-powerpc/iseries/hv_call_event.h diff --git a/trunk/arch/powerpc/include/asm/iseries/hv_call_sc.h b/trunk/include/asm-powerpc/iseries/hv_call_sc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/hv_call_sc.h rename to trunk/include/asm-powerpc/iseries/hv_call_sc.h diff --git a/trunk/arch/powerpc/include/asm/iseries/hv_call_xm.h b/trunk/include/asm-powerpc/iseries/hv_call_xm.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/hv_call_xm.h rename to trunk/include/asm-powerpc/iseries/hv_call_xm.h diff --git a/trunk/arch/powerpc/include/asm/iseries/hv_lp_config.h b/trunk/include/asm-powerpc/iseries/hv_lp_config.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/hv_lp_config.h rename to trunk/include/asm-powerpc/iseries/hv_lp_config.h diff --git a/trunk/arch/powerpc/include/asm/iseries/hv_lp_event.h b/trunk/include/asm-powerpc/iseries/hv_lp_event.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/hv_lp_event.h rename to trunk/include/asm-powerpc/iseries/hv_lp_event.h diff --git a/trunk/arch/powerpc/include/asm/iseries/hv_types.h b/trunk/include/asm-powerpc/iseries/hv_types.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/hv_types.h rename to trunk/include/asm-powerpc/iseries/hv_types.h diff --git a/trunk/arch/powerpc/include/asm/iseries/iommu.h b/trunk/include/asm-powerpc/iseries/iommu.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/iommu.h rename to trunk/include/asm-powerpc/iseries/iommu.h diff --git a/trunk/arch/powerpc/include/asm/iseries/it_lp_queue.h b/trunk/include/asm-powerpc/iseries/it_lp_queue.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/it_lp_queue.h rename to trunk/include/asm-powerpc/iseries/it_lp_queue.h diff --git a/trunk/arch/powerpc/include/asm/iseries/lpar_map.h b/trunk/include/asm-powerpc/iseries/lpar_map.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/lpar_map.h rename to trunk/include/asm-powerpc/iseries/lpar_map.h diff --git a/trunk/arch/powerpc/include/asm/iseries/mf.h b/trunk/include/asm-powerpc/iseries/mf.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/mf.h rename to trunk/include/asm-powerpc/iseries/mf.h diff --git a/trunk/arch/powerpc/include/asm/iseries/vio.h b/trunk/include/asm-powerpc/iseries/vio.h similarity index 100% rename from trunk/arch/powerpc/include/asm/iseries/vio.h rename to trunk/include/asm-powerpc/iseries/vio.h diff --git a/trunk/arch/powerpc/include/asm/kdebug.h b/trunk/include/asm-powerpc/kdebug.h similarity index 100% rename from trunk/arch/powerpc/include/asm/kdebug.h rename to trunk/include/asm-powerpc/kdebug.h diff --git a/trunk/arch/powerpc/include/asm/kdump.h b/trunk/include/asm-powerpc/kdump.h similarity index 100% rename from trunk/arch/powerpc/include/asm/kdump.h rename to trunk/include/asm-powerpc/kdump.h diff --git a/trunk/arch/powerpc/include/asm/kexec.h b/trunk/include/asm-powerpc/kexec.h similarity index 100% rename from trunk/arch/powerpc/include/asm/kexec.h rename to trunk/include/asm-powerpc/kexec.h diff --git a/trunk/arch/powerpc/include/asm/keylargo.h b/trunk/include/asm-powerpc/keylargo.h similarity index 100% rename from trunk/arch/powerpc/include/asm/keylargo.h rename to trunk/include/asm-powerpc/keylargo.h diff --git a/trunk/arch/powerpc/include/asm/kgdb.h b/trunk/include/asm-powerpc/kgdb.h similarity index 98% rename from trunk/arch/powerpc/include/asm/kgdb.h rename to trunk/include/asm-powerpc/kgdb.h index edd217006d27..1399caf719ae 100644 --- a/trunk/arch/powerpc/include/asm/kgdb.h +++ b/trunk/include/asm-powerpc/kgdb.h @@ -1,4 +1,6 @@ /* + * include/asm-powerpc/kgdb.h + * * The PowerPC (32/64) specific defines / externs for KGDB. Based on * the previous 32bit and 64bit specific files, which had the following * copyrights: diff --git a/trunk/arch/powerpc/include/asm/kmap_types.h b/trunk/include/asm-powerpc/kmap_types.h similarity index 100% rename from trunk/arch/powerpc/include/asm/kmap_types.h rename to trunk/include/asm-powerpc/kmap_types.h diff --git a/trunk/arch/powerpc/include/asm/kprobes.h b/trunk/include/asm-powerpc/kprobes.h similarity index 100% rename from trunk/arch/powerpc/include/asm/kprobes.h rename to trunk/include/asm-powerpc/kprobes.h diff --git a/trunk/arch/powerpc/include/asm/kvm.h b/trunk/include/asm-powerpc/kvm.h similarity index 100% rename from trunk/arch/powerpc/include/asm/kvm.h rename to trunk/include/asm-powerpc/kvm.h diff --git a/trunk/arch/powerpc/include/asm/kvm_asm.h b/trunk/include/asm-powerpc/kvm_asm.h similarity index 100% rename from trunk/arch/powerpc/include/asm/kvm_asm.h rename to trunk/include/asm-powerpc/kvm_asm.h diff --git a/trunk/arch/powerpc/include/asm/kvm_host.h b/trunk/include/asm-powerpc/kvm_host.h similarity index 100% rename from trunk/arch/powerpc/include/asm/kvm_host.h rename to trunk/include/asm-powerpc/kvm_host.h diff --git a/trunk/arch/powerpc/include/asm/kvm_para.h b/trunk/include/asm-powerpc/kvm_para.h similarity index 100% rename from trunk/arch/powerpc/include/asm/kvm_para.h rename to trunk/include/asm-powerpc/kvm_para.h diff --git a/trunk/arch/powerpc/include/asm/kvm_ppc.h b/trunk/include/asm-powerpc/kvm_ppc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/kvm_ppc.h rename to trunk/include/asm-powerpc/kvm_ppc.h diff --git a/trunk/arch/powerpc/include/asm/libata-portmap.h b/trunk/include/asm-powerpc/libata-portmap.h similarity index 100% rename from trunk/arch/powerpc/include/asm/libata-portmap.h rename to trunk/include/asm-powerpc/libata-portmap.h diff --git a/trunk/arch/powerpc/include/asm/linkage.h b/trunk/include/asm-powerpc/linkage.h similarity index 100% rename from trunk/arch/powerpc/include/asm/linkage.h rename to trunk/include/asm-powerpc/linkage.h diff --git a/trunk/arch/powerpc/include/asm/lmb.h b/trunk/include/asm-powerpc/lmb.h similarity index 100% rename from trunk/arch/powerpc/include/asm/lmb.h rename to trunk/include/asm-powerpc/lmb.h diff --git a/trunk/arch/powerpc/include/asm/local.h b/trunk/include/asm-powerpc/local.h similarity index 100% rename from trunk/arch/powerpc/include/asm/local.h rename to trunk/include/asm-powerpc/local.h diff --git a/trunk/arch/powerpc/include/asm/lppaca.h b/trunk/include/asm-powerpc/lppaca.h similarity index 100% rename from trunk/arch/powerpc/include/asm/lppaca.h rename to trunk/include/asm-powerpc/lppaca.h diff --git a/trunk/arch/powerpc/include/asm/lv1call.h b/trunk/include/asm-powerpc/lv1call.h similarity index 100% rename from trunk/arch/powerpc/include/asm/lv1call.h rename to trunk/include/asm-powerpc/lv1call.h diff --git a/trunk/arch/powerpc/include/asm/machdep.h b/trunk/include/asm-powerpc/machdep.h similarity index 100% rename from trunk/arch/powerpc/include/asm/machdep.h rename to trunk/include/asm-powerpc/machdep.h diff --git a/trunk/arch/powerpc/include/asm/macio.h b/trunk/include/asm-powerpc/macio.h similarity index 100% rename from trunk/arch/powerpc/include/asm/macio.h rename to trunk/include/asm-powerpc/macio.h diff --git a/trunk/arch/powerpc/include/asm/mc146818rtc.h b/trunk/include/asm-powerpc/mc146818rtc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mc146818rtc.h rename to trunk/include/asm-powerpc/mc146818rtc.h diff --git a/trunk/arch/powerpc/include/asm/mediabay.h b/trunk/include/asm-powerpc/mediabay.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mediabay.h rename to trunk/include/asm-powerpc/mediabay.h diff --git a/trunk/arch/powerpc/include/asm/mman.h b/trunk/include/asm-powerpc/mman.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mman.h rename to trunk/include/asm-powerpc/mman.h diff --git a/trunk/arch/powerpc/include/asm/mmu-40x.h b/trunk/include/asm-powerpc/mmu-40x.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mmu-40x.h rename to trunk/include/asm-powerpc/mmu-40x.h diff --git a/trunk/arch/powerpc/include/asm/mmu-44x.h b/trunk/include/asm-powerpc/mmu-44x.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mmu-44x.h rename to trunk/include/asm-powerpc/mmu-44x.h diff --git a/trunk/arch/powerpc/include/asm/mmu-8xx.h b/trunk/include/asm-powerpc/mmu-8xx.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mmu-8xx.h rename to trunk/include/asm-powerpc/mmu-8xx.h diff --git a/trunk/arch/powerpc/include/asm/mmu-fsl-booke.h b/trunk/include/asm-powerpc/mmu-fsl-booke.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mmu-fsl-booke.h rename to trunk/include/asm-powerpc/mmu-fsl-booke.h diff --git a/trunk/arch/powerpc/include/asm/mmu-hash32.h b/trunk/include/asm-powerpc/mmu-hash32.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mmu-hash32.h rename to trunk/include/asm-powerpc/mmu-hash32.h diff --git a/trunk/arch/powerpc/include/asm/mmu-hash64.h b/trunk/include/asm-powerpc/mmu-hash64.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mmu-hash64.h rename to trunk/include/asm-powerpc/mmu-hash64.h diff --git a/trunk/arch/powerpc/include/asm/mmu.h b/trunk/include/asm-powerpc/mmu.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mmu.h rename to trunk/include/asm-powerpc/mmu.h diff --git a/trunk/arch/powerpc/include/asm/mmu_context.h b/trunk/include/asm-powerpc/mmu_context.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mmu_context.h rename to trunk/include/asm-powerpc/mmu_context.h diff --git a/trunk/arch/powerpc/include/asm/mmzone.h b/trunk/include/asm-powerpc/mmzone.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mmzone.h rename to trunk/include/asm-powerpc/mmzone.h diff --git a/trunk/arch/powerpc/include/asm/module.h b/trunk/include/asm-powerpc/module.h similarity index 100% rename from trunk/arch/powerpc/include/asm/module.h rename to trunk/include/asm-powerpc/module.h diff --git a/trunk/arch/powerpc/include/asm/mpc512x.h b/trunk/include/asm-powerpc/mpc512x.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mpc512x.h rename to trunk/include/asm-powerpc/mpc512x.h diff --git a/trunk/arch/powerpc/include/asm/mpc52xx.h b/trunk/include/asm-powerpc/mpc52xx.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mpc52xx.h rename to trunk/include/asm-powerpc/mpc52xx.h diff --git a/trunk/arch/powerpc/include/asm/mpc52xx_psc.h b/trunk/include/asm-powerpc/mpc52xx_psc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mpc52xx_psc.h rename to trunk/include/asm-powerpc/mpc52xx_psc.h diff --git a/trunk/arch/powerpc/include/asm/mpc6xx.h b/trunk/include/asm-powerpc/mpc6xx.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mpc6xx.h rename to trunk/include/asm-powerpc/mpc6xx.h diff --git a/trunk/arch/powerpc/include/asm/mpc8260.h b/trunk/include/asm-powerpc/mpc8260.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mpc8260.h rename to trunk/include/asm-powerpc/mpc8260.h diff --git a/trunk/arch/powerpc/include/asm/mpc86xx.h b/trunk/include/asm-powerpc/mpc86xx.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mpc86xx.h rename to trunk/include/asm-powerpc/mpc86xx.h diff --git a/trunk/arch/powerpc/include/asm/mpc8xx.h b/trunk/include/asm-powerpc/mpc8xx.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mpc8xx.h rename to trunk/include/asm-powerpc/mpc8xx.h diff --git a/trunk/arch/powerpc/include/asm/mpic.h b/trunk/include/asm-powerpc/mpic.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mpic.h rename to trunk/include/asm-powerpc/mpic.h diff --git a/trunk/arch/powerpc/include/asm/msgbuf.h b/trunk/include/asm-powerpc/msgbuf.h similarity index 100% rename from trunk/arch/powerpc/include/asm/msgbuf.h rename to trunk/include/asm-powerpc/msgbuf.h diff --git a/trunk/arch/powerpc/include/asm/mutex.h b/trunk/include/asm-powerpc/mutex.h similarity index 100% rename from trunk/arch/powerpc/include/asm/mutex.h rename to trunk/include/asm-powerpc/mutex.h diff --git a/trunk/arch/powerpc/include/asm/nvram.h b/trunk/include/asm-powerpc/nvram.h similarity index 100% rename from trunk/arch/powerpc/include/asm/nvram.h rename to trunk/include/asm-powerpc/nvram.h diff --git a/trunk/arch/powerpc/include/asm/of_device.h b/trunk/include/asm-powerpc/of_device.h similarity index 100% rename from trunk/arch/powerpc/include/asm/of_device.h rename to trunk/include/asm-powerpc/of_device.h diff --git a/trunk/arch/powerpc/include/asm/of_platform.h b/trunk/include/asm-powerpc/of_platform.h similarity index 100% rename from trunk/arch/powerpc/include/asm/of_platform.h rename to trunk/include/asm-powerpc/of_platform.h diff --git a/trunk/arch/powerpc/include/asm/ohare.h b/trunk/include/asm-powerpc/ohare.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ohare.h rename to trunk/include/asm-powerpc/ohare.h diff --git a/trunk/arch/powerpc/include/asm/oprofile_impl.h b/trunk/include/asm-powerpc/oprofile_impl.h similarity index 100% rename from trunk/arch/powerpc/include/asm/oprofile_impl.h rename to trunk/include/asm-powerpc/oprofile_impl.h diff --git a/trunk/arch/powerpc/include/asm/pSeries_reconfig.h b/trunk/include/asm-powerpc/pSeries_reconfig.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pSeries_reconfig.h rename to trunk/include/asm-powerpc/pSeries_reconfig.h diff --git a/trunk/arch/powerpc/include/asm/paca.h b/trunk/include/asm-powerpc/paca.h similarity index 99% rename from trunk/arch/powerpc/include/asm/paca.h rename to trunk/include/asm-powerpc/paca.h index 6493a395508b..7b564444ff61 100644 --- a/trunk/arch/powerpc/include/asm/paca.h +++ b/trunk/include/asm-powerpc/paca.h @@ -1,4 +1,6 @@ /* + * include/asm-powerpc/paca.h + * * This control block defines the PACA which defines the processor * specific data for each logical processor on the system. * There are some pointers defined that are utilized by PLIC. diff --git a/trunk/arch/powerpc/include/asm/page.h b/trunk/include/asm-powerpc/page.h similarity index 100% rename from trunk/arch/powerpc/include/asm/page.h rename to trunk/include/asm-powerpc/page.h diff --git a/trunk/arch/powerpc/include/asm/page_32.h b/trunk/include/asm-powerpc/page_32.h similarity index 100% rename from trunk/arch/powerpc/include/asm/page_32.h rename to trunk/include/asm-powerpc/page_32.h diff --git a/trunk/arch/powerpc/include/asm/page_64.h b/trunk/include/asm-powerpc/page_64.h similarity index 100% rename from trunk/arch/powerpc/include/asm/page_64.h rename to trunk/include/asm-powerpc/page_64.h diff --git a/trunk/arch/powerpc/include/asm/param.h b/trunk/include/asm-powerpc/param.h similarity index 100% rename from trunk/arch/powerpc/include/asm/param.h rename to trunk/include/asm-powerpc/param.h diff --git a/trunk/arch/powerpc/include/asm/parport.h b/trunk/include/asm-powerpc/parport.h similarity index 100% rename from trunk/arch/powerpc/include/asm/parport.h rename to trunk/include/asm-powerpc/parport.h diff --git a/trunk/arch/powerpc/include/asm/pasemi_dma.h b/trunk/include/asm-powerpc/pasemi_dma.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pasemi_dma.h rename to trunk/include/asm-powerpc/pasemi_dma.h diff --git a/trunk/arch/powerpc/include/asm/pci-bridge.h b/trunk/include/asm-powerpc/pci-bridge.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pci-bridge.h rename to trunk/include/asm-powerpc/pci-bridge.h diff --git a/trunk/arch/powerpc/include/asm/pci.h b/trunk/include/asm-powerpc/pci.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pci.h rename to trunk/include/asm-powerpc/pci.h diff --git a/trunk/arch/powerpc/include/asm/percpu.h b/trunk/include/asm-powerpc/percpu.h similarity index 100% rename from trunk/arch/powerpc/include/asm/percpu.h rename to trunk/include/asm-powerpc/percpu.h diff --git a/trunk/arch/powerpc/include/asm/pgalloc-32.h b/trunk/include/asm-powerpc/pgalloc-32.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pgalloc-32.h rename to trunk/include/asm-powerpc/pgalloc-32.h diff --git a/trunk/arch/powerpc/include/asm/pgalloc-64.h b/trunk/include/asm-powerpc/pgalloc-64.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pgalloc-64.h rename to trunk/include/asm-powerpc/pgalloc-64.h diff --git a/trunk/arch/powerpc/include/asm/pgalloc.h b/trunk/include/asm-powerpc/pgalloc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pgalloc.h rename to trunk/include/asm-powerpc/pgalloc.h diff --git a/trunk/arch/powerpc/include/asm/pgtable-4k.h b/trunk/include/asm-powerpc/pgtable-4k.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pgtable-4k.h rename to trunk/include/asm-powerpc/pgtable-4k.h diff --git a/trunk/arch/powerpc/include/asm/pgtable-64k.h b/trunk/include/asm-powerpc/pgtable-64k.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pgtable-64k.h rename to trunk/include/asm-powerpc/pgtable-64k.h diff --git a/trunk/arch/powerpc/include/asm/pgtable-ppc32.h b/trunk/include/asm-powerpc/pgtable-ppc32.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pgtable-ppc32.h rename to trunk/include/asm-powerpc/pgtable-ppc32.h diff --git a/trunk/arch/powerpc/include/asm/pgtable-ppc64.h b/trunk/include/asm-powerpc/pgtable-ppc64.h similarity index 99% rename from trunk/arch/powerpc/include/asm/pgtable-ppc64.h rename to trunk/include/asm-powerpc/pgtable-ppc64.h index db0b8f3b8807..74c6f380b805 100644 --- a/trunk/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/trunk/include/asm-powerpc/pgtable-ppc64.h @@ -100,7 +100,7 @@ #define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY) -/* __pgprot defined in arch/powerpc/incliude/asm/page.h */ +/* __pgprot defined in asm-powerpc/page.h */ #define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED) #define PAGE_SHARED __pgprot(_PAGE_BASE | _PAGE_RW | _PAGE_USER) diff --git a/trunk/arch/powerpc/include/asm/pgtable.h b/trunk/include/asm-powerpc/pgtable.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pgtable.h rename to trunk/include/asm-powerpc/pgtable.h diff --git a/trunk/arch/powerpc/include/asm/phyp_dump.h b/trunk/include/asm-powerpc/phyp_dump.h similarity index 100% rename from trunk/arch/powerpc/include/asm/phyp_dump.h rename to trunk/include/asm-powerpc/phyp_dump.h diff --git a/trunk/arch/powerpc/include/asm/pmac_feature.h b/trunk/include/asm-powerpc/pmac_feature.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pmac_feature.h rename to trunk/include/asm-powerpc/pmac_feature.h diff --git a/trunk/arch/powerpc/include/asm/pmac_low_i2c.h b/trunk/include/asm-powerpc/pmac_low_i2c.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pmac_low_i2c.h rename to trunk/include/asm-powerpc/pmac_low_i2c.h diff --git a/trunk/arch/powerpc/include/asm/pmac_pfunc.h b/trunk/include/asm-powerpc/pmac_pfunc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pmac_pfunc.h rename to trunk/include/asm-powerpc/pmac_pfunc.h diff --git a/trunk/arch/powerpc/include/asm/pmc.h b/trunk/include/asm-powerpc/pmc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pmc.h rename to trunk/include/asm-powerpc/pmc.h diff --git a/trunk/arch/powerpc/include/asm/pmi.h b/trunk/include/asm-powerpc/pmi.h similarity index 100% rename from trunk/arch/powerpc/include/asm/pmi.h rename to trunk/include/asm-powerpc/pmi.h diff --git a/trunk/arch/powerpc/include/asm/poll.h b/trunk/include/asm-powerpc/poll.h similarity index 100% rename from trunk/arch/powerpc/include/asm/poll.h rename to trunk/include/asm-powerpc/poll.h diff --git a/trunk/arch/powerpc/include/asm/posix_types.h b/trunk/include/asm-powerpc/posix_types.h similarity index 100% rename from trunk/arch/powerpc/include/asm/posix_types.h rename to trunk/include/asm-powerpc/posix_types.h diff --git a/trunk/arch/powerpc/include/asm/ppc-pci.h b/trunk/include/asm-powerpc/ppc-pci.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ppc-pci.h rename to trunk/include/asm-powerpc/ppc-pci.h diff --git a/trunk/arch/powerpc/include/asm/ppc4xx.h b/trunk/include/asm-powerpc/ppc4xx.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ppc4xx.h rename to trunk/include/asm-powerpc/ppc4xx.h diff --git a/trunk/arch/powerpc/include/asm/ppc_asm.h b/trunk/include/asm-powerpc/ppc_asm.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ppc_asm.h rename to trunk/include/asm-powerpc/ppc_asm.h diff --git a/trunk/arch/powerpc/include/asm/processor.h b/trunk/include/asm-powerpc/processor.h similarity index 100% rename from trunk/arch/powerpc/include/asm/processor.h rename to trunk/include/asm-powerpc/processor.h diff --git a/trunk/arch/powerpc/include/asm/prom.h b/trunk/include/asm-powerpc/prom.h similarity index 100% rename from trunk/arch/powerpc/include/asm/prom.h rename to trunk/include/asm-powerpc/prom.h diff --git a/trunk/arch/powerpc/include/asm/ps3.h b/trunk/include/asm-powerpc/ps3.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ps3.h rename to trunk/include/asm-powerpc/ps3.h diff --git a/trunk/arch/powerpc/include/asm/ps3av.h b/trunk/include/asm-powerpc/ps3av.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ps3av.h rename to trunk/include/asm-powerpc/ps3av.h diff --git a/trunk/arch/powerpc/include/asm/ps3fb.h b/trunk/include/asm-powerpc/ps3fb.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ps3fb.h rename to trunk/include/asm-powerpc/ps3fb.h diff --git a/trunk/arch/powerpc/include/asm/ps3stor.h b/trunk/include/asm-powerpc/ps3stor.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ps3stor.h rename to trunk/include/asm-powerpc/ps3stor.h diff --git a/trunk/arch/powerpc/include/asm/ptrace.h b/trunk/include/asm-powerpc/ptrace.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ptrace.h rename to trunk/include/asm-powerpc/ptrace.h diff --git a/trunk/arch/powerpc/include/asm/qe.h b/trunk/include/asm-powerpc/qe.h similarity index 100% rename from trunk/arch/powerpc/include/asm/qe.h rename to trunk/include/asm-powerpc/qe.h diff --git a/trunk/arch/powerpc/include/asm/qe_ic.h b/trunk/include/asm-powerpc/qe_ic.h similarity index 99% rename from trunk/arch/powerpc/include/asm/qe_ic.h rename to trunk/include/asm-powerpc/qe_ic.h index 56a7745ca343..a779b2c9eaf1 100644 --- a/trunk/arch/powerpc/include/asm/qe_ic.h +++ b/trunk/include/asm-powerpc/qe_ic.h @@ -1,4 +1,6 @@ /* + * include/asm-powerpc/qe_ic.h + * * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. * * Authors: Shlomi Gridish diff --git a/trunk/arch/powerpc/include/asm/reg.h b/trunk/include/asm-powerpc/reg.h similarity index 100% rename from trunk/arch/powerpc/include/asm/reg.h rename to trunk/include/asm-powerpc/reg.h diff --git a/trunk/arch/powerpc/include/asm/reg_8xx.h b/trunk/include/asm-powerpc/reg_8xx.h similarity index 100% rename from trunk/arch/powerpc/include/asm/reg_8xx.h rename to trunk/include/asm-powerpc/reg_8xx.h diff --git a/trunk/arch/powerpc/include/asm/reg_booke.h b/trunk/include/asm-powerpc/reg_booke.h similarity index 100% rename from trunk/arch/powerpc/include/asm/reg_booke.h rename to trunk/include/asm-powerpc/reg_booke.h diff --git a/trunk/arch/powerpc/include/asm/reg_fsl_emb.h b/trunk/include/asm-powerpc/reg_fsl_emb.h similarity index 100% rename from trunk/arch/powerpc/include/asm/reg_fsl_emb.h rename to trunk/include/asm-powerpc/reg_fsl_emb.h diff --git a/trunk/arch/powerpc/include/asm/resource.h b/trunk/include/asm-powerpc/resource.h similarity index 100% rename from trunk/arch/powerpc/include/asm/resource.h rename to trunk/include/asm-powerpc/resource.h diff --git a/trunk/arch/powerpc/include/asm/rheap.h b/trunk/include/asm-powerpc/rheap.h similarity index 100% rename from trunk/arch/powerpc/include/asm/rheap.h rename to trunk/include/asm-powerpc/rheap.h diff --git a/trunk/arch/powerpc/include/asm/rio.h b/trunk/include/asm-powerpc/rio.h similarity index 100% rename from trunk/arch/powerpc/include/asm/rio.h rename to trunk/include/asm-powerpc/rio.h diff --git a/trunk/arch/powerpc/include/asm/rtas.h b/trunk/include/asm-powerpc/rtas.h similarity index 100% rename from trunk/arch/powerpc/include/asm/rtas.h rename to trunk/include/asm-powerpc/rtas.h diff --git a/trunk/arch/powerpc/include/asm/rtc.h b/trunk/include/asm-powerpc/rtc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/rtc.h rename to trunk/include/asm-powerpc/rtc.h diff --git a/trunk/arch/powerpc/include/asm/rwsem.h b/trunk/include/asm-powerpc/rwsem.h similarity index 96% rename from trunk/arch/powerpc/include/asm/rwsem.h rename to trunk/include/asm-powerpc/rwsem.h index 24cd9281ec37..a6cc93b78b98 100644 --- a/trunk/arch/powerpc/include/asm/rwsem.h +++ b/trunk/include/asm-powerpc/rwsem.h @@ -8,8 +8,8 @@ #ifdef __KERNEL__ /* - * R/W semaphores for PPC using the stuff in lib/rwsem.c. - * Adapted largely from include/asm-i386/rwsem.h + * include/asm-powerpc/rwsem.h: R/W semaphores for PPC using the stuff + * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h * by Paul Mackerras . */ diff --git a/trunk/arch/powerpc/include/asm/scatterlist.h b/trunk/include/asm-powerpc/scatterlist.h similarity index 100% rename from trunk/arch/powerpc/include/asm/scatterlist.h rename to trunk/include/asm-powerpc/scatterlist.h diff --git a/trunk/arch/powerpc/include/asm/seccomp.h b/trunk/include/asm-powerpc/seccomp.h similarity index 100% rename from trunk/arch/powerpc/include/asm/seccomp.h rename to trunk/include/asm-powerpc/seccomp.h diff --git a/trunk/arch/powerpc/include/asm/sections.h b/trunk/include/asm-powerpc/sections.h similarity index 100% rename from trunk/arch/powerpc/include/asm/sections.h rename to trunk/include/asm-powerpc/sections.h diff --git a/trunk/arch/powerpc/include/asm/sembuf.h b/trunk/include/asm-powerpc/sembuf.h similarity index 100% rename from trunk/arch/powerpc/include/asm/sembuf.h rename to trunk/include/asm-powerpc/sembuf.h diff --git a/trunk/arch/powerpc/include/asm/serial.h b/trunk/include/asm-powerpc/serial.h similarity index 100% rename from trunk/arch/powerpc/include/asm/serial.h rename to trunk/include/asm-powerpc/serial.h diff --git a/trunk/arch/powerpc/include/asm/setjmp.h b/trunk/include/asm-powerpc/setjmp.h similarity index 100% rename from trunk/arch/powerpc/include/asm/setjmp.h rename to trunk/include/asm-powerpc/setjmp.h diff --git a/trunk/arch/powerpc/include/asm/setup.h b/trunk/include/asm-powerpc/setup.h similarity index 100% rename from trunk/arch/powerpc/include/asm/setup.h rename to trunk/include/asm-powerpc/setup.h diff --git a/trunk/arch/powerpc/include/asm/shmbuf.h b/trunk/include/asm-powerpc/shmbuf.h similarity index 100% rename from trunk/arch/powerpc/include/asm/shmbuf.h rename to trunk/include/asm-powerpc/shmbuf.h diff --git a/trunk/arch/powerpc/include/asm/shmparam.h b/trunk/include/asm-powerpc/shmparam.h similarity index 100% rename from trunk/arch/powerpc/include/asm/shmparam.h rename to trunk/include/asm-powerpc/shmparam.h diff --git a/trunk/arch/powerpc/include/asm/sigcontext.h b/trunk/include/asm-powerpc/sigcontext.h similarity index 100% rename from trunk/arch/powerpc/include/asm/sigcontext.h rename to trunk/include/asm-powerpc/sigcontext.h diff --git a/trunk/arch/powerpc/include/asm/siginfo.h b/trunk/include/asm-powerpc/siginfo.h similarity index 100% rename from trunk/arch/powerpc/include/asm/siginfo.h rename to trunk/include/asm-powerpc/siginfo.h diff --git a/trunk/arch/powerpc/include/asm/signal.h b/trunk/include/asm-powerpc/signal.h similarity index 100% rename from trunk/arch/powerpc/include/asm/signal.h rename to trunk/include/asm-powerpc/signal.h diff --git a/trunk/arch/powerpc/include/asm/smp.h b/trunk/include/asm-powerpc/smp.h similarity index 100% rename from trunk/arch/powerpc/include/asm/smp.h rename to trunk/include/asm-powerpc/smp.h diff --git a/trunk/arch/powerpc/include/asm/smu.h b/trunk/include/asm-powerpc/smu.h similarity index 100% rename from trunk/arch/powerpc/include/asm/smu.h rename to trunk/include/asm-powerpc/smu.h diff --git a/trunk/arch/powerpc/include/asm/socket.h b/trunk/include/asm-powerpc/socket.h similarity index 100% rename from trunk/arch/powerpc/include/asm/socket.h rename to trunk/include/asm-powerpc/socket.h diff --git a/trunk/arch/powerpc/include/asm/sockios.h b/trunk/include/asm-powerpc/sockios.h similarity index 100% rename from trunk/arch/powerpc/include/asm/sockios.h rename to trunk/include/asm-powerpc/sockios.h diff --git a/trunk/arch/powerpc/include/asm/sparsemem.h b/trunk/include/asm-powerpc/sparsemem.h similarity index 100% rename from trunk/arch/powerpc/include/asm/sparsemem.h rename to trunk/include/asm-powerpc/sparsemem.h diff --git a/trunk/arch/powerpc/include/asm/spinlock.h b/trunk/include/asm-powerpc/spinlock.h similarity index 100% rename from trunk/arch/powerpc/include/asm/spinlock.h rename to trunk/include/asm-powerpc/spinlock.h diff --git a/trunk/arch/powerpc/include/asm/spinlock_types.h b/trunk/include/asm-powerpc/spinlock_types.h similarity index 100% rename from trunk/arch/powerpc/include/asm/spinlock_types.h rename to trunk/include/asm-powerpc/spinlock_types.h diff --git a/trunk/arch/powerpc/include/asm/spu.h b/trunk/include/asm-powerpc/spu.h similarity index 100% rename from trunk/arch/powerpc/include/asm/spu.h rename to trunk/include/asm-powerpc/spu.h diff --git a/trunk/arch/powerpc/include/asm/spu_csa.h b/trunk/include/asm-powerpc/spu_csa.h similarity index 100% rename from trunk/arch/powerpc/include/asm/spu_csa.h rename to trunk/include/asm-powerpc/spu_csa.h diff --git a/trunk/arch/powerpc/include/asm/spu_info.h b/trunk/include/asm-powerpc/spu_info.h similarity index 100% rename from trunk/arch/powerpc/include/asm/spu_info.h rename to trunk/include/asm-powerpc/spu_info.h diff --git a/trunk/arch/powerpc/include/asm/spu_priv1.h b/trunk/include/asm-powerpc/spu_priv1.h similarity index 100% rename from trunk/arch/powerpc/include/asm/spu_priv1.h rename to trunk/include/asm-powerpc/spu_priv1.h diff --git a/trunk/arch/powerpc/include/asm/sstep.h b/trunk/include/asm-powerpc/sstep.h similarity index 100% rename from trunk/arch/powerpc/include/asm/sstep.h rename to trunk/include/asm-powerpc/sstep.h diff --git a/trunk/arch/powerpc/include/asm/stat.h b/trunk/include/asm-powerpc/stat.h similarity index 100% rename from trunk/arch/powerpc/include/asm/stat.h rename to trunk/include/asm-powerpc/stat.h diff --git a/trunk/arch/powerpc/include/asm/statfs.h b/trunk/include/asm-powerpc/statfs.h similarity index 100% rename from trunk/arch/powerpc/include/asm/statfs.h rename to trunk/include/asm-powerpc/statfs.h diff --git a/trunk/arch/powerpc/include/asm/string.h b/trunk/include/asm-powerpc/string.h similarity index 100% rename from trunk/arch/powerpc/include/asm/string.h rename to trunk/include/asm-powerpc/string.h diff --git a/trunk/arch/powerpc/include/asm/suspend.h b/trunk/include/asm-powerpc/suspend.h similarity index 100% rename from trunk/arch/powerpc/include/asm/suspend.h rename to trunk/include/asm-powerpc/suspend.h diff --git a/trunk/arch/powerpc/include/asm/synch.h b/trunk/include/asm-powerpc/synch.h similarity index 100% rename from trunk/arch/powerpc/include/asm/synch.h rename to trunk/include/asm-powerpc/synch.h diff --git a/trunk/arch/powerpc/include/asm/syscall.h b/trunk/include/asm-powerpc/syscall.h similarity index 100% rename from trunk/arch/powerpc/include/asm/syscall.h rename to trunk/include/asm-powerpc/syscall.h diff --git a/trunk/arch/powerpc/include/asm/syscalls.h b/trunk/include/asm-powerpc/syscalls.h similarity index 100% rename from trunk/arch/powerpc/include/asm/syscalls.h rename to trunk/include/asm-powerpc/syscalls.h diff --git a/trunk/arch/powerpc/include/asm/systbl.h b/trunk/include/asm-powerpc/systbl.h similarity index 100% rename from trunk/arch/powerpc/include/asm/systbl.h rename to trunk/include/asm-powerpc/systbl.h diff --git a/trunk/arch/powerpc/include/asm/system.h b/trunk/include/asm-powerpc/system.h similarity index 100% rename from trunk/arch/powerpc/include/asm/system.h rename to trunk/include/asm-powerpc/system.h diff --git a/trunk/arch/powerpc/include/asm/tce.h b/trunk/include/asm-powerpc/tce.h similarity index 100% rename from trunk/arch/powerpc/include/asm/tce.h rename to trunk/include/asm-powerpc/tce.h diff --git a/trunk/arch/powerpc/include/asm/termbits.h b/trunk/include/asm-powerpc/termbits.h similarity index 100% rename from trunk/arch/powerpc/include/asm/termbits.h rename to trunk/include/asm-powerpc/termbits.h diff --git a/trunk/arch/powerpc/include/asm/termios.h b/trunk/include/asm-powerpc/termios.h similarity index 100% rename from trunk/arch/powerpc/include/asm/termios.h rename to trunk/include/asm-powerpc/termios.h diff --git a/trunk/arch/powerpc/include/asm/thread_info.h b/trunk/include/asm-powerpc/thread_info.h similarity index 100% rename from trunk/arch/powerpc/include/asm/thread_info.h rename to trunk/include/asm-powerpc/thread_info.h diff --git a/trunk/arch/powerpc/include/asm/time.h b/trunk/include/asm-powerpc/time.h similarity index 100% rename from trunk/arch/powerpc/include/asm/time.h rename to trunk/include/asm-powerpc/time.h diff --git a/trunk/arch/powerpc/include/asm/timex.h b/trunk/include/asm-powerpc/timex.h similarity index 100% rename from trunk/arch/powerpc/include/asm/timex.h rename to trunk/include/asm-powerpc/timex.h diff --git a/trunk/arch/powerpc/include/asm/tlb.h b/trunk/include/asm-powerpc/tlb.h similarity index 100% rename from trunk/arch/powerpc/include/asm/tlb.h rename to trunk/include/asm-powerpc/tlb.h diff --git a/trunk/arch/powerpc/include/asm/tlbflush.h b/trunk/include/asm-powerpc/tlbflush.h similarity index 100% rename from trunk/arch/powerpc/include/asm/tlbflush.h rename to trunk/include/asm-powerpc/tlbflush.h diff --git a/trunk/arch/powerpc/include/asm/topology.h b/trunk/include/asm-powerpc/topology.h similarity index 100% rename from trunk/arch/powerpc/include/asm/topology.h rename to trunk/include/asm-powerpc/topology.h diff --git a/trunk/arch/powerpc/include/asm/tsi108.h b/trunk/include/asm-powerpc/tsi108.h similarity index 100% rename from trunk/arch/powerpc/include/asm/tsi108.h rename to trunk/include/asm-powerpc/tsi108.h diff --git a/trunk/arch/powerpc/include/asm/tsi108_irq.h b/trunk/include/asm-powerpc/tsi108_irq.h similarity index 100% rename from trunk/arch/powerpc/include/asm/tsi108_irq.h rename to trunk/include/asm-powerpc/tsi108_irq.h diff --git a/trunk/arch/powerpc/include/asm/tsi108_pci.h b/trunk/include/asm-powerpc/tsi108_pci.h similarity index 100% rename from trunk/arch/powerpc/include/asm/tsi108_pci.h rename to trunk/include/asm-powerpc/tsi108_pci.h diff --git a/trunk/arch/powerpc/include/asm/types.h b/trunk/include/asm-powerpc/types.h similarity index 100% rename from trunk/arch/powerpc/include/asm/types.h rename to trunk/include/asm-powerpc/types.h diff --git a/trunk/arch/powerpc/include/asm/uaccess.h b/trunk/include/asm-powerpc/uaccess.h similarity index 100% rename from trunk/arch/powerpc/include/asm/uaccess.h rename to trunk/include/asm-powerpc/uaccess.h diff --git a/trunk/arch/powerpc/include/asm/ucc.h b/trunk/include/asm-powerpc/ucc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ucc.h rename to trunk/include/asm-powerpc/ucc.h diff --git a/trunk/arch/powerpc/include/asm/ucc_fast.h b/trunk/include/asm-powerpc/ucc_fast.h similarity index 99% rename from trunk/arch/powerpc/include/asm/ucc_fast.h rename to trunk/include/asm-powerpc/ucc_fast.h index 839aab8bf37d..fce16abe7ee1 100644 --- a/trunk/arch/powerpc/include/asm/ucc_fast.h +++ b/trunk/include/asm-powerpc/ucc_fast.h @@ -1,4 +1,6 @@ /* + * include/asm-powerpc/ucc_fast.h + * * Internal header file for UCC FAST unit routines. * * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. diff --git a/trunk/arch/powerpc/include/asm/ucc_slow.h b/trunk/include/asm-powerpc/ucc_slow.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ucc_slow.h rename to trunk/include/asm-powerpc/ucc_slow.h diff --git a/trunk/arch/powerpc/include/asm/ucontext.h b/trunk/include/asm-powerpc/ucontext.h similarity index 100% rename from trunk/arch/powerpc/include/asm/ucontext.h rename to trunk/include/asm-powerpc/ucontext.h diff --git a/trunk/arch/powerpc/include/asm/udbg.h b/trunk/include/asm-powerpc/udbg.h similarity index 100% rename from trunk/arch/powerpc/include/asm/udbg.h rename to trunk/include/asm-powerpc/udbg.h diff --git a/trunk/arch/powerpc/include/asm/uic.h b/trunk/include/asm-powerpc/uic.h similarity index 95% rename from trunk/arch/powerpc/include/asm/uic.h rename to trunk/include/asm-powerpc/uic.h index 597edfcae3d6..970eb7e2186a 100644 --- a/trunk/arch/powerpc/include/asm/uic.h +++ b/trunk/include/asm-powerpc/uic.h @@ -1,4 +1,6 @@ /* + * include/asm-powerpc/uic.h + * * IBM PPC4xx UIC external definitions and structure. * * Maintainer: David Gibson diff --git a/trunk/arch/powerpc/include/asm/unaligned.h b/trunk/include/asm-powerpc/unaligned.h similarity index 100% rename from trunk/arch/powerpc/include/asm/unaligned.h rename to trunk/include/asm-powerpc/unaligned.h diff --git a/trunk/arch/powerpc/include/asm/uninorth.h b/trunk/include/asm-powerpc/uninorth.h similarity index 100% rename from trunk/arch/powerpc/include/asm/uninorth.h rename to trunk/include/asm-powerpc/uninorth.h diff --git a/trunk/arch/powerpc/include/asm/unistd.h b/trunk/include/asm-powerpc/unistd.h similarity index 100% rename from trunk/arch/powerpc/include/asm/unistd.h rename to trunk/include/asm-powerpc/unistd.h diff --git a/trunk/arch/powerpc/include/asm/user.h b/trunk/include/asm-powerpc/user.h similarity index 100% rename from trunk/arch/powerpc/include/asm/user.h rename to trunk/include/asm-powerpc/user.h diff --git a/trunk/arch/powerpc/include/asm/vdso.h b/trunk/include/asm-powerpc/vdso.h similarity index 100% rename from trunk/arch/powerpc/include/asm/vdso.h rename to trunk/include/asm-powerpc/vdso.h diff --git a/trunk/arch/powerpc/include/asm/vdso_datapage.h b/trunk/include/asm-powerpc/vdso_datapage.h similarity index 100% rename from trunk/arch/powerpc/include/asm/vdso_datapage.h rename to trunk/include/asm-powerpc/vdso_datapage.h diff --git a/trunk/arch/powerpc/include/asm/vga.h b/trunk/include/asm-powerpc/vga.h similarity index 100% rename from trunk/arch/powerpc/include/asm/vga.h rename to trunk/include/asm-powerpc/vga.h diff --git a/trunk/arch/powerpc/include/asm/vio.h b/trunk/include/asm-powerpc/vio.h similarity index 100% rename from trunk/arch/powerpc/include/asm/vio.h rename to trunk/include/asm-powerpc/vio.h diff --git a/trunk/arch/powerpc/include/asm/xilinx_intc.h b/trunk/include/asm-powerpc/xilinx_intc.h similarity index 100% rename from trunk/arch/powerpc/include/asm/xilinx_intc.h rename to trunk/include/asm-powerpc/xilinx_intc.h diff --git a/trunk/arch/powerpc/include/asm/xmon.h b/trunk/include/asm-powerpc/xmon.h similarity index 100% rename from trunk/arch/powerpc/include/asm/xmon.h rename to trunk/include/asm-powerpc/xmon.h diff --git a/trunk/arch/powerpc/include/asm/xor.h b/trunk/include/asm-powerpc/xor.h similarity index 100% rename from trunk/arch/powerpc/include/asm/xor.h rename to trunk/include/asm-powerpc/xor.h diff --git a/trunk/arch/s390/include/asm/Kbuild b/trunk/include/asm-s390/Kbuild similarity index 100% rename from trunk/arch/s390/include/asm/Kbuild rename to trunk/include/asm-s390/Kbuild diff --git a/trunk/arch/s390/include/asm/airq.h b/trunk/include/asm-s390/airq.h similarity index 100% rename from trunk/arch/s390/include/asm/airq.h rename to trunk/include/asm-s390/airq.h diff --git a/trunk/arch/s390/include/asm/appldata.h b/trunk/include/asm-s390/appldata.h similarity index 100% rename from trunk/arch/s390/include/asm/appldata.h rename to trunk/include/asm-s390/appldata.h diff --git a/trunk/arch/s390/include/asm/atomic.h b/trunk/include/asm-s390/atomic.h similarity index 100% rename from trunk/arch/s390/include/asm/atomic.h rename to trunk/include/asm-s390/atomic.h diff --git a/trunk/arch/s390/include/asm/auxvec.h b/trunk/include/asm-s390/auxvec.h similarity index 100% rename from trunk/arch/s390/include/asm/auxvec.h rename to trunk/include/asm-s390/auxvec.h diff --git a/trunk/arch/s390/include/asm/bitops.h b/trunk/include/asm-s390/bitops.h similarity index 100% rename from trunk/arch/s390/include/asm/bitops.h rename to trunk/include/asm-s390/bitops.h diff --git a/trunk/arch/s390/include/asm/bug.h b/trunk/include/asm-s390/bug.h similarity index 100% rename from trunk/arch/s390/include/asm/bug.h rename to trunk/include/asm-s390/bug.h diff --git a/trunk/arch/s390/include/asm/bugs.h b/trunk/include/asm-s390/bugs.h similarity index 100% rename from trunk/arch/s390/include/asm/bugs.h rename to trunk/include/asm-s390/bugs.h diff --git a/trunk/arch/s390/include/asm/byteorder.h b/trunk/include/asm-s390/byteorder.h similarity index 100% rename from trunk/arch/s390/include/asm/byteorder.h rename to trunk/include/asm-s390/byteorder.h diff --git a/trunk/arch/s390/include/asm/cache.h b/trunk/include/asm-s390/cache.h similarity index 100% rename from trunk/arch/s390/include/asm/cache.h rename to trunk/include/asm-s390/cache.h diff --git a/trunk/arch/s390/include/asm/cacheflush.h b/trunk/include/asm-s390/cacheflush.h similarity index 100% rename from trunk/arch/s390/include/asm/cacheflush.h rename to trunk/include/asm-s390/cacheflush.h diff --git a/trunk/arch/s390/include/asm/ccwdev.h b/trunk/include/asm-s390/ccwdev.h similarity index 100% rename from trunk/arch/s390/include/asm/ccwdev.h rename to trunk/include/asm-s390/ccwdev.h diff --git a/trunk/arch/s390/include/asm/ccwgroup.h b/trunk/include/asm-s390/ccwgroup.h similarity index 100% rename from trunk/arch/s390/include/asm/ccwgroup.h rename to trunk/include/asm-s390/ccwgroup.h diff --git a/trunk/arch/s390/include/asm/checksum.h b/trunk/include/asm-s390/checksum.h similarity index 100% rename from trunk/arch/s390/include/asm/checksum.h rename to trunk/include/asm-s390/checksum.h diff --git a/trunk/arch/s390/include/asm/chpid.h b/trunk/include/asm-s390/chpid.h similarity index 100% rename from trunk/arch/s390/include/asm/chpid.h rename to trunk/include/asm-s390/chpid.h diff --git a/trunk/arch/s390/include/asm/chsc.h b/trunk/include/asm-s390/chsc.h similarity index 100% rename from trunk/arch/s390/include/asm/chsc.h rename to trunk/include/asm-s390/chsc.h diff --git a/trunk/arch/s390/include/asm/cio.h b/trunk/include/asm-s390/cio.h similarity index 100% rename from trunk/arch/s390/include/asm/cio.h rename to trunk/include/asm-s390/cio.h diff --git a/trunk/arch/s390/include/asm/cmb.h b/trunk/include/asm-s390/cmb.h similarity index 100% rename from trunk/arch/s390/include/asm/cmb.h rename to trunk/include/asm-s390/cmb.h diff --git a/trunk/arch/s390/include/asm/compat.h b/trunk/include/asm-s390/compat.h similarity index 100% rename from trunk/arch/s390/include/asm/compat.h rename to trunk/include/asm-s390/compat.h diff --git a/trunk/arch/s390/include/asm/cpcmd.h b/trunk/include/asm-s390/cpcmd.h similarity index 100% rename from trunk/arch/s390/include/asm/cpcmd.h rename to trunk/include/asm-s390/cpcmd.h diff --git a/trunk/arch/s390/include/asm/cpu.h b/trunk/include/asm-s390/cpu.h similarity index 100% rename from trunk/arch/s390/include/asm/cpu.h rename to trunk/include/asm-s390/cpu.h diff --git a/trunk/arch/s390/include/asm/cputime.h b/trunk/include/asm-s390/cputime.h similarity index 100% rename from trunk/arch/s390/include/asm/cputime.h rename to trunk/include/asm-s390/cputime.h diff --git a/trunk/arch/s390/include/asm/current.h b/trunk/include/asm-s390/current.h similarity index 100% rename from trunk/arch/s390/include/asm/current.h rename to trunk/include/asm-s390/current.h diff --git a/trunk/arch/s390/include/asm/dasd.h b/trunk/include/asm-s390/dasd.h similarity index 100% rename from trunk/arch/s390/include/asm/dasd.h rename to trunk/include/asm-s390/dasd.h diff --git a/trunk/arch/s390/include/asm/debug.h b/trunk/include/asm-s390/debug.h similarity index 100% rename from trunk/arch/s390/include/asm/debug.h rename to trunk/include/asm-s390/debug.h diff --git a/trunk/arch/s390/include/asm/delay.h b/trunk/include/asm-s390/delay.h similarity index 100% rename from trunk/arch/s390/include/asm/delay.h rename to trunk/include/asm-s390/delay.h diff --git a/trunk/arch/s390/include/asm/device.h b/trunk/include/asm-s390/device.h similarity index 100% rename from trunk/arch/s390/include/asm/device.h rename to trunk/include/asm-s390/device.h diff --git a/trunk/arch/s390/include/asm/diag.h b/trunk/include/asm-s390/diag.h similarity index 100% rename from trunk/arch/s390/include/asm/diag.h rename to trunk/include/asm-s390/diag.h diff --git a/trunk/arch/s390/include/asm/div64.h b/trunk/include/asm-s390/div64.h similarity index 100% rename from trunk/arch/s390/include/asm/div64.h rename to trunk/include/asm-s390/div64.h diff --git a/trunk/arch/s390/include/asm/dma.h b/trunk/include/asm-s390/dma.h similarity index 100% rename from trunk/arch/s390/include/asm/dma.h rename to trunk/include/asm-s390/dma.h diff --git a/trunk/arch/s390/include/asm/ebcdic.h b/trunk/include/asm-s390/ebcdic.h similarity index 100% rename from trunk/arch/s390/include/asm/ebcdic.h rename to trunk/include/asm-s390/ebcdic.h diff --git a/trunk/arch/s390/include/asm/elf.h b/trunk/include/asm-s390/elf.h similarity index 100% rename from trunk/arch/s390/include/asm/elf.h rename to trunk/include/asm-s390/elf.h diff --git a/trunk/arch/s390/include/asm/emergency-restart.h b/trunk/include/asm-s390/emergency-restart.h similarity index 100% rename from trunk/arch/s390/include/asm/emergency-restart.h rename to trunk/include/asm-s390/emergency-restart.h diff --git a/trunk/arch/s390/include/asm/errno.h b/trunk/include/asm-s390/errno.h similarity index 100% rename from trunk/arch/s390/include/asm/errno.h rename to trunk/include/asm-s390/errno.h diff --git a/trunk/arch/s390/include/asm/etr.h b/trunk/include/asm-s390/etr.h similarity index 100% rename from trunk/arch/s390/include/asm/etr.h rename to trunk/include/asm-s390/etr.h diff --git a/trunk/arch/s390/include/asm/extmem.h b/trunk/include/asm-s390/extmem.h similarity index 100% rename from trunk/arch/s390/include/asm/extmem.h rename to trunk/include/asm-s390/extmem.h diff --git a/trunk/arch/s390/include/asm/fb.h b/trunk/include/asm-s390/fb.h similarity index 100% rename from trunk/arch/s390/include/asm/fb.h rename to trunk/include/asm-s390/fb.h diff --git a/trunk/arch/s390/include/asm/fcntl.h b/trunk/include/asm-s390/fcntl.h similarity index 100% rename from trunk/arch/s390/include/asm/fcntl.h rename to trunk/include/asm-s390/fcntl.h diff --git a/trunk/arch/s390/include/asm/fcx.h b/trunk/include/asm-s390/fcx.h similarity index 100% rename from trunk/arch/s390/include/asm/fcx.h rename to trunk/include/asm-s390/fcx.h diff --git a/trunk/arch/s390/include/asm/futex.h b/trunk/include/asm-s390/futex.h similarity index 100% rename from trunk/arch/s390/include/asm/futex.h rename to trunk/include/asm-s390/futex.h diff --git a/trunk/arch/s390/include/asm/hardirq.h b/trunk/include/asm-s390/hardirq.h similarity index 100% rename from trunk/arch/s390/include/asm/hardirq.h rename to trunk/include/asm-s390/hardirq.h diff --git a/trunk/arch/s390/include/asm/hugetlb.h b/trunk/include/asm-s390/hugetlb.h similarity index 100% rename from trunk/arch/s390/include/asm/hugetlb.h rename to trunk/include/asm-s390/hugetlb.h diff --git a/trunk/arch/s390/include/asm/idals.h b/trunk/include/asm-s390/idals.h similarity index 100% rename from trunk/arch/s390/include/asm/idals.h rename to trunk/include/asm-s390/idals.h diff --git a/trunk/arch/s390/include/asm/io.h b/trunk/include/asm-s390/io.h similarity index 100% rename from trunk/arch/s390/include/asm/io.h rename to trunk/include/asm-s390/io.h diff --git a/trunk/arch/s390/include/asm/ioctl.h b/trunk/include/asm-s390/ioctl.h similarity index 100% rename from trunk/arch/s390/include/asm/ioctl.h rename to trunk/include/asm-s390/ioctl.h diff --git a/trunk/arch/s390/include/asm/ioctls.h b/trunk/include/asm-s390/ioctls.h similarity index 100% rename from trunk/arch/s390/include/asm/ioctls.h rename to trunk/include/asm-s390/ioctls.h diff --git a/trunk/arch/s390/include/asm/ipcbuf.h b/trunk/include/asm-s390/ipcbuf.h similarity index 100% rename from trunk/arch/s390/include/asm/ipcbuf.h rename to trunk/include/asm-s390/ipcbuf.h diff --git a/trunk/arch/s390/include/asm/ipl.h b/trunk/include/asm-s390/ipl.h similarity index 100% rename from trunk/arch/s390/include/asm/ipl.h rename to trunk/include/asm-s390/ipl.h diff --git a/trunk/arch/s390/include/asm/irq.h b/trunk/include/asm-s390/irq.h similarity index 100% rename from trunk/arch/s390/include/asm/irq.h rename to trunk/include/asm-s390/irq.h diff --git a/trunk/arch/s390/include/asm/irq_regs.h b/trunk/include/asm-s390/irq_regs.h similarity index 100% rename from trunk/arch/s390/include/asm/irq_regs.h rename to trunk/include/asm-s390/irq_regs.h diff --git a/trunk/arch/s390/include/asm/irqflags.h b/trunk/include/asm-s390/irqflags.h similarity index 100% rename from trunk/arch/s390/include/asm/irqflags.h rename to trunk/include/asm-s390/irqflags.h diff --git a/trunk/arch/s390/include/asm/isc.h b/trunk/include/asm-s390/isc.h similarity index 100% rename from trunk/arch/s390/include/asm/isc.h rename to trunk/include/asm-s390/isc.h diff --git a/trunk/arch/s390/include/asm/itcw.h b/trunk/include/asm-s390/itcw.h similarity index 100% rename from trunk/arch/s390/include/asm/itcw.h rename to trunk/include/asm-s390/itcw.h diff --git a/trunk/arch/s390/include/asm/kdebug.h b/trunk/include/asm-s390/kdebug.h similarity index 100% rename from trunk/arch/s390/include/asm/kdebug.h rename to trunk/include/asm-s390/kdebug.h diff --git a/trunk/arch/s390/include/asm/kexec.h b/trunk/include/asm-s390/kexec.h similarity index 100% rename from trunk/arch/s390/include/asm/kexec.h rename to trunk/include/asm-s390/kexec.h diff --git a/trunk/arch/s390/include/asm/kmap_types.h b/trunk/include/asm-s390/kmap_types.h similarity index 100% rename from trunk/arch/s390/include/asm/kmap_types.h rename to trunk/include/asm-s390/kmap_types.h diff --git a/trunk/arch/s390/include/asm/kprobes.h b/trunk/include/asm-s390/kprobes.h similarity index 100% rename from trunk/arch/s390/include/asm/kprobes.h rename to trunk/include/asm-s390/kprobes.h diff --git a/trunk/arch/s390/include/asm/kvm.h b/trunk/include/asm-s390/kvm.h similarity index 100% rename from trunk/arch/s390/include/asm/kvm.h rename to trunk/include/asm-s390/kvm.h diff --git a/trunk/arch/s390/include/asm/kvm_host.h b/trunk/include/asm-s390/kvm_host.h similarity index 100% rename from trunk/arch/s390/include/asm/kvm_host.h rename to trunk/include/asm-s390/kvm_host.h diff --git a/trunk/arch/s390/include/asm/kvm_para.h b/trunk/include/asm-s390/kvm_para.h similarity index 100% rename from trunk/arch/s390/include/asm/kvm_para.h rename to trunk/include/asm-s390/kvm_para.h diff --git a/trunk/arch/s390/include/asm/kvm_virtio.h b/trunk/include/asm-s390/kvm_virtio.h similarity index 100% rename from trunk/arch/s390/include/asm/kvm_virtio.h rename to trunk/include/asm-s390/kvm_virtio.h diff --git a/trunk/arch/s390/include/asm/linkage.h b/trunk/include/asm-s390/linkage.h similarity index 100% rename from trunk/arch/s390/include/asm/linkage.h rename to trunk/include/asm-s390/linkage.h diff --git a/trunk/arch/s390/include/asm/local.h b/trunk/include/asm-s390/local.h similarity index 100% rename from trunk/arch/s390/include/asm/local.h rename to trunk/include/asm-s390/local.h diff --git a/trunk/arch/s390/include/asm/lowcore.h b/trunk/include/asm-s390/lowcore.h similarity index 100% rename from trunk/arch/s390/include/asm/lowcore.h rename to trunk/include/asm-s390/lowcore.h diff --git a/trunk/arch/s390/include/asm/mathemu.h b/trunk/include/asm-s390/mathemu.h similarity index 100% rename from trunk/arch/s390/include/asm/mathemu.h rename to trunk/include/asm-s390/mathemu.h diff --git a/trunk/arch/s390/include/asm/mman.h b/trunk/include/asm-s390/mman.h similarity index 100% rename from trunk/arch/s390/include/asm/mman.h rename to trunk/include/asm-s390/mman.h diff --git a/trunk/arch/s390/include/asm/mmu.h b/trunk/include/asm-s390/mmu.h similarity index 100% rename from trunk/arch/s390/include/asm/mmu.h rename to trunk/include/asm-s390/mmu.h diff --git a/trunk/arch/s390/include/asm/mmu_context.h b/trunk/include/asm-s390/mmu_context.h similarity index 100% rename from trunk/arch/s390/include/asm/mmu_context.h rename to trunk/include/asm-s390/mmu_context.h diff --git a/trunk/arch/s390/include/asm/module.h b/trunk/include/asm-s390/module.h similarity index 100% rename from trunk/arch/s390/include/asm/module.h rename to trunk/include/asm-s390/module.h diff --git a/trunk/arch/s390/include/asm/monwriter.h b/trunk/include/asm-s390/monwriter.h similarity index 100% rename from trunk/arch/s390/include/asm/monwriter.h rename to trunk/include/asm-s390/monwriter.h diff --git a/trunk/arch/s390/include/asm/msgbuf.h b/trunk/include/asm-s390/msgbuf.h similarity index 100% rename from trunk/arch/s390/include/asm/msgbuf.h rename to trunk/include/asm-s390/msgbuf.h diff --git a/trunk/arch/s390/include/asm/mutex.h b/trunk/include/asm-s390/mutex.h similarity index 100% rename from trunk/arch/s390/include/asm/mutex.h rename to trunk/include/asm-s390/mutex.h diff --git a/trunk/arch/s390/include/asm/page.h b/trunk/include/asm-s390/page.h similarity index 100% rename from trunk/arch/s390/include/asm/page.h rename to trunk/include/asm-s390/page.h diff --git a/trunk/arch/s390/include/asm/param.h b/trunk/include/asm-s390/param.h similarity index 100% rename from trunk/arch/s390/include/asm/param.h rename to trunk/include/asm-s390/param.h diff --git a/trunk/arch/s390/include/asm/pci.h b/trunk/include/asm-s390/pci.h similarity index 100% rename from trunk/arch/s390/include/asm/pci.h rename to trunk/include/asm-s390/pci.h diff --git a/trunk/arch/s390/include/asm/percpu.h b/trunk/include/asm-s390/percpu.h similarity index 100% rename from trunk/arch/s390/include/asm/percpu.h rename to trunk/include/asm-s390/percpu.h diff --git a/trunk/arch/s390/include/asm/pgalloc.h b/trunk/include/asm-s390/pgalloc.h similarity index 100% rename from trunk/arch/s390/include/asm/pgalloc.h rename to trunk/include/asm-s390/pgalloc.h diff --git a/trunk/arch/s390/include/asm/pgtable.h b/trunk/include/asm-s390/pgtable.h similarity index 100% rename from trunk/arch/s390/include/asm/pgtable.h rename to trunk/include/asm-s390/pgtable.h diff --git a/trunk/arch/s390/include/asm/poll.h b/trunk/include/asm-s390/poll.h similarity index 100% rename from trunk/arch/s390/include/asm/poll.h rename to trunk/include/asm-s390/poll.h diff --git a/trunk/arch/s390/include/asm/posix_types.h b/trunk/include/asm-s390/posix_types.h similarity index 100% rename from trunk/arch/s390/include/asm/posix_types.h rename to trunk/include/asm-s390/posix_types.h diff --git a/trunk/arch/s390/include/asm/processor.h b/trunk/include/asm-s390/processor.h similarity index 100% rename from trunk/arch/s390/include/asm/processor.h rename to trunk/include/asm-s390/processor.h diff --git a/trunk/arch/s390/include/asm/ptrace.h b/trunk/include/asm-s390/ptrace.h similarity index 100% rename from trunk/arch/s390/include/asm/ptrace.h rename to trunk/include/asm-s390/ptrace.h diff --git a/trunk/arch/s390/include/asm/qdio.h b/trunk/include/asm-s390/qdio.h similarity index 100% rename from trunk/arch/s390/include/asm/qdio.h rename to trunk/include/asm-s390/qdio.h diff --git a/trunk/arch/s390/include/asm/qeth.h b/trunk/include/asm-s390/qeth.h similarity index 100% rename from trunk/arch/s390/include/asm/qeth.h rename to trunk/include/asm-s390/qeth.h diff --git a/trunk/arch/s390/include/asm/reset.h b/trunk/include/asm-s390/reset.h similarity index 100% rename from trunk/arch/s390/include/asm/reset.h rename to trunk/include/asm-s390/reset.h diff --git a/trunk/arch/s390/include/asm/resource.h b/trunk/include/asm-s390/resource.h similarity index 100% rename from trunk/arch/s390/include/asm/resource.h rename to trunk/include/asm-s390/resource.h diff --git a/trunk/arch/s390/include/asm/rwsem.h b/trunk/include/asm-s390/rwsem.h similarity index 100% rename from trunk/arch/s390/include/asm/rwsem.h rename to trunk/include/asm-s390/rwsem.h diff --git a/trunk/arch/s390/include/asm/s390_ext.h b/trunk/include/asm-s390/s390_ext.h similarity index 100% rename from trunk/arch/s390/include/asm/s390_ext.h rename to trunk/include/asm-s390/s390_ext.h diff --git a/trunk/arch/s390/include/asm/s390_rdev.h b/trunk/include/asm-s390/s390_rdev.h similarity index 100% rename from trunk/arch/s390/include/asm/s390_rdev.h rename to trunk/include/asm-s390/s390_rdev.h diff --git a/trunk/arch/s390/include/asm/scatterlist.h b/trunk/include/asm-s390/scatterlist.h similarity index 100% rename from trunk/arch/s390/include/asm/scatterlist.h rename to trunk/include/asm-s390/scatterlist.h diff --git a/trunk/arch/s390/include/asm/schid.h b/trunk/include/asm-s390/schid.h similarity index 100% rename from trunk/arch/s390/include/asm/schid.h rename to trunk/include/asm-s390/schid.h diff --git a/trunk/arch/s390/include/asm/sclp.h b/trunk/include/asm-s390/sclp.h similarity index 100% rename from trunk/arch/s390/include/asm/sclp.h rename to trunk/include/asm-s390/sclp.h diff --git a/trunk/arch/s390/include/asm/sections.h b/trunk/include/asm-s390/sections.h similarity index 100% rename from trunk/arch/s390/include/asm/sections.h rename to trunk/include/asm-s390/sections.h diff --git a/trunk/arch/s390/include/asm/segment.h b/trunk/include/asm-s390/segment.h similarity index 100% rename from trunk/arch/s390/include/asm/segment.h rename to trunk/include/asm-s390/segment.h diff --git a/trunk/arch/s390/include/asm/sembuf.h b/trunk/include/asm-s390/sembuf.h similarity index 100% rename from trunk/arch/s390/include/asm/sembuf.h rename to trunk/include/asm-s390/sembuf.h diff --git a/trunk/arch/s390/include/asm/setup.h b/trunk/include/asm-s390/setup.h similarity index 100% rename from trunk/arch/s390/include/asm/setup.h rename to trunk/include/asm-s390/setup.h diff --git a/trunk/arch/s390/include/asm/sfp-machine.h b/trunk/include/asm-s390/sfp-machine.h similarity index 100% rename from trunk/arch/s390/include/asm/sfp-machine.h rename to trunk/include/asm-s390/sfp-machine.h diff --git a/trunk/arch/s390/include/asm/sfp-util.h b/trunk/include/asm-s390/sfp-util.h similarity index 100% rename from trunk/arch/s390/include/asm/sfp-util.h rename to trunk/include/asm-s390/sfp-util.h diff --git a/trunk/arch/s390/include/asm/shmbuf.h b/trunk/include/asm-s390/shmbuf.h similarity index 100% rename from trunk/arch/s390/include/asm/shmbuf.h rename to trunk/include/asm-s390/shmbuf.h diff --git a/trunk/arch/s390/include/asm/shmparam.h b/trunk/include/asm-s390/shmparam.h similarity index 100% rename from trunk/arch/s390/include/asm/shmparam.h rename to trunk/include/asm-s390/shmparam.h diff --git a/trunk/arch/s390/include/asm/sigcontext.h b/trunk/include/asm-s390/sigcontext.h similarity index 100% rename from trunk/arch/s390/include/asm/sigcontext.h rename to trunk/include/asm-s390/sigcontext.h diff --git a/trunk/arch/s390/include/asm/siginfo.h b/trunk/include/asm-s390/siginfo.h similarity index 100% rename from trunk/arch/s390/include/asm/siginfo.h rename to trunk/include/asm-s390/siginfo.h diff --git a/trunk/arch/s390/include/asm/signal.h b/trunk/include/asm-s390/signal.h similarity index 100% rename from trunk/arch/s390/include/asm/signal.h rename to trunk/include/asm-s390/signal.h diff --git a/trunk/arch/s390/include/asm/sigp.h b/trunk/include/asm-s390/sigp.h similarity index 100% rename from trunk/arch/s390/include/asm/sigp.h rename to trunk/include/asm-s390/sigp.h diff --git a/trunk/arch/s390/include/asm/smp.h b/trunk/include/asm-s390/smp.h similarity index 100% rename from trunk/arch/s390/include/asm/smp.h rename to trunk/include/asm-s390/smp.h diff --git a/trunk/arch/s390/include/asm/socket.h b/trunk/include/asm-s390/socket.h similarity index 100% rename from trunk/arch/s390/include/asm/socket.h rename to trunk/include/asm-s390/socket.h diff --git a/trunk/arch/s390/include/asm/sockios.h b/trunk/include/asm-s390/sockios.h similarity index 100% rename from trunk/arch/s390/include/asm/sockios.h rename to trunk/include/asm-s390/sockios.h diff --git a/trunk/arch/s390/include/asm/sparsemem.h b/trunk/include/asm-s390/sparsemem.h similarity index 100% rename from trunk/arch/s390/include/asm/sparsemem.h rename to trunk/include/asm-s390/sparsemem.h diff --git a/trunk/arch/s390/include/asm/spinlock.h b/trunk/include/asm-s390/spinlock.h similarity index 100% rename from trunk/arch/s390/include/asm/spinlock.h rename to trunk/include/asm-s390/spinlock.h diff --git a/trunk/arch/s390/include/asm/spinlock_types.h b/trunk/include/asm-s390/spinlock_types.h similarity index 100% rename from trunk/arch/s390/include/asm/spinlock_types.h rename to trunk/include/asm-s390/spinlock_types.h diff --git a/trunk/arch/s390/include/asm/stat.h b/trunk/include/asm-s390/stat.h similarity index 100% rename from trunk/arch/s390/include/asm/stat.h rename to trunk/include/asm-s390/stat.h diff --git a/trunk/arch/s390/include/asm/statfs.h b/trunk/include/asm-s390/statfs.h similarity index 100% rename from trunk/arch/s390/include/asm/statfs.h rename to trunk/include/asm-s390/statfs.h diff --git a/trunk/arch/s390/include/asm/string.h b/trunk/include/asm-s390/string.h similarity index 100% rename from trunk/arch/s390/include/asm/string.h rename to trunk/include/asm-s390/string.h diff --git a/trunk/arch/s390/include/asm/suspend.h b/trunk/include/asm-s390/suspend.h similarity index 100% rename from trunk/arch/s390/include/asm/suspend.h rename to trunk/include/asm-s390/suspend.h diff --git a/trunk/arch/s390/include/asm/sysinfo.h b/trunk/include/asm-s390/sysinfo.h similarity index 100% rename from trunk/arch/s390/include/asm/sysinfo.h rename to trunk/include/asm-s390/sysinfo.h diff --git a/trunk/arch/s390/include/asm/system.h b/trunk/include/asm-s390/system.h similarity index 100% rename from trunk/arch/s390/include/asm/system.h rename to trunk/include/asm-s390/system.h diff --git a/trunk/arch/s390/include/asm/tape390.h b/trunk/include/asm-s390/tape390.h similarity index 100% rename from trunk/arch/s390/include/asm/tape390.h rename to trunk/include/asm-s390/tape390.h diff --git a/trunk/arch/s390/include/asm/termbits.h b/trunk/include/asm-s390/termbits.h similarity index 100% rename from trunk/arch/s390/include/asm/termbits.h rename to trunk/include/asm-s390/termbits.h diff --git a/trunk/arch/s390/include/asm/termios.h b/trunk/include/asm-s390/termios.h similarity index 100% rename from trunk/arch/s390/include/asm/termios.h rename to trunk/include/asm-s390/termios.h diff --git a/trunk/arch/s390/include/asm/thread_info.h b/trunk/include/asm-s390/thread_info.h similarity index 100% rename from trunk/arch/s390/include/asm/thread_info.h rename to trunk/include/asm-s390/thread_info.h diff --git a/trunk/arch/s390/include/asm/timer.h b/trunk/include/asm-s390/timer.h similarity index 100% rename from trunk/arch/s390/include/asm/timer.h rename to trunk/include/asm-s390/timer.h diff --git a/trunk/arch/s390/include/asm/timex.h b/trunk/include/asm-s390/timex.h similarity index 100% rename from trunk/arch/s390/include/asm/timex.h rename to trunk/include/asm-s390/timex.h diff --git a/trunk/arch/s390/include/asm/tlb.h b/trunk/include/asm-s390/tlb.h similarity index 100% rename from trunk/arch/s390/include/asm/tlb.h rename to trunk/include/asm-s390/tlb.h diff --git a/trunk/arch/s390/include/asm/tlbflush.h b/trunk/include/asm-s390/tlbflush.h similarity index 100% rename from trunk/arch/s390/include/asm/tlbflush.h rename to trunk/include/asm-s390/tlbflush.h diff --git a/trunk/arch/s390/include/asm/todclk.h b/trunk/include/asm-s390/todclk.h similarity index 100% rename from trunk/arch/s390/include/asm/todclk.h rename to trunk/include/asm-s390/todclk.h diff --git a/trunk/arch/s390/include/asm/topology.h b/trunk/include/asm-s390/topology.h similarity index 100% rename from trunk/arch/s390/include/asm/topology.h rename to trunk/include/asm-s390/topology.h diff --git a/trunk/arch/s390/include/asm/types.h b/trunk/include/asm-s390/types.h similarity index 100% rename from trunk/arch/s390/include/asm/types.h rename to trunk/include/asm-s390/types.h diff --git a/trunk/arch/s390/include/asm/uaccess.h b/trunk/include/asm-s390/uaccess.h similarity index 100% rename from trunk/arch/s390/include/asm/uaccess.h rename to trunk/include/asm-s390/uaccess.h diff --git a/trunk/arch/s390/include/asm/ucontext.h b/trunk/include/asm-s390/ucontext.h similarity index 100% rename from trunk/arch/s390/include/asm/ucontext.h rename to trunk/include/asm-s390/ucontext.h diff --git a/trunk/arch/s390/include/asm/unaligned.h b/trunk/include/asm-s390/unaligned.h similarity index 100% rename from trunk/arch/s390/include/asm/unaligned.h rename to trunk/include/asm-s390/unaligned.h diff --git a/trunk/arch/s390/include/asm/unistd.h b/trunk/include/asm-s390/unistd.h similarity index 100% rename from trunk/arch/s390/include/asm/unistd.h rename to trunk/include/asm-s390/unistd.h diff --git a/trunk/arch/s390/include/asm/user.h b/trunk/include/asm-s390/user.h similarity index 100% rename from trunk/arch/s390/include/asm/user.h rename to trunk/include/asm-s390/user.h diff --git a/trunk/arch/s390/include/asm/vtoc.h b/trunk/include/asm-s390/vtoc.h similarity index 100% rename from trunk/arch/s390/include/asm/vtoc.h rename to trunk/include/asm-s390/vtoc.h diff --git a/trunk/arch/s390/include/asm/xor.h b/trunk/include/asm-s390/xor.h similarity index 100% rename from trunk/arch/s390/include/asm/xor.h rename to trunk/include/asm-s390/xor.h diff --git a/trunk/arch/s390/include/asm/zcrypt.h b/trunk/include/asm-s390/zcrypt.h similarity index 100% rename from trunk/arch/s390/include/asm/zcrypt.h rename to trunk/include/asm-s390/zcrypt.h diff --git a/trunk/include/linux/buffer_head.h b/trunk/include/linux/buffer_head.h index eadaab44015f..50cfe8ceb478 100644 --- a/trunk/include/linux/buffer_head.h +++ b/trunk/include/linux/buffer_head.h @@ -115,6 +115,7 @@ BUFFER_FNS(Uptodate, uptodate) BUFFER_FNS(Dirty, dirty) TAS_BUFFER_FNS(Dirty, dirty) BUFFER_FNS(Lock, locked) +TAS_BUFFER_FNS(Lock, locked) BUFFER_FNS(Req, req) TAS_BUFFER_FNS(Req, req) BUFFER_FNS(Mapped, mapped) @@ -320,15 +321,10 @@ static inline void wait_on_buffer(struct buffer_head *bh) __wait_on_buffer(bh); } -static inline int trylock_buffer(struct buffer_head *bh) -{ - return likely(!test_and_set_bit(BH_Lock, &bh->b_state)); -} - static inline void lock_buffer(struct buffer_head *bh) { might_sleep(); - if (!trylock_buffer(bh)) + if (test_set_buffer_locked(bh)) __lock_buffer(bh); } diff --git a/trunk/include/linux/ide.h b/trunk/include/linux/ide.h index 87c12ed96954..b846bc44a27e 100644 --- a/trunk/include/linux/ide.h +++ b/trunk/include/linux/ide.h @@ -219,7 +219,18 @@ static inline int __ide_default_irq(unsigned long base) #include #endif -#define MAX_HWIFS 10 +#ifndef MAX_HWIFS +#if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA) +# define MAX_HWIFS 1 +#else +# define MAX_HWIFS 10 +#endif +#endif + +#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) +#undef MAX_HWIFS +#define MAX_HWIFS CONFIG_IDE_MAX_HWIFS +#endif /* Currently only m68k, apus and m8xx need it */ #ifndef IDE_ARCH_ACK_INTR @@ -498,33 +509,24 @@ struct ide_tp_ops { extern const struct ide_tp_ops default_tp_ops; -/** - * struct ide_port_ops - IDE port operations - * - * @init_dev: host specific initialization of a device - * @set_pio_mode: routine to program host for PIO mode - * @set_dma_mode: routine to program host for DMA mode - * @selectproc: tweaks hardware to select drive - * @reset_poll: chipset polling based on hba specifics - * @pre_reset: chipset specific changes to default for device-hba resets - * @resetproc: routine to reset controller after a disk reset - * @maskproc: special host masking for drive selection - * @quirkproc: check host's drive quirk list - * - * @mdma_filter: filter MDMA modes - * @udma_filter: filter UDMA modes - * - * @cable_detect: detect cable type - */ struct ide_port_ops { + /* host specific initialization of a device */ void (*init_dev)(ide_drive_t *); + /* routine to program host for PIO mode */ void (*set_pio_mode)(ide_drive_t *, const u8); + /* routine to program host for DMA mode */ void (*set_dma_mode)(ide_drive_t *, const u8); + /* tweaks hardware to select drive */ void (*selectproc)(ide_drive_t *); + /* chipset polling based on hba specifics */ int (*reset_poll)(ide_drive_t *); + /* chipset specific changes to default for device-hba resets */ void (*pre_reset)(ide_drive_t *); + /* routine to reset controller after a disk reset */ void (*resetproc)(ide_drive_t *); + /* special host masking for drive selection */ void (*maskproc)(ide_drive_t *, int); + /* check host's drive quirk list */ void (*quirkproc)(ide_drive_t *); u8 (*mdma_filter)(ide_drive_t *); diff --git a/trunk/include/linux/ieee80211.h b/trunk/include/linux/ieee80211.h index 7f4df7c7659d..a1630ba0b87c 100644 --- a/trunk/include/linux/ieee80211.h +++ b/trunk/include/linux/ieee80211.h @@ -506,19 +506,6 @@ struct ieee80211_channel_sw_ie { u8 count; } __attribute__ ((packed)); -/** - * struct ieee80211_tim - * - * This structure refers to "Traffic Indication Map information element" - */ -struct ieee80211_tim_ie { - u8 dtim_count; - u8 dtim_period; - u8 bitmap_ctrl; - /* variable size: 1 - 251 bytes */ - u8 virtual_map[0]; -} __attribute__ ((packed)); - struct ieee80211_mgmt { __le16 frame_control; __le16 duration; diff --git a/trunk/include/linux/ihex.h b/trunk/include/linux/ihex.h index 31d8629e75a1..2baace2788a7 100644 --- a/trunk/include/linux/ihex.h +++ b/trunk/include/linux/ihex.h @@ -18,7 +18,7 @@ struct ihex_binrec { __be32 addr; __be16 len; uint8_t data[0]; -} __attribute__((packed)); +} __attribute__((aligned(4))); /* Find the next record, taking into account the 4-byte alignment */ static inline const struct ihex_binrec * diff --git a/trunk/include/linux/interrupt.h b/trunk/include/linux/interrupt.h index 58ff4e74b2f3..62aa4f895abe 100644 --- a/trunk/include/linux/interrupt.h +++ b/trunk/include/linux/interrupt.h @@ -223,6 +223,35 @@ static inline int disable_irq_wake(unsigned int irq) #define or_softirq_pending(x) (local_softirq_pending() |= (x)) #endif +/* + * Temporary defines for UP kernels, until all code gets fixed. + */ +#ifndef CONFIG_SMP +static inline void __deprecated cli(void) +{ + local_irq_disable(); +} +static inline void __deprecated sti(void) +{ + local_irq_enable(); +} +static inline void __deprecated save_flags(unsigned long *x) +{ + local_save_flags(*x); +} +#define save_flags(x) save_flags(&x) +static inline void __deprecated restore_flags(unsigned long x) +{ + local_irq_restore(x); +} + +static inline void __deprecated save_and_cli(unsigned long *x) +{ + local_irq_save(*x); +} +#define save_and_cli(x) save_and_cli(&x) +#endif /* CONFIG_SMP */ + /* Some architectures might implement lazy enabling/disabling of * interrupts. In some cases, such as stop_machine, we might want * to ensure that after a local_irq_disable(), interrupts have diff --git a/trunk/include/linux/kexec.h b/trunk/include/linux/kexec.h index 32110cede64f..82f88a8a827b 100644 --- a/trunk/include/linux/kexec.h +++ b/trunk/include/linux/kexec.h @@ -130,8 +130,8 @@ void vmcoreinfo_append_str(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); unsigned long paddr_vmcoreinfo_note(void); -#define VMCOREINFO_OSRELEASE(value) \ - vmcoreinfo_append_str("OSRELEASE=%s\n", value) +#define VMCOREINFO_OSRELEASE(name) \ + vmcoreinfo_append_str("OSRELEASE=%s\n", #name) #define VMCOREINFO_PAGESIZE(value) \ vmcoreinfo_append_str("PAGESIZE=%ld\n", value) #define VMCOREINFO_SYMBOL(name) \ diff --git a/trunk/include/linux/mISDNif.h b/trunk/include/linux/mISDNif.h index 8f2d60da04e7..5c948f337817 100644 --- a/trunk/include/linux/mISDNif.h +++ b/trunk/include/linux/mISDNif.h @@ -37,7 +37,7 @@ */ #define MISDN_MAJOR_VERSION 1 #define MISDN_MINOR_VERSION 0 -#define MISDN_RELEASE 19 +#define MISDN_RELEASE 18 /* primitives for information exchange * generell format @@ -242,8 +242,7 @@ struct mISDNhead { #define TEI_SAPI 63 #define CTRL_SAPI 0 -#define MISDN_MAX_CHANNEL 127 -#define MISDN_CHMAP_SIZE ((MISDN_MAX_CHANNEL + 1) >> 3) +#define MISDN_CHMAP_SIZE 4 #define SOL_MISDN 0 @@ -276,32 +275,11 @@ struct mISDN_devinfo { u_int Dprotocols; u_int Bprotocols; u_int protocol; - u_char channelmap[MISDN_CHMAP_SIZE]; + u_long channelmap[MISDN_CHMAP_SIZE]; u_int nrbchan; char name[MISDN_MAX_IDLEN]; }; -static inline int -test_channelmap(u_int nr, u_char *map) -{ - if (nr <= MISDN_MAX_CHANNEL) - return map[nr >> 3] & (1 << (nr & 7)); - else - return 0; -} - -static inline void -set_channelmap(u_int nr, u_char *map) -{ - map[nr >> 3] |= (1 << (nr & 7)); -} - -static inline void -clear_channelmap(u_int nr, u_char *map) -{ - map[nr >> 3] &= ~(1 << (nr & 7)); -} - /* CONTROL_CHANNEL parameters */ #define MISDN_CTRL_GETOP 0x0000 #define MISDN_CTRL_LOOP 0x0001 @@ -427,7 +405,7 @@ struct mISDNdevice { u_int Dprotocols; u_int Bprotocols; u_int nrbchan; - u_char channelmap[MISDN_CHMAP_SIZE]; + u_long channelmap[MISDN_CHMAP_SIZE]; struct list_head bchannels; struct mISDNchannel *teimgr; struct device dev; @@ -452,7 +430,7 @@ struct mISDNstack { #endif }; -/* global alloc/queue functions */ +/* global alloc/queue dunctions */ static inline struct sk_buff * mI_alloc_skb(unsigned int len, gfp_t gfp_mask) diff --git a/trunk/include/linux/maple.h b/trunk/include/linux/maple.h index c23d3f51ba40..c853b1066018 100644 --- a/trunk/include/linux/maple.h +++ b/trunk/include/linux/maple.h @@ -51,6 +51,7 @@ struct maple_devinfo { struct maple_device { struct maple_driver *driver; struct mapleq *mq; + void *private_data; void (*callback) (struct mapleq * mq); unsigned long when, interval, function; struct maple_devinfo devinfo; @@ -69,9 +70,7 @@ void maple_getcond_callback(struct maple_device *dev, void (*callback) (struct mapleq * mq), unsigned long interval, unsigned long function); -int maple_driver_register(struct maple_driver *); -void maple_driver_unregister(struct maple_driver *); - +int maple_driver_register(struct device_driver *drv); int maple_add_packet_sleeps(struct maple_device *mdev, u32 function, u32 command, u32 length, void *data); void maple_clear_dev(struct maple_device *mdev); @@ -79,7 +78,4 @@ void maple_clear_dev(struct maple_device *mdev); #define to_maple_dev(n) container_of(n, struct maple_device, dev) #define to_maple_driver(n) container_of(n, struct maple_driver, drv) -#define maple_get_drvdata(d) dev_get_drvdata(&(d)->dev) -#define maple_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) - #endif /* __LINUX_MAPLE_H */ diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h index 488c56e649b5..ee583f642a9f 100644 --- a/trunk/include/linux/netdevice.h +++ b/trunk/include/linux/netdevice.h @@ -61,7 +61,9 @@ struct wireless_dev; #define NET_XMIT_DROP 1 /* skb dropped */ #define NET_XMIT_CN 2 /* congestion notification */ #define NET_XMIT_POLICED 3 /* skb is shot by police */ -#define NET_XMIT_MASK 0xFFFF /* qdisc flags in net/sch_generic.h */ +#define NET_XMIT_BYPASS 4 /* packet does not leave via dequeue; + (TC use only - dev_queue_xmit + returns this as NET_XMIT_SUCCESS) */ /* Backlog congestion levels */ #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ diff --git a/trunk/include/linux/page-flags.h b/trunk/include/linux/page-flags.h index c74d3e875314..25aaccdb2f26 100644 --- a/trunk/include/linux/page-flags.h +++ b/trunk/include/linux/page-flags.h @@ -163,7 +163,7 @@ static inline int Page##uname(struct page *page) \ struct page; /* forward declaration */ -TESTPAGEFLAG(Locked, locked) +PAGEFLAG(Locked, locked) TESTSCFLAG(Locked, locked) PAGEFLAG(Error, error) PAGEFLAG(Referenced, referenced) TESTCLEARFLAG(Referenced, referenced) PAGEFLAG(Dirty, dirty) TESTSCFLAG(Dirty, dirty) __CLEARPAGEFLAG(Dirty, dirty) diff --git a/trunk/include/linux/pagemap.h b/trunk/include/linux/pagemap.h index 5da31c12101c..69ed3cb1197a 100644 --- a/trunk/include/linux/pagemap.h +++ b/trunk/include/linux/pagemap.h @@ -250,6 +250,29 @@ static inline struct page *read_mapping_page(struct address_space *mapping, return read_cache_page(mapping, index, filler, data); } +int add_to_page_cache_locked(struct page *page, struct address_space *mapping, + pgoff_t index, gfp_t gfp_mask); +int add_to_page_cache_lru(struct page *page, struct address_space *mapping, + pgoff_t index, gfp_t gfp_mask); +extern void remove_from_page_cache(struct page *page); +extern void __remove_from_page_cache(struct page *page); + +/* + * Like add_to_page_cache_locked, but used to add newly allocated pages: + * the page is new, so we can just run SetPageLocked() against it. + */ +static inline int add_to_page_cache(struct page *page, + struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) +{ + int error; + + SetPageLocked(page); + error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); + if (unlikely(error)) + ClearPageLocked(page); + return error; +} + /* * Return byte-offset into filesystem object for page. */ @@ -271,28 +294,13 @@ extern int __lock_page_killable(struct page *page); extern void __lock_page_nosync(struct page *page); extern void unlock_page(struct page *page); -static inline void set_page_locked(struct page *page) -{ - set_bit(PG_locked, &page->flags); -} - -static inline void clear_page_locked(struct page *page) -{ - clear_bit(PG_locked, &page->flags); -} - -static inline int trylock_page(struct page *page) -{ - return !test_and_set_bit(PG_locked, &page->flags); -} - /* * lock_page may only be called if we have the page's inode pinned. */ static inline void lock_page(struct page *page) { might_sleep(); - if (!trylock_page(page)) + if (TestSetPageLocked(page)) __lock_page(page); } @@ -304,7 +312,7 @@ static inline void lock_page(struct page *page) static inline int lock_page_killable(struct page *page) { might_sleep(); - if (!trylock_page(page)) + if (TestSetPageLocked(page)) return __lock_page_killable(page); return 0; } @@ -316,7 +324,7 @@ static inline int lock_page_killable(struct page *page) static inline void lock_page_nosync(struct page *page) { might_sleep(); - if (!trylock_page(page)) + if (TestSetPageLocked(page)) __lock_page_nosync(page); } @@ -401,27 +409,4 @@ static inline int fault_in_pages_readable(const char __user *uaddr, int size) return ret; } -int add_to_page_cache_locked(struct page *page, struct address_space *mapping, - pgoff_t index, gfp_t gfp_mask); -int add_to_page_cache_lru(struct page *page, struct address_space *mapping, - pgoff_t index, gfp_t gfp_mask); -extern void remove_from_page_cache(struct page *page); -extern void __remove_from_page_cache(struct page *page); - -/* - * Like add_to_page_cache_locked, but used to add newly allocated pages: - * the page is new, so we can just run set_page_locked() against it. - */ -static inline int add_to_page_cache(struct page *page, - struct address_space *mapping, pgoff_t offset, gfp_t gfp_mask) -{ - int error; - - set_page_locked(page); - error = add_to_page_cache_locked(page, mapping, offset, gfp_mask); - if (unlikely(error)) - clear_page_locked(page); - return error; -} - #endif /* _LINUX_PAGEMAP_H */ diff --git a/trunk/include/linux/parser.h b/trunk/include/linux/parser.h index 7dcd05075756..cc554ca8bc78 100644 --- a/trunk/include/linux/parser.h +++ b/trunk/include/linux/parser.h @@ -14,7 +14,7 @@ struct match_token { const char *pattern; }; -typedef struct match_token match_table_t[]; +typedef const struct match_token match_table_t[]; /* Maximum number of arguments that match_token will find in a pattern */ enum {MAX_OPT_ARGS = 3}; diff --git a/trunk/include/linux/pm_qos_params.h b/trunk/include/linux/pm_qos_params.h index d74f75ed1e47..2e4e97bd19f7 100644 --- a/trunk/include/linux/pm_qos_params.h +++ b/trunk/include/linux/pm_qos_params.h @@ -1,6 +1,6 @@ /* interface for the pm_qos_power infrastructure of the linux kernel. * - * Mark Gross + * Mark Gross */ #include #include diff --git a/trunk/include/linux/spi/orion_spi.h b/trunk/include/linux/spi/orion_spi.h deleted file mode 100644 index b4d9fa6f797c..000000000000 --- a/trunk/include/linux/spi/orion_spi.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * orion_spi.h - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#ifndef __LINUX_SPI_ORION_SPI_H -#define __LINUX_SPI_ORION_SPI_H - -struct orion_spi_info { - u32 tclk; /* no support yet */ -}; - - -#endif diff --git a/trunk/include/linux/tracehook.h b/trunk/include/linux/tracehook.h index ab3ef7aefa95..12532839f508 100644 --- a/trunk/include/linux/tracehook.h +++ b/trunk/include/linux/tracehook.h @@ -487,9 +487,6 @@ static inline int tracehook_notify_jctl(int notify, int why) return notify || (current->ptrace & PT_PTRACED); } -#define DEATH_REAP -1 -#define DEATH_DELAYED_GROUP_LEADER -2 - /** * tracehook_notify_death - task is dead, ready to notify parent * @task: @current task now exiting @@ -504,6 +501,8 @@ static inline int tracehook_notify_jctl(int notify, int why) * * Called with write_lock_irq(&tasklist_lock) held. */ +#define DEATH_REAP -1 +#define DEATH_DELAYED_GROUP_LEADER -2 static inline int tracehook_notify_death(struct task_struct *task, void **death_cookie, int group_dead) { diff --git a/trunk/include/linux/vt_kern.h b/trunk/include/linux/vt_kern.h index 1c78d56c57e5..8c8119ffee12 100644 --- a/trunk/include/linux/vt_kern.h +++ b/trunk/include/linux/vt_kern.h @@ -86,7 +86,6 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); #define con_copy_unimap(d, s) (0) #define con_get_unimap(vc, ct, uct, list) (-EINVAL) #define con_free_unimap(vc) do { ; } while (0) -#define con_protect_unimap(vc, rdonly) do { ; } while (0) #define vc_translate(vc, c) (c) #endif diff --git a/trunk/include/net/dst.h b/trunk/include/net/dst.h index 8a8b71e5f3f1..c5c318a628f8 100644 --- a/trunk/include/net/dst.h +++ b/trunk/include/net/dst.h @@ -252,7 +252,17 @@ static inline int dst_output(struct sk_buff *skb) /* Input packet from network to transport. */ static inline int dst_input(struct sk_buff *skb) { - return skb->dst->input(skb); + int err; + + for (;;) { + err = skb->dst->input(skb); + + if (likely(err == 0)) + return err; + /* Oh, Jamal... Seems, I will not forgive you this mess. :-) */ + if (unlikely(err != NET_XMIT_BYPASS)) + return err; + } } static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie) diff --git a/trunk/include/net/flow.h b/trunk/include/net/flow.h index 228b2477ceec..ad16e0076c89 100644 --- a/trunk/include/net/flow.h +++ b/trunk/include/net/flow.h @@ -47,6 +47,7 @@ struct flowi { #define fl4_scope nl_u.ip4_u.scope __u8 proto; + __u8 flags; union { struct { __be16 sport; diff --git a/trunk/include/net/mac80211.h b/trunk/include/net/mac80211.h index b397e4d984c7..b52721008be8 100644 --- a/trunk/include/net/mac80211.h +++ b/trunk/include/net/mac80211.h @@ -177,10 +177,9 @@ enum ieee80211_bss_change { * @aid: association ID number, valid only when @assoc is true * @use_cts_prot: use CTS protection * @use_short_preamble: use 802.11b short preamble - * @dtim_period: num of beacons before the next DTIM, for PSM * @timestamp: beacon timestamp * @beacon_int: beacon interval - * @assoc_capability: capabilities taken from assoc resp + * @assoc_capability: capabbilities taken from assoc resp * @assoc_ht: association in HT mode * @ht_conf: ht capabilities * @ht_bss_conf: ht extended capabilities @@ -192,7 +191,6 @@ struct ieee80211_bss_conf { /* erp related data */ bool use_cts_prot; bool use_short_preamble; - u8 dtim_period; u16 beacon_int; u16 assoc_capability; u64 timestamp; @@ -432,7 +430,6 @@ enum ieee80211_conf_flags { * @radio_enabled: when zero, driver is required to switch off the radio. * TODO make a flag * @beacon_int: beacon interval (TODO make interface config) - * @listen_interval: listen interval in units of beacon interval * @flags: configuration flags defined above * @power_level: requested transmit power (in dBm) * @max_antenna_gain: maximum antenna gain (in dBi) @@ -447,7 +444,6 @@ struct ieee80211_conf { int radio_enabled; int beacon_int; - u16 listen_interval; u32 flags; int power_level; int max_antenna_gain; @@ -789,9 +785,6 @@ enum ieee80211_hw_flags { * @max_signal: Maximum value for signal (rssi) in RX information, used * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB * - * @max_listen_interval: max listen interval in units of beacon interval - * that HW supports - * * @queues: number of available hardware transmit queues for * data packets. WMM/QoS requires at least four, these * queues need to have configurable access parameters. @@ -819,9 +812,7 @@ struct ieee80211_hw { unsigned int extra_tx_headroom; int channel_change_time; int vif_data_size; - u16 queues; - u16 ampdu_queues; - u16 max_listen_interval; + u16 queues, ampdu_queues; s8 max_signal; }; diff --git a/trunk/include/net/sch_generic.h b/trunk/include/net/sch_generic.h index a7abfda3e447..b5f40d7ef724 100644 --- a/trunk/include/net/sch_generic.h +++ b/trunk/include/net/sch_generic.h @@ -193,22 +193,10 @@ static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc) return qdisc->dev_queue->qdisc; } -/* The qdisc root lock is a mechanism by which to top level - * of a qdisc tree can be locked from any qdisc node in the - * forest. This allows changing the configuration of some - * aspect of the qdisc tree while blocking out asynchronous - * qdisc access in the packet processing paths. - * - * It is only legal to do this when the root will not change - * on us. Otherwise we'll potentially lock the wrong qdisc - * root. This is enforced by holding the RTNL semaphore, which - * all users of this lock accessor must do. - */ static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc) { struct Qdisc *root = qdisc_root(qdisc); - ASSERT_RTNL(); return qdisc_lock(root); } @@ -343,18 +331,6 @@ static inline unsigned int qdisc_pkt_len(struct sk_buff *skb) return qdisc_skb_cb(skb)->pkt_len; } -/* additional qdisc xmit flags (NET_XMIT_MASK in linux/netdevice.h) */ -enum net_xmit_qdisc_t { - __NET_XMIT_STOLEN = 0x00010000, - __NET_XMIT_BYPASS = 0x00020000, -}; - -#ifdef CONFIG_NET_CLS_ACT -#define net_xmit_drop_count(e) ((e) & __NET_XMIT_STOLEN ? 0 : 1) -#else -#define net_xmit_drop_count(e) (1) -#endif - static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch) { #ifdef CONFIG_NET_SCHED @@ -367,7 +343,7 @@ static inline int qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch) static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch) { qdisc_skb_cb(skb)->pkt_len = skb->len; - return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; + return qdisc_enqueue(skb, sch); } static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, diff --git a/trunk/include/net/sctp/structs.h b/trunk/include/net/sctp/structs.h index ab1c472ea753..535a18f57a13 100644 --- a/trunk/include/net/sctp/structs.h +++ b/trunk/include/net/sctp/structs.h @@ -524,7 +524,8 @@ static inline void sctp_ssn_skip(struct sctp_stream *stream, __u16 id, */ struct sctp_af { int (*sctp_xmit) (struct sk_buff *skb, - struct sctp_transport *); + struct sctp_transport *, + int ipfragok); int (*setsockopt) (struct sock *sk, int level, int optname, diff --git a/trunk/include/video/radeon.h b/trunk/include/video/radeon.h index 95a1f2038b1d..83467e18f5e9 100644 --- a/trunk/include/video/radeon.h +++ b/trunk/include/video/radeon.h @@ -527,9 +527,8 @@ /* DSTCACHE_CTLSTAT bit constants */ -#define RB2D_DC_FLUSH_2D (1 << 0) -#define RB2D_DC_FREE_2D (1 << 2) -#define RB2D_DC_FLUSH_ALL (RB2D_DC_FLUSH_2D | RB2D_DC_FREE_2D) +#define RB2D_DC_FLUSH (3 << 0) +#define RB2D_DC_FLUSH_ALL 0xf #define RB2D_DC_BUSY (1 << 31) diff --git a/trunk/init/main.c b/trunk/init/main.c index 0bc7e167bf45..9c3b68b86ca0 100644 --- a/trunk/init/main.c +++ b/trunk/init/main.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/trunk/kernel/auditsc.c b/trunk/kernel/auditsc.c index 972f8e61d36a..496c3dd37276 100644 --- a/trunk/kernel/auditsc.c +++ b/trunk/kernel/auditsc.c @@ -243,9 +243,6 @@ static inline int open_arg(int flags, int mask) static int audit_match_perm(struct audit_context *ctx, int mask) { - if (unlikely(!ctx)) - return 0; - unsigned n = ctx->major; switch (audit_classify_syscall(ctx->arch, n)) { case 0: /* native */ @@ -287,10 +284,6 @@ static int audit_match_filetype(struct audit_context *ctx, int which) { unsigned index = which & ~S_IFMT; mode_t mode = which & S_IFMT; - - if (unlikely(!ctx)) - return 0; - if (index >= ctx->name_count) return 0; if (ctx->names[index].ino == -1) diff --git a/trunk/kernel/dma-coherent.c b/trunk/kernel/dma-coherent.c index 91e96950cd52..7517115a8cce 100644 --- a/trunk/kernel/dma-coherent.c +++ b/trunk/kernel/dma-coherent.c @@ -77,14 +77,15 @@ void *dma_mark_declared_memory_occupied(struct device *dev, { struct dma_coherent_mem *mem = dev->dma_mem; int pos, err; + int pages = (size + (device_addr & ~PAGE_MASK) + PAGE_SIZE - 1); - size += device_addr & ~PAGE_MASK; + pages >>= PAGE_SHIFT; if (!mem) return ERR_PTR(-EINVAL); pos = (device_addr - mem->device_base) >> PAGE_SHIFT; - err = bitmap_allocate_region(mem->bitmap, pos, get_order(size)); + err = bitmap_allocate_region(mem->bitmap, pos, get_order(pages)); if (err != 0) return ERR_PTR(err); return mem->virt_base + (pos << PAGE_SHIFT); diff --git a/trunk/kernel/irq/manage.c b/trunk/kernel/irq/manage.c index 0314074fa232..152abfd3589f 100644 --- a/trunk/kernel/irq/manage.c +++ b/trunk/kernel/irq/manage.c @@ -323,8 +323,7 @@ static int __irq_set_trigger(struct irq_chip *chip, unsigned int irq, ret = chip->set_type(irq, flags & IRQF_TRIGGER_MASK); if (ret) - pr_err("setting trigger mode %d for irq %u failed (%pF)\n", - (int)(flags & IRQF_TRIGGER_MASK), + pr_err("setting flow type for irq %u failed (%pF)\n", irq, chip->set_type); return ret; diff --git a/trunk/kernel/pm_qos_params.c b/trunk/kernel/pm_qos_params.c index da9c2dda6a4e..8cb757026386 100644 --- a/trunk/kernel/pm_qos_params.c +++ b/trunk/kernel/pm_qos_params.c @@ -24,7 +24,7 @@ * requirement that the application has is cleaned up when closes the file * pointer or exits the pm_qos_object will get an opportunity to clean up. * - * Mark Gross + * mark gross mgross@linux.intel.com */ #include @@ -211,8 +211,8 @@ EXPORT_SYMBOL_GPL(pm_qos_requirement); * @value: defines the qos request * * This function inserts a new entry in the pm_qos_class list of requested qos - * performance characteristics. It recomputes the aggregate QoS expectations - * for the pm_qos_class of parameters. + * performance charactoistics. It recomputes the agregate QoS expectations for + * the pm_qos_class of parrameters. */ int pm_qos_add_requirement(int pm_qos_class, char *name, s32 value) { @@ -250,10 +250,10 @@ EXPORT_SYMBOL_GPL(pm_qos_add_requirement); * @name: identifies the request * @value: defines the qos request * - * Updates an existing qos requirement for the pm_qos_class of parameters along + * Updates an existing qos requierement for the pm_qos_class of parameters along * with updating the target pm_qos_class value. * - * If the named request isn't in the list then no change is made. + * If the named request isn't in the lest then no change is made. */ int pm_qos_update_requirement(int pm_qos_class, char *name, s32 new_value) { @@ -287,7 +287,7 @@ EXPORT_SYMBOL_GPL(pm_qos_update_requirement); * @pm_qos_class: identifies which list of qos request to us * @name: identifies the request * - * Will remove named qos request from pm_qos_class list of parameters and + * Will remove named qos request from pm_qos_class list of parrameters and * recompute the current target value for the pm_qos_class. */ void pm_qos_remove_requirement(int pm_qos_class, char *name) @@ -319,7 +319,7 @@ EXPORT_SYMBOL_GPL(pm_qos_remove_requirement); * @notifier: notifier block managed by caller. * * will register the notifier into a notification chain that gets called - * upon changes to the pm_qos_class target value. + * uppon changes to the pm_qos_class target value. */ int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier) { @@ -338,7 +338,7 @@ EXPORT_SYMBOL_GPL(pm_qos_add_notifier); * @notifier: notifier block to be removed. * * will remove the notifier from the notification chain that gets called - * upon changes to the pm_qos_class target value. + * uppon changes to the pm_qos_class target value. */ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier) { diff --git a/trunk/kernel/relay.c b/trunk/kernel/relay.c index 8d13a7855c08..04006ef970b8 100644 --- a/trunk/kernel/relay.c +++ b/trunk/kernel/relay.c @@ -944,10 +944,6 @@ static void relay_file_read_consume(struct rchan_buf *buf, size_t n_subbufs = buf->chan->n_subbufs; size_t read_subbuf; - if (buf->subbufs_produced == buf->subbufs_consumed && - buf->offset == buf->bytes_consumed) - return; - if (buf->bytes_consumed + bytes_consumed > subbuf_size) { relay_subbufs_consumed(buf->chan, buf->cpu, 1); buf->bytes_consumed = 0; @@ -979,8 +975,6 @@ static int relay_file_read_avail(struct rchan_buf *buf, size_t read_pos) relay_file_read_consume(buf, read_pos, 0); - consumed = buf->subbufs_consumed; - if (unlikely(buf->offset > subbuf_size)) { if (produced == consumed) return 0; @@ -999,12 +993,8 @@ static int relay_file_read_avail(struct rchan_buf *buf, size_t read_pos) if (consumed > produced) produced += n_subbufs * subbuf_size; - if (consumed == produced) { - if (buf->offset == subbuf_size && - buf->subbufs_produced > buf->subbufs_consumed) - return 1; + if (consumed == produced) return 0; - } return 1; } diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 04160d277e7a..21f7da94662e 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -5004,21 +5004,19 @@ static int __sched_setscheduler(struct task_struct *p, int policy, return -EPERM; } - if (user) { #ifdef CONFIG_RT_GROUP_SCHED - /* - * Do not allow realtime tasks into groups that have no runtime - * assigned. - */ - if (rt_policy(policy) && task_group(p)->rt_bandwidth.rt_runtime == 0) - return -EPERM; + /* + * Do not allow realtime tasks into groups that have no runtime + * assigned. + */ + if (user + && rt_policy(policy) && task_group(p)->rt_bandwidth.rt_runtime == 0) + return -EPERM; #endif - retval = security_task_setscheduler(p, policy, param); - if (retval) - return retval; - } - + retval = security_task_setscheduler(p, policy, param); + if (retval) + return retval; /* * make sure no PI-waiters arrive (or leave) while we are * changing the priority of the task: diff --git a/trunk/kernel/semaphore.c b/trunk/kernel/semaphore.c index 94a62c0d4ade..aaaeae8244e7 100644 --- a/trunk/kernel/semaphore.c +++ b/trunk/kernel/semaphore.c @@ -212,7 +212,9 @@ static inline int __sched __down_common(struct semaphore *sem, long state, waiter.up = 0; for (;;) { - if (signal_pending_state(state, task)) + if (state == TASK_INTERRUPTIBLE && signal_pending(task)) + goto interrupted; + if (state == TASK_KILLABLE && fatal_signal_pending(task)) goto interrupted; if (timeout <= 0) goto timed_out; diff --git a/trunk/mm/filemap.c b/trunk/mm/filemap.c index 54e968650855..d97d1ad55473 100644 --- a/trunk/mm/filemap.c +++ b/trunk/mm/filemap.c @@ -558,14 +558,14 @@ EXPORT_SYMBOL(wait_on_page_bit); * But that's OK - sleepers in wait_on_page_writeback() just go back to sleep. * * The first mb is necessary to safely close the critical section opened by the - * test_and_set_bit() to lock the page; the second mb is necessary to enforce - * ordering between the clear_bit and the read of the waitqueue (to avoid SMP - * races with a parallel wait_on_page_locked()). + * TestSetPageLocked(), the second mb is necessary to enforce ordering between + * the clear_bit and the read of the waitqueue (to avoid SMP races with a + * parallel wait_on_page_locked()). */ void unlock_page(struct page *page) { smp_mb__before_clear_bit(); - if (!test_and_clear_bit(PG_locked, &page->flags)) + if (!TestClearPageLocked(page)) BUG(); smp_mb__after_clear_bit(); wake_up_page(page, PG_locked); @@ -931,7 +931,7 @@ grab_cache_page_nowait(struct address_space *mapping, pgoff_t index) struct page *page = find_get_page(mapping, index); if (page) { - if (trylock_page(page)) + if (!TestSetPageLocked(page)) return page; page_cache_release(page); return NULL; @@ -1027,7 +1027,7 @@ static void do_generic_file_read(struct file *filp, loff_t *ppos, if (inode->i_blkbits == PAGE_CACHE_SHIFT || !mapping->a_ops->is_partially_uptodate) goto page_not_up_to_date; - if (!trylock_page(page)) + if (TestSetPageLocked(page)) goto page_not_up_to_date; if (!mapping->a_ops->is_partially_uptodate(page, desc, offset)) diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c index 1002f473f497..6793b9c68107 100644 --- a/trunk/mm/memory.c +++ b/trunk/mm/memory.c @@ -1789,7 +1789,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, * not dirty accountable. */ if (PageAnon(old_page)) { - if (trylock_page(old_page)) { + if (!TestSetPageLocked(old_page)) { reuse = can_share_swap_page(old_page); unlock_page(old_page); } @@ -2765,26 +2765,16 @@ int make_pages_present(unsigned long addr, unsigned long end) vma = find_vma(current->mm, addr); if (!vma) - return -ENOMEM; + return -1; write = (vma->vm_flags & VM_WRITE) != 0; BUG_ON(addr >= end); BUG_ON(end > vma->vm_end); len = DIV_ROUND_UP(end, PAGE_SIZE) - addr/PAGE_SIZE; ret = get_user_pages(current, current->mm, addr, len, write, 0, NULL, NULL); - if (ret < 0) { - /* - SUS require strange return value to mlock - - invalid addr generate to ENOMEM. - - out of memory should generate EAGAIN. - */ - if (ret == -EFAULT) - ret = -ENOMEM; - else if (ret == -ENOMEM) - ret = -EAGAIN; + if (ret < 0) return ret; - } - return ret == len ? 0 : -ENOMEM; + return ret == len ? 0 : -1; } #if !defined(__HAVE_ARCH_GATE_AREA) diff --git a/trunk/mm/migrate.c b/trunk/mm/migrate.c index 2a80136b23bb..153572fb60b8 100644 --- a/trunk/mm/migrate.c +++ b/trunk/mm/migrate.c @@ -605,7 +605,7 @@ static int move_to_new_page(struct page *newpage, struct page *page) * establishing additional references. We are the only one * holding a reference to the new page at this point. */ - if (!trylock_page(newpage)) + if (TestSetPageLocked(newpage)) BUG(); /* Prepare mapping for the new page.*/ @@ -667,7 +667,7 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private, BUG_ON(charge); rc = -EAGAIN; - if (!trylock_page(page)) { + if (TestSetPageLocked(page)) { if (!force) goto move_newpage; lock_page(page); diff --git a/trunk/mm/mlock.c b/trunk/mm/mlock.c index 01fbe93eff5c..7b2656055d6a 100644 --- a/trunk/mm/mlock.c +++ b/trunk/mm/mlock.c @@ -78,6 +78,8 @@ static int mlock_fixup(struct vm_area_struct *vma, struct vm_area_struct **prev, mm->locked_vm -= pages; out: + if (ret == -ENOMEM) + ret = -EAGAIN; return ret; } diff --git a/trunk/mm/mm_init.c b/trunk/mm/mm_init.c index 936ef2efd892..c6af41ea9994 100644 --- a/trunk/mm/mm_init.c +++ b/trunk/mm/mm_init.c @@ -14,10 +14,6 @@ #ifdef CONFIG_DEBUG_MEMORY_INIT int __meminitdata mminit_loglevel; -#ifndef SECTIONS_SHIFT -#define SECTIONS_SHIFT 0 -#endif - /* The zonelists are simply reported, validation is manual. */ void mminit_verify_zonelist(void) { @@ -78,7 +74,11 @@ void __init mminit_verify_pageflags_layout(void) NR_PAGEFLAGS); mminit_dprintk(MMINIT_TRACE, "pageflags_layout_shifts", "Section %d Node %d Zone %d\n", +#ifdef SECTIONS_SHIFT SECTIONS_SHIFT, +#else + 0, +#endif NODES_SHIFT, ZONES_SHIFT); mminit_dprintk(MMINIT_TRACE, "pageflags_layout_offsets", diff --git a/trunk/mm/mmap.c b/trunk/mm/mmap.c index 971d0eda754a..245c3d69067b 100644 --- a/trunk/mm/mmap.c +++ b/trunk/mm/mmap.c @@ -370,7 +370,7 @@ find_vma_prepare(struct mm_struct *mm, unsigned long addr, if (vma_tmp->vm_end > addr) { vma = vma_tmp; if (vma_tmp->vm_start <= addr) - break; + return vma; __rb_link = &__rb_parent->rb_left; } else { rb_prev = __rb_parent; diff --git a/trunk/mm/nommu.c b/trunk/mm/nommu.c index ed75bc962fbe..5edccd9c9218 100644 --- a/trunk/mm/nommu.c +++ b/trunk/mm/nommu.c @@ -266,27 +266,6 @@ void *vmalloc_node(unsigned long size, int node) } EXPORT_SYMBOL(vmalloc_node); -#ifndef PAGE_KERNEL_EXEC -# define PAGE_KERNEL_EXEC PAGE_KERNEL -#endif - -/** - * vmalloc_exec - allocate virtually contiguous, executable memory - * @size: allocation size - * - * Kernel-internal function to allocate enough pages to cover @size - * the page level allocator and map them into contiguous and - * executable kernel virtual space. - * - * For tight control over page level allocator and protection flags - * use __vmalloc() instead. - */ - -void *vmalloc_exec(unsigned long size) -{ - return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC); -} - /** * vmalloc_32 - allocate virtually contiguous memory (32bit addressable) * @size: allocation size diff --git a/trunk/mm/rmap.c b/trunk/mm/rmap.c index 1ea4e6fcee77..94a5246a3f98 100644 --- a/trunk/mm/rmap.c +++ b/trunk/mm/rmap.c @@ -422,7 +422,7 @@ int page_referenced(struct page *page, int is_locked, referenced += page_referenced_anon(page, mem_cont); else if (is_locked) referenced += page_referenced_file(page, mem_cont); - else if (!trylock_page(page)) + else if (TestSetPageLocked(page)) referenced++; else { if (page->mapping) diff --git a/trunk/mm/shmem.c b/trunk/mm/shmem.c index 04fb4f1ab88e..c1e5a3b4f758 100644 --- a/trunk/mm/shmem.c +++ b/trunk/mm/shmem.c @@ -1265,7 +1265,7 @@ static int shmem_getpage(struct inode *inode, unsigned long idx, } /* We have to do this with page locked to prevent races */ - if (!trylock_page(swappage)) { + if (TestSetPageLocked(swappage)) { shmem_swp_unmap(entry); spin_unlock(&info->lock); wait_on_page_locked(swappage); @@ -1329,7 +1329,7 @@ static int shmem_getpage(struct inode *inode, unsigned long idx, shmem_swp_unmap(entry); filepage = find_get_page(mapping, idx); if (filepage && - (!PageUptodate(filepage) || !trylock_page(filepage))) { + (!PageUptodate(filepage) || TestSetPageLocked(filepage))) { spin_unlock(&info->lock); wait_on_page_locked(filepage); page_cache_release(filepage); diff --git a/trunk/mm/swap.c b/trunk/mm/swap.c index 9e0cb3118079..7417a2adbe50 100644 --- a/trunk/mm/swap.c +++ b/trunk/mm/swap.c @@ -444,7 +444,7 @@ void pagevec_strip(struct pagevec *pvec) for (i = 0; i < pagevec_count(pvec); i++) { struct page *page = pvec->pages[i]; - if (PagePrivate(page) && trylock_page(page)) { + if (PagePrivate(page) && !TestSetPageLocked(page)) { if (PagePrivate(page)) try_to_release_page(page, 0); unlock_page(page); diff --git a/trunk/mm/swap_state.c b/trunk/mm/swap_state.c index 167cf2dc8a03..b8035b055129 100644 --- a/trunk/mm/swap_state.c +++ b/trunk/mm/swap_state.c @@ -201,7 +201,7 @@ void delete_from_swap_cache(struct page *page) */ static inline void free_swap_cache(struct page *page) { - if (PageSwapCache(page) && trylock_page(page)) { + if (PageSwapCache(page) && !TestSetPageLocked(page)) { remove_exclusive_swap_page(page); unlock_page(page); } @@ -302,9 +302,9 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, * re-using the just freed swap entry for an existing page. * May fail (-ENOMEM) if radix-tree node allocation failed. */ - set_page_locked(new_page); + SetPageLocked(new_page); err = add_to_swap_cache(new_page, entry, gfp_mask & GFP_KERNEL); - if (likely(!err)) { + if (!err) { /* * Initiate read into locked page and return. */ @@ -312,7 +312,7 @@ struct page *read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask, swap_readpage(NULL, new_page); return new_page; } - clear_page_locked(new_page); + ClearPageLocked(new_page); swap_free(entry); } while (err != -ENOMEM); diff --git a/trunk/mm/swapfile.c b/trunk/mm/swapfile.c index 1e330f2998fa..bb7f79641f9e 100644 --- a/trunk/mm/swapfile.c +++ b/trunk/mm/swapfile.c @@ -403,7 +403,7 @@ void free_swap_and_cache(swp_entry_t entry) if (p) { if (swap_entry_free(p, swp_offset(entry)) == 1) { page = find_get_page(&swapper_space, entry.val); - if (page && unlikely(!trylock_page(page))) { + if (page && unlikely(TestSetPageLocked(page))) { page_cache_release(page); page = NULL; } diff --git a/trunk/mm/truncate.c b/trunk/mm/truncate.c index 250505091d37..894e9a70699f 100644 --- a/trunk/mm/truncate.c +++ b/trunk/mm/truncate.c @@ -187,7 +187,7 @@ void truncate_inode_pages_range(struct address_space *mapping, if (page_index > next) next = page_index; next++; - if (!trylock_page(page)) + if (TestSetPageLocked(page)) continue; if (PageWriteback(page)) { unlock_page(page); @@ -280,7 +280,7 @@ unsigned long __invalidate_mapping_pages(struct address_space *mapping, pgoff_t index; int lock_failed; - lock_failed = !trylock_page(page); + lock_failed = TestSetPageLocked(page); /* * We really shouldn't be looking at the ->index of an diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index 1ff1a58e7c10..75be453628bf 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -496,7 +496,7 @@ static unsigned long shrink_page_list(struct list_head *page_list, page = lru_to_page(page_list); list_del(&page->lru); - if (!trylock_page(page)) + if (TestSetPageLocked(page)) goto keep; VM_BUG_ON(PageActive(page)); @@ -582,7 +582,7 @@ static unsigned long shrink_page_list(struct list_head *page_list, * A synchronous write - probably a ramdisk. Go * ahead and try to reclaim the page. */ - if (!trylock_page(page)) + if (TestSetPageLocked(page)) goto keep; if (PageDirty(page) || PageWriteback(page)) goto keep_locked; diff --git a/trunk/net/ax25/sysctl_net_ax25.c b/trunk/net/ax25/sysctl_net_ax25.c index f288fc4aef9b..f597987b2424 100644 --- a/trunk/net/ax25/sysctl_net_ax25.c +++ b/trunk/net/ax25/sysctl_net_ax25.c @@ -36,7 +36,6 @@ static struct ctl_path ax25_path[] = { { .procname = "ax25", .ctl_name = NET_AX25, }, { } }; - static const ctl_table ax25_param_table[] = { { .ctl_name = NET_AX25_IP_DEFAULT_MODE, @@ -168,7 +167,6 @@ static const ctl_table ax25_param_table[] = { .extra1 = &min_proto, .extra2 = &max_proto }, -#ifdef CONFIG_AX25_DAMA_SLAVE { .ctl_name = NET_AX25_DAMA_SLAVE_TIMEOUT, .procname = "dama_slave_timeout", @@ -179,8 +177,6 @@ static const ctl_table ax25_param_table[] = { .extra1 = &min_ds_timeout, .extra2 = &max_ds_timeout }, -#endif - { .ctl_name = 0 } /* that's all, folks! */ }; @@ -214,6 +210,16 @@ void ax25_register_sysctl(void) ax25_table[n].procname = ax25_dev->dev->name; ax25_table[n].mode = 0555; +#ifndef CONFIG_AX25_DAMA_SLAVE + /* + * We do not wish to have a representation of this parameter + * in /proc/sys/ when configured *not* to include the + * AX.25 DAMA slave code, do we? + */ + + child[AX25_VALUES_DS_TIMEOUT].procname = NULL; +#endif + child[AX25_MAX_VALUES].ctl_name = 0; /* just in case... */ for (k = 0; k < AX25_MAX_VALUES; k++) diff --git a/trunk/net/bridge/br_netfilter.c b/trunk/net/bridge/br_netfilter.c index 6a9a6cd74b1e..6e280a8a31ee 100644 --- a/trunk/net/bridge/br_netfilter.c +++ b/trunk/net/bridge/br_netfilter.c @@ -113,7 +113,7 @@ void br_netfilter_rtable_init(struct net_bridge *br) struct rtable *rt = &br->fake_rtable; atomic_set(&rt->u.dst.__refcnt, 1); - rt->u.dst.dev = br->dev; + rt->u.dst.dev = &br->dev; rt->u.dst.path = &rt->u.dst; rt->u.dst.metrics[RTAX_MTU - 1] = 1500; rt->u.dst.flags = DST_NOXFRM; diff --git a/trunk/net/bridge/br_stp.c b/trunk/net/bridge/br_stp.c index 6e63ec3f1fcf..921bbe5cb94a 100644 --- a/trunk/net/bridge/br_stp.c +++ b/trunk/net/bridge/br_stp.c @@ -368,25 +368,14 @@ static void br_make_blocking(struct net_bridge_port *p) /* called under bridge lock */ static void br_make_forwarding(struct net_bridge_port *p) { - struct net_bridge *br = p->br; + if (p->state == BR_STATE_BLOCKING) { + if (p->br->stp_enabled == BR_KERNEL_STP) + p->state = BR_STATE_LISTENING; + else + p->state = BR_STATE_LEARNING; - if (p->state != BR_STATE_BLOCKING) - return; - - if (br->forward_delay == 0) { - p->state = BR_STATE_FORWARDING; - br_topology_change_detection(br); - del_timer(&p->forward_delay_timer); - } - else if (p->br->stp_enabled == BR_KERNEL_STP) - p->state = BR_STATE_LISTENING; - else - p->state = BR_STATE_LEARNING; - - br_log_state(p); - - if (br->forward_delay != 0) - mod_timer(&p->forward_delay_timer, jiffies + br->forward_delay); + br_log_state(p); + mod_timer(&p->forward_delay_timer, jiffies + p->br->forward_delay); } } /* called under bridge lock */ diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 01993ad74e76..69320a56a084 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -1796,7 +1796,7 @@ int dev_queue_xmit(struct sk_buff *skb) skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_EGRESS); #endif if (q->enqueue) { - spinlock_t *root_lock = qdisc_lock(q); + spinlock_t *root_lock = qdisc_root_lock(q); spin_lock(root_lock); @@ -1805,6 +1805,7 @@ int dev_queue_xmit(struct sk_buff *skb) spin_unlock(root_lock); + rc = rc == NET_XMIT_BYPASS ? NET_XMIT_SUCCESS : rc; goto out; } @@ -1908,6 +1909,7 @@ int netif_rx(struct sk_buff *skb) if (queue->input_pkt_queue.qlen <= netdev_max_backlog) { if (queue->input_pkt_queue.qlen) { enqueue: + dev_hold(skb->dev); __skb_queue_tail(&queue->input_pkt_queue, skb); local_irq_restore(flags); return NET_RX_SUCCESS; @@ -1993,7 +1995,7 @@ static void net_tx_action(struct softirq_action *h) smp_mb__before_clear_bit(); clear_bit(__QDISC_STATE_SCHED, &q->state); - root_lock = qdisc_lock(q); + root_lock = qdisc_root_lock(q); if (spin_trylock(root_lock)) { qdisc_run(q); spin_unlock(root_lock); @@ -2268,20 +2270,6 @@ int netif_receive_skb(struct sk_buff *skb) return ret; } -/* Network device is going away, flush any packets still pending */ -static void flush_backlog(void *arg) -{ - struct net_device *dev = arg; - struct softnet_data *queue = &__get_cpu_var(softnet_data); - struct sk_buff *skb, *tmp; - - skb_queue_walk_safe(&queue->input_pkt_queue, skb, tmp) - if (skb->dev == dev) { - __skb_unlink(skb, &queue->input_pkt_queue); - kfree_skb(skb); - } -} - static int process_backlog(struct napi_struct *napi, int quota) { int work = 0; @@ -2291,6 +2279,7 @@ static int process_backlog(struct napi_struct *napi, int quota) napi->weight = weight_p; do { struct sk_buff *skb; + struct net_device *dev; local_irq_disable(); skb = __skb_dequeue(&queue->input_pkt_queue); @@ -2299,9 +2288,14 @@ static int process_backlog(struct napi_struct *napi, int quota) local_irq_enable(); break; } + local_irq_enable(); + dev = skb->dev; + netif_receive_skb(skb); + + dev_put(dev); } while (++work < quota && jiffies == start_time); return work; @@ -3994,10 +3988,6 @@ int register_netdevice(struct net_device *dev) } } - /* Enable software GSO if SG is supported. */ - if (dev->features & NETIF_F_SG) - dev->features |= NETIF_F_GSO; - netdev_initialize_kobject(dev); ret = netdev_register_kobject(dev); if (ret) @@ -4175,8 +4165,6 @@ void netdev_run_todo(void) dev->reg_state = NETREG_UNREGISTERED; - on_each_cpu(flush_backlog, dev, 1); - netdev_wait_allrefs(dev); /* paranoia */ diff --git a/trunk/net/core/neighbour.c b/trunk/net/core/neighbour.c index 9d92e41826e7..f62c8af85d38 100644 --- a/trunk/net/core/neighbour.c +++ b/trunk/net/core/neighbour.c @@ -2281,7 +2281,6 @@ static struct neighbour *neigh_get_idx(struct seq_file *seq, loff_t *pos) struct neighbour *n = neigh_get_first(seq); if (n) { - --(*pos); while (*pos) { n = neigh_get_next(seq, n, pos); if (!n) @@ -2342,7 +2341,6 @@ static struct pneigh_entry *pneigh_get_idx(struct seq_file *seq, loff_t *pos) struct pneigh_entry *pn = pneigh_get_first(seq); if (pn) { - --(*pos); while (*pos) { pn = pneigh_get_next(seq, pn, pos); if (!pn) @@ -2356,11 +2354,10 @@ static void *neigh_get_idx_any(struct seq_file *seq, loff_t *pos) { struct neigh_seq_state *state = seq->private; void *rc; - loff_t idxpos = *pos; - rc = neigh_get_idx(seq, &idxpos); + rc = neigh_get_idx(seq, pos); if (!rc && !(state->flags & NEIGH_SEQ_NEIGH_ONLY)) - rc = pneigh_get_idx(seq, &idxpos); + rc = pneigh_get_idx(seq, pos); return rc; } @@ -2369,6 +2366,7 @@ void *neigh_seq_start(struct seq_file *seq, loff_t *pos, struct neigh_table *tbl __acquires(tbl->lock) { struct neigh_seq_state *state = seq->private; + loff_t pos_minus_one; state->tbl = tbl; state->bucket = 0; @@ -2376,7 +2374,8 @@ void *neigh_seq_start(struct seq_file *seq, loff_t *pos, struct neigh_table *tbl read_lock_bh(&tbl->lock); - return *pos ? neigh_get_idx_any(seq, pos) : SEQ_START_TOKEN; + pos_minus_one = *pos - 1; + return *pos ? neigh_get_idx_any(seq, &pos_minus_one) : SEQ_START_TOKEN; } EXPORT_SYMBOL(neigh_seq_start); @@ -2386,7 +2385,7 @@ void *neigh_seq_next(struct seq_file *seq, void *v, loff_t *pos) void *rc; if (v == SEQ_START_TOKEN) { - rc = neigh_get_first(seq); + rc = neigh_get_idx(seq, pos); goto out; } diff --git a/trunk/net/core/pktgen.c b/trunk/net/core/pktgen.c index 2498cdaf8cbe..3284605f2ec7 100644 --- a/trunk/net/core/pktgen.c +++ b/trunk/net/core/pktgen.c @@ -2085,19 +2085,15 @@ static inline int f_pick(struct pktgen_dev *pkt_dev) if (pkt_dev->flows[flow].count >= pkt_dev->lflow) { /* reset time */ pkt_dev->flows[flow].count = 0; - pkt_dev->flows[flow].flags = 0; pkt_dev->curfl += 1; if (pkt_dev->curfl >= pkt_dev->cflows) pkt_dev->curfl = 0; /*reset */ } } else { flow = random32() % pkt_dev->cflows; - pkt_dev->curfl = flow; - if (pkt_dev->flows[flow].count > pkt_dev->lflow) { + if (pkt_dev->flows[flow].count > pkt_dev->lflow) pkt_dev->flows[flow].count = 0; - pkt_dev->flows[flow].flags = 0; - } } return pkt_dev->curfl; @@ -2166,7 +2162,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev) mc = random32() % pkt_dev->src_mac_count; else { mc = pkt_dev->cur_src_mac_offset++; - if (pkt_dev->cur_src_mac_offset >= + if (pkt_dev->cur_src_mac_offset > pkt_dev->src_mac_count) pkt_dev->cur_src_mac_offset = 0; } @@ -2193,7 +2189,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev) else { mc = pkt_dev->cur_dst_mac_offset++; - if (pkt_dev->cur_dst_mac_offset >= + if (pkt_dev->cur_dst_mac_offset > pkt_dev->dst_mac_count) { pkt_dev->cur_dst_mac_offset = 0; } diff --git a/trunk/net/ipv4/sysctl_net_ipv4.c b/trunk/net/ipv4/sysctl_net_ipv4.c index e0689fd7b798..770d827f5ab8 100644 --- a/trunk/net/ipv4/sysctl_net_ipv4.c +++ b/trunk/net/ipv4/sysctl_net_ipv4.c @@ -232,7 +232,6 @@ static struct ctl_table ipv4_table[] = { .mode = 0644, .proc_handler = &ipv4_doint_and_flush, .strategy = &ipv4_doint_and_flush_strategy, - .extra2 = &init_net, }, { .ctl_name = NET_IPV4_NO_PMTU_DISC, diff --git a/trunk/net/ipv6/ip6_output.c b/trunk/net/ipv6/ip6_output.c index a4402de425d9..a027003d69a4 100644 --- a/trunk/net/ipv6/ip6_output.c +++ b/trunk/net/ipv6/ip6_output.c @@ -269,7 +269,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl, skb->mark = sk->sk_mark; mtu = dst_mtu(dst); - if ((skb->len <= mtu) || skb->local_df || skb_is_gso(skb)) { + if ((skb->len <= mtu) || ipfragok || skb_is_gso(skb)) { IP6_INC_STATS(ip6_dst_idev(skb->dst), IPSTATS_MIB_OUTREQUESTS); return NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, dst->dev, diff --git a/trunk/net/ipv6/ipv6_sockglue.c b/trunk/net/ipv6/ipv6_sockglue.c index 741cfcd96f88..ea33b26512c2 100644 --- a/trunk/net/ipv6/ipv6_sockglue.c +++ b/trunk/net/ipv6/ipv6_sockglue.c @@ -346,8 +346,6 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, */ if (optlen == 0) optval = NULL; - else if (optval == NULL) - goto e_inval; else if (optlen < sizeof(struct ipv6_opt_hdr) || optlen & 0x7 || optlen > 8 * 255) goto e_inval; diff --git a/trunk/net/ipv6/syncookies.c b/trunk/net/ipv6/syncookies.c index ec394cf5a19b..a46badd1082d 100644 --- a/trunk/net/ipv6/syncookies.c +++ b/trunk/net/ipv6/syncookies.c @@ -199,8 +199,10 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) ireq6 = inet6_rsk(req); treq = tcp_rsk(req); - if (security_inet_conn_request(sk, skb, req)) - goto out_free; + if (security_inet_conn_request(sk, skb, req)) { + reqsk_free(req); + goto out; + } req->mss = mss; ireq->rmt_port = th->source; @@ -253,13 +255,14 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) fl.fl_ip_dport = inet_rsk(req)->rmt_port; fl.fl_ip_sport = inet_sk(sk)->sport; security_req_classify_flow(req, &fl); - if (ip6_dst_lookup(sk, &dst, &fl)) - goto out_free; - + if (ip6_dst_lookup(sk, &dst, &fl)) { + reqsk_free(req); + goto out; + } if (final_p) ipv6_addr_copy(&fl.fl6_dst, final_p); if ((xfrm_lookup(&dst, &fl, sk, 0)) < 0) - goto out_free; + goto out; } req->window_clamp = tp->window_clamp ? :dst_metric(dst, RTAX_WINDOW); @@ -270,10 +273,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) ireq->rcv_wscale = rcv_wscale; ret = get_cookie_sock(sk, skb, req, dst); -out: - return ret; -out_free: - reqsk_free(req); - return NULL; + +out: return ret; } diff --git a/trunk/net/mac80211/ieee80211_i.h b/trunk/net/mac80211/ieee80211_i.h index ec59345af65b..a4f9a832722a 100644 --- a/trunk/net/mac80211/ieee80211_i.h +++ b/trunk/net/mac80211/ieee80211_i.h @@ -82,7 +82,6 @@ struct ieee80211_sta_bss { u8 bssid[ETH_ALEN]; u8 ssid[IEEE80211_MAX_SSID_LEN]; - u8 dtim_period; u16 capability; /* host byte order */ enum ieee80211_band band; int freq; @@ -587,7 +586,6 @@ struct ieee80211_local { struct timer_list sta_cleanup; unsigned long queues_pending[BITS_TO_LONGS(IEEE80211_MAX_QUEUES)]; - unsigned long queues_pending_run[BITS_TO_LONGS(IEEE80211_MAX_QUEUES)]; struct ieee80211_tx_stored_packet pending_packet[IEEE80211_MAX_QUEUES]; struct tasklet_struct tx_pending_tasklet; diff --git a/trunk/net/mac80211/main.c b/trunk/net/mac80211/main.c index 0c02c471bca2..a4c5b90de769 100644 --- a/trunk/net/mac80211/main.c +++ b/trunk/net/mac80211/main.c @@ -1689,11 +1689,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) if (local->hw.conf.beacon_int < 10) local->hw.conf.beacon_int = 100; - if (local->hw.max_listen_interval == 0) - local->hw.max_listen_interval = 1; - - local->hw.conf.listen_interval = local->hw.max_listen_interval; - local->wstats_flags |= local->hw.flags & (IEEE80211_HW_SIGNAL_UNSPEC | IEEE80211_HW_SIGNAL_DB | IEEE80211_HW_SIGNAL_DBM) ? diff --git a/trunk/net/mac80211/mlme.c b/trunk/net/mac80211/mlme.c index e1d11c9b6729..acb04133a95d 100644 --- a/trunk/net/mac80211/mlme.c +++ b/trunk/net/mac80211/mlme.c @@ -551,7 +551,6 @@ static void ieee80211_set_associated(struct net_device *dev, /* set timing information */ sdata->bss_conf.beacon_int = bss->beacon_int; sdata->bss_conf.timestamp = bss->timestamp; - sdata->bss_conf.dtim_period = bss->dtim_period; changed |= ieee80211_handle_bss_capability(sdata, bss); @@ -774,8 +773,7 @@ static void ieee80211_send_assoc(struct net_device *dev, mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, IEEE80211_STYPE_REASSOC_REQ); mgmt->u.reassoc_req.capab_info = cpu_to_le16(capab); - mgmt->u.reassoc_req.listen_interval = - cpu_to_le16(local->hw.conf.listen_interval); + mgmt->u.reassoc_req.listen_interval = cpu_to_le16(1); memcpy(mgmt->u.reassoc_req.current_ap, ifsta->prev_bssid, ETH_ALEN); } else { @@ -783,8 +781,7 @@ static void ieee80211_send_assoc(struct net_device *dev, mgmt->frame_control = IEEE80211_FC(IEEE80211_FTYPE_MGMT, IEEE80211_STYPE_ASSOC_REQ); mgmt->u.assoc_req.capab_info = cpu_to_le16(capab); - mgmt->u.reassoc_req.listen_interval = - cpu_to_le16(local->hw.conf.listen_interval); + mgmt->u.assoc_req.listen_interval = cpu_to_le16(1); } /* SSID */ @@ -2691,16 +2688,6 @@ static void ieee80211_rx_bss_info(struct net_device *dev, bss->beacon_int = le16_to_cpu(mgmt->u.beacon.beacon_int); bss->capability = le16_to_cpu(mgmt->u.beacon.capab_info); - if (elems->tim) { - struct ieee80211_tim_ie *tim_ie = - (struct ieee80211_tim_ie *)elems->tim; - bss->dtim_period = tim_ie->dtim_period; - } - - /* set default value for buggy APs */ - if (!elems->tim || bss->dtim_period == 0) - bss->dtim_period = 1; - bss->supp_rates_len = 0; if (elems->supp_rates) { clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; @@ -3663,21 +3650,11 @@ static int ieee80211_sta_find_ibss(struct net_device *dev, "%s\n", print_mac(mac, bssid), print_mac(mac2, ifsta->bssid)); #endif /* CONFIG_MAC80211_IBSS_DEBUG */ - - if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) { + if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 && + (bss = ieee80211_rx_bss_get(dev, bssid, + local->hw.conf.channel->center_freq, + ifsta->ssid, ifsta->ssid_len))) { int ret; - int search_freq; - - if (ifsta->flags & IEEE80211_STA_AUTO_CHANNEL_SEL) - search_freq = bss->freq; - else - search_freq = local->hw.conf.channel->center_freq; - - bss = ieee80211_rx_bss_get(dev, bssid, search_freq, - ifsta->ssid, ifsta->ssid_len); - if (!bss) - goto dont_join; - printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" " based on configured SSID\n", dev->name, print_mac(mac, bssid)); @@ -3685,8 +3662,6 @@ static int ieee80211_sta_find_ibss(struct net_device *dev, ieee80211_rx_bss_put(local, bss); return ret; } - -dont_join: #ifdef CONFIG_MAC80211_IBSS_DEBUG printk(KERN_DEBUG " did not try to join ibss\n"); #endif /* CONFIG_MAC80211_IBSS_DEBUG */ @@ -3920,7 +3895,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { struct ieee80211_if_sta *ifsta = &sdata->u.sta; if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) || - (!(ifsta->state == IEEE80211_IBSS_JOINED) && + (!ifsta->state == IEEE80211_IBSS_JOINED && !ieee80211_sta_active_ibss(dev))) ieee80211_sta_find_ibss(dev, ifsta); } diff --git a/trunk/net/mac80211/tx.c b/trunk/net/mac80211/tx.c index 771ec68b848d..69019e943873 100644 --- a/trunk/net/mac80211/tx.c +++ b/trunk/net/mac80211/tx.c @@ -1060,14 +1060,13 @@ static int ieee80211_tx_prepare(struct ieee80211_tx_data *tx, static int __ieee80211_tx(struct ieee80211_local *local, struct sk_buff *skb, struct ieee80211_tx_data *tx) { - struct ieee80211_tx_info *info; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); int ret, i; - if (skb) { - if (netif_subqueue_stopped(local->mdev, skb)) - return IEEE80211_TX_AGAIN; - info = IEEE80211_SKB_CB(skb); + if (netif_subqueue_stopped(local->mdev, skb)) + return IEEE80211_TX_AGAIN; + if (skb) { ieee80211_dump_frame(wiphy_name(local->hw.wiphy), "TX to low-level driver", skb); ret = local->ops->tx(local_to_hw(local), skb); @@ -1216,7 +1215,6 @@ static int ieee80211_tx(struct net_device *dev, struct sk_buff *skb) if (ret == IEEE80211_TX_FRAG_AGAIN) skb = NULL; - set_bit(queue, local->queues_pending); smp_mb(); /* @@ -1710,19 +1708,14 @@ void ieee80211_tx_pending(unsigned long data) netif_tx_lock_bh(dev); for (i = 0; i < ieee80211_num_regular_queues(&local->hw); i++) { /* Check that this queue is ok */ - if (__netif_subqueue_stopped(local->mdev, i) && - !test_bit(i, local->queues_pending_run)) + if (__netif_subqueue_stopped(local->mdev, i)) continue; if (!test_bit(i, local->queues_pending)) { - clear_bit(i, local->queues_pending_run); ieee80211_wake_queue(&local->hw, i); continue; } - clear_bit(i, local->queues_pending_run); - netif_start_subqueue(local->mdev, i); - store = &local->pending_packet[i]; tx.extra_frag = store->extra_frag; tx.num_extra_frag = store->num_extra_frag; diff --git a/trunk/net/mac80211/util.c b/trunk/net/mac80211/util.c index 0d463c80c404..19f85e1b3695 100644 --- a/trunk/net/mac80211/util.c +++ b/trunk/net/mac80211/util.c @@ -361,7 +361,6 @@ void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue) struct ieee80211_local *local = hw_to_local(hw); if (test_bit(queue, local->queues_pending)) { - set_bit(queue, local->queues_pending_run); tasklet_schedule(&local->tx_pending_tasklet); } else { netif_wake_subqueue(local->mdev, queue); diff --git a/trunk/net/mac80211/wme.c b/trunk/net/mac80211/wme.c index 4310e2f65661..28437f0001db 100644 --- a/trunk/net/mac80211/wme.c +++ b/trunk/net/mac80211/wme.c @@ -241,14 +241,12 @@ void ieee80211_ht_agg_queue_remove(struct ieee80211_local *local, } else { struct netdev_queue *txq; spinlock_t *root_lock; - struct Qdisc *q; txq = netdev_get_tx_queue(local->mdev, agg_queue); - q = rcu_dereference(txq->qdisc); - root_lock = qdisc_lock(q); + root_lock = qdisc_root_lock(txq->qdisc); spin_lock_bh(root_lock); - qdisc_reset(q); + qdisc_reset(txq->qdisc); spin_unlock_bh(root_lock); } } diff --git a/trunk/net/rfkill/rfkill-input.c b/trunk/net/rfkill/rfkill-input.c index e5b69556bb5b..8aa822730145 100644 --- a/trunk/net/rfkill/rfkill-input.c +++ b/trunk/net/rfkill/rfkill-input.c @@ -109,25 +109,6 @@ static DEFINE_RFKILL_TASK(rfkill_uwb, RFKILL_TYPE_UWB); static DEFINE_RFKILL_TASK(rfkill_wimax, RFKILL_TYPE_WIMAX); static DEFINE_RFKILL_TASK(rfkill_wwan, RFKILL_TYPE_WWAN); -static void rfkill_schedule_evsw_rfkillall(int state) -{ - /* EVERY radio type. state != 0 means radios ON */ - /* handle EPO (emergency power off) through shortcut */ - if (state) { - rfkill_schedule_set(&rfkill_wwan, - RFKILL_STATE_UNBLOCKED); - rfkill_schedule_set(&rfkill_wimax, - RFKILL_STATE_UNBLOCKED); - rfkill_schedule_set(&rfkill_uwb, - RFKILL_STATE_UNBLOCKED); - rfkill_schedule_set(&rfkill_bt, - RFKILL_STATE_UNBLOCKED); - rfkill_schedule_set(&rfkill_wlan, - RFKILL_STATE_UNBLOCKED); - } else - rfkill_schedule_epo(); -} - static void rfkill_event(struct input_handle *handle, unsigned int type, unsigned int code, int data) { @@ -151,7 +132,21 @@ static void rfkill_event(struct input_handle *handle, unsigned int type, } else if (type == EV_SW) { switch (code) { case SW_RFKILL_ALL: - rfkill_schedule_evsw_rfkillall(data); + /* EVERY radio type. data != 0 means radios ON */ + /* handle EPO (emergency power off) through shortcut */ + if (data) { + rfkill_schedule_set(&rfkill_wwan, + RFKILL_STATE_UNBLOCKED); + rfkill_schedule_set(&rfkill_wimax, + RFKILL_STATE_UNBLOCKED); + rfkill_schedule_set(&rfkill_uwb, + RFKILL_STATE_UNBLOCKED); + rfkill_schedule_set(&rfkill_bt, + RFKILL_STATE_UNBLOCKED); + rfkill_schedule_set(&rfkill_wlan, + RFKILL_STATE_UNBLOCKED); + } else + rfkill_schedule_epo(); break; default: break; @@ -173,7 +168,6 @@ static int rfkill_connect(struct input_handler *handler, struct input_dev *dev, handle->handler = handler; handle->name = "rfkill"; - /* causes rfkill_start() to be called */ error = input_register_handle(handle); if (error) goto err_free_handle; @@ -191,23 +185,6 @@ static int rfkill_connect(struct input_handler *handler, struct input_dev *dev, return error; } -static void rfkill_start(struct input_handle *handle) -{ - /* Take event_lock to guard against configuration changes, we - * should be able to deal with concurrency with rfkill_event() - * just fine (which event_lock will also avoid). */ - spin_lock_irq(&handle->dev->event_lock); - - if (test_bit(EV_SW, handle->dev->evbit)) { - if (test_bit(SW_RFKILL_ALL, handle->dev->swbit)) - rfkill_schedule_evsw_rfkillall(test_bit(SW_RFKILL_ALL, - handle->dev->sw)); - /* add resync for further EV_SW events here */ - } - - spin_unlock_irq(&handle->dev->event_lock); -} - static void rfkill_disconnect(struct input_handle *handle) { input_close_device(handle); @@ -248,7 +225,6 @@ static struct input_handler rfkill_handler = { .event = rfkill_event, .connect = rfkill_connect, .disconnect = rfkill_disconnect, - .start = rfkill_start, .name = "rfkill", .id_table = rfkill_ids, }; diff --git a/trunk/net/rfkill/rfkill.c b/trunk/net/rfkill/rfkill.c index d2d45655cd1a..c6f2f388cb72 100644 --- a/trunk/net/rfkill/rfkill.c +++ b/trunk/net/rfkill/rfkill.c @@ -105,16 +105,6 @@ static void rfkill_led_trigger(struct rfkill *rfkill, #endif /* CONFIG_RFKILL_LEDS */ } -#ifdef CONFIG_RFKILL_LEDS -static void rfkill_led_trigger_activate(struct led_classdev *led) -{ - struct rfkill *rfkill = container_of(led->trigger, - struct rfkill, led_trigger); - - rfkill_led_trigger(rfkill, rfkill->state); -} -#endif /* CONFIG_RFKILL_LEDS */ - static void notify_rfkill_state_change(struct rfkill *rfkill) { blocking_notifier_call_chain(&rfkill_notifier_list, @@ -599,10 +589,7 @@ static void rfkill_led_trigger_register(struct rfkill *rfkill) #ifdef CONFIG_RFKILL_LEDS int error; - if (!rfkill->led_trigger.name) - rfkill->led_trigger.name = rfkill->dev.bus_id; - if (!rfkill->led_trigger.activate) - rfkill->led_trigger.activate = rfkill_led_trigger_activate; + rfkill->led_trigger.name = rfkill->dev.bus_id; error = led_trigger_register(&rfkill->led_trigger); if (error) rfkill->led_trigger.name = NULL; diff --git a/trunk/net/sched/sch_atm.c b/trunk/net/sched/sch_atm.c index 43d37256c15e..6b517b9dac5b 100644 --- a/trunk/net/sched/sch_atm.c +++ b/trunk/net/sched/sch_atm.c @@ -415,7 +415,7 @@ static int atm_tc_enqueue(struct sk_buff *skb, struct Qdisc *sch) case TC_ACT_QUEUED: case TC_ACT_STOLEN: kfree_skb(skb); - return NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; + return NET_XMIT_SUCCESS; case TC_ACT_SHOT: kfree_skb(skb); goto drop; @@ -432,11 +432,9 @@ static int atm_tc_enqueue(struct sk_buff *skb, struct Qdisc *sch) ret = qdisc_enqueue(skb, flow->q); if (ret != 0) { drop: __maybe_unused - if (net_xmit_drop_count(ret)) { - sch->qstats.drops++; - if (flow) - flow->qstats.drops++; - } + sch->qstats.drops++; + if (flow) + flow->qstats.drops++; return ret; } sch->bstats.bytes += qdisc_pkt_len(skb); @@ -457,7 +455,7 @@ drop: __maybe_unused return 0; } tasklet_schedule(&p->task); - return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; + return NET_XMIT_BYPASS; } /* @@ -532,7 +530,7 @@ static int atm_tc_requeue(struct sk_buff *skb, struct Qdisc *sch) if (!ret) { sch->q.qlen++; sch->qstats.requeues++; - } else if (net_xmit_drop_count(ret)) { + } else { sch->qstats.drops++; p->link.qstats.drops++; } diff --git a/trunk/net/sched/sch_cbq.c b/trunk/net/sched/sch_cbq.c index 4e261ce62f48..14954bf4a683 100644 --- a/trunk/net/sched/sch_cbq.c +++ b/trunk/net/sched/sch_cbq.c @@ -230,7 +230,7 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) (cl = cbq_class_lookup(q, prio)) != NULL) return cl; - *qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; + *qerr = NET_XMIT_BYPASS; for (;;) { int result = 0; defmap = head->defaults; @@ -256,7 +256,7 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) switch (result) { case TC_ACT_QUEUED: case TC_ACT_STOLEN: - *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; + *qerr = NET_XMIT_SUCCESS; case TC_ACT_SHOT: return NULL; case TC_ACT_RECLASSIFY: @@ -377,7 +377,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch) q->rx_class = cl; #endif if (cl == NULL) { - if (ret & __NET_XMIT_BYPASS) + if (ret == NET_XMIT_BYPASS) sch->qstats.drops++; kfree_skb(skb); return ret; @@ -397,11 +397,9 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch) return ret; } - if (net_xmit_drop_count(ret)) { - sch->qstats.drops++; - cbq_mark_toplevel(q, cl); - cl->qstats.drops++; - } + sch->qstats.drops++; + cbq_mark_toplevel(q, cl); + cl->qstats.drops++; return ret; } @@ -432,10 +430,8 @@ cbq_requeue(struct sk_buff *skb, struct Qdisc *sch) cbq_activate_class(cl); return 0; } - if (net_xmit_drop_count(ret)) { - sch->qstats.drops++; - cl->qstats.drops++; - } + sch->qstats.drops++; + cl->qstats.drops++; return ret; } @@ -668,15 +664,13 @@ static int cbq_reshape_fail(struct sk_buff *skb, struct Qdisc *child) q->rx_class = NULL; if (cl && (cl = cbq_reclassify(skb, cl)) != NULL) { - int ret; cbq_mark_toplevel(q, cl); q->rx_class = cl; cl->q->__parent = sch; - ret = qdisc_enqueue(skb, cl->q); - if (ret == NET_XMIT_SUCCESS) { + if (qdisc_enqueue(skb, cl->q) == 0) { sch->q.qlen++; sch->bstats.packets++; sch->bstats.bytes += qdisc_pkt_len(skb); @@ -684,8 +678,7 @@ static int cbq_reshape_fail(struct sk_buff *skb, struct Qdisc *child) cbq_activate_class(cl); return 0; } - if (net_xmit_drop_count(ret)) - sch->qstats.drops++; + sch->qstats.drops++; return 0; } diff --git a/trunk/net/sched/sch_dsmark.c b/trunk/net/sched/sch_dsmark.c index edd1298f85f6..a935676987e2 100644 --- a/trunk/net/sched/sch_dsmark.c +++ b/trunk/net/sched/sch_dsmark.c @@ -236,7 +236,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch) case TC_ACT_QUEUED: case TC_ACT_STOLEN: kfree_skb(skb); - return NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; + return NET_XMIT_SUCCESS; case TC_ACT_SHOT: goto drop; @@ -254,8 +254,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch) err = qdisc_enqueue(skb, p->q); if (err != NET_XMIT_SUCCESS) { - if (net_xmit_drop_count(err)) - sch->qstats.drops++; + sch->qstats.drops++; return err; } @@ -268,7 +267,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch) drop: kfree_skb(skb); sch->qstats.drops++; - return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; + return NET_XMIT_BYPASS; } static struct sk_buff *dsmark_dequeue(struct Qdisc *sch) @@ -322,8 +321,7 @@ static int dsmark_requeue(struct sk_buff *skb, struct Qdisc *sch) err = p->q->ops->requeue(skb, p->q); if (err != NET_XMIT_SUCCESS) { - if (net_xmit_drop_count(err)) - sch->qstats.drops++; + sch->qstats.drops++; return err; } diff --git a/trunk/net/sched/sch_generic.c b/trunk/net/sched/sch_generic.c index 7cf83b37459d..9c9cd4d94890 100644 --- a/trunk/net/sched/sch_generic.c +++ b/trunk/net/sched/sch_generic.c @@ -29,7 +29,7 @@ /* Main transmission queue. */ /* Modifications to data participating in scheduling must be protected with - * qdisc_lock(qdisc) spinlock. + * qdisc_root_lock(qdisc) spinlock. * * The idea is the following: * - enqueue, dequeue are serialized via qdisc root lock @@ -126,7 +126,7 @@ static inline int qdisc_restart(struct Qdisc *q) if (unlikely((skb = dequeue_skb(q)) == NULL)) return 0; - root_lock = qdisc_lock(q); + root_lock = qdisc_root_lock(q); /* And release qdisc */ spin_unlock(root_lock); @@ -507,7 +507,7 @@ struct Qdisc * qdisc_create_dflt(struct net_device *dev, } EXPORT_SYMBOL(qdisc_create_dflt); -/* Under qdisc_lock(qdisc) and BH! */ +/* Under qdisc_root_lock(qdisc) and BH! */ void qdisc_reset(struct Qdisc *qdisc) { @@ -543,7 +543,7 @@ static void __qdisc_destroy(struct rcu_head *head) kfree((char *) qdisc - qdisc->padded); } -/* Under qdisc_lock(qdisc) and BH! */ +/* Under qdisc_root_lock(qdisc) and BH! */ void qdisc_destroy(struct Qdisc *qdisc) { @@ -659,7 +659,7 @@ static bool some_qdisc_is_running(struct net_device *dev, int lock) dev_queue = netdev_get_tx_queue(dev, i); q = dev_queue->qdisc; - root_lock = qdisc_lock(q); + root_lock = qdisc_root_lock(q); if (lock) spin_lock_bh(root_lock); @@ -735,7 +735,7 @@ static void shutdown_scheduler_queue(struct net_device *dev, struct Qdisc *qdisc_default = _qdisc_default; if (qdisc) { - spinlock_t *root_lock = qdisc_lock(qdisc); + spinlock_t *root_lock = qdisc_root_lock(qdisc); dev_queue->qdisc = qdisc_default; dev_queue->qdisc_sleeping = qdisc_default; diff --git a/trunk/net/sched/sch_hfsc.c b/trunk/net/sched/sch_hfsc.c index c2b8d9cce3d2..0ae7d19dcba8 100644 --- a/trunk/net/sched/sch_hfsc.c +++ b/trunk/net/sched/sch_hfsc.c @@ -1159,14 +1159,14 @@ hfsc_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) if (cl->level == 0) return cl; - *qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; + *qerr = NET_XMIT_BYPASS; tcf = q->root.filter_list; while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) { #ifdef CONFIG_NET_CLS_ACT switch (result) { case TC_ACT_QUEUED: case TC_ACT_STOLEN: - *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; + *qerr = NET_XMIT_SUCCESS; case TC_ACT_SHOT: return NULL; } @@ -1578,7 +1578,7 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch) cl = hfsc_classify(skb, sch, &err); if (cl == NULL) { - if (err & __NET_XMIT_BYPASS) + if (err == NET_XMIT_BYPASS) sch->qstats.drops++; kfree_skb(skb); return err; @@ -1586,10 +1586,8 @@ hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch) err = qdisc_enqueue(skb, cl->qdisc); if (unlikely(err != NET_XMIT_SUCCESS)) { - if (net_xmit_drop_count(err)) { - cl->qstats.drops++; - sch->qstats.drops++; - } + cl->qstats.drops++; + sch->qstats.drops++; return err; } diff --git a/trunk/net/sched/sch_htb.c b/trunk/net/sched/sch_htb.c index be35422711a3..75a40951c4f2 100644 --- a/trunk/net/sched/sch_htb.c +++ b/trunk/net/sched/sch_htb.c @@ -214,14 +214,14 @@ static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch, if ((cl = htb_find(skb->priority, sch)) != NULL && cl->level == 0) return cl; - *qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; + *qerr = NET_XMIT_BYPASS; tcf = q->filter_list; while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) { #ifdef CONFIG_NET_CLS_ACT switch (result) { case TC_ACT_QUEUED: case TC_ACT_STOLEN: - *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; + *qerr = NET_XMIT_SUCCESS; case TC_ACT_SHOT: return NULL; } @@ -567,16 +567,14 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch) } #ifdef CONFIG_NET_CLS_ACT } else if (!cl) { - if (ret & __NET_XMIT_BYPASS) + if (ret == NET_XMIT_BYPASS) sch->qstats.drops++; kfree_skb(skb); return ret; #endif - } else if ((ret = qdisc_enqueue(skb, cl->un.leaf.q)) != NET_XMIT_SUCCESS) { - if (net_xmit_drop_count(ret)) { - sch->qstats.drops++; - cl->qstats.drops++; - } + } else if (qdisc_enqueue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) { + sch->qstats.drops++; + cl->qstats.drops++; return NET_XMIT_DROP; } else { cl->bstats.packets += @@ -612,17 +610,15 @@ static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch) } #ifdef CONFIG_NET_CLS_ACT } else if (!cl) { - if (ret & __NET_XMIT_BYPASS) + if (ret == NET_XMIT_BYPASS) sch->qstats.drops++; kfree_skb(skb); return ret; #endif - } else if ((ret = cl->un.leaf.q->ops->requeue(skb, cl->un.leaf.q)) != + } else if (cl->un.leaf.q->ops->requeue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) { - if (net_xmit_drop_count(ret)) { - sch->qstats.drops++; - cl->qstats.drops++; - } + sch->qstats.drops++; + cl->qstats.drops++; return NET_XMIT_DROP; } else htb_activate(q, cl); diff --git a/trunk/net/sched/sch_netem.c b/trunk/net/sched/sch_netem.c index fb0294d0b55e..a59085700678 100644 --- a/trunk/net/sched/sch_netem.c +++ b/trunk/net/sched/sch_netem.c @@ -176,7 +176,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) if (count == 0) { sch->qstats.drops++; kfree_skb(skb); - return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; + return NET_XMIT_BYPASS; } skb_orphan(skb); @@ -240,9 +240,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) sch->q.qlen++; sch->bstats.bytes += qdisc_pkt_len(skb); sch->bstats.packets++; - } else if (net_xmit_drop_count(ret)) { + } else sch->qstats.drops++; - } pr_debug("netem: enqueue ret %d\n", ret); return ret; diff --git a/trunk/net/sched/sch_prio.c b/trunk/net/sched/sch_prio.c index eac197610edf..f849243eb095 100644 --- a/trunk/net/sched/sch_prio.c +++ b/trunk/net/sched/sch_prio.c @@ -38,14 +38,14 @@ prio_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) struct tcf_result res; int err; - *qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; + *qerr = NET_XMIT_BYPASS; if (TC_H_MAJ(skb->priority) != sch->handle) { err = tc_classify(skb, q->filter_list, &res); #ifdef CONFIG_NET_CLS_ACT switch (err) { case TC_ACT_STOLEN: case TC_ACT_QUEUED: - *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; + *qerr = NET_XMIT_SUCCESS; case TC_ACT_SHOT: return NULL; } @@ -74,7 +74,7 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch) #ifdef CONFIG_NET_CLS_ACT if (qdisc == NULL) { - if (ret & __NET_XMIT_BYPASS) + if (ret == NET_XMIT_BYPASS) sch->qstats.drops++; kfree_skb(skb); return ret; @@ -88,8 +88,7 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch) sch->q.qlen++; return NET_XMIT_SUCCESS; } - if (net_xmit_drop_count(ret)) - sch->qstats.drops++; + sch->qstats.drops++; return ret; } @@ -103,7 +102,7 @@ prio_requeue(struct sk_buff *skb, struct Qdisc* sch) qdisc = prio_classify(skb, sch, &ret); #ifdef CONFIG_NET_CLS_ACT if (qdisc == NULL) { - if (ret & __NET_XMIT_BYPASS) + if (ret == NET_XMIT_BYPASS) sch->qstats.drops++; kfree_skb(skb); return ret; @@ -115,8 +114,7 @@ prio_requeue(struct sk_buff *skb, struct Qdisc* sch) sch->qstats.requeues++; return 0; } - if (net_xmit_drop_count(ret)) - sch->qstats.drops++; + sch->qstats.drops++; return NET_XMIT_DROP; } diff --git a/trunk/net/sched/sch_red.c b/trunk/net/sched/sch_red.c index 5da05839e225..3f2d1d7f3bbd 100644 --- a/trunk/net/sched/sch_red.c +++ b/trunk/net/sched/sch_red.c @@ -97,7 +97,7 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc* sch) sch->bstats.bytes += qdisc_pkt_len(skb); sch->bstats.packets++; sch->q.qlen++; - } else if (net_xmit_drop_count(ret)) { + } else { q->stats.pdrop++; sch->qstats.drops++; } diff --git a/trunk/net/sched/sch_sfq.c b/trunk/net/sched/sch_sfq.c index 6e041d10dbdb..8589da666568 100644 --- a/trunk/net/sched/sch_sfq.c +++ b/trunk/net/sched/sch_sfq.c @@ -171,14 +171,14 @@ static unsigned int sfq_classify(struct sk_buff *skb, struct Qdisc *sch, if (!q->filter_list) return sfq_hash(q, skb) + 1; - *qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS; + *qerr = NET_XMIT_BYPASS; result = tc_classify(skb, q->filter_list, &res); if (result >= 0) { #ifdef CONFIG_NET_CLS_ACT switch (result) { case TC_ACT_STOLEN: case TC_ACT_QUEUED: - *qerr = NET_XMIT_SUCCESS | __NET_XMIT_STOLEN; + *qerr = NET_XMIT_SUCCESS; case TC_ACT_SHOT: return 0; } @@ -285,7 +285,7 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc *sch) hash = sfq_classify(skb, sch, &ret); if (hash == 0) { - if (ret & __NET_XMIT_BYPASS) + if (ret == NET_XMIT_BYPASS) sch->qstats.drops++; kfree_skb(skb); return ret; @@ -339,7 +339,7 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc *sch) hash = sfq_classify(skb, sch, &ret); if (hash == 0) { - if (ret & __NET_XMIT_BYPASS) + if (ret == NET_XMIT_BYPASS) sch->qstats.drops++; kfree_skb(skb); return ret; diff --git a/trunk/net/sched/sch_tbf.c b/trunk/net/sched/sch_tbf.c index 7d3b7ff3bf07..b296672f7632 100644 --- a/trunk/net/sched/sch_tbf.c +++ b/trunk/net/sched/sch_tbf.c @@ -135,8 +135,7 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc* sch) ret = qdisc_enqueue(skb, q->qdisc); if (ret != 0) { - if (net_xmit_drop_count(ret)) - sch->qstats.drops++; + sch->qstats.drops++; return ret; } diff --git a/trunk/net/sctp/ipv6.c b/trunk/net/sctp/ipv6.c index 483a01d0740a..a238d6834b33 100644 --- a/trunk/net/sctp/ipv6.c +++ b/trunk/net/sctp/ipv6.c @@ -195,7 +195,8 @@ SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, } /* Based on tcp_v6_xmit() in tcp_ipv6.c. */ -static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport) +static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport, + int ipfragok) { struct sock *sk = skb->sk; struct ipv6_pinfo *np = inet6_sk(sk); @@ -230,10 +231,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport) SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); - if (!(transport->param_flags & SPP_PMTUD_ENABLE)) - skb->local_df = 1; - - return ip6_xmit(sk, skb, &fl, np->opt, 0); + return ip6_xmit(sk, skb, &fl, np->opt, ipfragok); } /* Returns the dst cache entry for the given source and destination ip diff --git a/trunk/net/sctp/output.c b/trunk/net/sctp/output.c index 0dc4a7dfb234..45684646b1db 100644 --- a/trunk/net/sctp/output.c +++ b/trunk/net/sctp/output.c @@ -586,8 +586,10 @@ int sctp_packet_transmit(struct sctp_packet *packet) SCTP_DEBUG_PRINTK("***sctp_transmit_packet*** skb len %d\n", nskb->len); - nskb->local_df = packet->ipfragok; - (*tp->af_specific->sctp_xmit)(nskb, tp); + if (tp->param_flags & SPP_PMTUD_ENABLE) + (*tp->af_specific->sctp_xmit)(nskb, tp, packet->ipfragok); + else + (*tp->af_specific->sctp_xmit)(nskb, tp, 1); out: packet->size = packet->overhead; diff --git a/trunk/net/sctp/protocol.c b/trunk/net/sctp/protocol.c index 0b65354aaf64..a6e0818bcff5 100644 --- a/trunk/net/sctp/protocol.c +++ b/trunk/net/sctp/protocol.c @@ -862,21 +862,16 @@ static int sctp_inet_supported_addrs(const struct sctp_sock *opt, /* Wrapper routine that calls the ip transmit routine. */ static inline int sctp_v4_xmit(struct sk_buff *skb, - struct sctp_transport *transport) + struct sctp_transport *transport, int ipfragok) { - struct inet_sock *inet = inet_sk(skb->sk); - SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " "src:%u.%u.%u.%u, dst:%u.%u.%u.%u\n", __func__, skb, skb->len, NIPQUAD(skb->rtable->rt_src), NIPQUAD(skb->rtable->rt_dst)); - inet->pmtudisc = transport->param_flags & SPP_PMTUD_ENABLE ? - IP_PMTUDISC_DO : IP_PMTUDISC_DONT; - SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); - return ip_queue_xmit(skb, 0); + return ip_queue_xmit(skb, ipfragok); } static struct sctp_af sctp_af_inet; diff --git a/trunk/scripts/kconfig/conf.c b/trunk/scripts/kconfig/conf.c index 36b5eedcdc75..9fba838c7069 100644 --- a/trunk/scripts/kconfig/conf.c +++ b/trunk/scripts/kconfig/conf.c @@ -596,7 +596,7 @@ int main(int ac, char **av) break; } - if (conf_write(NULL)) { + if (conf_get_changed() && conf_write(NULL)) { fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); exit(1); } diff --git a/trunk/scripts/kconfig/confdata.c b/trunk/scripts/kconfig/confdata.c index df6a188b9930..07597611cc50 100644 --- a/trunk/scripts/kconfig/confdata.c +++ b/trunk/scripts/kconfig/confdata.c @@ -222,8 +222,10 @@ int conf_read_simple(const char *name, int def) continue; if (def == S_DEF_USER) { sym = sym_find(line + 9); - if (!sym) + if (!sym) { + conf_warning("trying to assign nonexistent symbol %s", line + 9); break; + } } else { sym = sym_lookup(line + 9, 0); if (sym->type == S_UNKNOWN) @@ -259,8 +261,10 @@ int conf_read_simple(const char *name, int def) } if (def == S_DEF_USER) { sym = sym_find(line + 7); - if (!sym) + if (!sym) { + conf_warning("trying to assign nonexistent symbol %s", line + 7); break; + } } else { sym = sym_lookup(line + 7, 0); if (sym->type == S_UNKNOWN) diff --git a/trunk/scripts/kernel-doc b/trunk/scripts/kernel-doc index ff787e6ff8ed..d8f77e26081c 100755 --- a/trunk/scripts/kernel-doc +++ b/trunk/scripts/kernel-doc @@ -1403,7 +1403,7 @@ sub dump_struct($$) { my $members = $3; # ignore embedded structs or unions - $members =~ s/{.*}//g; + $members =~ s/{.*?}//g; # ignore members marked private: $members =~ s/\/\*.*?private:.*?public:.*?\*\///gos; diff --git a/trunk/sound/core/seq/oss/seq_oss_synth.c b/trunk/sound/core/seq/oss/seq_oss_synth.c index e024e4588b82..558dadbf45f1 100644 --- a/trunk/sound/core/seq/oss/seq_oss_synth.c +++ b/trunk/sound/core/seq/oss/seq_oss_synth.c @@ -604,9 +604,6 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in { struct seq_oss_synth *rec; - if (dev < 0 || dev >= dp->max_synthdev) - return -ENXIO; - if (dp->synths[dev].is_midi) { struct midi_info minf; snd_seq_oss_midi_make_info(dp, dp->synths[dev].midi_mapped, &minf);