]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 4 Feb 2008 17:16:03 +0000 (09:16 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 4 Feb 2008 17:16:03 +0000 (09:16 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: (78 commits)
  x86: fix RTC lockdep warning: potential hardirq recursion
  x86: cpa, micro-optimization
  x86: cpa, clean up code flow
  x86: cpa, eliminate CPA_ enum
  x86: cpa, cleanups
  x86: implement gbpages support in change_page_attr()
  x86: support gbpages in pagetable dump
  x86: add gbpages support to lookup_address
  x86: add pgtable accessor functions for gbpages
  x86: add PUD_PAGE_SIZE
  x86: add feature macros for the gbpages cpuid bit
  x86: switch direct mapping setup over to set_pte
  x86: fix page-present check in cpa_flush_range
  x86: remove cpa warning
  x86: remove now unused clear_kernel_mapping
  x86: switch pci-gart over to using set_memory_np() instead of clear_kernel_mapping()
  x86: cpa selftest, skip non present entries
  x86: CPA fix pagetable split
  x86: rename LARGE_PAGE_SIZE to PMD_PAGE_SIZE
  x86: cpa, fix lookup_address
  ...

419 files changed:
CREDITS
Documentation/00-INDEX
Documentation/BUG-HUNTING
Documentation/SubmittingPatches
Documentation/arm/Sharp-LH/IOBarrier
Documentation/debugging-modules.txt
Documentation/driver-model/platform.txt
Documentation/filesystems/configfs/configfs.txt
Documentation/filesystems/porting
Documentation/filesystems/proc.txt
Documentation/filesystems/ramfs-rootfs-initramfs.txt
Documentation/filesystems/relay.txt
Documentation/frv/README.txt [moved from Documentation/fujitsu/frv/README.txt with 100% similarity]
Documentation/frv/atomic-ops.txt [moved from Documentation/fujitsu/frv/atomic-ops.txt with 100% similarity]
Documentation/frv/booting.txt [moved from Documentation/fujitsu/frv/booting.txt with 98% similarity]
Documentation/frv/clock.txt [moved from Documentation/fujitsu/frv/clock.txt with 100% similarity]
Documentation/frv/configuring.txt [moved from Documentation/fujitsu/frv/configuring.txt with 100% similarity]
Documentation/frv/features.txt [moved from Documentation/fujitsu/frv/features.txt with 100% similarity]
Documentation/frv/gdbinit [moved from Documentation/fujitsu/frv/gdbinit with 100% similarity]
Documentation/frv/gdbstub.txt [moved from Documentation/fujitsu/frv/gdbstub.txt with 100% similarity]
Documentation/frv/kernel-ABI.txt [moved from Documentation/fujitsu/frv/kernel-ABI.txt with 100% similarity]
Documentation/frv/mmu-layout.txt [moved from Documentation/fujitsu/frv/mmu-layout.txt with 100% similarity]
Documentation/initrd.txt
Documentation/ja_JP/stable_kernel_rules.txt [new file with mode: 0644]
Documentation/kernel-parameters.txt
Documentation/lguest/lguest.c
Documentation/networking/decnet.txt
Documentation/smp.txt [deleted file]
MAINTAINERS
Makefile
arch/Kconfig [new file with mode: 0644]
arch/alpha/Kconfig
arch/arm/Kconfig
arch/arm/Kconfig.instrumentation [deleted file]
arch/arm/mach-pxa/corgi_ssp.c
arch/arm/mach-sa1100/collie_pm.c
arch/arm/plat-s3c24xx/irq.c
arch/avr32/Kconfig
arch/blackfin/Kconfig
arch/cris/Kconfig
arch/frv/Kconfig
arch/frv/kernel/entry.S
arch/frv/lib/atomic-ops.S
arch/h8300/Kconfig
arch/h8300/platform/h8s/ints.c
arch/ia64/Kconfig
arch/m32r/Kconfig
arch/m32r/kernel/ptrace.c
arch/m68k/Kconfig
arch/m68knommu/Kconfig
arch/mips/Kconfig
arch/mips/au1000/mtx-1/board_setup.c
arch/mips/kernel/binfmt_elfn32.c
arch/mips/kernel/binfmt_elfo32.c
arch/mips/kernel/kspd.c
arch/mips/kernel/setup.c
arch/mips/kernel/smtc.c
arch/mips/mm/c-r4k.c
arch/mips/sgi-ip27/ip27-hubio.c
arch/parisc/Kconfig
arch/parisc/kernel/cache.c
arch/parisc/kernel/hardware.c
arch/parisc/kernel/signal.c
arch/powerpc/Kconfig
arch/ppc/Kconfig
arch/s390/Kconfig
arch/sh/Kconfig
arch/sparc/Kconfig
arch/sparc/kernel/ioport.c
arch/sparc64/Kconfig
arch/um/Kconfig
arch/um/sys-x86_64/signal.c
arch/v850/Kconfig
arch/x86/Kconfig
arch/x86/kvm/Kconfig
arch/x86/lib/bitops_32.c
arch/x86/lib/bitops_64.c
arch/xtensa/Kconfig
drivers/Kconfig
drivers/acpi/scan.c
drivers/acpi/utilities/utresrc.c
drivers/ata/ata_piix.c
drivers/ata/libata-core.c
drivers/ata/pata_at32.c
drivers/ata/pata_efar.c
drivers/ata/pata_it8213.c
drivers/ata/pata_sis.c
drivers/base/core.c
drivers/base/driver.c
drivers/base/power/main.c
drivers/base/power/power.h
drivers/block/Kconfig
drivers/block/cciss_scsi.c
drivers/block/virtio_blk.c
drivers/bluetooth/btuart_cs.c
drivers/char/drm/drm_vm.c
drivers/char/drm/r300_reg.h
drivers/char/drm/via_dma.c
drivers/char/efirtc.c
drivers/char/epca.c
drivers/char/hangcheck-timer.c
drivers/char/hvcs.c
drivers/char/ip2/i2lib.c
drivers/char/ip2/ip2main.c
drivers/char/mspec.c
drivers/char/nozomi.c
drivers/char/synclink.c
drivers/char/toshiba.c
drivers/char/virtio_console.c
drivers/dio/dio-driver.c
drivers/edac/edac_pci.c
drivers/edac/i5000_edac.c
drivers/firmware/edd.c
drivers/ide/ide-timing.h
drivers/input/gameport/gameport.c
drivers/input/keyboard/bf54x-keys.c
drivers/input/keyboard/jornada720_kbd.c
drivers/input/serio/gscps2.c
drivers/isdn/hardware/eicon/debuglib.c
drivers/isdn/hardware/eicon/debuglib.h
drivers/isdn/hardware/eicon/di.c
drivers/isdn/hardware/eicon/message.c
drivers/isdn/hysdn/hycapi.c
drivers/lguest/lguest_device.c
drivers/macintosh/adb.c
drivers/macintosh/smu.c
drivers/media/common/saa7146_core.c
drivers/media/dvb/dvb-core/dvb_net.c
drivers/media/video/bt8xx/bttv-cards.c
drivers/media/video/indycam.c
drivers/media/video/mt20xx.c
drivers/media/video/pvrusb2/pvrusb2.h
drivers/media/video/pwc/pwc-if.c
drivers/media/video/tea6420.c
drivers/media/video/usbvideo/quickcam_messenger.c
drivers/media/video/usbvision/usbvision-video.c
drivers/media/video/vpx3220.c
drivers/media/video/zoran_card.c
drivers/media/video/zr36050.c
drivers/media/video/zr36060.c
drivers/message/fusion/lsi/mpi_log_sas.h
drivers/message/fusion/mptctl.c
drivers/message/fusion/mptscsih.c
drivers/message/i2o/iop.c
drivers/mtd/devices/doc2000.c
drivers/mtd/nand/autcpu12.c
drivers/mtd/nand/bf5xx_nand.c
drivers/mtd/nand/cs553x_nand.c
drivers/mtd/nand/edb7312.c
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nandsim.c
drivers/mtd/nand/s3c2410.c
drivers/mtd/nand/sharpsl.c
drivers/mtd/nftlmount.c
drivers/net/Kconfig
drivers/net/arm/at91_ether.c
drivers/net/ax88796.c
drivers/net/bfin_mac.c
drivers/net/bfin_mac.h
drivers/net/bonding/bond_main.c
drivers/net/bonding/bonding.h
drivers/net/cxgb3/mc5.c
drivers/net/cxgb3/sge.c
drivers/net/cxgb3/t3_hw.c
drivers/net/e100.c
drivers/net/e1000/e1000_main.c
drivers/net/e1000e/defines.h
drivers/net/e1000e/ethtool.c
drivers/net/e1000e/netdev.c
drivers/net/eexpress.c
drivers/net/ehea/ehea.h
drivers/net/ehea/ehea_ethtool.c
drivers/net/ehea/ehea_hw.h
drivers/net/ehea/ehea_main.c
drivers/net/ehea/ehea_phyp.c
drivers/net/ehea/ehea_phyp.h
drivers/net/ehea/ehea_qmr.c
drivers/net/ehea/ehea_qmr.h
drivers/net/forcedeth.c
drivers/net/ibmlana.c
drivers/net/igb/igb_main.c
drivers/net/irda/ali-ircc.h
drivers/net/irda/nsc-ircc.h
drivers/net/irda/via-ircc.h
drivers/net/lib8390.c
drivers/net/macb.c
drivers/net/mipsnet.c
drivers/net/mipsnet.h [deleted file]
drivers/net/natsemi.c
drivers/net/pasemi_mac.c
drivers/net/pasemi_mac.h
drivers/net/pci-skeleton.c
drivers/net/phy/Kconfig
drivers/net/phy/Makefile
drivers/net/phy/broadcom.c
drivers/net/phy/mdio_bus.c
drivers/net/phy/phy.c
drivers/net/phy/phy_device.c
drivers/net/phy/realtek.c [new file with mode: 0644]
drivers/net/s2io.c
drivers/net/s2io.h
drivers/net/sis190.c
drivers/net/skfp/ess.c
drivers/net/skfp/fplustm.c
drivers/net/skfp/hwmtm.c
drivers/net/sky2.c
drivers/net/sunbmac.c
drivers/net/sunqe.c
drivers/net/sunvnet.c
drivers/net/tokenring/abyss.c
drivers/net/tokenring/abyss.h
drivers/net/tokenring/madgemc.c
drivers/net/tokenring/madgemc.h
drivers/net/tokenring/olympic.c
drivers/net/tokenring/proteon.c
drivers/net/tokenring/skisa.c
drivers/net/tokenring/tms380tr.c
drivers/net/tokenring/tms380tr.h
drivers/net/tokenring/tmspci.c
drivers/net/ucc_geth.c
drivers/net/usb/rtl8150.c
drivers/net/via-rhine.c
drivers/net/via-velocity.c
drivers/net/via-velocity.h
drivers/net/virtio_net.c
drivers/net/wan/cycx_drv.c
drivers/net/wireless/ath5k/base.c
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-helpers.h
drivers/net/wireless/iwlwifi/iwl3945-base.c
drivers/net/wireless/iwlwifi/iwl4965-base.c
drivers/net/wireless/libertas/scan.c
drivers/nubus/nubus.c
drivers/parisc/ccio-dma.c
drivers/parisc/hppb.c
drivers/parport/probe.c
drivers/pci/Makefile
drivers/pci/hotplug-pci.c [new file with mode: 0644]
drivers/pci/pci-sysfs.c
drivers/pci/pci.c
drivers/pci/pcie/Kconfig
drivers/pci/pcie/Makefile
drivers/pci/pcie/aspm.c [deleted file]
drivers/pci/probe.c
drivers/pci/remove.c
drivers/pci/setup-bus.c
drivers/pcmcia/m32r_pcc.c
drivers/pcmcia/m8xx_pcmcia.c
drivers/scsi/NCR53C9x.h
drivers/scsi/aha1542.c
drivers/scsi/aic7xxx/Makefile
drivers/scsi/aic7xxx/aic79xx_inline.h
drivers/scsi/aic7xxx/aic79xx_osm.c
drivers/scsi/aic7xxx/aic79xx_pci.c
drivers/scsi/aic7xxx/aic7xxx_inline.h
drivers/scsi/aic7xxx/aic7xxx_osm.c
drivers/scsi/ipr.c
drivers/scsi/ips.c
drivers/scsi/lpfc/lpfc.h
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_mbox.c
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/qla2xxx/qla_gs.c
drivers/scsi/qla4xxx/ql4_def.h
drivers/scsi/qla4xxx/ql4_init.c
drivers/scsi/scsi_tgt_lib.c
drivers/scsi/scsi_transport_sas.c
drivers/serial/Kconfig
drivers/serial/icom.h
drivers/serial/mux.c
drivers/spi/spi_imx.c
drivers/ssb/b43_pci_bridge.c
drivers/video/aty/radeon_pm.c
drivers/video/cyblafb.c
drivers/video/intelfb/intelfb.h
drivers/video/omap/lcdc.c
drivers/video/sm501fb.c
drivers/virtio/Kconfig
drivers/virtio/Makefile
drivers/virtio/virtio.c
drivers/virtio/virtio_balloon.c [new file with mode: 0644]
drivers/virtio/virtio_pci.c [new file with mode: 0644]
drivers/virtio/virtio_ring.c
drivers/watchdog/shwdt.c
fs/befs/btree.c
fs/befs/datastream.c
fs/binfmt_elf.c
fs/freevxfs/vxfs_dir.h
fs/freevxfs/vxfs_immed.c
fs/gfs2/recovery.c
fs/jffs2/readinode.c
fs/jfs/jfs_xtree.c
fs/locks.c
fs/ncpfs/mmap.c
fs/ocfs2/alloc.c
fs/ocfs2/dir.c
fs/ocfs2/ocfs1_fs_compat.h
fs/ocfs2/suballoc.c
fs/reiserfs/bitmap.c
fs/signalfd.c
include/acpi/acpixf.h
include/acpi/processor.h
include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
include/asm-arm/arch-pxa/pxa-regs.h
include/asm-arm/arch-versatile/irqs.h
include/asm-arm/hardware/it8152.h
include/asm-arm/mach/udc_pxa2xx.h
include/asm-frv/atomic.h
include/asm-frv/bitops.h
include/asm-frv/cacheflush.h
include/asm-frv/highmem.h
include/asm-frv/mem-layout.h
include/asm-frv/pgtable.h
include/asm-ia64/compat.h
include/asm-m68knommu/bitops.h
include/asm-m68knommu/commproc.h
include/asm-m68knommu/delay.h
include/asm-m68knommu/m5249sim.h
include/asm-m68knommu/m5307sim.h
include/asm-m68knommu/m5407sim.h
include/asm-m68knommu/m68360_regs.h
include/asm-m68knommu/mcfuart.h
include/asm-mips/compat.h
include/asm-mips/mach-excite/excite_fpga.h
include/asm-mips/mach-wrppmc/mach-gt64120.h
include/asm-mips/sgi/ip22.h
include/asm-mips/sn/sn0/hubio.h
include/asm-parisc/compat.h
include/asm-parisc/elf.h
include/asm-parisc/linkage.h
include/asm-parisc/vga.h
include/asm-powerpc/compat.h
include/asm-s390/compat.h
include/asm-sparc64/compat.h
include/asm-x86/compat.h
include/asm-x86/mach-voyager/do_timer.h
include/linux/aspm.h [deleted file]
include/linux/chio.h
include/linux/cyclades.h
include/linux/cycx_x25.h
include/linux/dccp.h
include/linux/device.h
include/linux/dma-mapping.h
include/linux/dmaengine.h
include/linux/ethtool.h
include/linux/fs.h
include/linux/hdreg.h
include/linux/hrtimer.h
include/linux/ieee80211.h
include/linux/init.h
include/linux/lguest_launcher.h
include/linux/llc.h
include/linux/pci.h
include/linux/pci_regs.h
include/linux/phy.h
include/linux/pm.h
include/linux/pnp.h
include/linux/radix-tree.h
include/linux/reiserfs_fs_sb.h
include/linux/signalfd.h
include/linux/skbuff.h
include/linux/sm501-regs.h
include/linux/spinlock_api_up.h
include/linux/virtio.h
include/linux/virtio_balloon.h [new file with mode: 0644]
include/linux/virtio_blk.h
include/linux/virtio_config.h
include/linux/virtio_net.h
include/linux/virtio_pci.h [new file with mode: 0644]
include/linux/virtio_ring.h
include/linux/wireless.h
include/media/rds.h
include/net/if_inet6.h
include/net/inet6_hashtables.h
include/net/inet_connection_sock.h
include/net/inet_hashtables.h
include/net/inet_timewait_sock.h
include/net/sock.h
include/scsi/scsi_transport_fc.h
init/Kconfig
kernel/Kconfig.instrumentation [deleted file]
kernel/Makefile
kernel/exit.c
kernel/posix-timers.c
kernel/relay.c
lib/Kconfig.debug
lib/crc32.c
lib/kobject.c
lib/zlib_deflate/defutil.h
mm/mmap.c
mm/truncate.c
net/9p/trans_virtio.c
net/core/net_namespace.c
net/core/skbuff.c
net/dccp/dccp.h
net/dccp/ipv4.c
net/dccp/ipv6.c
net/dccp/proto.c
net/ipv4/inet_connection_sock.c
net/ipv4/inet_hashtables.c
net/ipv4/tcp.c
net/ipv4/tcp_ipv4.c
net/ipv6/inet6_hashtables.c
net/ipv6/tcp_ipv6.c
net/mac80211/Kconfig
net/mac80211/ieee80211.c
net/mac80211/rc80211_pid_algo.c
net/mac80211/rc80211_simple.c
net/mac80211/rx.c
net/rfkill/rfkill.c
net/sctp/sm_statefuns.c
scripts/kconfig/mconf.c
scripts/kconfig/menu.c
scripts/mod/modpost.c
scripts/setlocalversion [changed mode: 0644->0755]
sound/oss/via82cxxx_audio.c
sound/usb/usx2y/usX2Yhwdep.c
sound/usb/usx2y/usx2yhwdeppcm.c

diff --git a/CREDITS b/CREDITS
index edff310dbe531a6f9c2da88578c605f099e79bfc..da0a56e23beeca7512d80c762425c4fedfaf45b8 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -508,12 +508,8 @@ D: REINER SCT cyberJack pinpad/e-com USB chipcard reader driver
 S: Germany
 
 N: Adrian Bunk
-E: bunk@stusta.de
 P: 1024D/4F12B400  B29C E71E FE19 6755 5C8A  84D4 99FC EA98 4F12 B400
 D: misc kernel hacking and testing
-S: Grasmeierstrasse 11
-S: 80805 Muenchen
-S: Germany
 
 N: Ray Burr
 E: ryb@nightmare.com
@@ -1124,6 +1120,9 @@ S: 1150 Ringwood Court
 S: San Jose, California 95131
 S: USA
 
+N: Adam Fritzler
+E: mid@zigamorph.net
+
 N: Fernando Fuganti
 E: fuganti@conectiva.com.br
 E: fuganti@netbank.com.br
index c3014df066c4e3ee61b12397cb6e964131630427..40ac7759c3bb5342edf9168153edbf1f1ff05e79 100644 (file)
@@ -154,7 +154,7 @@ firmware_class/
        - request_firmware() hotplug interface info.
 floppy.txt
        - notes and driver options for the floppy disk driver.
-fujitsu/
+frv/
        - Fujitsu FR-V Linux documentation.
 gpio.txt
        - overview of GPIO (General Purpose Input/Output) access conventions.
@@ -364,8 +364,6 @@ sharedsubtree.txt
        - a description of shared subtrees for namespaces.
 smart-config.txt
        - description of the Smart Config makefile feature.
-smp.txt
-       - a few notes on symmetric multi-processing.
 sony-laptop.txt
        - Sony Notebook Control Driver (SNC) Readme.
 sonypi.txt
index 35f5bd243336aeb1927f42483e26fa7586bcb205..6c816751b8686394d8cbdbd1fc639154d7f5b7ac 100644 (file)
@@ -53,7 +53,7 @@ Finding it the old way
 
 [Sat Mar  2 10:32:33 PST 1996 KERNEL_BUG-HOWTO lm@sgi.com (Larry McVoy)]
 
-This is how to track down a bug if you know nothing about kernel hacking.  
+This is how to track down a bug if you know nothing about kernel hacking.
 It's a brute force approach but it works pretty well.
 
 You need:
@@ -66,12 +66,12 @@ You will then do:
 
         . Rebuild a revision that you believe works, install, and verify that.
         . Do a binary search over the kernels to figure out which one
-          introduced the bug.  I.e., suppose 1.3.28 didn't have the bug, but 
+          introduced the bug.  I.e., suppose 1.3.28 didn't have the bug, but
           you know that 1.3.69 does.  Pick a kernel in the middle and build
           that, like 1.3.50.  Build & test; if it works, pick the mid point
           between .50 and .69, else the mid point between .28 and .50.
         . You'll narrow it down to the kernel that introduced the bug.  You
-          can probably do better than this but it gets tricky.  
+          can probably do better than this but it gets tricky.
 
         . Narrow it down to a subdirectory
 
@@ -81,27 +81,27 @@ You will then do:
             directories:
 
                 Copy the non-working directory next to the working directory
-                as "dir.63".  
+                as "dir.63".
                 One directory at time, try moving the working directory to
-                "dir.62" and mv dir.63 dir"time, try 
+                "dir.62" and mv dir.63 dir"time, try
 
                         mv dir dir.62
                         mv dir.63 dir
                         find dir -name '*.[oa]' -print | xargs rm -f
 
                 And then rebuild and retest.  Assuming that all related
-                changes were contained in the sub directory, this should 
-                isolate the change to a directory.  
+                changes were contained in the sub directory, this should
+                isolate the change to a directory.
 
                 Problems: changes in header files may have occurred; I've
-                found in my case that they were self explanatory - you may 
+                found in my case that they were self explanatory - you may
                 or may not want to give up when that happens.
 
         . Narrow it down to a file
 
           - You can apply the same technique to each file in the directory,
-            hoping that the changes in that file are self contained.  
-            
+            hoping that the changes in that file are self contained.
+
         . Narrow it down to a routine
 
           - You can take the old file and the new file and manually create
@@ -130,7 +130,7 @@ You will then do:
             that makes the difference.
 
 Finally, you take all the info that you have, kernel revisions, bug
-description, the extent to which you have narrowed it down, and pass 
+description, the extent to which you have narrowed it down, and pass
 that off to whomever you believe is the maintainer of that section.
 A post to linux.dev.kernel isn't such a bad idea if you've done some
 work to narrow it down.
index 681e2b36195c98ea5271b76383b3a574b190b04f..08a1ed1cb5d84192d4b1e3e0eec3cf058dfded73 100644 (file)
@@ -220,20 +220,8 @@ decreasing the likelihood of your MIME-attached change being accepted.
 Exception:  If your mailer is mangling patches then someone may ask
 you to re-send them using MIME.
 
-
-WARNING: Some mailers like Mozilla send your messages with
----- message header ----
-Content-Type: text/plain; charset=us-ascii; format=flowed
----- message header ----
-The problem is that "format=flowed" makes some of the mailers
-on receiving side to replace TABs with spaces and do similar
-changes. Thus the patches from you can look corrupted.
-
-To fix this just make your mozilla defaults/pref/mailnews.js file to look like:
-pref("mailnews.send_plaintext_flowed", false); // RFC 2646=======
-pref("mailnews.display.disable_format_flowed_support", true);
-
-
+See Documentation/email-clients.txt for hints about configuring
+your e-mail client so that it sends your patches untouched.
 
 8) E-mail size.
 
index c0d8853672dc9e533e4be07c573c5e2918331038..2e953e228f4d7295d4f847cf531fb1719cc64a35 100644 (file)
@@ -32,7 +32,7 @@ BARRIER IO before the access to the SMC chip because the AEN latch
 only needs occurs after the SMC IO write cycle.  The routines that
 implement this work-around make an additional concession which is to
 disable interrupts during the IO sequence.  Other hardware devices
-(the LogicPD CPLD) have registers in the same the physical memory
+(the LogicPD CPLD) have registers in the same physical memory
 region as the SMC chip.  An interrupt might allow an access to one of
 those registers while SMC IO is being performed.
 
index 24029f65fc94a0096a2116b1c893c6258cb843a7..172ad4aec493cbe9a9db3b6193a43d8794b231e6 100644 (file)
@@ -16,3 +16,7 @@ echo 'echo "$@" >> /tmp/modprobe.log' >> /tmp/modprobe
 echo 'exec /sbin/modprobe "$@"' >> /tmp/modprobe
 chmod a+x /tmp/modprobe
 echo /tmp/modprobe > /proc/sys/kernel/modprobe
+
+Note that the above applies only when the *kernel* is requesting
+that the module be loaded -- it won't have any effect if that module
+is being loaded explicitly using "modprobe" from userspace.
index 2a97320ee17f1d1b1c5a9b1efc138bbea4631f0e..83009fdcbbc8ee2de932cb4713dbb44734eab4b0 100644 (file)
@@ -122,15 +122,15 @@ None the less, there are some APIs to support such legacy drivers.  Avoid
 using these calls except with such hotplug-deficient drivers.
 
        struct platform_device *platform_device_alloc(
-                       char *name, unsigned id);
+                       const char *name, int id);
 
 You can use platform_device_alloc() to dynamically allocate a device, which
 you will then initialize with resources and platform_device_register().
 A better solution is usually:
 
        struct platform_device *platform_device_register_simple(
-                       char *name, unsigned id,
-                       struct resource *res, unsigned nres);
+                       const char *name, int id,
+                       struct resource *res, unsigned int nres);
 
 You can use platform_device_register_simple() as a one-step call to allocate
 and register a device.
index d1b98257d00063db10075d54180b7497bcc99d41..44c97e6accb2655faed63b52e4bc63848571a7ab 100644 (file)
@@ -377,7 +377,7 @@ more explicit to have a method whereby userspace sees this divergence.
 Rather than have a group where some items behave differently than
 others, configfs provides a method whereby one or many subgroups are
 automatically created inside the parent at its creation.  Thus,
-mkdir("parent) results in "parent", "parent/subgroup1", up through
+mkdir("parent") results in "parent", "parent/subgroup1", up through
 "parent/subgroupN".  Items of type 1 can now be created in
 "parent/subgroup1", and items of type N can be created in
 "parent/subgroupN".
index dac45c92d872b977312372210243ffa318ad08cb..0f33c77bc14b2695f6ebb1d70c464bee674c7c33 100644 (file)
@@ -1,6 +1,6 @@
 Changes since 2.5.0:
 
---- 
+---
 [recommended]
 
 New helpers: sb_bread(), sb_getblk(), sb_find_get_block(), set_bh(),
@@ -10,7 +10,7 @@ Use them.
 
 (sb_find_get_block() replaces 2.4's get_hash_table())
 
---- 
+---
 [recommended]
 
 New methods: ->alloc_inode() and ->destroy_inode().
@@ -28,7 +28,7 @@ Declare
 
 Use FOO_I(inode) instead of &inode->u.foo_inode_i;
 
-Add foo_alloc_inode() and foo_destory_inode() - the former should allocate
+Add foo_alloc_inode() and foo_destroy_inode() - the former should allocate
 foo_inode_info and return the address of ->vfs_inode, the latter should free
 FOO_I(inode) (see in-tree filesystems for examples).
 
index 194c8f35132065496048f8ae0bd80b688240d96c..0b1b0c0086137c6bb07a1f220ccb6df7d31832b6 100644 (file)
@@ -216,6 +216,7 @@ Table 1-3: Contents of the stat files (as of 2.6.22-rc3)
   priority      priority level
   nice          nice level
   num_threads   number of threads
+  it_real_value        (obsolete, always 0)
   start_time    time the process started after system boot
   vsize         virtual memory size
   rss           resident set memory size
index 339c6a4f220ec036a7bc681d512ef65982dcdcef..7be232b44ee4602f74dc0b75ed66d150c23a6aaf 100644 (file)
@@ -118,7 +118,7 @@ All this differs from the old initrd in several ways:
     with the new root (cd /newmount; mount --move . /; chroot .), attach
     stdin/stdout/stderr to the new /dev/console, and exec the new init.
 
-    Since this is a remarkably persnickity process (and involves deleting
+    Since this is a remarkably persnickety process (and involves deleting
     commands before you can run them), the klibc package introduced a helper
     program (utils/run_init.c) to do all this for you.  Most other packages
     (such as busybox) have named this command "switch_root".
index 18d23f9a18c74663e1a7cbcc07232e7879945c5e..094f2d2f38b1a5571283ee745aa494c12b12808c 100644 (file)
@@ -140,7 +140,7 @@ close()     decrements the channel buffer's refcount.  When the refcount
 In order for a user application to make use of relay files, the
 host filesystem must be mounted.  For example,
 
-       mount -t debugfs debugfs /debug
+       mount -t debugfs debugfs /sys/kernel/debug
 
 NOTE:   the host filesystem doesn't need to be mounted for kernel
        clients to create or use channels - it only needs to be
similarity index 98%
rename from Documentation/fujitsu/frv/booting.txt
rename to Documentation/frv/booting.txt
index 4e229056ef2261b79ac3ab40ef59820da16b0cf9..ace200b7c2140145c457ee86ce7f02b532c85e87 100644 (file)
@@ -177,5 +177,5 @@ separated by spaces:
   (*) vdc=...
 
       This option configures the MB93493 companion chip visual display
-      driver. Please see Documentation/fujitsu/mb93493/vdc.txt for more
+      driver. Please see Documentation/frv/mb93493/vdc.txt for more
       information.
index 74f68b35f7c161d0e6efe9a0822a8e45e6f49b49..1ba84f3584e3022e952647ce7420894f01d8349e 100644 (file)
@@ -85,7 +85,7 @@ involve special block devices or loopbacks; you merely create a directory on
 disk with the desired initrd content, cd to that directory, and run (as an
 example):
 
-find . | cpio --quiet -c -o | gzip -9 -n > /boot/imagefile.img
+find . | cpio --quiet -H newc -o | gzip -9 -n > /boot/imagefile.img
 
 Examining the contents of an existing image file is just as simple:
 
diff --git a/Documentation/ja_JP/stable_kernel_rules.txt b/Documentation/ja_JP/stable_kernel_rules.txt
new file mode 100644 (file)
index 0000000..17d8751
--- /dev/null
@@ -0,0 +1,79 @@
+NOTE:
+This is Japanese translated version of "Documentation/stable_kernel_rules.txt".
+This one is maintained by Tsugikazu Shibata <tshibata@ab.jp.nec.com>
+and JF Project team <www.linux.or.jp/JF>.
+If you find difference with original file or problem in translation,
+please contact maintainer of this file or JF project.
+
+Please also note that purpose of this file is easier to read for non
+English natives and do no intended to fork. So, if you have any
+comment or update of this file, please try to update Original(English)
+file at first.
+
+==================================
+ã\81\93ã\82\8cã\81¯ã\80\81
+linux-2.6.24/Documentation/stable_kernel_rules.txt
+ã\81®å\92\8c訳ã\81§ã\81\99ã\80\82
+
+翻訳å\9b£ä½\93ï¼\9a JF Ã£\83\97ã\83­ã\82¸ã\82§ã\82¯ã\83\88 < http://www.linux.or.jp/JF/ >
+翻訳æ\97¥ï¼\9a 2007/12/30
+翻訳è\80\85ï¼\9a Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com>
+æ ¡æ­£è\80\85ï¼\9a Ã¦Â­Â¦Ã¤Âº\95伸å\85\89ã\81\95ã\82\93ã\80\81<takei at webmasters dot gr dot jp>
+         Ã£\81\8bã\81­ã\81\93ã\81\95ã\82\93 (Seiji Kaneko) <skaneko at a2 dot mbn dot or dot jp>
+         Ã¥Â°\8fæ\9e\97 Ã©\9b\85Ã¥\85¸ã\81\95ã\82\93 (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp>
+         Ã©\87\8eÃ¥\8f£ã\81\95ã\82\93 (Kenji Noguchi) <tokyo246 at gmail dot com>
+         Ã§Â¥\9e宮信太é\83\8eã\81\95ã\82\93 <jin at libjingu dot jp>
+==================================
+
+ã\81\9aã\81£ã\81¨ç\9f¥ã\82\8aã\81\9fã\81\8bã\81£ã\81\9f Linux 2.6 -stable Ã£\83ªã\83ªã\83¼ã\82¹ã\81®å\85¨ã\81¦
+
+"-stable" Ã£\83\84ã\83ªã\83¼ã\81«ã\81©ã\81®ã\82\88ã\81\86ã\81ªç¨®é¡\9eã\81®ã\83\91ã\83\83ã\83\81ã\81\8cÃ¥\8f\97ã\81\91Ã¥\85¥ã\82\8cã\82\89ã\82\8cã\82\8bã\81\8bã\80\81ã\81©ã\81®ã\82\88ã\81\86ã\81ª
+ã\82\82ã\81®ã\81\8cå\8f\97ã\81\91å\85¥ã\82\8cã\82\89ã\82\8cã\81ªã\81\84ã\81\8bã\80\81ã\81«ã\81¤ã\81\84ã\81¦ã\81®è¦\8få\89\87-
+
+ - Ã¦\98\8eã\82\89ã\81\8bã\81«æ­£ã\81\97ã\81\8fã\80\81ã\83\86ã\82¹ã\83\88ã\81\95ã\82\8cã\81¦ã\81\84ã\82\8bã\82\82ã\81®ã\81§ã\81ªã\81\91ã\82\8cã\81°ã\81ªã\82\89ã\81ªã\81\84ã\80\82
+ - Ã¦\96\87è\84\88(å¤\89æ\9b´è¡\8cã\81®å\89\8då¾\8c)ã\82\92Ã¥\90«ã\82\81ã\81¦ 100 Ã¨Â¡\8cã\82\88ã\82\8a大ã\81\8dã\81\8fã\81¦ã\81¯ã\81\84ã\81\91ã\81ªã\81\84ã\80\82
+ - Ã£\81\9fã\81 ä¸\80Ã¥\80\8bã\81®ã\81\93ã\81¨ã\81 ã\81\91ã\82\92修正ã\81\97ã\81¦ã\81\84ã\82\8bã\81¹ã\81\8dã\80\82
+ - Ã§\9a\86ã\82\92æ\82©ã\81¾ã\81\9bã\81¦ã\81\84ã\82\8bæ\9c\89©ã\81®ã\83\90ã\82°ã\82\92修正ã\81\97ã\81ªã\81\91ã\82\8cã\81°ã\81ªã\82\89ã\81ªã\81\84ã\80\82("ã\81\93ã\82\8cã\81¯ã\83\90ã\82°ã\81§
+   Ã£\81\82ã\82\8bã\81\8bã\82\82ã\81\97ã\82\8cã\81ªã\81\84ã\81\8c..." Ã£\81®ã\82\88ã\81\86ã\81ªã\82\82ã\81®ã\81§ã\81¯ã\81ªã\81\84)
+ - Ã£\83\93ã\83«ã\83\89ã\82¨ã\83©ã\83¼(CONFIG_BROKENã\81«ã\81ªã\81£ã\81¦ã\81\84ã\82\8bã\82\82ã\81®ã\82\92é\99¤ã\81\8f), oops, Ã£\83\8fã\83³ã\82°ã\80\81ã\83\87ã\83¼
+   Ã£\82¿ç ´å£\8aã\80\81ç\8f¾å®\9fã\81®ã\82ȋ\82­ã\83¥ã\83ªã\83\86ã\82£å\95\8fé¡\8cã\80\81ã\81\9dã\81®ä»\96 "ã\81\82ã\81\82ã\80\81ã\81\93ã\82\8cã\81¯ã\83\80ã\83¡ã\81 ã\81­"ã\81¨ã\81\84ã\81\86
+   Ã£\82\88ã\81\86ã\81ªã\82\82ã\81®ã\82\92修正ã\81\97ã\81ªã\81\91ã\82\8cã\81°ã\81ªã\82\89ã\81ªã\81\84ã\80\82ç\9f­ã\81\8fè¨\80ã\81\88ã\81°ã\80\81é\87\8d大ã\81ªå\95\8fé¡\8cã\80\82
+ - Ã£\81©ã\81®ã\82\88ã\81\86ã\81«ç«¶å\90\88ç\8a¶æ\85\8bã\81\8cç\99ºç\94\9fã\81\99ã\82\8bã\81\8bã\81®èª¬æ\98\8eã\82\82ä¸\80ç·\92ã\81«æ\9b¸ã\81\8bã\82\8cã\81¦ã\81\84ã\81ªã\81\84é\99\90ã\82\8aã\80\81
+   "ç\90\86è«\96ç\9a\84ã\81«ã\81¯ç«¶å\90\88ç\8a¶æ\85\8bã\81«ã\81ªã\82\8b"ã\82\88ã\81\86ã\81ªã\82\82ã\81®ã\81¯ä¸\8dÃ¥\8f¯ã\80\82
+ - Ã£\81\84ã\81\8bã\81ªã\82\8bäº\9bç´°ã\81ªä¿®æ­£ã\82\82Ã¥\90«ã\82\81ã\82\8bã\81\93ã\81¨ã\81¯ã\81§ã\81\8dã\81ªã\81\84ã\80\82(ã\82¹ã\83\9aã\83«ã\81®ä¿®æ­£ã\80\81空ç\99½ã\81®ã\82¯ã\83ªã\83¼
+   Ã£\83³ã\82¢ã\83\83ã\83\97ã\81ªã\81©)
+ - Ã¥Â¯Â¾Ã¥Â¿\9cã\81\99ã\82\8bã\82µã\83\96ã\82·ã\82¹ã\83\86ã\83 ã\83¡ã\83³ã\83\86ã\83\8aã\81\8cÃ¥\8f\97ã\81\91Ã¥\85¥ã\82\8cã\81\9fã\82\82ã\81®ã\81§ã\81ªã\81\91ã\82\8cã\81°ã\81ªã\82\89ã\81ªã\81\84ã\80\82
+ - Documentation/SubmittingPatches Ã£\81®è¦\8fÃ¥\89\87ã\81«å¾\93ã\81£ã\81\9fã\82\82ã\81®ã\81§ã\81ªã\81\91ã\82\8cã\81°ã\81ªã\82\89ã\81ªã\81\84ã\80\82
+
+-stable Ã£\83\84ã\83ªã\83¼ã\81«ã\83\91ã\83\83ã\83\81ã\82\92é\80\81ä»\98ã\81\99ã\82\8bæ\89\8bç¶\9aã\81\8d-
+
+ - Ã¤Â¸\8aè¨\98ã\81®è¦\8fÃ¥\89\87ã\81«å¾\93ã\81£ã\81¦ã\81\84ã\82\8bã\81\8bã\82\92確èª\8dã\81\97ã\81\9få¾\8cã\81«ã\80\81stable@kernel.org Ã£\81«ã\83\91ã\83\83ã\83\81
+   Ã£\82\92é\80\81ã\82\8bã\80\82
+ - Ã©\80\81ä¿¡è\80\85ã\81¯ã\83\91ã\83\83ã\83\81ã\81\8cã\82­ã\83¥ã\83¼ã\81«å\8f\97ã\81\91ä»\98ã\81\91ã\82\89ã\82\8cã\81\9fé\9a\9bã\81«ã\81¯ ACK Ã£\82\92ã\80\81Ã¥\8d´ä¸\8bã\81\95ã\82\8cã\81\9få ´å\90\88
+   Ã£\81«ã\81¯ NAK Ã£\82\92Ã¥\8f\97ã\81\91Ã¥\8f\96ã\82\8bã\80\82ã\81\93ã\81®å\8f\8då¿\9cã\81¯é\96\8bç\99ºè\80\85ã\81\9fã\81¡ã\81®ã\82¹ã\82±ã\82¸ã\83¥ã\83¼ã\83«ã\81«ã\82\88ã\81£ã\81¦ã\80\81æ\95°
+   Ã¦\97¥ã\81\8bã\81\8bã\82\8bå ´å\90\88ã\81\8cã\81\82ã\82\8bã\80\82
+ - Ã£\82\82ã\81\97Ã¥\8f\97ã\81\91Ã¥\8f\96ã\82\89ã\82\8cã\81\9fã\82\89ã\80\81ã\83\91ã\83\83ã\83\81ã\81¯ä»\96ã\81®é\96\8bç\99ºè\80\85ã\81\9fã\81¡ã\81®ã\83‹\83\93ã\83¥ã\83¼ã\81®ã\81\9fã\82\81ã\81«
+   -stable Ã£\82­ã\83¥ã\83¼ã\81«è¿½å\8a ã\81\95ã\82\8cã\82\8bã\80\82
+ - Ã£\82ȋ\82­ã\83¥ã\83ªã\83\86ã\82£ã\83\91ã\83\83ã\83\81ã\81¯ã\81\93ã\81®ã\82¨ã\82¤ã\83ªã\82¢ã\82¹ (stable@kernel.org) Ã£\81«é\80\81ã\82\89ã\82\8cã\82\8bã\81¹
+   Ã£\81\8dã\81§ã\81¯ã\81ªã\81\8fã\80\81代ã\82\8fã\82\8aã\81« security@kernel.org Ã£\81®ã\82¢ã\83\89ã\83‹\82¹ã\81«é\80\81ã\82\89ã\82\8cã\82\8bã\80\82
+
+ã\83¬ã\83\93ã\83¥ã\83¼ã\82µã\82¤ã\82¯ã\83«-
+
+ - -stable Ã£\83¡ã\83³ã\83\86ã\83\8aã\81\8cã\83‹\83\93ã\83¥ã\83¼ã\82µã\82¤ã\82¯ã\83«ã\82\92決ã\82\81ã\82\8bã\81¨ã\81\8dã\80\81ã\83\91ã\83\83ã\83\81ã\81¯ã\83‹\83\93ã\83¥ã\83¼å§\94
+   Ã¥\93¡ä¼\9aã\81¨ã\83\91ã\83\83ã\83\81ã\81\8cå½±é\9f¿ã\81\99ã\82\8bé \98Ã¥\9f\9fã\81®ã\83¡ã\83³ã\83\86ã\83\8a(æ\8f\90ä¾\9bè\80\85ã\81\8cã\81\9dã\81®é \98Ã¥\9f\9fã\81®ã\83¡ã\83³ã\83\86ã\83\8aã\81§ç\84¡
+   Ã£\81\84é\99\90ã\82\8a)ã\81«é\80\81ã\82\89ã\82\8cã\80\81linux-kernel Ã£\83¡ã\83¼ã\83ªã\83³ã\82°ã\83ªã\82¹ã\83\88ã\81«CCã\81\95ã\82\8cã\82\8bã\80\82
+ - Ã£\83‹\83\93ã\83¥ã\83¼å§\94Ã¥\93¡ä¼\9aã\81¯ 48æ\99\82é\96\93ã\81®é\96\93ã\81« ACK Ã£\81\8b NAK Ã£\82\92Ã¥\87ºã\81\99ã\80\82
+ - Ã£\82\82ã\81\97ã\83\91ã\83\83ã\83\81ã\81\8cå§\94Ã¥\93¡ä¼\9aã\81®ã\83¡ã\83³ã\83\90ã\81\8bã\82\89Ã¥\8d´ä¸\8bã\82\8cã\82\8bã\81\8bã\80\81ã\83¡ã\83³ã\83\86ã\83\8aé\81\94ã\82\84ã\83¡ã\83³ã\83\90ã\81\8cæ°\97ä»\98
+   Ã£\81\8bã\81ªã\81\8bã\81£ã\81\9fÃ¥\95\8fé¡\8cã\81\8cæ\8c\81ã\81¡ã\81\82ã\81\8cã\82\8aã\80\81linux-kernel Ã£\83¡ã\83³ã\83\90ã\81\8cã\83\91ã\83\83ã\83\81ã\81«ç\95°è­°ã\82\92Ã¥\94±ã\81\88
+   Ã£\81\9få ´å\90\88ã\81«ã\81¯ã\80\81ã\83\91ã\83\83ã\83\81ã\81¯ã\82­ã\83¥ã\83¼ã\81\8bã\82\89Ã¥\89\8aé\99¤ã\81\95ã\82\8cã\82\8bã\80\82
+ - Ã£\83‹\83\93ã\83¥ã\83¼ã\82µã\82¤ã\82¯ã\83«ã\81®æ\9c\80å¾\8cã\81«ã\80\81ACK Ã£\82\92Ã¥\8f\97ã\81\91ã\81\9fã\83\91ã\83\83ã\83\81ã\81¯æ\9c\80æ\96°ã\81® -stable Ã£\83ªã\83ªã\83¼
+   Ã£\82¹ã\81«è¿½å\8a ã\81\95ã\82\8cã\80\81ã\81\9dã\81®å¾\8cã\81«æ\96°ã\81\97ã\81\84 -stable Ã£\83ªã\83ªã\83¼ã\82¹ã\81\8cè¡\8cã\82\8fã\82\8cã\82\8bã\80\82
+ - Ã£\82ȋ\82­ã\83¥ã\83ªã\83\86ã\82£ã\83\91ã\83\83ã\83\81ã\81¯ã\80\81é\80\9a常ã\81®ã\83‹\83\93ã\83¥ã\83¼ã\82µã\82¤ã\82¯ã\83«ã\82\92é\80\9aã\82\89ã\81\9aã\80\81ã\82ȋ\82­ã\83¥ã\83ªã\83\86ã\82£
+   Ã£\82«ã\83¼ã\83\8dã\83«ã\83\81ã\83¼ã\83 ã\81\8bã\82\89ç\9b´æ\8eÂ¥ -stable Ã£\83\84ã\83ªã\83¼ã\81«å\8f\97ã\81\91ä»\98ã\81\91ã\82\89ã\82\8cã\82\8bã\80\82
+   Ã£\81\93ã\81®æ\89\8bç¶\9aã\81\8dã\81®è©³ç´°ã\81«ã\81¤ã\81\84ã\81¦ã\81¯ kernel security Ã£\83\81ã\83¼ã\83 ã\81«å\95\8fã\81\84Ã¥\90\88ã\82\8fã\81\9bã\82\8bã\81\93ã\81¨ã\80\82
+
+ã\83¬ã\83\93ã\83¥ã\83¼å§\94å\93¡ä¼\9a-
+
+ - Ã£\81\93ã\81®å§\94Ã¥\93¡ä¼\9aã\81¯ã\80\81ã\81\93ã\81®ã\82¿ã\82¹ã\82¯ã\81«ã\81¤ã\81\84ã\81¦æ´»å\8b\95ã\81\99ã\82\8bå¤\9aã\81\8fã\81®ã\83\9cã\83©ã\83³ã\83\86ã\82£ã\82¢ã\81¨ã\80\81å°\91æ\95°ã\81®
+   Ã©\9d\9eã\83\9cã\83©ã\83³ã\83\86ã\82£ã\82¢ã\81®ã\82«ã\83¼ã\83\8dã\83«é\96\8bç\99ºè\80\85é\81\94ã\81§æ§\8bæ\88\90ã\81\95ã\82\8cã\81¦ã\81\84ã\82\8bã\80\82
+
index cf3868956f1e852850fa7ac3a680f0b4b6e25ee6..9ad4e6fc56fdb7a880e5276ea5f9b0c1d780778e 100644 (file)
@@ -549,7 +549,7 @@ and is between 256 and 4096 characters. It is defined in the file
                        1 will print _a lot_ more information - normally
                        only useful to kernel developers.
 
-       decnet=         [HW,NET]
+       decnet.addr=    [HW,NET]
                        Format: <area>[,<node>]
                        See also Documentation/networking/decnet.txt.
 
@@ -1561,14 +1561,17 @@ and is between 256 and 4096 characters. It is defined in the file
        ramdisk_size=   [RAM] Sizes of RAM disks in kilobytes
                        See Documentation/ramdisk.txt.
 
-       rcu.blimit=     [KNL,BOOT] Set maximum number of finished
-                       RCU callbacks to process in one batch.
+       rcupdate.blimit=        [KNL,BOOT]
+                       Set maximum number of finished RCU callbacks to process
+                       in one batch.
 
-       rcu.qhimark=    [KNL,BOOT] Set threshold of queued
+       rcupdate.qhimark=       [KNL,BOOT]
+                       Set threshold of queued
                        RCU callbacks over which batch limiting is disabled.
 
-       rcu.qlowmark=   [KNL,BOOT] Set threshold of queued
-                       RCU callbacks below which batch limiting is re-enabled.
+       rcupdate.qlowmark=      [KNL,BOOT]
+                       Set threshold of queued RCU callbacks below which
+                       batch limiting is re-enabled.
 
        rdinit=         [KNL]
                        Format: <full_path>
@@ -1888,9 +1891,6 @@ and is between 256 and 4096 characters. It is defined in the file
        st=             [HW,SCSI] SCSI tape parameters (buffers, etc.)
                        See Documentation/scsi/st.txt.
 
-       st0x=           [HW,SCSI]
-                       See header of drivers/scsi/seagate.c.
-
        sti=            [PARISC,HW]
                        Format: <num>
                        Set the STI (builtin display/keyboard on the HP-PARISC
@@ -1975,9 +1975,6 @@ and is between 256 and 4096 characters. It is defined in the file
        tipar.delay=    [HW,PPT]
                        Set inter-bit delay in microseconds (default 10).
 
-       tmc8xx=         [HW,SCSI]
-                       See header of drivers/scsi/seagate.c.
-
        tmscsim=        [HW,SCSI]
                        See comment before function dc390_setup() in
                        drivers/scsi/tmscsim.c.
index 6c8a2386cd50d150fb58844324c40fbb8685bb8c..0f23d67f958ff5b6ee96a0248fdd2c9b9ab65586 100644 (file)
@@ -34,6 +34,8 @@
 #include <zlib.h>
 #include <assert.h>
 #include <sched.h>
+#include <limits.h>
+#include <stddef.h>
 #include "linux/lguest_launcher.h"
 #include "linux/virtio_config.h"
 #include "linux/virtio_net.h"
@@ -99,13 +101,11 @@ struct device_list
        /* The descriptor page for the devices. */
        u8 *descpage;
 
-       /* The tail of the last descriptor. */
-       unsigned int desc_used;
-
        /* A single linked list of devices. */
        struct device *dev;
-       /* ... And an end pointer so we can easily append new devices */
-       struct device **lastdev;
+       /* And a pointer to the last device for easy append and also for
+        * configuration appending. */
+       struct device *lastdev;
 };
 
 /* The list of Guest devices, based on command line arguments. */
@@ -191,7 +191,14 @@ static void *_convert(struct iovec *iov, size_t size, size_t align,
 #define cpu_to_le64(v64) (v64)
 #define le16_to_cpu(v16) (v16)
 #define le32_to_cpu(v32) (v32)
-#define le64_to_cpu(v32) (v64)
+#define le64_to_cpu(v64) (v64)
+
+/* The device virtqueue descriptors are followed by feature bitmasks. */
+static u8 *get_feature_bits(struct device *dev)
+{
+       return (u8 *)(dev->desc + 1)
+               + dev->desc->num_vq * sizeof(struct lguest_vqconfig);
+}
 
 /*L:100 The Launcher code itself takes us out into userspace, that scary place
  * where pointers run wild and free!  Unfortunately, like most userspace
@@ -914,21 +921,58 @@ static void enable_fd(int fd, struct virtqueue *vq)
        write(waker_fd, &vq->dev->fd, sizeof(vq->dev->fd));
 }
 
+/* Resetting a device is fairly easy. */
+static void reset_device(struct device *dev)
+{
+       struct virtqueue *vq;
+
+       verbose("Resetting device %s\n", dev->name);
+       /* Clear the status. */
+       dev->desc->status = 0;
+
+       /* Clear any features they've acked. */
+       memset(get_feature_bits(dev) + dev->desc->feature_len, 0,
+              dev->desc->feature_len);
+
+       /* Zero out the virtqueues. */
+       for (vq = dev->vq; vq; vq = vq->next) {
+               memset(vq->vring.desc, 0,
+                      vring_size(vq->config.num, getpagesize()));
+               vq->last_avail_idx = 0;
+       }
+}
+
 /* This is the generic routine we call when the Guest uses LHCALL_NOTIFY. */
 static void handle_output(int fd, unsigned long addr)
 {
        struct device *i;
        struct virtqueue *vq;
 
-       /* Check each virtqueue. */
+       /* Check each device and virtqueue. */
        for (i = devices.dev; i; i = i->next) {
+               /* Notifications to device descriptors reset the device. */
+               if (from_guest_phys(addr) == i->desc) {
+                       reset_device(i);
+                       return;
+               }
+
+               /* Notifications to virtqueues mean output has occurred. */
                for (vq = i->vq; vq; vq = vq->next) {
-                       if (vq->config.pfn == addr/getpagesize()
-                           && vq->handle_output) {
-                               verbose("Output to %s\n", vq->dev->name);
-                               vq->handle_output(fd, vq);
+                       if (vq->config.pfn != addr/getpagesize())
+                               continue;
+
+                       /* Guest should acknowledge (and set features!)  before
+                        * using the device. */
+                       if (i->desc->status == 0) {
+                               warnx("%s gave early output", i->name);
                                return;
                        }
+
+                       if (strcmp(vq->dev->name, "console") != 0)
+                               verbose("Output to %s\n", vq->dev->name);
+                       if (vq->handle_output)
+                               vq->handle_output(fd, vq);
+                       return;
                }
        }
 
@@ -986,54 +1030,44 @@ static void handle_input(int fd)
  *
  * All devices need a descriptor so the Guest knows it exists, and a "struct
  * device" so the Launcher can keep track of it.  We have common helper
- * routines to allocate them.
- *
- * This routine allocates a new "struct lguest_device_desc" from descriptor
- * table just above the Guest's normal memory.  It returns a pointer to that
- * descriptor. */
-static struct lguest_device_desc *new_dev_desc(u16 type)
-{
-       struct lguest_device_desc *d;
+ * routines to allocate and manage them. */
 
-       /* We only have one page for all the descriptors. */
-       if (devices.desc_used + sizeof(*d) > getpagesize())
-               errx(1, "Too many devices");
-
-       /* We don't need to set config_len or status: page is 0 already. */
-       d = (void *)devices.descpage + devices.desc_used;
-       d->type = type;
-       devices.desc_used += sizeof(*d);
-
-       return d;
+/* The layout of the device page is a "struct lguest_device_desc" followed by a
+ * number of virtqueue descriptors, then two sets of feature bits, then an
+ * array of configuration bytes.  This routine returns the configuration
+ * pointer. */
+static u8 *device_config(const struct device *dev)
+{
+       return (void *)(dev->desc + 1)
+               + dev->desc->num_vq * sizeof(struct lguest_vqconfig)
+               + dev->desc->feature_len * 2;
 }
 
-/* Each device descriptor is followed by some configuration information.
- * Each configuration field looks like: u8 type, u8 len, [... len bytes...].
- *
- * This routine adds a new field to an existing device's descriptor.  It only
- * works for the last device, but that's OK because that's how we use it. */
-static void add_desc_field(struct device *dev, u8 type, u8 len, const void *c)
+/* This routine allocates a new "struct lguest_device_desc" from descriptor
+ * table page just above the Guest's normal memory.  It returns a pointer to
+ * that descriptor. */
+static struct lguest_device_desc *new_dev_desc(u16 type)
 {
-       /* This is the last descriptor, right? */
-       assert(devices.descpage + devices.desc_used
-              == (u8 *)(dev->desc + 1) + dev->desc->config_len);
+       struct lguest_device_desc d = { .type = type };
+       void *p;
 
-       /* We only have one page of device descriptions. */
-       if (devices.desc_used + 2 + len > getpagesize())
-               errx(1, "Too many devices");
+       /* Figure out where the next device config is, based on the last one. */
+       if (devices.lastdev)
+               p = device_config(devices.lastdev)
+                       + devices.lastdev->desc->config_len;
+       else
+               p = devices.descpage;
 
-       /* Copy in the new config header: type then length. */
-       devices.descpage[devices.desc_used++] = type;
-       devices.descpage[devices.desc_used++] = len;
-       memcpy(devices.descpage + devices.desc_used, c, len);
-       devices.desc_used += len;
+       /* We only have one page for all the descriptors. */
+       if (p + sizeof(d) > (void *)devices.descpage + getpagesize())
+               errx(1, "Too many devices");
 
-       /* Update the device descriptor length: two byte head then data. */
-       dev->desc->config_len += 2 + len;
+       /* p might not be aligned, so we memcpy in. */
+       return memcpy(p, &d, sizeof(d));
 }
 
-/* This routine adds a virtqueue to a device.  We specify how many descriptors
- * the virtqueue is to have. */
+/* Each device descriptor is followed by the description of its virtqueues.  We
+ * specify how many descriptors the virtqueue is to have. */
 static void add_virtqueue(struct device *dev, unsigned int num_descs,
                          void (*handle_output)(int fd, struct virtqueue *me))
 {
@@ -1059,9 +1093,15 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
        /* Initialize the vring. */
        vring_init(&vq->vring, num_descs, p, getpagesize());
 
-       /* Add the configuration information to this device's descriptor. */
-       add_desc_field(dev, VIRTIO_CONFIG_F_VIRTQUEUE,
-                      sizeof(vq->config), &vq->config);
+       /* Append virtqueue to this device's descriptor.  We use
+        * device_config() to get the end of the device's current virtqueues;
+        * we check that we haven't added any config or feature information
+        * yet, otherwise we'd be overwriting them. */
+       assert(dev->desc->config_len == 0 && dev->desc->feature_len == 0);
+       memcpy(device_config(dev), &vq->config, sizeof(vq->config));
+       dev->desc->num_vq++;
+
+       verbose("Virtqueue page %#lx\n", to_guest_phys(p));
 
        /* Add to tail of list, so dev->vq is first vq, dev->vq->next is
         * second.  */
@@ -1072,11 +1112,41 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
         * virtqueue. */
        vq->handle_output = handle_output;
 
-       /* Set the "Don't Notify Me" flag if we don't have a handler */
+       /* As an optimization, set the advisory "Don't Notify Me" flag if we
+        * don't have a handler */
        if (!handle_output)
                vq->vring.used->flags = VRING_USED_F_NO_NOTIFY;
 }
 
+/* The first half of the feature bitmask is for us to advertise features.  The
+ * second half if for the Guest to accept features. */
+static void add_feature(struct device *dev, unsigned bit)
+{
+       u8 *features = get_feature_bits(dev);
+
+       /* We can't extend the feature bits once we've added config bytes */
+       if (dev->desc->feature_len <= bit / CHAR_BIT) {
+               assert(dev->desc->config_len == 0);
+               dev->desc->feature_len = (bit / CHAR_BIT) + 1;
+       }
+
+       features[bit / CHAR_BIT] |= (1 << (bit % CHAR_BIT));
+}
+
+/* This routine sets the configuration fields for an existing device's
+ * descriptor.  It only works for the last device, but that's OK because that's
+ * how we use it. */
+static void set_config(struct device *dev, unsigned len, const void *conf)
+{
+       /* Check we haven't overflowed our single page. */
+       if (device_config(dev) + len > devices.descpage + getpagesize())
+               errx(1, "Too many devices");
+
+       /* Copy in the config information, and store the length. */
+       memcpy(device_config(dev), conf, len);
+       dev->desc->config_len = len;
+}
+
 /* This routine does all the creation and setup of a new device, including
  * calling new_dev_desc() to allocate the descriptor and device memory. */
 static struct device *new_device(const char *name, u16 type, int fd,
@@ -1084,14 +1154,6 @@ static struct device *new_device(const char *name, u16 type, int fd,
 {
        struct device *dev = malloc(sizeof(*dev));
 
-       /* Append to device list.  Prepending to a single-linked list is
-        * easier, but the user expects the devices to be arranged on the bus
-        * in command-line order.  The first network device on the command line
-        * is eth0, the first block device /dev/vda, etc. */
-       *devices.lastdev = dev;
-       dev->next = NULL;
-       devices.lastdev = &dev->next;
-
        /* Now we populate the fields one at a time. */
        dev->fd = fd;
        /* If we have an input handler for this file descriptor, then we add it
@@ -1102,6 +1164,17 @@ static struct device *new_device(const char *name, u16 type, int fd,
        dev->handle_input = handle_input;
        dev->name = name;
        dev->vq = NULL;
+
+       /* Append to device list.  Prepending to a single-linked list is
+        * easier, but the user expects the devices to be arranged on the bus
+        * in command-line order.  The first network device on the command line
+        * is eth0, the first block device /dev/vda, etc. */
+       if (devices.lastdev)
+               devices.lastdev->next = dev;
+       else
+               devices.dev = dev;
+       devices.lastdev = dev;
+
        return dev;
 }
 
@@ -1226,7 +1299,7 @@ static void setup_tun_net(const char *arg)
        int netfd, ipfd;
        u32 ip;
        const char *br_name = NULL;
-       u8 hwaddr[6];
+       struct virtio_net_config conf;
 
        /* We open the /dev/net/tun device and tell it we want a tap device.  A
         * tap device is like a tun device, only somehow different.  To tell
@@ -1265,12 +1338,13 @@ static void setup_tun_net(const char *arg)
                ip = str2ip(arg);
 
        /* Set up the tun device, and get the mac address for the interface. */
-       configure_device(ipfd, ifr.ifr_name, ip, hwaddr);
+       configure_device(ipfd, ifr.ifr_name, ip, conf.mac);
 
        /* Tell Guest what MAC address to use. */
-       add_desc_field(dev, VIRTIO_CONFIG_NET_MAC_F, sizeof(hwaddr), hwaddr);
+       add_feature(dev, VIRTIO_NET_F_MAC);
+       set_config(dev, sizeof(conf), &conf);
 
-       /* We don't seed the socket any more; setup is done. */
+       /* We don't need the socket any more; setup is done. */
        close(ipfd);
 
        verbose("device %u: tun net %u.%u.%u.%u\n",
@@ -1458,8 +1532,7 @@ static void setup_block_file(const char *filename)
        struct device *dev;
        struct vblk_info *vblk;
        void *stack;
-       u64 cap;
-       unsigned int val;
+       struct virtio_blk_config conf;
 
        /* This is the pipe the I/O thread will use to tell us I/O is done. */
        pipe(p);
@@ -1477,14 +1550,18 @@ static void setup_block_file(const char *filename)
        vblk->fd = open_or_die(filename, O_RDWR|O_LARGEFILE);
        vblk->len = lseek64(vblk->fd, 0, SEEK_END);
 
+       /* We support barriers. */
+       add_feature(dev, VIRTIO_BLK_F_BARRIER);
+
        /* Tell Guest how many sectors this device has. */
-       cap = cpu_to_le64(vblk->len / 512);
-       add_desc_field(dev, VIRTIO_CONFIG_BLK_F_CAPACITY, sizeof(cap), &cap);
+       conf.capacity = cpu_to_le64(vblk->len / 512);
 
        /* Tell Guest not to put in too many descriptors at once: two are used
         * for the in and out elements. */
-       val = cpu_to_le32(VIRTQUEUE_NUM - 2);
-       add_desc_field(dev, VIRTIO_CONFIG_BLK_F_SEG_MAX, sizeof(val), &val);
+       add_feature(dev, VIRTIO_BLK_F_SEG_MAX);
+       conf.seg_max = cpu_to_le32(VIRTQUEUE_NUM - 2);
+
+       set_config(dev, sizeof(conf), &conf);
 
        /* The I/O thread writes to this end of the pipe when done. */
        vblk->done_fd = p[1];
@@ -1505,7 +1582,7 @@ static void setup_block_file(const char *filename)
        close(vblk->workpipe[0]);
 
        verbose("device %u: virtblock %llu sectors\n",
-               devices.device_num, cap);
+               devices.device_num, le64_to_cpu(conf.capacity));
 }
 /* That's the end of device setup. :*/
 
@@ -1610,12 +1687,12 @@ int main(int argc, char *argv[])
        /* First we initialize the device list.  Since console and network
         * device receive input from a file descriptor, we keep an fdset
         * (infds) and the maximum fd number (max_infd) with the head of the
-        * list.  We also keep a pointer to the last device, for easy appending
-        * to the list.  Finally, we keep the next interrupt number to hand out
-        * (1: remember that 0 is used by the timer). */
+        * list.  We also keep a pointer to the last device.  Finally, we keep
+        * the next interrupt number to hand out (1: remember that 0 is used by
+        * the timer). */
        FD_ZERO(&devices.infds);
        devices.max_infd = -1;
-       devices.lastdev = &devices.dev;
+       devices.lastdev = NULL;
        devices.next_irq = 1;
 
        cpu_id = 0;
index badb7480ea6282904d7ff648629262fa0f632a97..d8968958d839ddb7d94a317c8ac83918c66a2b63 100644 (file)
@@ -60,7 +60,7 @@ operation of the local communications in any other way though.
 
 The kernel command line takes options looking like the following:
 
-    decnet=1,2
+    decnet.addr=1,2
 
 the two numbers are the node address 1,2 = 1.2 For 2.2.xx kernels
 and early 2.3.xx kernels, you must use a comma when specifying the
diff --git a/Documentation/smp.txt b/Documentation/smp.txt
deleted file mode 100644 (file)
index 82fc50b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-To set up SMP
-
-Configure the kernel and answer Y to CONFIG_SMP.
-
-If you are using LILO, it is handy to have both SMP and non-SMP
-kernel images on hand. Edit /etc/lilo.conf to create an entry
-for another kernel image called "linux-smp" or something.
-
-The next time you compile the kernel, when running a SMP kernel,
-edit linux/Makefile and change "MAKE=make" to "MAKE=make -jN"
-(where N = number of CPU + 1, or if you have tons of memory/swap
- you can just use "-j" without a number). Feel free to experiment
-with this one.
-
-Of course you should time how long each build takes :-)
-Example:
-   make config
-   time -v sh -c 'make clean install modules modules_install'
-
-If you are using some Compaq MP compliant machines you will need to set
-the operating system in the BIOS settings to "Unixware" - don't ask me
-why Compaqs don't work otherwise.
index 58b16038baea02ba54bbd115ea7964964cbc7f83..da30a72a839c21cc47676dfd24c04636dedee75c 100644 (file)
@@ -84,13 +84,6 @@ S: Status, one of the following:
                        it has been replaced by a better system and you
                        should be using that.
 
-3C359 NETWORK DRIVER
-P:     Mike Phillips
-M:     mikep@linuxtr.net
-L:     netdev@vger.kernel.org
-W:     http://www.linuxtr.net
-S:     Maintained
-
 3C505 NETWORK DRIVER
 P:     Philip Blundell
 M:     philb@gnu.org
@@ -939,8 +932,6 @@ M:  maxk@qualcomm.com
 S:     Maintained
 
 BONDING DRIVER
-P:     Chad Tindel
-M:     ctindel@users.sourceforge.net
 P:     Jay Vosburgh
 M:     fubar@us.ibm.com
 L:     bonding-devel@lists.sourceforge.net
@@ -2864,15 +2855,6 @@ L:       ocfs2-devel@oss.oracle.com
 W:     http://oss.oracle.com/projects/ocfs2/
 S:     Supported
 
-OLYMPIC NETWORK DRIVER
-P:     Peter De Shrijver
-M:     p2@ace.ulyssis.student.kuleuven.ac.be
-P:     Mike Phillips
-M:     mikep@linuxtr.net
-L:     netdev@vger.kernel.org
-W:     http://www.linuxtr.net
-S:     Maintained
-
 OMNIKEY CARDMAN 4000 DRIVER
 P:     Harald Welte
 M:     laforge@gnumonks.org
@@ -3195,7 +3177,7 @@ S:        Maintained
 
 RAYLINK/WEBGEAR 802.11 WIRELESS LAN DRIVER
 P:     Corey Thomas
-M:     corey@world.std.com
+M:     coreythomas@charter.net
 L:     linux-wireless@vger.kernel.org
 S:     Maintained
 
@@ -3788,13 +3770,6 @@ L:       tlan-devel@lists.sourceforge.net (subscribers-only)
 W:     http://sourceforge.net/projects/tlan/
 S:     Maintained
 
-TOKEN-RING NETWORK DRIVER
-P:     Mike Phillips
-M:     mikep@linuxtr.net
-L:     netdev@vger.kernel.org
-W:     http://www.linuxtr.net
-S:     Maintained
-
 TOSHIBA ACPI EXTRAS DRIVER
 P:     John Belmonte
 M:     toshiba_acpi@memebeam.org
@@ -3815,18 +3790,9 @@ L:       linux-kernel@vger.kernel.org
 S:     Maintained
 
 TRIVIAL PATCHES
-P:     Adrian Bunk
+P:     Jesper Juhl
 M:     trivial@kernel.org
 L:     linux-kernel@vger.kernel.org
-W:     http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/
-T:     git kernel.org:/pub/scm/linux/kernel/git/bunk/trivial.git
-S:     Maintained
-
-TMS380 TOKEN-RING NETWORK DRIVER
-P:     Adam Fritzler
-M:     mid@auk.cx
-L:     linux-tr@linuxtr.net
-W:     http://www.auk.cx/tms380tr/
 S:     Maintained
 
 TULIP NETWORK DRIVER
index 0f84c742ed0e1c8363d27121fb2ce563fb582bc7..89f2d8b5136d72efcc0bd761cd3ba37ab956718f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1484,7 +1484,7 @@ kernelversion:
 # Single targets
 # ---------------------------------------------------------------------------
 # Single targets are compatible with:
-# - build whith mixed source and output
+# - build with mixed source and output
 # - build with separate output dir 'make O=...'
 # - external modules
 #
diff --git a/arch/Kconfig b/arch/Kconfig
new file mode 100644 (file)
index 0000000..3d72dc3
--- /dev/null
@@ -0,0 +1,31 @@
+#
+# General architecture dependent options
+#
+
+config OPROFILE
+       tristate "OProfile system profiling (EXPERIMENTAL)"
+       depends on PROFILING
+       depends on HAVE_OPROFILE
+       help
+         OProfile is a profiling system capable of profiling the
+         whole system, include the kernel, kernel modules, libraries,
+         and applications.
+
+         If unsure, say N.
+
+config HAVE_OPROFILE
+       def_bool n
+
+config KPROBES
+       bool "Kprobes"
+       depends on KALLSYMS && MODULES
+       depends on HAVE_KPROBES
+       help
+         Kprobes allows you to trap at almost any kernel address and
+         execute a callback function.  register_kprobe() establishes
+         a probepoint and specifies the callback.  Kprobes is useful
+         for kernel debugging, non-intrusive instrumentation and testing.
+         If in doubt, say "N".
+
+config HAVE_KPROBES
+       def_bool n
index c613d5fb0daa35774f2d8679f7e01a7bc0ee1de5..01b10ab588a630b36c0290448ffa53d29bf03dfc 100644 (file)
@@ -5,6 +5,7 @@
 config ALPHA
        bool
        default y
+       select HAVE_OPROFILE
        help
          The Alpha is a 64-bit general-purpose processor designed and
          marketed by the Digital Equipment Corporation of blessed memory,
@@ -531,8 +532,8 @@ config SMP
          singleprocessor machines. On a singleprocessor machine, the kernel
          will run faster if you say N here.
 
-         See also the <file:Documentation/smp.txt>, and the SMP-HOWTO
-         available at <http://www.tldp.org/docs.html#howto>.
+         See also the SMP-HOWTO available at
+         <http://www.tldp.org/docs.html#howto>.
 
          If you don't know what to do here, say N.
 
@@ -649,8 +650,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/alpha/Kconfig.debug"
 
 # DUMMY_CONSOLE may be defined in drivers/video/console/Kconfig
index 4b1a8e3d292cfe74c864790c30cb08ca8dd59f63..471637002e8b3f867ceda2816890ac9e55214a28 100644 (file)
@@ -10,6 +10,8 @@ config ARM
        default y
        select RTC_LIB
        select SYS_SUPPORTS_APM_EMULATION
+       select HAVE_OPROFILE
+       select HAVE_KPROBES if (!XIP_KERNEL)
        help
          The ARM series is a line of low-power-consumption RISC chip designs
          licensed by ARM Ltd and targeted at embedded applications and
@@ -135,6 +137,23 @@ config FIQ
 config ARCH_MTD_XIP
        bool
 
+if OPROFILE
+
+config OPROFILE_ARMV6
+       def_bool y
+       depends on CPU_V6 && !SMP
+       select OPROFILE_ARM11_CORE
+
+config OPROFILE_MPCORE
+       def_bool y
+       depends on CPU_V6 && SMP
+       select OPROFILE_ARM11_CORE
+
+config OPROFILE_ARM11_CORE
+       bool
+
+endif
+
 config VECTORS_BASE
        hex
        default 0xffff0000 if MMU || CPU_HIGH_VECTOR
@@ -616,8 +635,7 @@ config SMP
          processor machines. On a single processor machine, the kernel will
          run faster if you say N here.
 
-         See also the <file:Documentation/smp.txt>,
-         <file:Documentation/i386/IO-APIC.txt>,
+         See also <file:Documentation/i386/IO-APIC.txt>,
          <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
          <http://www.linuxdoc.org/docs.html#howto>.
 
@@ -1128,8 +1146,6 @@ endmenu
 
 source "fs/Kconfig"
 
-source "arch/arm/Kconfig.instrumentation"
-
 source "arch/arm/Kconfig.debug"
 
 source "security/Kconfig"
diff --git a/arch/arm/Kconfig.instrumentation b/arch/arm/Kconfig.instrumentation
deleted file mode 100644 (file)
index 453ad8e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-menuconfig INSTRUMENTATION
-       bool "Instrumentation Support"
-       default y
-       ---help---
-         Say Y here to get to see options related to performance measurement,
-         system-wide debugging, and testing. This option alone does not add any
-         kernel code.
-
-         If you say N, all options in this submenu will be skipped and
-         disabled. If you're trying to debug the kernel itself, go see the
-         Kernel Hacking menu.
-
-if INSTRUMENTATION
-
-config PROFILING
-       bool "Profiling support (EXPERIMENTAL)"
-       help
-         Say Y here to enable the extended profiling support mechanisms used
-         by profilers such as OProfile.
-
-config OPROFILE
-       tristate "OProfile system profiling (EXPERIMENTAL)"
-       depends on PROFILING && !UML
-       help
-         OProfile is a profiling system capable of profiling the
-         whole system, include the kernel, kernel modules, libraries,
-         and applications.
-
-         If unsure, say N.
-
-config OPROFILE_ARMV6
-       bool
-       depends on OPROFILE && CPU_V6 && !SMP
-       default y
-       select OPROFILE_ARM11_CORE
-
-config OPROFILE_MPCORE
-       bool
-       depends on OPROFILE && CPU_V6 && SMP
-       default y
-       select OPROFILE_ARM11_CORE
-
-config OPROFILE_ARM11_CORE
-       bool
-
-config KPROBES
-       bool "Kprobes"
-       depends on KALLSYMS && MODULES && !UML && !XIP_KERNEL
-       help
-         Kprobes allows you to trap at almost any kernel address and
-         execute a callback function.  register_kprobe() establishes
-         a probepoint and specifies the callback.  Kprobes is useful
-         for kernel debugging, non-intrusive instrumentation and testing.
-         If in doubt, say "N".
-
-config MARKERS
-       bool "Activate markers"
-       help
-         Place an empty function call at each marker site. Can be
-         dynamically changed for a probe function.
-
-endif # INSTRUMENTATION
index efba65edcd51af287077294659b9564dae19417b..31706224a04c07a58e4c6e91a99a703ff5ff6f12 100644 (file)
@@ -32,7 +32,7 @@ static struct corgissp_machinfo *ssp_machinfo;
 /*
  * There are three devices connected to the SSP interface:
  *   1. A touchscreen controller (TI ADS7846 compatible)
- *   2. An LCD contoller (with some Backlight functionality)
+ *   2. An LCD controller (with some Backlight functionality)
  *   3. A battery monitoring IC (Maxim MAX1111)
  *
  * Each device uses a different speed/mode of communication.
index 1e25b1d19fce7e7f537269a5df27a27584be8b3d..94620be7bfac15ba366c90bca5bac761b98146ed 100644 (file)
@@ -165,7 +165,7 @@ int collie_read_temp(void)
 
        ucb1x00_adc_enable(ucb);
        ucb1x00_io_write(ucb, COLLIE_TC35143_GPIO_TMP_ON, 0);
-       /* >1010 = battery removed, 460 = 22C ?, higer = lower temp ? */
+       /* >1010 = battery removed, 460 = 22C ?, higher = lower temp ? */
        voltage = ucb1x00_adc_read(ucb, UCB_ADC_INP_AD0, UCB_SYNC);
        ucb1x00_io_write(ucb, 0, COLLIE_TC35143_GPIO_TMP_ON);
        ucb1x00_adc_disable(ucb);
index d486f5112569bcd66721b892b128f49ddf016126..ae2c5d7efc9dc411cc1488840bee40d8b648a456 100644 (file)
@@ -47,7 +47,7 @@
  *               Mark IRQ_LCD valid
  *
  *   25-Jul-2005  Ben Dooks
- *               Split the S3C2440 IRQ code to seperate file
+ *               Split the S3C2440 IRQ code to separate file
 */
 
 #include <linux/init.h>
index e34e2c9c94cb5b678eeae91929682ab081c7e661..c816f29154c929be053fd48c6b48f98913779b30 100644 (file)
@@ -10,6 +10,8 @@ config AVR32
        # With EMBEDDED=n, we get lots of stuff automatically selected
        # that we usually don't need on AVR32.
        select EMBEDDED
+       select HAVE_OPROFILE
+       select HAVE_KPROBES
        help
          AVR32 is a high-performance 32-bit RISC microprocessor core,
          designed for cost-sensitive embedded applications, with particular
@@ -54,9 +56,6 @@ config ARCH_HAS_ILOG2_U32
 config ARCH_HAS_ILOG2_U64
        def_bool n
 
-config ARCH_SUPPORTS_OPROFILE
-       def_bool y
-
 config GENERIC_HWEIGHT
        def_bool y
 
@@ -236,8 +235,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/avr32/Kconfig.debug"
 
 source "security/Kconfig"
index 4802eb767dc98d7fc7f4dcdd4b80a64e6c211b58..ba21e33b8b1ff2047a078dd3f418d8b4a794be8d 100644 (file)
@@ -24,6 +24,7 @@ config RWSEM_XCHGADD_ALGORITHM
 config BLACKFIN
        bool
        default y
+       select HAVE_OPROFILE
 
 config ZONE_DMA
        bool
@@ -973,8 +974,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/blackfin/Kconfig.debug"
 
 source "security/Kconfig"
index 222da1501f47c0e81508996e8f74ec7c5ff21353..7f0be4cd5e9a1568207fa9939a7f8816c1807035 100644 (file)
@@ -213,8 +213,6 @@ source "drivers/pci/Kconfig"
 
 source "drivers/usb/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/cris/Kconfig.debug"
 
 source "security/Kconfig"
index e3f965c91e2215815d7173a41c4b7e1e52b23a5a..bf0468cbe7130914e81f9dc82e1e1a5d53c2a25e 100644 (file)
@@ -79,7 +79,7 @@ config FRV_OUTOFLINE_ATOMIC_OPS
          Setting this option causes the FR-V atomic operations to be mostly
          implemented out-of-line.
 
-         See Documentation/fujitsu/frv/atomic-ops.txt for more information.
+         See Documentation/frv/atomic-ops.txt for more information.
 
 config HIGHMEM
        bool "High memory support"
@@ -375,8 +375,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/frv/Kconfig.debug"
 
 source "security/Kconfig"
index f926c70947764ef108d5d3da1bddd44a364e9e14..99046b1f51c8f733c5c406f9985f7a3a3414a21e 100644 (file)
@@ -253,7 +253,7 @@ __entry_kernel_external_interrupt_reentry:
        andi.p          gr5,#~PSR_ET,gr5
 
        # set CCCR.CC3 to Undefined to abort atomic-modify completion inside the kernel
-       # - for an explanation of how it works, see: Documentation/fujitsu/frv/atomic-ops.txt
+       # - for an explanation of how it works, see: Documentation/frv/atomic-ops.txt
        andi            gr25,#~0xc0,gr25
 
        sti             gr20,@(gr28,#REG_TBR)
@@ -445,7 +445,7 @@ __entry_kernel_softprog_interrupt_reentry:
        sti             gr22,@(sp,#REG_SP)
 
        # set CCCR.CC3 to Undefined to abort atomic-modify completion inside the kernel
-       # - for an explanation of how it works, see: Documentation/fujitsu/frv/atomic-ops.txt
+       # - for an explanation of how it works, see: Documentation/frv/atomic-ops.txt
        movsg           cccr,gr20
        andi            gr20,#~0xc0,gr20
        movgs           gr20,cccr
index 545cd325ac577d00c9ef96dc3f73fc97d24d44fe..ee0ac905fb08ac271139ecd12de58e9fc9b61366 100644 (file)
@@ -1,7 +1,7 @@
 /* atomic-ops.S: kernel atomic operations
  *
  * For an explanation of how atomic ops work in this arch, see:
- *   Documentation/fujitsu/frv/atomic-ops.txt
+ *   Documentation/frv/atomic-ops.txt
  *
  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
index ff6a8712bd6d8c3f59f7724050d9793a22db3fcf..dc61222e11207b1d802481aa4dfdd4fd788e20b8 100644 (file)
@@ -223,8 +223,6 @@ endmenu
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/h8300/Kconfig.debug"
 
 source "security/Kconfig"
index 551fd5f30d826ae0a25ab015100c18d9d0b3d4c4..ac10b9783850aa1473bd13c463af1e4eac021708 100644 (file)
@@ -121,7 +121,7 @@ void __init init_IRQ(void)
                printk("virtual vector at 0x%08lx\n",(unsigned long)ramvec);
 
 #if defined(CONFIG_GDB_DEBUG)
-       /* save orignal break vector */
+       /* save original break vector */
        break_vec = ramvec[TRAP3_VEC];
 #else
        break_vec = VECTOR(trace_break);
index c9307c99a1dc26977399b955f9436f9898afca72..b0de1132dfc02e0537c381b66be30d507daee2f5 100644 (file)
@@ -15,6 +15,8 @@ config IA64
        select ACPI if (!IA64_HP_SIM)
        select PM if (!IA64_HP_SIM)
        select ARCH_SUPPORTS_MSI
+       select HAVE_OPROFILE
+       select HAVE_KPROBES
        default y
        help
          The Itanium Processor Family is Intel's 64-bit successor to
@@ -283,8 +285,8 @@ config SMP
          single processor systems.  On a single processor system, the kernel
          will run faster if you say N here.
 
-         See also the <file:Documentation/smp.txt> and the SMP-HOWTO
-         available at <http://www.tldp.org/docs.html#howto>.
+         See also the SMP-HOWTO available at
+         <http://www.tldp.org/docs.html#howto>.
 
          If you don't know what to do here, say N.
 
@@ -600,8 +602,6 @@ config IRQ_PER_CPU
 
 source "arch/ia64/hp/sim/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/ia64/Kconfig.debug"
 
 source "security/Kconfig"
index 49326e9d4413117165c26f96da89c2df4c51035e..795180b8fd8e6199e56d118fec12f09a3079eb35 100644 (file)
@@ -8,6 +8,7 @@ mainmenu "Linux/M32R Kernel Configuration"
 config M32R
        bool
        default y
+       select HAVE_OPROFILE
 
 config SBUS
        bool
@@ -302,8 +303,7 @@ config SMP
          Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
          Management" code will be disabled if you say Y here.
 
-         See also the <file:Documentation/smp.txt>,
-         and the SMP-HOWTO available at
+         See also the SMP-HOWTO available at
          <http://www.linuxdoc.org/docs.html#howto>.
 
          If you don't know what to do here, say N.
@@ -426,8 +426,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/m32r/Kconfig.debug"
 
 source "security/Kconfig"
index ed4d0756c5dbd0abd84a39bd4b0c43cf20118aea..9aa615d3a5b24372cdd1a193ee7869cd4c5ce78e 100644 (file)
@@ -476,7 +476,7 @@ unregister_debug_trap(struct task_struct *child, unsigned long addr,
                return 0;
        }
 
-       /* Recover orignal instruction code. */
+       /* Recover original instruction code. */
        *code = p->insn[i];
 
        /* Shift debug trap entries. */
index 24e6bc09e7a7ade51bba7235baf6ca134a9c51f8..8236e42ef7115e07784cce95200d6d5af31427e6 100644 (file)
@@ -678,8 +678,6 @@ endmenu
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/m68k/Kconfig.debug"
 
 source "security/Kconfig"
index bd9213749ac27e228e6ac2dc07603bca7ef2f70a..6abbbb8aac5ebc733f7e4eb8cc8df3df6ef3959c 100644 (file)
@@ -711,8 +711,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/m68knommu/Kconfig.debug"
 
 source "security/Kconfig"
index 36a4018f71d26ea7d685ff72578ece6b21815501..ec78a5762e9ec3be6a23630413c4f81a5f6b0fe9 100644 (file)
@@ -1,6 +1,7 @@
 config MIPS
        bool
        default y
+       select HAVE_OPROFILE
        # Horrible source of confusion.  Die, die, die ...
        select EMBEDDED
        select RTC_LIB
@@ -1754,8 +1755,8 @@ config SMP
          People using multiprocessor machines who say Y here should also say
          Y to "Enhanced Real Time Clock Support", below.
 
-         See also the <file:Documentation/smp.txt> and the SMP-HOWTO
-         available at <http://www.tldp.org/docs.html#howto>.
+         See also the SMP-HOWTO available at
+         <http://www.tldp.org/docs.html#howto>.
 
          If you don't know what to do here, say N.
 
@@ -2095,8 +2096,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/mips/Kconfig.debug"
 
 source "security/Kconfig"
index abfc4bcddf7a4569d7783f5de5603cb1f6e88a6a..310d5dff89fca6347f34ce38e112dbf2116a87f6 100644 (file)
@@ -99,7 +99,7 @@ mtx1_pci_idsel(unsigned int devsel, int assert)
 #endif
 
        if (assert && devsel != 0) {
-               // supress signal to cardbus
+               // suppress signal to cardbus
                au_writel( 0x00000002, SYS_OUTPUTCLR ); // set EXT_IO3 OFF
        }
        else {
index 9b34238d41c09d7a91887469fc3ff02eef223704..77db3473deabfc20c97acb99d89dbd77c96b9170 100644 (file)
@@ -98,7 +98,7 @@ static __inline__ void
 jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
 {
        /*
-        * Convert jiffies to nanoseconds and seperate with
+        * Convert jiffies to nanoseconds and separate with
         * one divide.
         */
        u64 nsec = (u64)jiffies * TICK_NSEC;
index da41eac195ca0197b332824205cd47e31d4231b9..08f4cd781ee33cc5ac695fed9705a33e7e507e65 100644 (file)
@@ -100,7 +100,7 @@ static inline void
 jiffies_to_compat_timeval(unsigned long jiffies, struct compat_timeval *value)
 {
        /*
-        * Convert jiffies to nanoseconds and seperate with
+        * Convert jiffies to nanoseconds and separate with
         * one divide.
         */
        u64 nsec = (u64)jiffies * TICK_NSEC;
index f6704ab16306a91b5b2b654d3dcc312b5a437648..998c4efcce88df4acb15485d529badd73a0782eb 100644 (file)
@@ -221,7 +221,7 @@ void sp_work_handle_request(void)
                }
        }
 
-       /* Run the syscall at the priviledge of the user who loaded the
+       /* Run the syscall at the privilege of the user who loaded the
           SP program */
 
        if (vpe_getuid(tclimit))
index 269c252d956f42c1d74ec85162af510c3e986141..c032409cba9b50b7df4bfad7988dd26ad0d00213 100644 (file)
@@ -424,13 +424,13 @@ static void __init bootmem_init(void)
 #endif /* CONFIG_SGI_IP27 */
 
 /*
- * arch_mem_init - initialize memory managment subsystem
+ * arch_mem_init - initialize memory management subsystem
  *
  *  o plat_mem_setup() detects the memory configuration and will record detected
  *    memory areas using add_memory_region.
  *
  * At this stage the memory configuration of the system is known to the
- * kernel but generic memory managment system is still entirely uninitialized.
+ * kernel but generic memory management system is still entirely uninitialized.
  *
  *  o bootmem_init()
  *  o sparse_init()
index 85f700e581316df1a2e4d735e89a767d89fddd12..b42e71c711199a4f169f717e8467240b8ebbae57 100644 (file)
@@ -65,7 +65,7 @@ asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
 static atomic_t ipi_timer_latch[NR_CPUS];
 
 /*
- * Number of InterProcessor Interupt (IPI) message buffers to allocate
+ * Number of InterProcessor Interrupt (IPI) message buffers to allocate
  */
 
 #define IPIBUF_PER_CPU 4
@@ -780,7 +780,7 @@ void smtc_send_ipi(int cpu, int type, unsigned int action)
        if (cpu_data[cpu].vpe_id != cpu_data[smp_processor_id()].vpe_id) {
                if (type == SMTC_CLOCK_TICK)
                        atomic_inc(&ipi_timer_latch[cpu]);
-               /* If not on same VPE, enqueue and send cross-VPE interupt */
+               /* If not on same VPE, enqueue and send cross-VPE interrupt */
                smtc_ipi_nq(&IPIQ[cpu], pipi);
                LOCK_CORE_PRA();
                settc(cpu_data[cpu].tc_id);
@@ -1063,7 +1063,7 @@ static void setup_cross_vpe_interrupts(unsigned int nvpe)
                return;
 
        if (!cpu_has_vint)
-               panic("SMTC Kernel requires Vectored Interupt support");
+               panic("SMTC Kernel requires Vectored Interrupt support");
 
        set_vi_handler(MIPS_CPU_IPI_IRQ, ipi_irq_dispatch);
 
index 02bd180f0e02748354383af23352900da6d1b02b..53ec05267a98190739ac454d217f4e12a9f34e90 100644 (file)
@@ -1101,7 +1101,7 @@ static void __init setup_scache(void)
        /*
         * Do the probing thing on R4000SC and R4400SC processors.  Other
         * processors don't have a S-cache that would be relevant to the
-        * Linux memory managment.
+        * Linux memory management.
         */
        switch (c->cputype) {
        case CPU_R4000SC:
index 524b371f9397ae2bff5eb527614666c866f31343..a1fa4abb3f6a719ad0122a0861f3b2d659d293a4 100644 (file)
@@ -168,7 +168,7 @@ static void hub_set_piomode(nasid_t nasid)
 }
 
 /*
- * hub_pio_init  -  PIO-related hub initalization
+ * hub_pio_init  -  PIO-related hub initialization
  *
  * @hub:       hubinfo structure for our hub
  */
index 2b649c46631c14fb07d408dd3bad2e0869a8dae6..028d8a0fdbfd2b3213c183a5f6a371211fe55833 100644 (file)
@@ -7,6 +7,7 @@ mainmenu "Linux/PA-RISC Kernel Configuration"
 
 config PARISC
        def_bool y
+       select HAVE_OPROFILE
        help
          The PA-RISC microprocessor is designed by Hewlett-Packard and used
          in many of their workstations & servers (HP9000 700 and 800 series,
@@ -205,9 +206,8 @@ config SMP
          singleprocessor machines. On a singleprocessor machine, the kernel
          will run faster if you say N here.
 
-         See also the <file:Documentation/smp.txt>,
-         <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available
-         at <http://www.tldp.org/docs.html#howto>.
+         See also <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO
+         available at <http://www.tldp.org/docs.html#howto>.
 
          If you don't know what to do here, say N.
 
@@ -272,8 +272,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/parisc/Kconfig.debug"
 
 source "security/Kconfig"
index 395bbce649937e627315a3d3796a17fb2fe256f8..e10d25d2d9c935b6049d16a81a5efc02903018b2 100644 (file)
@@ -305,7 +305,7 @@ flush_user_cache_page_non_current(struct vm_area_struct *vma,
        /* save the current process space and pgd */
        unsigned long space = mfsp(3), pgd = mfctl(25);
 
-       /* we don't mind taking interrups since they may not
+       /* we don't mind taking interrupts since they may not
         * do anything with user space, but we can't
         * be preempted here */
        preempt_disable();
index 04848b2b381c40c8cc10e387281baf66dfc9c3c6..84b9611a92285b8edcbab9fffc20fdbca6662d7c 100644 (file)
@@ -1187,7 +1187,7 @@ static struct hp_hardware hp_hardware_list[] __devinitdata = {
        {HPHW_FIO, 0x005, 0x000A9, 0x00, "AllegroLow Core PCI USB KB"}, 
        {HPHW_FIO, 0x006, 0x000A9, 0x00, "AllegroHigh Core PCI SuperIO RS-232"}, 
        {HPHW_FIO, 0x006, 0x000A9, 0x00, "AllegroHigh Core PCI USB KB"}, 
-       {HPHW_FIO, 0x007, 0x000A9, 0x0, "Miscelaneous PCI Plug-in"}, 
+       {HPHW_FIO, 0x007, 0x000A9, 0x0, "Miscellaneous PCI Plug-in"},
        {HPHW_FIO, 0x00A, 0x000A9, 0x0, "Lego 360 Core PCI SuperIO RS-232"}, 
        {HPHW_FIO, 0x00A, 0x000A9, 0x0, "Lego 360 Core PCI USB KB"}, 
        {HPHW_FIO, 0x004, 0x00320, 0x0, "Metheus Frame Buffer"}, 
index 2ce3806f02e1989d5157ac9c9a3a037f40a384fc..58fccc96d0035362aaada7b17521c1346bb15a61 100644 (file)
@@ -333,7 +333,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
        flush_user_icache_range((unsigned long) &frame->tramp[0],
                           (unsigned long) &frame->tramp[TRAMP_SIZE]);
 
-       /* TRAMP Words 0-4, Lenght 5 = SIGRESTARTBLOCK_TRAMP
+       /* TRAMP Words 0-4, Length 5 = SIGRESTARTBLOCK_TRAMP
         * TRAMP Words 5-9, Length 4 = SIGRETURN_TRAMP
         * So the SIGRETURN_TRAMP is at the end of SIGRESTARTBLOCK_TRAMP
         */
index 4a22c992861837e21eac00b220869b1e56155209..b94d4502a477f155ab386bcf101f2e9d1e73a774 100644 (file)
@@ -87,6 +87,8 @@ config ARCH_NO_VIRT_TO_BUS
 config PPC
        bool
        default y
+       select HAVE_OPROFILE
+       select HAVE_KPROBES
 
 config EARLY_PRINTK
        bool
@@ -713,8 +715,6 @@ source "arch/powerpc/sysdev/qe_lib/Kconfig"
 
 source "lib/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/powerpc/Kconfig.debug"
 
 source "security/Kconfig"
index db5934cdafb3b9fd603317e53789a8e5230001db..531156f8919ca5e4877f1835a14a303a232496ae 100644 (file)
@@ -42,6 +42,8 @@ config GENERIC_CALIBRATE_DELAY
 config PPC
        bool
        default y
+       select HAVE_OPROFILE
+       select HAVE_KPROBES
 
 config PPC32
        bool
@@ -1256,8 +1258,6 @@ endmenu
 
 source "lib/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/ppc/Kconfig.debug"
 
 source "security/Kconfig"
index 6ef54d27fc001720f738aa3f066e15497503c064..82cbffd0365495cd7a87fbef95c7d7280823291a 100644 (file)
@@ -51,6 +51,8 @@ mainmenu "Linux Kernel Configuration"
 
 config S390
        def_bool y
+       select HAVE_OPROFILE
+       select HAVE_KPROBES
 
 source "init/Kconfig"
 
@@ -81,8 +83,8 @@ config SMP
          singleprocessor machines. On a singleprocessor machine, the kernel
          will run faster if you say N here.
 
-         See also the <file:Documentation/smp.txt> and the SMP-HOWTO
-         available at <http://www.tldp.org/docs.html#howto>.
+         See also the SMP-HOWTO available at
+         <http://www.tldp.org/docs.html#howto>.
 
          Even if you don't know what to do here, say Y.
 
@@ -526,8 +528,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/s390/Kconfig.debug"
 
 source "security/Kconfig"
index b30c4c376a831c2a40563b1da7d16c3b64cac731..1c3a90835c7e00caf0cb6960c4da7a75f603ea51 100644 (file)
@@ -8,6 +8,7 @@ mainmenu "Linux/SuperH Kernel Configuration"
 config SUPERH
        def_bool y
        select EMBEDDED
+       select HAVE_OPROFILE
        help
          The SuperH is a RISC processor targeted for use in embedded systems
          and consumer electronics; it was also used in the Sega Dreamcast
@@ -672,9 +673,8 @@ config SMP
          People using multiprocessor machines who say Y here should also say
          Y to "Enhanced Real Time Clock Support", below.
 
-         See also the <file:Documentation/smp.txt>,
-         <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available
-         at <http://www.tldp.org/docs.html#howto>.
+         See also <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO
+         available at <http://www.tldp.org/docs.html#howto>.
 
          If you don't know what to do here, say N.
 
@@ -896,8 +896,6 @@ source "drivers/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/sh/Kconfig.debug"
 
 source "security/Kconfig"
index 527adc808ad6c8609bc81581d49bcceec1ceb0aa..99f8971716d2226a53a27c3e5c19e99c32b6f135 100644 (file)
@@ -48,9 +48,8 @@ config SMP
          Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
          Management" code will be disabled if you say Y here.
 
-         See also the <file:Documentation/smp.txt>,
-         <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
-         <http://www.tldp.org/docs.html#howto>.
+         See also <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO
+         available at <http://www.tldp.org/docs.html#howto>.
 
          If you don't know what to do here, say N.
 
@@ -63,6 +62,7 @@ config NR_CPUS
 config SPARC
        bool
        default y
+       select HAVE_OPROFILE
 
 # Identify this as a Sparc32 build
 config SPARC32
@@ -320,8 +320,6 @@ endmenu
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/sparc/Kconfig.debug"
 
 source "security/Kconfig"
index 97aa50d1e4ae053c2d61776d5880c820a2d38635..ad0ede24ca1d80e6e826d9e5eaee7f37bd391d36 100644 (file)
@@ -305,7 +305,7 @@ void *sbus_alloc_consistent(struct sbus_dev *sdev, long len, u32 *dma_addrp)
        struct resource *res;
        int order;
 
-       /* XXX why are some lenghts signed, others unsigned? */
+       /* XXX why are some lengths signed, others unsigned? */
        if (len <= 0) {
                return NULL;
        }
@@ -393,7 +393,7 @@ void sbus_free_consistent(struct sbus_dev *sdev, long n, void *p, u32 ba)
  */
 dma_addr_t sbus_map_single(struct sbus_dev *sdev, void *va, size_t len, int direction)
 {
-       /* XXX why are some lenghts signed, others unsigned? */
+       /* XXX why are some lengths signed, others unsigned? */
        if (len <= 0) {
                return 0;
        }
index 158522f51d31d4d6dac1d3a5c011156dc7c2f4e5..a8c6366f05a1b416ddbfd3a28c2e31b6d333a05d 100644 (file)
@@ -8,6 +8,8 @@ mainmenu "Linux/UltraSPARC Kernel Configuration"
 config SPARC
        bool
        default y
+       select HAVE_OPROFILE
+       select HAVE_KPROBES
 
 config SPARC64
        bool
@@ -166,9 +168,8 @@ config SMP
          Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
          Management" code will be disabled if you say Y here.
 
-         See also the <file:Documentation/smp.txt>,
-         <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
-         <http://www.tldp.org/docs.html#howto>.
+         See also <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO
+         available at <http://www.tldp.org/docs.html#howto>.
 
          If you don't know what to do here, say N.
 
@@ -465,8 +466,6 @@ source "drivers/sbus/char/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/sparc64/Kconfig.debug"
 
 source "security/Kconfig"
index dd1689b814cb5a842c456a0337f66ec9db2dbe2e..55945db1313c815507fa634511d445a1f7767a19 100644 (file)
@@ -289,6 +289,4 @@ config INPUT
        bool
        default n
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/um/Kconfig.debug"
index 7457436b433a915c6b41d783417d2a0b40cbd171..14070181407ba58c380ffd3c4ebeff40fd2796c9 100644 (file)
@@ -112,7 +112,7 @@ static int copy_sc_to_user(struct sigcontext __user *to,
        err |= PUTREG(regs, RSI, to, si);
        err |= PUTREG(regs, RBP, to, bp);
        /*
-        * Must use orignal RSP, which is passed in, rather than what's in
+        * Must use original RSP, which is passed in, rather than what's in
         * the pt_regs, because that's already been updated to point at the
         * signal frame.
         */
index b6a50b8b38de2c4edc2fdbc8b30012d772c3b672..ace479ab273ff329cc387ce536e8598f171054b4 100644 (file)
@@ -331,8 +331,6 @@ source "sound/Kconfig"
 
 source "drivers/usb/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/v850/Kconfig.debug"
 
 source "security/Kconfig"
index 77198f49b3839a03b33d664c6c8ec00a4a2474d6..59eef1c7fdaa4a210f3f7923113d5fe0d88faafe 100644 (file)
@@ -18,6 +18,8 @@ config X86_64
 ### Arch settings
 config X86
        def_bool y
+       select HAVE_OPROFILE
+       select HAVE_KPROBES
 
 config GENERIC_LOCKBREAK
        def_bool n
@@ -106,10 +108,6 @@ config GENERIC_TIME_VSYSCALL
 config HAVE_SETUP_PER_CPU_AREA
        def_bool X86_64
 
-config ARCH_SUPPORTS_OPROFILE
-       bool
-       default y
-
 select HAVE_KVM
 
 config ARCH_HIBERNATION_POSSIBLE
@@ -204,8 +202,7 @@ config SMP
          Y to "Enhanced Real Time Clock Support", below. The "Advanced Power
          Management" code will be disabled if you say Y here.
 
-         See also the <file:Documentation/smp.txt>,
-         <file:Documentation/i386/IO-APIC.txt>,
+         See also <file:Documentation/i386/IO-APIC.txt>,
          <file:Documentation/nmi_watchdog.txt> and the SMP-HOWTO available at
          <http://www.tldp.org/docs.html#howto>.
 
@@ -1598,8 +1595,6 @@ source "drivers/firmware/Kconfig"
 
 source "fs/Kconfig"
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/x86/Kconfig.debug"
 
 source "security/Kconfig"
index c83e1c9b5129b3cc96ecfcb8992e378cd7d4119e..41962e793c0fe9f122d22517956535875ea1170f 100644 (file)
@@ -53,5 +53,6 @@ config KVM_AMD
 # OK, it's a little counter-intuitive to do this, but it puts it neatly under
 # the virtualization menu.
 source drivers/lguest/Kconfig
+source drivers/virtio/Kconfig
 
 endif # VIRTUALIZATION
index afd0045595d470938ef69f6547db0f859b08fbf5..b65440459859e4843ee23a672c05519d2669876b 100644 (file)
@@ -2,7 +2,7 @@
 #include <linux/module.h>
 
 /**
- * find_next_bit - find the first set bit in a memory region
+ * find_next_bit - find the next set bit in a memory region
  * @addr: The address to base the search on
  * @offset: The bitnumber to start searching at
  * @size: The maximum size to search
index 95b6d9639fba60fa9c03c027199bd173f631102b..0e8f491e6ccc84b13ec7c0e82683002f829a862e 100644 (file)
@@ -58,7 +58,7 @@ long find_first_zero_bit(const unsigned long * addr, unsigned long size)
 }
 
 /**
- * find_next_zero_bit - find the first zero bit in a memory region
+ * find_next_zero_bit - find the next zero bit in a memory region
  * @addr: The address to base the search on
  * @offset: The bitnumber to start searching at
  * @size: The maximum size to search
index 844721e8e3dd11a5924be7be42caf06b865e8ddd..5d5546ce88fe90b02ff376a633a4933b22639685 100644 (file)
@@ -246,8 +246,6 @@ config EMBEDDED_RAMDISK_IMAGE
          provide one yourself.
 endmenu
 
-source "kernel/Kconfig.instrumentation"
-
 source "arch/xtensa/Kconfig.debug"
 
 source "security/Kconfig"
index 08d4ae201597cde366f07efc2a4a8f4f8e08d83e..3f8a231fe7544b94593e5fb0cb639f936d4744f4 100644 (file)
@@ -91,6 +91,4 @@ source "drivers/dca/Kconfig"
 source "drivers/auxdisplay/Kconfig"
 
 source "drivers/uio/Kconfig"
-
-source "drivers/virtio/Kconfig"
 endmenu
index cbfe9ae7a9e55226d82c86e6e6947121ee6e7adc..d9d531cce27f26e401ff920b8325968b5fd4fb37 100644 (file)
@@ -830,7 +830,7 @@ static int acpi_bus_get_flags(struct acpi_device *device)
        if (ACPI_SUCCESS(status))
                device->flags.wake_capable = 1;
 
-       /* TBD: Peformance management */
+       /* TBD: Performance management */
 
        return 0;
 }
index cbbd3315a1e22bbc9eacc32942ccaded198c14a7..b630ee137ee197b4a2c8c9555ce1879886a26a3b 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
  *
- * Module Name: utresrc - Resource managment utilities
+ * Module Name: utresrc - Resource management utilities
  *
  ******************************************************************************/
 
index 47892e6f5ded72f310e0de62c0ec152ce6350f7e..4b99ed0c59bb2cbada622776825725791e05d997 100644 (file)
@@ -837,7 +837,7 @@ static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev)
        if (is_slave) {
                /* clear TIME1|IE1|PPE1|DTE1 */
                master_data &= 0xff0f;
-               /* Enable SITRE (seperate slave timing register) */
+               /* Enable SITRE (separate slave timing register) */
                master_data |= 0x4000;
                /* enable PPE1, IE1 and TIME1 as needed */
                master_data |= (control << 4);
index bdbd55af70228ad38e646a4aa9e8bfcc1f0d0f37..361cf50cbdeab53565f57e3dcc6c84ec64cfd439 100644 (file)
@@ -3097,7 +3097,7 @@ static int ata_dev_set_mode(struct ata_device *dev)
 /**
  *     ata_do_set_mode - Program timings and issue SET FEATURES - XFER
  *     @link: link on which timings will be programmed
- *     @r_failed_dev: out paramter for failed device
+ *     @r_failed_dev: out parameter for failed device
  *
  *     Standard implementation of the function used to tune and set
  *     ATA device disk transfer mode (PIO3, UDMA6, etc.).  If
index 67e574de31e855c5ae6b1a046d1bc3f5b5f29c1c..db057b183d601b95c9ff950bfaef5acba39de562 100644 (file)
@@ -324,7 +324,7 @@ static int __init pata_at32_probe(struct platform_device *pdev)
        if (irq < 0)
                return irq;
 
-       /* Setup struct containing private infomation */
+       /* Setup struct containing private information */
        info = kzalloc(sizeof(struct at32_ide_info), GFP_KERNEL);
        if (!info)
                return -ENOMEM;
index 043dcd35106c0877aed1ce07e91a8f6a9d4b8892..dc33220fe5b20ca9588af25522d40288627bf2cf 100644 (file)
@@ -135,7 +135,7 @@ static void efar_set_piomode (struct ata_port *ap, struct ata_device *adev)
                idetm_data &= 0xCC0F;
                idetm_data |= (control << 4);
 
-               /* Slave timing in seperate register */
+               /* Slave timing in separate register */
                pci_read_config_byte(dev, 0x44, &slave_data);
                slave_data &= 0x0F << shift;
                slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << shift;
index 1eda821e5e395b32dd78a86bc8c7ab2bd58fd537..e0c2cc29d0ca93d60b970441ef0d4d54599aced9 100644 (file)
@@ -128,7 +128,7 @@ static void it8213_set_piomode (struct ata_port *ap, struct ata_device *adev)
                idetm_data &= 0xCC0F;
                idetm_data |= (control << 4);
 
-               /* Slave timing in seperate register */
+               /* Slave timing in separate register */
                pci_read_config_byte(dev, 0x44, &slave_data);
                slave_data &= 0xF0;
                slave_data |= ((timings[pio][0] << 2) | timings[pio][1]) << 4;
index 87546d9f1ca0839cf5067d94116af34ae297c7e7..dc7e91562e436fafadab3d2796e328ac4cf5b351 100644 (file)
@@ -345,7 +345,7 @@ static void sis_old_set_dmamode (struct ata_port *ap, struct ata_device *adev)
 
        if (adev->dma_mode < XFER_UDMA_0) {
                /* bits 3-0 hold recovery timing bits 8-10 active timing and
-                  the higer bits are dependant on the device */
+                  the higher bits are dependant on the device */
                timing &= ~0x870F;
                timing |= mwdma_bits[speed];
        } else {
@@ -385,7 +385,7 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev)
 
        if (adev->dma_mode < XFER_UDMA_0) {
                /* bits 3-0 hold recovery timing bits 8-10 active timing and
-                  the higer bits are dependant on the device, bit 15 udma */
+                  the higher bits are dependant on the device, bit 15 udma */
                timing &= ~0x870F;
                timing |= mwdma_bits[speed];
        } else {
index b1727876182cdff178550856fc0696a770db9bdc..9c0070b5bd3e75d828a44d405dca4695b70e6ef6 100644 (file)
@@ -423,10 +423,8 @@ struct kset *devices_kset;
 int device_create_file(struct device *dev, struct device_attribute *attr)
 {
        int error = 0;
-       if (get_device(dev)) {
+       if (dev)
                error = sysfs_create_file(&dev->kobj, &attr->attr);
-               put_device(dev);
-       }
        return error;
 }
 
@@ -437,10 +435,8 @@ int device_create_file(struct device *dev, struct device_attribute *attr)
  */
 void device_remove_file(struct device *dev, struct device_attribute *attr)
 {
-       if (get_device(dev)) {
+       if (dev)
                sysfs_remove_file(&dev->kobj, &attr->attr);
-               put_device(dev);
-       }
 }
 
 /**
@@ -1144,25 +1140,11 @@ error:
 }
 EXPORT_SYMBOL_GPL(device_create);
 
-/**
- * find_device - finds a device that was created with device_create()
- * @class: pointer to the struct class that this device was registered with
- * @devt: the dev_t of the device that was previously registered
- */
-static struct device *find_device(struct class *class, dev_t devt)
+static int __match_devt(struct device *dev, void *data)
 {
-       struct device *dev = NULL;
-       struct device *dev_tmp;
+       dev_t *devt = data;
 
-       down(&class->sem);
-       list_for_each_entry(dev_tmp, &class->devices, node) {
-               if (dev_tmp->devt == devt) {
-                       dev = dev_tmp;
-                       break;
-               }
-       }
-       up(&class->sem);
-       return dev;
+       return dev->devt == *devt;
 }
 
 /**
@@ -1177,9 +1159,11 @@ void device_destroy(struct class *class, dev_t devt)
 {
        struct device *dev;
 
-       dev = find_device(class, devt);
-       if (dev)
+       dev = class_find_device(class, &devt, __match_devt);
+       if (dev) {
+               put_device(dev);
                device_unregister(dev);
+       }
 }
 EXPORT_SYMBOL_GPL(device_destroy);
 
@@ -1203,9 +1187,11 @@ void destroy_suspended_device(struct class *class, dev_t devt)
 {
        struct device *dev;
 
-       dev = find_device(class, devt);
-       if (dev)
+       dev = class_find_device(class, &devt, __match_devt);
+       if (dev) {
                device_pm_schedule_removal(dev);
+               put_device(dev);
+       }
 }
 EXPORT_SYMBOL_GPL(destroy_suspended_device);
 #endif /* CONFIG_PM_SLEEP */
index a35f04121a00f938503f3b585c4e792e8a578d8f..ba75184c653c32794e3ac60283369a1bd39ea461 100644 (file)
@@ -97,10 +97,9 @@ int driver_create_file(struct device_driver *drv,
                       struct driver_attribute *attr)
 {
        int error;
-       if (get_driver(drv)) {
+       if (drv)
                error = sysfs_create_file(&drv->p->kobj, &attr->attr);
-               put_driver(drv);
-       } else
+       else
                error = -EINVAL;
        return error;
 }
@@ -114,10 +113,8 @@ EXPORT_SYMBOL_GPL(driver_create_file);
 void driver_remove_file(struct device_driver *drv,
                        struct driver_attribute *attr)
 {
-       if (get_driver(drv)) {
+       if (drv)
                sysfs_remove_file(&drv->p->kobj, &attr->attr);
-               put_driver(drv);
-       }
 }
 EXPORT_SYMBOL_GPL(driver_remove_file);
 
index 200ed5fafd505ad0e18fff1131500e2a2fd4ba9c..bdc03f7e8424ceda39d454413a76d637a9215418 100644 (file)
@@ -129,6 +129,7 @@ void device_pm_schedule_removal(struct device *dev)
        list_move_tail(&dev->power.entry, &dpm_destroy);
        mutex_unlock(&dpm_list_mtx);
 }
+EXPORT_SYMBOL_GPL(device_pm_schedule_removal);
 
 /**
  *     pm_sleep_lock - mutual exclusion for registration and suspend
index 6f0dfca8ebdd2437da619ab7a0c89abd7a60dcca..e32d3bdb92c1dbf45d02c161130fcafbdd0044d9 100644 (file)
@@ -13,7 +13,6 @@ static inline struct device *to_device(struct list_head *entry)
 
 extern void device_pm_add(struct device *);
 extern void device_pm_remove(struct device *);
-extern void device_pm_schedule_removal(struct device *);
 extern int pm_sleep_lock(void);
 extern void pm_sleep_unlock(void);
 
index f2122855d4ec5d714ae0260708aa66562af17db1..64e5148d82bc8cce2018012f6bf5587570ba2267 100644 (file)
@@ -440,6 +440,7 @@ config VIRTIO_BLK
        tristate "Virtio block driver (EXPERIMENTAL)"
        depends on EXPERIMENTAL && VIRTIO
        ---help---
-         This is the virtual block driver for lguest.  Say Y or M.
+         This is the virtual block driver for virtio.  It can be used with
+          lguest or QEMU based VMMs (like KVM or Xen).  Say Y or M.
 
 endif # BLK_DEV
index 63ee6c076cb3ec61771c05b2743998a9a4da1b49..55178e9973a094fe08fd23bf040c237e58695a02 100644 (file)
@@ -1453,7 +1453,7 @@ static int cciss_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
        rc = sendcmd(CCISS_RESET_MSG, ctlr, NULL, 0, 2, 0, 0, 
                (unsigned char *) &cmd_in_trouble->Header.LUN.LunAddrBytes[0], 
                TYPE_MSG);
-       /* sendcmd turned off interrputs on the board, turn 'em back on. */
+       /* sendcmd turned off interrupts on the board, turn 'em back on. */
        (*c)->access.set_intr_mask(*c, CCISS_INTR_ON);
        if (rc == 0)
                return SUCCESS;
@@ -1483,7 +1483,7 @@ static int  cciss_eh_abort_handler(struct scsi_cmnd *scsicmd)
                0, 2, 0, 0, 
                (unsigned char *) &cmd_to_abort->Header.LUN.LunAddrBytes[0], 
                TYPE_MSG);
-       /* sendcmd turned off interrputs on the board, turn 'em back on. */
+       /* sendcmd turned off interrupts on the board, turn 'em back on. */
        (*c)->access.set_intr_mask(*c, CCISS_INTR_ON);
        if (rc == 0)
                return SUCCESS;
index 924ddd8bccd2b8fdd32e06a7db1c3e05918ebc12..3b1a68d6eddb3c0860794c778a643340b59ec920 100644 (file)
@@ -7,8 +7,10 @@
 #include <linux/scatterlist.h>
 
 #define VIRTIO_MAX_SG  (3+MAX_PHYS_SEGMENTS)
+#define PART_BITS 4
+
+static int major, index;
 
-static unsigned char virtblk_index = 'a';
 struct virtio_blk
 {
        spinlock_t lock;
@@ -36,7 +38,7 @@ struct virtblk_req
        struct virtio_blk_inhdr in_hdr;
 };
 
-static bool blk_done(struct virtqueue *vq)
+static void blk_done(struct virtqueue *vq)
 {
        struct virtio_blk *vblk = vq->vdev->priv;
        struct virtblk_req *vbr;
@@ -65,7 +67,6 @@ static bool blk_done(struct virtqueue *vq)
        /* In case queue is stopped waiting for more buffers. */
        blk_start_queue(vblk->disk->queue);
        spin_unlock_irqrestore(&vblk->lock, flags);
-       return true;
 }
 
 static bool do_req(struct request_queue *q, struct virtio_blk *vblk,
@@ -153,20 +154,37 @@ static int virtblk_ioctl(struct inode *inode, struct file *filp,
                              (void __user *)data);
 }
 
+/* We provide getgeo only to please some old bootloader/partitioning tools */
+static int virtblk_getgeo(struct block_device *bd, struct hd_geometry *geo)
+{
+       /* some standard values, similar to sd */
+       geo->heads = 1 << 6;
+       geo->sectors = 1 << 5;
+       geo->cylinders = get_capacity(bd->bd_disk) >> 11;
+       return 0;
+}
+
 static struct block_device_operations virtblk_fops = {
-       .ioctl = virtblk_ioctl,
-       .owner = THIS_MODULE,
+       .ioctl  = virtblk_ioctl,
+       .owner  = THIS_MODULE,
+       .getgeo = virtblk_getgeo,
 };
 
+static int index_to_minor(int index)
+{
+       return index << PART_BITS;
+}
+
 static int virtblk_probe(struct virtio_device *vdev)
 {
        struct virtio_blk *vblk;
-       int err, major;
-       void *token;
-       unsigned int len;
+       int err;
        u64 cap;
        u32 v;
 
+       if (index_to_minor(index) >= 1 << MINORBITS)
+               return -ENOSPC;
+
        vdev->priv = vblk = kmalloc(sizeof(*vblk), GFP_KERNEL);
        if (!vblk) {
                err = -ENOMEM;
@@ -178,7 +196,7 @@ static int virtblk_probe(struct virtio_device *vdev)
        vblk->vdev = vdev;
 
        /* We expect one virtqueue, for output. */
-       vblk->vq = vdev->config->find_vq(vdev, blk_done);
+       vblk->vq = vdev->config->find_vq(vdev, 0, blk_done);
        if (IS_ERR(vblk->vq)) {
                err = PTR_ERR(vblk->vq);
                goto out_free_vblk;
@@ -190,17 +208,11 @@ static int virtblk_probe(struct virtio_device *vdev)
                goto out_free_vq;
        }
 
-       major = register_blkdev(0, "virtblk");
-       if (major < 0) {
-               err = major;
-               goto out_mempool;
-       }
-
        /* FIXME: How many partitions?  How long is a piece of string? */
-       vblk->disk = alloc_disk(1 << 4);
+       vblk->disk = alloc_disk(1 << PART_BITS);
        if (!vblk->disk) {
                err = -ENOMEM;
-               goto out_unregister_blkdev;
+               goto out_mempool;
        }
 
        vblk->disk->queue = blk_init_queue(do_virtblk_request, &vblk->lock);
@@ -209,22 +221,32 @@ static int virtblk_probe(struct virtio_device *vdev)
                goto out_put_disk;
        }
 
-       sprintf(vblk->disk->disk_name, "vd%c", virtblk_index++);
+       if (index < 26) {
+               sprintf(vblk->disk->disk_name, "vd%c", 'a' + index % 26);
+       } else if (index < (26 + 1) * 26) {
+               sprintf(vblk->disk->disk_name, "vd%c%c",
+                       'a' + index / 26 - 1, 'a' + index % 26);
+       } else {
+               const unsigned int m1 = (index / 26 - 1) / 26 - 1;
+               const unsigned int m2 = (index / 26 - 1) % 26;
+               const unsigned int m3 =  index % 26;
+               sprintf(vblk->disk->disk_name, "vd%c%c%c",
+                       'a' + m1, 'a' + m2, 'a' + m3);
+       }
+
        vblk->disk->major = major;
-       vblk->disk->first_minor = 0;
+       vblk->disk->first_minor = index_to_minor(index);
        vblk->disk->private_data = vblk;
        vblk->disk->fops = &virtblk_fops;
+       index++;
 
        /* If barriers are supported, tell block layer that queue is ordered */
-       token = vdev->config->find(vdev, VIRTIO_CONFIG_BLK_F, &len);
-       if (virtio_use_bit(vdev, token, len, VIRTIO_BLK_F_BARRIER))
+       if (vdev->config->feature(vdev, VIRTIO_BLK_F_BARRIER))
                blk_queue_ordered(vblk->disk->queue, QUEUE_ORDERED_TAG, NULL);
 
-       err = virtio_config_val(vdev, VIRTIO_CONFIG_BLK_F_CAPACITY, &cap);
-       if (err) {
-               dev_err(&vdev->dev, "Bad/missing capacity in config\n");
-               goto out_cleanup_queue;
-       }
+       /* Host must always specify the capacity. */
+       __virtio_config_val(vdev, offsetof(struct virtio_blk_config, capacity),
+                           &cap);
 
        /* If capacity is too big, truncate with warning. */
        if ((sector_t)cap != cap) {
@@ -234,31 +256,25 @@ static int virtblk_probe(struct virtio_device *vdev)
        }
        set_capacity(vblk->disk, cap);
 
-       err = virtio_config_val(vdev, VIRTIO_CONFIG_BLK_F_SIZE_MAX, &v);
+       /* Host can optionally specify maximum segment size and number of
+        * segments. */
+       err = virtio_config_val(vdev, VIRTIO_BLK_F_SIZE_MAX,
+                               offsetof(struct virtio_blk_config, size_max),
+                               &v);
        if (!err)
                blk_queue_max_segment_size(vblk->disk->queue, v);
-       else if (err != -ENOENT) {
-               dev_err(&vdev->dev, "Bad SIZE_MAX in config\n");
-               goto out_cleanup_queue;
-       }
 
-       err = virtio_config_val(vdev, VIRTIO_CONFIG_BLK_F_SEG_MAX, &v);
+       err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX,
+                               offsetof(struct virtio_blk_config, seg_max),
+                               &v);
        if (!err)
                blk_queue_max_hw_segments(vblk->disk->queue, v);
-       else if (err != -ENOENT) {
-               dev_err(&vdev->dev, "Bad SEG_MAX in config\n");
-               goto out_cleanup_queue;
-       }
 
        add_disk(vblk->disk);
        return 0;
 
-out_cleanup_queue:
-       blk_cleanup_queue(vblk->disk->queue);
 out_put_disk:
        put_disk(vblk->disk);
-out_unregister_blkdev:
-       unregister_blkdev(major, "virtblk");
 out_mempool:
        mempool_destroy(vblk->pool);
 out_free_vq:
@@ -274,12 +290,16 @@ static void virtblk_remove(struct virtio_device *vdev)
        struct virtio_blk *vblk = vdev->priv;
        int major = vblk->disk->major;
 
+       /* Nothing should be pending. */
        BUG_ON(!list_empty(&vblk->reqs));
+
+       /* Stop all the virtqueues. */
+       vdev->config->reset(vdev);
+
        blk_cleanup_queue(vblk->disk->queue);
        put_disk(vblk->disk);
        unregister_blkdev(major, "virtblk");
        mempool_destroy(vblk->pool);
-       /* There should be nothing in the queue now, so no need to shutdown */
        vdev->config->del_vq(vblk->vq);
        kfree(vblk);
 }
@@ -299,11 +319,15 @@ static struct virtio_driver virtio_blk = {
 
 static int __init init(void)
 {
+       major = register_blkdev(0, "virtblk");
+       if (major < 0)
+               return major;
        return register_virtio_driver(&virtio_blk);
 }
 
 static void __exit fini(void)
 {
+       unregister_blkdev(major, "virtblk");
        unregister_virtio_driver(&virtio_blk);
 }
 module_init(init);
index 08f48d577ababf1b38bb0cf4693a311922392a8e..dade1626865bcac133d5340d2b1049756a53a0d3 100644 (file)
@@ -383,7 +383,7 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed)
        outb(lcr, iobase + UART_LCR);   /* Set 8N1  */
        outb(fcr, iobase + UART_FCR);   /* Enable FIFO's */
 
-       /* Turn on interrups */
+       /* Turn on interrupts */
        outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER);
 
        spin_unlock_irqrestore(&(info->lock), flags);
index e8d50af58201825effe532d775362187a90b46fc..ef5e6b130c4845aa8b3ad68b36538b34d90e6311 100644 (file)
@@ -506,6 +506,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
        vma->vm_ops = &drm_vm_dma_ops;
 
        vma->vm_flags |= VM_RESERVED;   /* Don't swap */
+       vma->vm_flags |= VM_DONTEXPAND;
 
        vma->vm_file = filp;    /* Needed for drm_vm_open() */
        drm_vm_open_locked(vma);
@@ -655,6 +656,7 @@ static int drm_mmap_locked(struct file *filp, struct vm_area_struct *vma)
                return -EINVAL; /* This should never happen. */
        }
        vma->vm_flags |= VM_RESERVED;   /* Don't swap */
+       vma->vm_flags |= VM_DONTEXPAND;
 
        vma->vm_file = filp;    /* Needed for drm_vm_open() */
        drm_vm_open_locked(vma);
index 3ae57ecc7afd84b30b6557a4e01d0be30c45fc5c..fa194a46c1e4f3166ef0d2164e215b8221b9be07 100644 (file)
@@ -584,7 +584,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define R300_RE_FOG_START                     0x4298
 
 /* Not sure why there are duplicate of factor and constant values.
- * My best guess so far is that there are seperate zbiases for test and write.
+ * My best guess so far is that there are separate zbiases for test and write.
  * Ordering might be wrong.
  * Some of the tests indicate that fgl has a fallback implementation of zbias
  * via pixel shaders.
index 75d6b748c2c0dec1e2634082820681e5f5b3e288..7009dbddac436fc86fbd1fe20757382d6228541f 100644 (file)
@@ -400,7 +400,7 @@ static inline uint32_t *via_align_buffer(drm_via_private_t * dev_priv,
 }
 
 /*
- * This function is used internally by ring buffer mangement code.
+ * This function is used internally by ring buffer management code.
  *
  * Returns virtual pointer to ring buffer.
  */
index 004141d535a27852eda7d3a9ea287893ea3db2e7..49233f5898742040339b5a1d31c4ce7fd74d9960 100644 (file)
@@ -18,7 +18,7 @@
  *
  * NOTES:
  *     - Locking is required for safe execution of EFI calls with regards
- *       to interrrupts and SMP.
+ *       to interrupts and SMP.
  *
  * TODO (December 1999):
  *     - provide the API to set/get the WakeUp Alarm (different from the
index ffcecde9e2a5b317319e605480c5520264c77ee3..ffd747c5dff00dc7e69a1835d078003dd7ffc3d7 100644 (file)
@@ -1797,7 +1797,7 @@ static unsigned termios2digi_c(struct channel *ch, unsigned cflag)
        res |= cflag & ((CBAUD ^ CBAUDEX) | PARODD | PARENB | CSTOPB | CSIZE);
        /*
         * This gets a little confusing. The Digi cards have their own
-        * representation of c_cflags controling baud rate. For the most part
+        * representation of c_cflags controlling baud rate. For the most part
         * this is identical to the Linux implementation. However; Digi
         * supports one rate (76800) that Linux doesn't. This means that the
         * c_cflag entry that would normally mean 76800 for Digi actually means
@@ -2068,7 +2068,7 @@ static int info_ioctl(struct tty_struct *tty, struct file *file,
                {
                        /*
                         * This call is made by the apps to complete the
-                        * initilization of the board(s). This routine is
+                        * initialization of the board(s). This routine is
                         * responsible for setting the card to its initial
                         * state and setting the drivers control fields to the
                         * sutianle settings for the card in question.
index 0e8ceea5ea780a10c0e5f9bbb506da486cd658c6..712d9f271aa6b8ed7026bca1594cc3b38052287f 100644 (file)
@@ -26,7 +26,7 @@
  * The hangcheck-timer driver uses the TSC to catch delays that
  * jiffies does not notice.  A timer is set.  When the timer fires, it
  * checks whether it was delayed and if that delay exceeds a given
- * margin of error.  The hangcheck_tick module paramter takes the timer
+ * margin of error.  The hangcheck_tick module parameter takes the timer
  * duration in seconds.  The hangcheck_margin parameter defines the
  * margin of error, in seconds.  The defaults are 60 seconds for the
  * timer and 180 seconds for the margin of error.  IOW, a timer is set
index fd7559084b8204479c76dc0cbd72da06fe431126..3402def22007145a5ffba726bcc3e3b55554b51d 100644 (file)
@@ -838,7 +838,7 @@ static int __devexit hvcs_remove(struct vio_dev *dev)
        if (!hvcsd)
                return -ENODEV;
 
-       /* By this time the vty-server won't be getting any more interrups */
+       /* By this time the vty-server won't be getting any more interrupts */
 
        spin_lock_irqsave(&hvcsd->lock, flags);
 
index e46120d05b689af32f855e68a1656fd1d9794fd0..d6567b32fb5c18c960651fb49fdfee5277225895 100644 (file)
@@ -661,7 +661,7 @@ i2QueueCommands(int type, i2ChanStrPtr pCh, int timeout, int nCommands,
                if (!in_interrupt()) {
                        schedule_timeout_interruptible(1);      // short nap
                } else {
-                       // we cannot sched/sleep in interrrupt silly
+                       // we cannot sched/sleep in interrupt silly
                        return 0;   
                }
                if (signal_pending(current)) {
index e04e66cf2c68c53c6bc829d2923fbc8c5910a909..0f49ccf02a7fea974440587b337e60f015740e6f 100644 (file)
@@ -1251,7 +1251,7 @@ ip2_poll(unsigned long arg)
 
        // Just polled boards, IRQ = 0 will hit all non-interrupt boards.
        // It will NOT poll boards handled by hard interrupts.
-       // The issue of queued BH interrups is handled in ip2_interrupt().
+       // The issue of queued BH interrupts is handled in ip2_interrupt().
        ip2_polled_interrupt();
 
        PollTimer.expires = POLL_TIMEOUT;
index 82f2e27dca7d17ac42072adbd56cb52a175d551a..ff146c2b08fd65cb6e26498923d4df8b03ab95df 100644 (file)
@@ -283,7 +283,7 @@ mspec_mmap(struct file *file, struct vm_area_struct *vma,
        vdata->refcnt = ATOMIC_INIT(1);
        vma->vm_private_data = vdata;
 
-       vma->vm_flags |= (VM_IO | VM_RESERVED | VM_PFNMAP);
+       vma->vm_flags |= (VM_IO | VM_RESERVED | VM_PFNMAP | VM_DONTEXPAND);
        if (vdata->type == MSPEC_FETCHOP || vdata->type == MSPEC_UNCACHED)
                vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
        vma->vm_ops = &mspec_vm_ops;
index 6076e662886a43fc3b863ab3bd6022e0e8041f0e..dfaab2322de32c09a0adeab709cf5613ca9a0d5f 100644 (file)
@@ -2,7 +2,7 @@
  * nozomi.c  -- HSDPA driver Broadband Wireless Data Card - Globe Trotter
  *
  * Written by: Ulf Jakobsson,
- *             Jan ï¿½erfeldt,
+ *             Jan Ã…kerfeldt,
  *             Stefan Thomasson,
  *
  * Maintained by: Paul Hardwick (p.hardwick@option.com)
  * --------------------------------------------------------------------------
  */
 
-/*
- * CHANGELOG
- * Version 2.1d
- * 11-November-2007 Jiri Slaby, Frank Seidel
- * - Big rework of multicard support by Jiri
- * - Major cleanups (semaphore to mutex, endianess, no major reservation)
- * - Optimizations
- *
- * Version 2.1c
- * 30-October-2007 Frank Seidel
- * - Completed multicard support
- * - Minor cleanups
- *
- * Version 2.1b
- * 07-August-2007 Frank Seidel
- * - Minor cleanups
- * - theoretical multicard support
- *
- * Version 2.1
- * 03-July-2006 Paul Hardwick
- *
- * - Stability Improvements. Incorporated spinlock wraps patch.
- * - Updated for newer 2.6.14+ kernels (tty_buffer_request_room)
- * - using __devexit macro for tty
- *
- *
- * Version 2.0
- * 08-feb-2006 15:34:10:Ulf
- *
- * -Fixed issue when not waking up line disipine layer, could probably result
- *  in better uplink performance for 2.4.
- *
- * -Fixed issue with big endian during initalization, now proper toggle flags
- *  are handled between preloader and maincode.
- *
- * -Fixed flow control issue.
- *
- * -Added support for setting DTR.
- *
- * -For 2.4 kernels, removing temporary buffer that's not needed.
- *
- * -Reading CTS only for modem port (only port that supports it).
- *
- * -Return 0 in write_room instead of netative value, it's not handled in
- *  upper layer.
- *
- * --------------------------------------------------------------------------
- * Version 1.0
- *
- * First version of driver, only tested with card of type F32_2.
- * Works fine with 2.4 and 2.6 kernels.
- * Driver also support big endian architecture.
- */
-
 /* Enable this to have a lot of debug printouts */
 #define DEBUG
 
@@ -143,8 +89,9 @@ do {                                                         \
 /* Do we need this settable at runtime? */
 static int debug = NOZOMI_DEBUG_LEVEL;
 
-#define D(lvl, args...)  do {if (lvl & debug) NFO(KERN_DEBUG, ##args); } \
-                               while (0)
+#define D(lvl, args...)  do \
+                       {if (lvl & debug) NFO(KERN_DEBUG, ##args); } \
+                       while (0)
 #define D_(lvl, args...) D(lvl, ##args)
 
 /* These printouts are always printed */
@@ -273,13 +220,13 @@ enum port_type {
 /* Big endian */
 
 struct toggles {
-       unsigned enabled:5;     /*
+       unsigned int enabled:5; /*
                                 * Toggle fields are valid if enabled is 0,
                                 * else A-channels must always be used.
                                 */
-       unsigned diag_dl:1;
-       unsigned mdm_dl:1;
-       unsigned mdm_ul:1;
+       unsigned int diag_dl:1;
+       unsigned int mdm_dl:1;
+       unsigned int mdm_ul:1;
 } __attribute__ ((packed));
 
 /* Configuration table to read at startup of card */
@@ -320,19 +267,19 @@ struct config_table {
 /* This stores all control downlink flags */
 struct ctrl_dl {
        u8 port;
-       unsigned reserved:4;
-       unsigned CTS:1;
-       unsigned RI:1;
-       unsigned DCD:1;
-       unsigned DSR:1;
+       unsigned int reserved:4;
+       unsigned int CTS:1;
+       unsigned int RI:1;
+       unsigned int DCD:1;
+       unsigned int DSR:1;
 } __attribute__ ((packed));
 
 /* This stores all control uplink flags */
 struct ctrl_ul {
        u8 port;
-       unsigned reserved:6;
-       unsigned RTS:1;
-       unsigned DTR:1;
+       unsigned int reserved:6;
+       unsigned int RTS:1;
+       unsigned int DTR:1;
 } __attribute__ ((packed));
 
 #else
@@ -340,10 +287,10 @@ struct ctrl_ul {
 
 /* This represents the toggle information */
 struct toggles {
-       unsigned mdm_ul:1;
-       unsigned mdm_dl:1;
-       unsigned diag_dl:1;
-       unsigned enabled:5;     /*
+       unsigned int mdm_ul:1;
+       unsigned int mdm_dl:1;
+       unsigned int diag_dl:1;
+       unsigned int enabled:5; /*
                                 * Toggle fields are valid if enabled is 0,
                                 * else A-channels must always be used.
                                 */
@@ -379,19 +326,19 @@ struct config_table {
 
 /* This stores all control downlink flags */
 struct ctrl_dl {
-       unsigned DSR:1;
-       unsigned DCD:1;
-       unsigned RI:1;
-       unsigned CTS:1;
-       unsigned reserverd:4;
+       unsigned int DSR:1;
+       unsigned int DCD:1;
+       unsigned int RI:1;
+       unsigned int CTS:1;
+       unsigned int reserverd:4;
        u8 port;
 } __attribute__ ((packed));
 
 /* This stores all control uplink flags */
 struct ctrl_ul {
-       unsigned DTR:1;
-       unsigned RTS:1;
-       unsigned reserved:6;
+       unsigned int DTR:1;
+       unsigned int RTS:1;
+       unsigned int reserved:6;
        u8 port;
 } __attribute__ ((packed));
 #endif
@@ -448,7 +395,7 @@ struct buffer {
 } __attribute__ ((packed));
 
 /*    Global variables */
-static struct pci_device_id nozomi_pci_tbl[] = {
+static const struct pci_device_id nozomi_pci_tbl[] __devinitconst = {
        {PCI_DEVICE(VENDOR1, DEVICE1)},
        {},
 };
@@ -524,12 +471,12 @@ out:
  * -Optimize
  * -Rewrite cleaner
  */
-static u32 write_mem32(void __iomem *mem_addr_start, u32 *buf,
+static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
                        u32 size_bytes)
 {
        u32 i = 0;
        u32 *ptr = (__force u32 *) mem_addr_start;
-       u16 *buf16;
+       const u16 *buf16;
 
        if (unlikely(!ptr || !buf))
                return 0;
@@ -537,7 +484,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, u32 *buf,
        /* shortcut for extremely often used cases */
        switch (size_bytes) {
        case 2: /* 2 bytes */
-               buf16 = (u16 *) buf;
+               buf16 = (const u16 *)buf;
                writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
                return 2;
                break;
@@ -554,7 +501,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, u32 *buf,
        while (i < size_bytes) {
                if (size_bytes - i == 2) {
                        /* 2 bytes */
-                       buf16 = (u16 *) buf;
+                       buf16 = (const u16 *)buf;
                        writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
                        i += 2;
                } else {
@@ -694,7 +641,7 @@ static void dump_table(const struct nozomi *dc)
           dc->config_table.ul_ctrl_len);
 }
 #else
-static __inline__ void dump_table(const struct nozomi *dc) { }
+static inline void dump_table(const struct nozomi *dc) { }
 #endif
 
 /*
@@ -776,8 +723,7 @@ static int nozomi_read_config_table(struct nozomi *dc)
 /* Enable uplink interrupts  */
 static void enable_transmit_ul(enum port_type port, struct nozomi *dc)
 {
-       u16 mask[NOZOMI_MAX_PORTS] = \
-                       {MDM_UL, DIAG_UL, APP1_UL, APP2_UL, CTRL_UL};
+       static const u16 mask[] = {MDM_UL, DIAG_UL, APP1_UL, APP2_UL, CTRL_UL};
 
        if (port < NOZOMI_MAX_PORTS) {
                dc->last_ier |= mask[port];
@@ -790,8 +736,8 @@ static void enable_transmit_ul(enum port_type port, struct nozomi *dc)
 /* Disable uplink interrupts  */
 static void disable_transmit_ul(enum port_type port, struct nozomi *dc)
 {
-       u16 mask[NOZOMI_MAX_PORTS] = \
-                       {~MDM_UL, ~DIAG_UL, ~APP1_UL, ~APP2_UL, ~CTRL_UL};
+       static const u16 mask[] =
+               {~MDM_UL, ~DIAG_UL, ~APP1_UL, ~APP2_UL, ~CTRL_UL};
 
        if (port < NOZOMI_MAX_PORTS) {
                dc->last_ier &= mask[port];
@@ -804,8 +750,7 @@ static void disable_transmit_ul(enum port_type port, struct nozomi *dc)
 /* Enable downlink interrupts */
 static void enable_transmit_dl(enum port_type port, struct nozomi *dc)
 {
-       u16 mask[NOZOMI_MAX_PORTS] = \
-                       {MDM_DL, DIAG_DL, APP1_DL, APP2_DL, CTRL_DL};
+       static const u16 mask[] = {MDM_DL, DIAG_DL, APP1_DL, APP2_DL, CTRL_DL};
 
        if (port < NOZOMI_MAX_PORTS) {
                dc->last_ier |= mask[port];
@@ -818,8 +763,8 @@ static void enable_transmit_dl(enum port_type port, struct nozomi *dc)
 /* Disable downlink interrupts */
 static void disable_transmit_dl(enum port_type port, struct nozomi *dc)
 {
-       u16 mask[NOZOMI_MAX_PORTS] = \
-                       {~MDM_DL, ~DIAG_DL, ~APP1_DL, ~APP2_DL, ~CTRL_DL};
+       static const u16 mask[] =
+               {~MDM_DL, ~DIAG_DL, ~APP1_DL, ~APP2_DL, ~CTRL_DL};
 
        if (port < NOZOMI_MAX_PORTS) {
                dc->last_ier &= mask[port];
@@ -833,13 +778,13 @@ static void disable_transmit_dl(enum port_type port, struct nozomi *dc)
  * Return 1 - send buffer to card and ack.
  * Return 0 - don't ack, don't send buffer to card.
  */
-static int send_data(enum port_type index, struct nozomi *dc)
+static int send_data(enum port_type index, const struct nozomi *dc)
 {
        u32 size = 0;
-       struct port *port = &dc->port[index];
-       u8 toggle = port->toggle_ul;
+       const struct port *port = &dc->port[index];
+       const u8 toggle = port->toggle_ul;
        void __iomem *addr = port->ul_addr[toggle];
-       u32 ul_size = port->ul_size[toggle];
+       const u32 ul_size = port->ul_size[toggle];
        struct tty_struct *tty = port->tty;
 
        /* Get data from tty and place in buf for now */
@@ -1102,7 +1047,7 @@ static int send_flow_control(struct nozomi *dc)
 }
 
 /*
- * Handle donlink data, ports that are handled are modem and diagnostics
+ * Handle downlink data, ports that are handled are modem and diagnostics
  * Return 1 - ok
  * Return 0 - toggle fields are out of sync
  */
@@ -1359,20 +1304,20 @@ static void nozomi_setup_private_data(struct nozomi *dc)
 static ssize_t card_type_show(struct device *dev, struct device_attribute *attr,
                          char *buf)
 {
-       struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev));
+       const struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev));
 
        return sprintf(buf, "%d\n", dc->card_type);
 }
-static DEVICE_ATTR(card_type, 0444, card_type_show, NULL);
+static DEVICE_ATTR(card_type, S_IRUGO, card_type_show, NULL);
 
 static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr,
                          char *buf)
 {
-       struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev));
+       const struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev));
 
        return sprintf(buf, "%u\n", dc->open_ttys);
 }
-static DEVICE_ATTR(open_ttys, 0444, open_ttys_show, NULL);
+static DEVICE_ATTR(open_ttys, S_IRUGO, open_ttys_show, NULL);
 
 static void make_sysfs_files(struct nozomi *dc)
 {
@@ -1735,7 +1680,7 @@ static int ntty_write_room(struct tty_struct *tty)
 {
        struct port *port = tty->driver_data;
        int room = 0;
-       struct nozomi *dc = get_dc_by_tty(tty);
+       const struct nozomi *dc = get_dc_by_tty(tty);
 
        if (!dc || !port)
                return 0;
@@ -1755,9 +1700,9 @@ exit:
 /* Gets io control parameters */
 static int ntty_tiocmget(struct tty_struct *tty, struct file *file)
 {
-       struct port *port = tty->driver_data;
-       struct ctrl_dl *ctrl_dl = &port->ctrl_dl;
-       struct ctrl_ul *ctrl_ul = &port->ctrl_ul;
+       const struct port *port = tty->driver_data;
+       const struct ctrl_dl *ctrl_dl = &port->ctrl_dl;
+       const struct ctrl_ul *ctrl_ul = &port->ctrl_ul;
 
        return  (ctrl_ul->RTS ? TIOCM_RTS : 0) |
                (ctrl_ul->DTR ? TIOCM_DTR : 0) |
@@ -1787,7 +1732,7 @@ static int ntty_tiocmset(struct tty_struct *tty, struct file *file,
 static int ntty_cflags_changed(struct port *port, unsigned long flags,
                struct async_icount *cprev)
 {
-       struct async_icount cnow = port->tty_icount;
+       const struct async_icount cnow = port->tty_icount;
        int ret;
 
        ret =   ((flags & TIOCM_RNG) && (cnow.rng != cprev->rng)) ||
@@ -1802,7 +1747,7 @@ static int ntty_cflags_changed(struct port *port, unsigned long flags,
 
 static int ntty_ioctl_tiocgicount(struct port *port, void __user *argp)
 {
-       struct async_icount cnow = port->tty_icount;
+       const struct async_icount cnow = port->tty_icount;
        struct serial_icounter_struct icount;
 
        icount.cts = cnow.cts;
@@ -1882,7 +1827,10 @@ static void ntty_throttle(struct tty_struct *tty)
 /* just to discard single character writes */
 static void ntty_put_char(struct tty_struct *tty, unsigned char c)
 {
-       /* FIXME !!! */
+       /*
+        * card does not react correct when we write single chars
+        * to the card, so we discard them
+        */
        DBG2("PUT CHAR Function: %c", c);
 }
 
@@ -1910,7 +1858,7 @@ exit_in_buffer:
        return rval;
 }
 
-static struct tty_operations tty_ops = {
+static const struct tty_operations tty_ops = {
        .ioctl = ntty_ioctl,
        .open = ntty_open,
        .close = ntty_close,
index 905d1f51a7bfd7db75f90b9de128f13fd5142ac8..d010ed95ed3b1681bed5cea128625bbaea61a71b 100644 (file)
@@ -1544,7 +1544,7 @@ static void mgsl_isr_receive_data( struct mgsl_struct *info )
 
 /* mgsl_isr_misc()
  * 
- *     Service a miscellaneos interrupt source.
+ *     Service a miscellaneous interrupt source.
  *     
  * Arguments:          info            pointer to device extension (instance data)
  * Return Value:       None
index 5422f999636fffff6e499a9b7242d52f9e733fa9..ce5ebe3b168ffe0cb59f83484370a2bf6d957602 100644 (file)
@@ -505,7 +505,7 @@ static int __init toshiba_init(void)
        if (tosh_probe())
                return -ENODEV;
 
-       printk(KERN_INFO "Toshiba System Managment Mode driver v" TOSH_VERSION "\n");
+       printk(KERN_INFO "Toshiba System Management Mode driver v" TOSH_VERSION "\n");
 
        /* set the port to use for Fn status if not specified as a parameter */
        if (tosh_fn==0x00)
index e34da5c971966fc87d68b40588ea4f22e3f94189..dc17fe3a88bc48f2813ad5c3e5dd27efd00ff7d3 100644 (file)
@@ -158,13 +158,13 @@ static int __devinit virtcons_probe(struct virtio_device *dev)
        /* Find the input queue. */
        /* FIXME: This is why we want to wean off hvc: we do nothing
         * when input comes in. */
-       in_vq = vdev->config->find_vq(vdev, NULL);
+       in_vq = vdev->config->find_vq(vdev, 0, NULL);
        if (IS_ERR(in_vq)) {
                err = PTR_ERR(in_vq);
                goto free;
        }
 
-       out_vq = vdev->config->find_vq(vdev, NULL);
+       out_vq = vdev->config->find_vq(vdev, 1, NULL);
        if (IS_ERR(out_vq)) {
                err = PTR_ERR(out_vq);
                goto free_in_vq;
index e4c48e329367d93617635e65a671ffb2816a47f7..8cd8507b1a8ae4e76662101b4a55c513ec91e14e 100644 (file)
 #include <linux/dio.h>
 
 
-       /**
-        *  dio_match_device - Tell if a DIO device structure has a matching
-        *                     DIO device id structure
-        *  @ids: array of DIO device id structures to search in
-        *  @dev: the DIO device structure to match against
-        *
-        *  Used by a driver to check whether a DIO device present in the
-        *  system is in its list of supported devices. Returns the matching
-        *  dio_device_id structure or %NULL if there is no match.
-        */
+/**
+ *  dio_match_device - Tell if a DIO device structure has a matching DIO device id structure
+ *  @ids: array of DIO device id structures to search in
+ *  @d: the DIO device structure to match against
+ *
+ *  Used by a driver to check whether a DIO device present in the
+ *  system is in its list of supported devices. Returns the matching
+ *  dio_device_id structure or %NULL if there is no match.
+ */
 
 const struct dio_device_id *
 dio_match_device(const struct dio_device_id *ids,
@@ -66,13 +65,13 @@ static int dio_device_probe(struct device *dev)
 }
 
 
-       /**
       *  dio_register_driver - register a new DIO driver
       *  @drv: the driver structure to register
       *
       *  Adds the driver structure to the list of registered drivers
       *  Returns zero or a negative error value.
       */
+/**
+ *  dio_register_driver - register a new DIO driver
+ *  @drv: the driver structure to register
+ *
+ *  Adds the driver structure to the list of registered drivers
+ *  Returns zero or a negative error value.
+ */
 
 int dio_register_driver(struct dio_driver *drv)
 {
@@ -85,15 +84,15 @@ int dio_register_driver(struct dio_driver *drv)
 }
 
 
-       /**
       *  dio_unregister_driver - unregister a DIO driver
       *  @drv: the driver structure to unregister
       *
       *  Deletes the driver structure from the list of registered DIO drivers,
       *  gives it a chance to clean up by calling its remove() function for
       *  each device it was responsible for, and marks those devices as
       *  driverless.
       */
+/**
+ *  dio_unregister_driver - unregister a DIO driver
+ *  @drv: the driver structure to unregister
+ *
+ *  Deletes the driver structure from the list of registered DIO drivers,
+ *  gives it a chance to clean up by calling its remove() function for
+ *  each device it was responsible for, and marks those devices as
+ *  driverless.
+ */
 
 void dio_unregister_driver(struct dio_driver *drv)
 {
@@ -101,16 +100,15 @@ void dio_unregister_driver(struct dio_driver *drv)
 }
 
 
-       /**
-        *  dio_bus_match - Tell if a DIO device structure has a matching DIO
-        *                  device id structure
-        *  @ids: array of DIO device id structures to search in
-        *  @dev: the DIO device structure to match against
-        *
-        *  Used by a driver to check whether a DIO device present in the
-        *  system is in its list of supported devices. Returns the matching
-        *  dio_device_id structure or %NULL if there is no match.
-        */
+/**
+ *  dio_bus_match - Tell if a DIO device structure has a matching DIO device id structure
+ *  @dev: the DIO device structure to match against
+ *  @drv: the &device_driver that points to the array of DIO device id structures to search
+ *
+ *  Used by a driver to check whether a DIO device present in the
+ *  system is in its list of supported devices. Returns the matching
+ *  dio_device_id structure or %NULL if there is no match.
+ */
 
 static int dio_bus_match(struct device *dev, struct device_driver *drv)
 {
index 5dee9f50414bee396fde63895efa6ddcf7f0841c..e0b47b74ec4581aa60dda973c612bddc6c5738ca 100644 (file)
@@ -73,7 +73,7 @@ EXPORT_SYMBOL_GPL(edac_pci_alloc_ctl_info);
  *
  *     Last action on the pci control structure.
  *
- *     call the remove sysfs informaton, which will unregister
+ *     call the remove sysfs information, which will unregister
  *     this control struct's kobj. When that kobj's ref count
  *     goes to zero, its release function will be call and then
  *     kfree() the memory.
index a1f24c42d5ff45176984727961c245df1d0908fc..5a852017c17a70dc87d1bd16c7e83587b8b7a1c7 100644 (file)
@@ -351,7 +351,7 @@ struct i5000_pvt {
        u16 b1_ambpresent0;     /* Branch 1, Channel 8 */
        u16 b1_ambpresent1;     /* Branch 1, Channel 1 */
 
-       /* DIMM infomation matrix, allocating architecture maximums */
+       /* DIMM information matrix, allocating architecture maximums */
        struct i5000_dimm_info dimm_info[MAX_CSROWS][MAX_CHANNELS];
 
        /* Actual values for this controller */
index d168223db1594b7d351956f14903448548c08e1e..744011989044e029ca95cd00b9e3eb9ffed7cfb8 100644 (file)
@@ -11,7 +11,7 @@
  *
  * This code takes information provided by BIOS EDD calls
  * fn41 - Check Extensions Present and
- * fn48 - Get Device Parametes with EDD extensions
+ * fn48 - Get Device Parameters with EDD extensions
  * made in setup.S, copied to safe structures in setup.c,
  * and presents it in sysfs.
  *
index adeda7626529eaa15ca17baa51d83f43a4cd8e3a..3b12ffe770712dd1f1a708c7852ff5745a9b6e2a 100644 (file)
@@ -199,7 +199,7 @@ static int ide_timing_compute(ide_drive_t *drive, short speed, struct ide_timing
        }
 
 /*
- * Lenghten active & recovery time so that cycle time is correct.
+ * Lengthen active & recovery time so that cycle time is correct.
  */
 
        if (t->act8b + t->rec8b < t->cyc8b) {
index 1dc2ac9f3d1cce12d1516c07b567c4656b28ee54..c5600ac5feb3aa6c99dba80628d501d515488ebf 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/init.h>
 #include <linux/gameport.h>
 #include <linux/wait.h>
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/kthread.h>
index e5f4da9283406920945cee029758f3d0f8fbab94..05e3494cf8b87f4bb80fc9b904cda36099e6b6e5 100644 (file)
@@ -42,7 +42,6 @@
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/input.h>
-#include <linux/irq.h>
 
 #include <asm/portmux.h>
 #include <asm/mach/bf54x_keys.h>
index e6696b3c9416c066c6c7411e7318df4cb6326e1d..986f93cfc6b8a0211020e8978f374c9c29b272d2 100644 (file)
@@ -17,7 +17,6 @@
  */
 #include <linux/device.h>
 #include <linux/errno.h>
-#include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/input.h>
index 3e99df6be08465affbbb0550fd5be59688f71c39..adc3bd6e7f7bbc9a0d038d748dd3f95794a46f8f 100644 (file)
@@ -141,7 +141,7 @@ static void gscps2_flush(struct gscps2port *ps2port)
 /*
  * gscps2_writeb_output() - write a byte to the port
  *
- * returns 1 on sucess, 0 on error
+ * returns 1 on success, 0 on error
  */
 
 static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data)
index a19b7ffe9aceabdfbbf3fb5d7b5af01d4c0c8749..e39c5c1f623edf096ba9fb7c86ba34bc4a3849e7 100644 (file)
@@ -106,7 +106,7 @@ DbgRegister (char *drvName, char *drvTag, unsigned long dbgMask)
   return (1) ;
  }
 /*
- * Check if we registered whith an old maint driver (see debuglib.h)
+ * Check if we registered with an old maint driver (see debuglib.h)
  */
  if ( myDriverDebugHandle.dbg_end != NULL
    /* location of 'dbg_prt' in _OldDbgHandle_ struct */
index 11b3b9edd1d6f8f1a15dcd9137f02add7f73d887..016410cf227340e679e81a88f662e7fc8a1b14cb 100644 (file)
@@ -177,7 +177,7 @@ DBG_DECL(PRV3)
 } }
 #endif
 /*
- * For event level debug use a separate define, the paramete are
+ * For event level debug use a separate define, the parameter are
  * different and cause compiler errors on some systems.
  */
 #define DBG_EVL_ID(args) \
index ce8df38789087c4f7c85b056ba033644d3a1be00..10760b3c5eb56bda220b5b6b0d7390241d2b0a6d 100644 (file)
@@ -285,7 +285,7 @@ byte pr_dpc(ADAPTER * a)
                 a->ram_in(a, &RcIn->RcId),
                 a->ram_in(a, &RcIn->RcCh),
                 a->ram_inw(a, &RcIn->Reference),
-                tmp[0],  /* type of extended informtion */
+                tmp[0],  /* type of extended information */
                 tmp[1]); /* extended information        */
         a->ram_out(a, &RcIn->Rc, 0);
       }
index ccd35d047ec8c314dc337e827ca3ad58b45ae767..b9177ca4369a8d614eb8005335bacef00843fd0e 100644 (file)
@@ -4941,7 +4941,7 @@ void sig_ind(PLCI   * plci)
       /* b = IE1                */
       /* S = IE1 length + cont. */
       /* b = IE2                */
-      /* S = IE2 lenght + cont. */
+      /* S = IE2 length + cont. */
       sendf(plci->appl,
         _MANUFACTURER_I,
         Id,
index f85450146bdcb8e18e8c192199c086f063c1efa1..d3999a8e9f88cb55516cde292fd04af447ae32b5 100644 (file)
@@ -541,7 +541,7 @@ hycapi_rx_capipkt(hysdn_card * card, unsigned char *buf, unsigned short len)
        }
        ctrl = &cinfo->capi_ctrl;
        if(len < CAPI_MSG_BASELEN) {
-               printk(KERN_ERR "HYSDN Card%d: invalid CAPI-message, lenght %d!\n",
+               printk(KERN_ERR "HYSDN Card%d: invalid CAPI-message, length %d!\n",
                       card->myid, len);
                return;
        }       
index e2eec38c83c2ef21248353d132e3308810e1e17d..84f85e23cca7a65a86b3ffa3647953373c5339b3 100644 (file)
@@ -52,57 +52,82 @@ struct lguest_device {
 /*D:130
  * Device configurations
  *
- * The configuration information for a device consists of a series of fields.
- * We don't really care what they are: the Launcher set them up, and the driver
- * will look at them during setup.
+ * The configuration information for a device consists of one or more
+ * virtqueues, a feature bitmaks, and some configuration bytes.  The
+ * configuration bytes don't really matter to us: the Launcher sets them up, and
+ * the driver will look at them during setup.
  *
- * For us these fields come immediately after that device's descriptor in the
- * lguest_devices page.
- *
- * Each field starts with a "type" byte, a "length" byte, then that number of
- * bytes of configuration information.  The device descriptor tells us the
- * total configuration length so we know when we've reached the last field. */
+ * A convenient routine to return the device's virtqueue config array:
+ * immediately after the descriptor. */
+static struct lguest_vqconfig *lg_vq(const struct lguest_device_desc *desc)
+{
+       return (void *)(desc + 1);
+}
 
-/* type + length bytes */
-#define FHDR_LEN 2
+/* The features come immediately after the virtqueues. */
+static u8 *lg_features(const struct lguest_device_desc *desc)
+{
+       return (void *)(lg_vq(desc) + desc->num_vq);
+}
 
-/* This finds the first field of a given type for a device's configuration. */
-static void *lg_find(struct virtio_device *vdev, u8 type, unsigned int *len)
+/* The config space comes after the two feature bitmasks. */
+static u8 *lg_config(const struct lguest_device_desc *desc)
 {
-       struct lguest_device_desc *desc = to_lgdev(vdev)->desc;
-       int i;
-
-       for (i = 0; i < desc->config_len; i += FHDR_LEN + desc->config[i+1]) {
-               if (desc->config[i] == type) {
-                       /* Mark it used, so Host can know we looked at it, and
-                        * also so we won't find the same one twice. */
-                       desc->config[i] |= 0x80;
-                       /* Remember, the second byte is the length. */
-                       *len = desc->config[i+1];
-                       /* We return a pointer to the field header. */
-                       return desc->config + i;
-               }
-       }
+       return lg_features(desc) + desc->feature_len * 2;
+}
 
-       /* Not found: return NULL for failure. */
-       return NULL;
+/* The total size of the config page used by this device (incl. desc) */
+static unsigned desc_size(const struct lguest_device_desc *desc)
+{
+       return sizeof(*desc)
+               + desc->num_vq * sizeof(struct lguest_vqconfig)
+               + desc->feature_len * 2
+               + desc->config_len;
+}
+
+/* This tests (and acknowleges) a feature bit. */
+static bool lg_feature(struct virtio_device *vdev, unsigned fbit)
+{
+       struct lguest_device_desc *desc = to_lgdev(vdev)->desc;
+       u8 *features;
+
+       /* Obviously if they ask for a feature off the end of our feature
+        * bitmap, it's not set. */
+       if (fbit / 8 > desc->feature_len)
+               return false;
+
+       /* The feature bitmap comes after the virtqueues. */
+       features = lg_features(desc);
+       if (!(features[fbit / 8] & (1 << (fbit % 8))))
+               return false;
+
+       /* We set the matching bit in the other half of the bitmap to tell the
+        * Host we want to use this feature.  We don't use this yet, but we
+        * could in future. */
+       features[desc->feature_len + fbit / 8] |= (1 << (fbit % 8));
+       return true;
 }
 
 /* Once they've found a field, getting a copy of it is easy. */
-static void lg_get(struct virtio_device *vdev, void *token,
+static void lg_get(struct virtio_device *vdev, unsigned int offset,
                   void *buf, unsigned len)
 {
-       /* Check they didn't ask for more than the length of the field! */
-       BUG_ON(len > ((u8 *)token)[1]);
-       memcpy(buf, token + FHDR_LEN, len);
+       struct lguest_device_desc *desc = to_lgdev(vdev)->desc;
+
+       /* Check they didn't ask for more than the length of the config! */
+       BUG_ON(offset + len > desc->config_len);
+       memcpy(buf, lg_config(desc) + offset, len);
 }
 
 /* Setting the contents is also trivial. */
-static void lg_set(struct virtio_device *vdev, void *token,
+static void lg_set(struct virtio_device *vdev, unsigned int offset,
                   const void *buf, unsigned len)
 {
-       BUG_ON(len > ((u8 *)token)[1]);
-       memcpy(token + FHDR_LEN, buf, len);
+       struct lguest_device_desc *desc = to_lgdev(vdev)->desc;
+
+       /* Check they didn't ask for more than the length of the config! */
+       BUG_ON(offset + len > desc->config_len);
+       memcpy(lg_config(desc) + offset, buf, len);
 }
 
 /* The operations to get and set the status word just access the status field
@@ -114,9 +139,20 @@ static u8 lg_get_status(struct virtio_device *vdev)
 
 static void lg_set_status(struct virtio_device *vdev, u8 status)
 {
+       BUG_ON(!status);
        to_lgdev(vdev)->desc->status = status;
 }
 
+/* To reset the device, we (ab)use the NOTIFY hypercall, with the descriptor
+ * address of the device.  The Host will zero the status and all the
+ * features. */
+static void lg_reset(struct virtio_device *vdev)
+{
+       unsigned long offset = (void *)to_lgdev(vdev)->desc - lguest_devices;
+
+       hcall(LHCALL_NOTIFY, (max_pfn<<PAGE_SHIFT) + offset, 0, 0);
+}
+
 /*
  * Virtqueues
  *
@@ -165,39 +201,29 @@ static void lg_notify(struct virtqueue *vq)
  *
  * So we provide devices with a "find virtqueue and set it up" function. */
 static struct virtqueue *lg_find_vq(struct virtio_device *vdev,
-                                   bool (*callback)(struct virtqueue *vq))
+                                   unsigned index,
+                                   void (*callback)(struct virtqueue *vq))
 {
+       struct lguest_device *ldev = to_lgdev(vdev);
        struct lguest_vq_info *lvq;
        struct virtqueue *vq;
-       unsigned int len;
-       void *token;
        int err;
 
-       /* Look for a field of the correct type to mark a virtqueue.  Note that
-        * if this succeeds, then the type will be changed so it won't be found
-        * again, and future lg_find_vq() calls will find the next
-        * virtqueue (if any). */
-       token = vdev->config->find(vdev, VIRTIO_CONFIG_F_VIRTQUEUE, &len);
-       if (!token)
+       /* We must have this many virtqueues. */
+       if (index >= ldev->desc->num_vq)
                return ERR_PTR(-ENOENT);
 
        lvq = kmalloc(sizeof(*lvq), GFP_KERNEL);
        if (!lvq)
                return ERR_PTR(-ENOMEM);
 
-       /* Note: we could use a configuration space inside here, just like we
-        * do for the device.  This would allow expansion in future, because
-        * our configuration system is designed to be expansible.  But this is
-        * way easier. */
-       if (len != sizeof(lvq->config)) {
-               dev_err(&vdev->dev, "Unexpected virtio config len %u\n", len);
-               err = -EIO;
-               goto free_lvq;
-       }
-       /* Make a copy of the "struct lguest_vqconfig" field.  We need a copy
-        * because the config space might not be aligned correctly. */
-       vdev->config->get(vdev, token, &lvq->config, sizeof(lvq->config));
+       /* Make a copy of the "struct lguest_vqconfig" entry, which sits after
+        * the descriptor.  We need a copy because the config space might not
+        * be aligned correctly. */
+       memcpy(&lvq->config, lg_vq(ldev->desc)+index, sizeof(lvq->config));
 
+       printk("Mapping virtqueue %i addr %lx\n", index,
+              (unsigned long)lvq->config.pfn << PAGE_SHIFT);
        /* Figure out how many pages the ring will take, and map that memory */
        lvq->pages = lguest_map((unsigned long)lvq->config.pfn << PAGE_SHIFT,
                                DIV_ROUND_UP(vring_size(lvq->config.num,
@@ -259,11 +285,12 @@ static void lg_del_vq(struct virtqueue *vq)
 
 /* The ops structure which hooks everything together. */
 static struct virtio_config_ops lguest_config_ops = {
-       .find = lg_find,
+       .feature = lg_feature,
        .get = lg_get,
        .set = lg_set,
        .get_status = lg_get_status,
        .set_status = lg_set_status,
+       .reset = lg_reset,
        .find_vq = lg_find_vq,
        .del_vq = lg_del_vq,
 };
@@ -329,13 +356,14 @@ static void scan_devices(void)
        struct lguest_device_desc *d;
 
        /* We start at the page beginning, and skip over each entry. */
-       for (i = 0; i < PAGE_SIZE; i += sizeof(*d) + d->config_len) {
+       for (i = 0; i < PAGE_SIZE; i += desc_size(d)) {
                d = lguest_devices + i;
 
                /* Once we hit a zero, stop. */
                if (d->type == 0)
                        break;
 
+               printk("Device at %i has size %u\n", i, desc_size(d));
                add_lguest_device(d);
        }
 }
index 7ce0ea64465ccd666b5b2c234db58ac497cd7e03..28958101061f9a922cf4c79f7cd41c8ec3472e45 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/completion.h>
 #include <linux/device.h>
 #include <linux/kthread.h>
+#include <linux/platform_device.h>
 
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
index d409f67594828e5501e754edc1fb60e5337b2f3d..8ba49385c3ff4fd149c21980eabf0cc1996ee32b 100644 (file)
@@ -12,7 +12,7 @@
  *  - maybe add timeout to commands ?
  *  - blocking version of time functions
  *  - polling version of i2c commands (including timer that works with
- *    interrutps off)
+ *    interrupts off)
  *  - maybe avoid some data copies with i2c by directly using the smu cmd
  *    buffer and a lower level internal interface
  *  - understand SMU -> CPU events and implement reception of them via
@@ -179,7 +179,7 @@ static irqreturn_t smu_db_intr(int irq, void *arg)
                /* CPU might have brought back the cache line, so we need
                 * to flush again before peeking at the SMU response. We
                 * flush the entire buffer for now as we haven't read the
-                * reply lenght (it's only 2 cache lines anyway)
+                * reply length (it's only 2 cache lines anyway)
                 */
                faddr = (unsigned long)smu->cmd_buf;
                flush_inval_dcache_range(faddr, faddr + 256);
index 7d04a6fd1acb03affddb06faada0a40018066a19..168a8d3a5e556e889b7b44033b06531addb9faf8 100644 (file)
@@ -388,7 +388,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
        }
        dev->revision &= 0xf;
 
-       /* remap the memory from virtual to physical adress */
+       /* remap the memory from virtual to physical address */
 
        err = pci_request_region(pci, 0, "saa7146");
        if (err < 0)
index a33eb5988c42e8aa1fcf64c1959084617c3d8e8e..ed3f8268ed11445e60fce10500a66e15d3e3be53 100644 (file)
@@ -681,7 +681,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len )
                                                        drop = 1;
                                                /* else: destination address matches the MAC address of our receiver device */
                                        }
-                                       /* else: promiscious mode; pass everything up the stack */
+                                       /* else: promiscuous mode; pass everything up the stack */
 
                                        if (drop) {
 #ifdef ULE_DEBUG
index 63a47cd4c161110796503cfc3a83fa5412e9ba7a..7374c02dd183fc1a5d457b8899828dab9c195dd8 100644 (file)
@@ -4344,7 +4344,7 @@ static void rv605_muxsel(struct bttv *btv, unsigned int input)
        gpio_bits(0x200,0x000);
        mdelay(1);
 
-       /* create a new conection */
+       /* create a new connection */
        gpio_bits(0x480,0x080);
        gpio_bits(0x480,0x480);
        mdelay(1);
index 5c2c4029ff86bd76a3872152b198b58259e73936..84b9e4f2b3b3fcef7c25b2b60d88df30925d44f6 100644 (file)
@@ -326,7 +326,7 @@ static int indycam_attach(struct i2c_adapter *adap, int addr, int kind)
        // initialize
        err = indycam_write_block(client, 0, sizeof(initseq), (u8 *)&initseq);
        if (err) {
-               printk(KERN_ERR "IndyCam initalization failed\n");
+               printk(KERN_ERR "IndyCam initialization failed\n");
                err = -EIO;
                goto out_detach_client;
        }
index b630c26cfe856b9b45ead161d34ee013fddbeadc..58bab653330fee8ce0b6e26d618cd02c3c9fb37e 100644 (file)
@@ -369,7 +369,7 @@ static struct dvb_tuner_ops mt2032_tuner_ops = {
        .get_frequency     = microtune_get_frequency,
 };
 
-// Initalization as described in "MT203x Programming Procedures", Rev 1.2, Feb.2001
+// Initialization as described in "MT203x Programming Procedures", Rev 1.2, Feb.2001
 static int mt2032_init(struct dvb_frontend *fe)
 {
        struct microtune_priv *priv = fe->tuner_priv;
index 074533e9c21ee69079ed0de2ea15df86bed86b04..1a9a4baf12b84664821c42b862789f68a4fcf20d 100644 (file)
@@ -27,7 +27,7 @@
    might want to increase this - however the driver operation will not
    be impaired if it is too small.  Instead additional units just
    won't have an ID assigned and it might not be possible to specify
-   module paramters for those extra units. */
+   module parameters for those extra units. */
 #define PVR_NUM 20
 
 #endif /* __PVRUSB2_H */
index 7300ace8f44ed1331bb5f385b3821dfb749aedf9..f991d72fe10808d29263e7c0cb6411e9f93bc0b1 100644 (file)
@@ -542,7 +542,7 @@ int pwc_handle_frame(struct pwc_device *pdev)
        }
 
        if (pdev->read_frame != NULL) {
-               /* Decompression is a lenghty process, so it's outside of the lock.
+               /* Decompression is a lengthy process, so it's outside of the lock.
                   This gives the isoc_handler the opportunity to fill more frames
                   in the mean time.
                */
index e0ff811fab6f3e69a69af355e287f4d6db29c92e..ca05cd65508765559524b104dc7805ab5dad278f 100644 (file)
@@ -57,7 +57,7 @@ static int tea6420_switch(struct i2c_client *client, int i, int o, int g)
 
        dprintk("adr:0x%02x, i:%d, o:%d, g:%d\n", client->addr, i, o, g);
 
-       /* check if the paramters are valid */
+       /* check if the parameters are valid */
        if (i < 1 || i > 6 || o < 1 || o > 4 || g < 0 || g > 6 || g % 2 != 0)
                return -1;
 
index d847273eeba0c247c4f707a4fed3b00feef04b3e..5e7b795013706591aff8dfb09099d9dd60a8fff1 100644 (file)
@@ -258,7 +258,7 @@ static void qcm_hsv2rgb(u16 hue, u16 sat, u16 val, u16 *r, u16 *g, u16 *b)
        unsigned int p;
 
        /*
-       the registers controling gain are 8 bit of which
+       the registers controlling gain are 8 bit of which
        we affect only the last 4 bits with our gain.
        we know that if saturation is 0, (unsaturated) then
        we're grayscale (center axis of the colour cone) so
index b52b826a30be8b5fb38f03ed38de20dc3e338ee9..df52f8a602155c6c32e26011f6dd93f0c6c7b097 100644 (file)
@@ -131,7 +131,7 @@ static struct usbvision_v4l2_format_st usbvision_v4l2_format[] = {
 /* Function prototypes */
 static void usbvision_release(struct usb_usbvision *usbvision);
 
-/* Default initalization of device driver parameters */
+/* Default initialization of device driver parameters */
 /* Set the default format for ISOC endpoint */
 static int isocMode = ISOC_MODE_COMPRESS;
 /* Set the default Debug Mode of the device driver */
index 8ef31ed7d3f1133edfe514ba0b34445d3aaed3a6..a9133858e913552e62474792ad6b647a0865edd5 100644 (file)
@@ -566,7 +566,7 @@ vpx3220_init_client (struct i2c_client *client)
 }
 
 /* -----------------------------------------------------------------------
- * Client managment code
+ * Client management code
  */
 
 /*
index 6e0ac4c5c379683187645e104e467b82c171b196..690281bb59ee616f71db4393d7b63a4080455284 100644 (file)
@@ -1270,7 +1270,7 @@ zoran_setup_videocodec (struct zoran *zr,
 }
 
 /*
- *   Scan for a Buz card (actually for the PCI contoler ZR36057),
+ *   Scan for a Buz card (actually for the PCI controller ZR36057),
  *   request the irq and map the io memory
  */
 static int __devinit
index 9f622e00c479b573875bd062886afa8688063c5c..faae4ec3ea0bf5288f12a1c52a78ce75e12bd7c2 100644 (file)
@@ -161,7 +161,7 @@ zr36050_wait_end (struct zr36050 *ptr)
                udelay(1);
                if (i++ > 200000) {     // 200ms, there is for sure something wrong!!!
                        dprintk(1,
-                               "%s: timout at wait_end (last status: 0x%02x)\n",
+                               "%s: timeout at wait_end (last status: 0x%02x)\n",
                                ptr->name, ptr->status1);
                        break;
                }
index 1ef14fef08e624a85c2a2733fb39fa04c2685344..7849b65969d0741e624b350aa80e79eb18d50321 100644 (file)
@@ -163,7 +163,7 @@ zr36060_wait_end (struct zr36060 *ptr)
                udelay(1);
                if (i++ > 200000) {     // 200ms, there is for sure something wrong!!!
                        dprintk(1,
-                               "%s: timout at wait_end (last status: 0x%02x)\n",
+                               "%s: timeout at wait_end (last status: 0x%02x)\n",
                                ptr->name, ptr->status);
                        break;
                }
index 6be1f6b65777a07208da7ad26eb084c7c8308b7e..af9da03e95e571f7677f5092d6dd7e123eedd59a 100644 (file)
 #define PL_LOGINFO_SUB_CODE_FRAME_XFER_ERROR                 (0x00000400) /* Bits 0-3 encode Transport Status Register (offset 0x08) */
                                                                           /* Bit 0 is Status Bit 0: FrameXferErr */
                                                                           /* Bit 1 & 2 are Status Bits 16 and 17: FrameXmitErrStatus */
-                                                                          /* Bit 3 is Status Bit 18 WriteDataLenghtGTDataLengthErr */
+                                                                          /* Bit 3 is Status Bit 18 WriteDataLengthGTDataLengthErr */
 
 #define PL_LOGINFO_SUB_CODE_TX_FM_CONNECTED_LOW              (0x00000500)
 #define PL_LOGINFO_SUB_CODE_SATA_NON_NCQ_RW_ERR_BIT_SET      (0x00000600)
index 6029509702d35e02b92f76fc1546007c39ee5299..e630b50966ec5ba0192a36acb9e22a328e9b5675 100644 (file)
@@ -1708,7 +1708,7 @@ mptctl_replace_fw (unsigned long arg)
  *
  * Outputs:    None.
  * Return:     0 if successful
- *             -EBUSY  if previous command timout and IOC reset is not complete.
+ *             -EBUSY  if previous command timeout and IOC reset is not complete.
  *             -EFAULT if data unavailable
  *             -ENODEV if no such device/adapter
  *             -ETIME  if timer expires
@@ -1748,7 +1748,7 @@ mptctl_mpt_command (unsigned long arg)
  *
  * Outputs:    None.
  * Return:     0 if successful
- *             -EBUSY  if previous command timout and IOC reset is not complete.
+ *             -EBUSY  if previous command timeout and IOC reset is not complete.
  *             -EFAULT if data unavailable
  *             -ENODEV if no such device/adapter
  *             -ETIME  if timer expires
@@ -2316,7 +2316,7 @@ done_free_mem:
  * Outputs:    None.
  * Return:     0 if successful
  *             -EFAULT if data unavailable
- *             -EBUSY  if previous command timout and IOC reset is not complete.
+ *             -EBUSY  if previous command timeout and IOC reset is not complete.
  *             -ENODEV if no such device/adapter
  *             -ETIME  if timer expires
  *             -ENOMEM if memory allocation error
@@ -2553,7 +2553,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
  * Outputs:    None.
  * Return:     0 if successful
  *             -EFAULT if data unavailable
- *             -EBUSY  if previous command timout and IOC reset is not complete.
+ *             -EBUSY  if previous command timeout and IOC reset is not complete.
  *             -ENODEV if no such device/adapter
  *             -ETIME  if timer expires
  *             -ENOMEM if memory allocation error
index 5c614ec38cc494da6671db10a964302cca993127..af1de0ccee2f54c37c3567585e9e73db6f83bfe4 100644 (file)
@@ -1736,7 +1736,7 @@ mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, i
  fail_out:
 
        /*
-        * Free task managment mf, and corresponding tm flags
+        * Free task management mf, and corresponding tm flags
         */
        mpt_free_msg_frame(ioc, mf);
        hd->tmPending = 0;
index 7814a06ae970f515cc43e21051e0bb13a09c53a9..da715e11c1b28cc493de7047e1772074c804e981 100644 (file)
@@ -916,7 +916,7 @@ static int i2o_parse_hrt(struct i2o_controller *c)
  *     status block. The status block could then be accessed through
  *     c->status_block.
  *
- *     Returns 0 on sucess or negative error code on failure.
+ *     Returns 0 on success or negative error code on failure.
  */
 int i2o_status_get(struct i2o_controller *c)
 {
index c73e96bfafc636047bbe9bebef7067b4a79d4bb3..90acf57c19bd29962197cf9ed83fa332e3888a4c 100644 (file)
@@ -376,7 +376,7 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
         * hardware restriction. */
        if (doc->mfr) {
                if (doc->mfr == mfr && doc->id == id)
-                       return 1;       /* This is another the same the first */
+                       return 1;       /* This is the same as the first */
                else
                        printk(KERN_WARNING
                               "Flash chip at floor %d, chip %d is different:\n",
index e3744eb8eccba4a68f3780379911a1eff7df2ef5..dd38011ee0b7326096973b694a3339467bc984f5 100644 (file)
@@ -20,7 +20,7 @@
  *
  *     02-12-2002 TG   Cleanup of module params
  *
- *     02-20-2002 TG   adjusted for different rd/wr adress support
+ *     02-20-2002 TG   adjusted for different rd/wr address support
  *                     added support for read device ready/busy line
  *                     added page_cache
  *
@@ -144,7 +144,7 @@ static int __init autcpu12_init(void)
                goto out;
        }
 
-       /* map physical adress */
+       /* map physical address */
        autcpu12_fio_base = ioremap(AUTCPU12_PHYS_SMC, SZ_1K);
        if (!autcpu12_fio_base) {
                printk("Ioremap autcpu12 SmartMedia Card failed\n");
@@ -227,7 +227,7 @@ static void __exit autcpu12_cleanup(void)
        /* Release resources, unregister device */
        nand_release(autcpu12_mtd);
 
-       /* unmap physical adress */
+       /* unmap physical address */
        iounmap(autcpu12_fio_base);
 
        /* Free the MTD device structure */
index 1657ecd74881ee4eebd9ce1752ef692a11c05c8b..a52f3a737c39a606e0832b3db47f19effa274a83 100644 (file)
@@ -4,7 +4,7 @@
  *     http://blackfin.uclinux.org/
  *     Bryan Wu <bryan.wu@analog.com>
  *
- * Blackfin BF5xx on-chip NAND flash controler driver
+ * Blackfin BF5xx on-chip NAND flash controller driver
  *
  * Derived from drivers/mtd/nand/s3c2410.c
  * Copyright (c) 2007 Ben Dooks <ben@simtec.co.uk>
index 89deff007116388b718c5828f476ce4bb507c841..19e1594421a476cae392e4b5f2b6b48c6fb18bb3 100644 (file)
@@ -337,7 +337,7 @@ static void __exit cs553x_cleanup(void)
                nand_release(cs553x_mtd[i]);
                cs553x_mtd[i] = NULL;
 
-               /* unmap physical adress */
+               /* unmap physical address */
                iounmap(mmio_base);
 
                /* Free the MTD device structure */
index 0146cdc48039617259a72c5a8c094d6a53c18cc5..ba67bbec20d3a4fbab3ac9733d05ee7cc3f61229 100644 (file)
@@ -125,7 +125,7 @@ static int __init ep7312_init(void)
                return -ENOMEM;
        }
 
-       /* map physical adress */
+       /* map physical address */
        ep7312_fio_base = ioremap(ep7312_fio_pbase, SZ_1K);
        if (!ep7312_fio_base) {
                printk("ioremap EDB7312 NAND flash failed\n");
index e29c1da7f56e82530a987beb96ab84a735a2b637..ddd4fc019042ff72250c887944a3410ec6b69459 100644 (file)
@@ -89,7 +89,7 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to,
                             struct mtd_oob_ops *ops);
 
 /*
- * For devices which display every fart in the system on a seperate LED. Is
+ * For devices which display every fart in the system on a separate LED. Is
  * compiled away when LED support is disabled.
  */
 DEFINE_LED_TRIGGER(nand_led_trigger);
index 10490b48d9f75844c81a00dc8f32825475345afc..bb885d1fcab5e9bbb87a085f0af76a76ea5e88bb 100644 (file)
@@ -210,7 +210,7 @@ MODULE_PARM_DESC(overridesize,   "Specifies the NAND Flash size overriding the I
 #define STATE_CMD_RESET        0x0000000C /* reset */
 #define STATE_CMD_MASK         0x0000000F /* command states mask */
 
-/* After an addres is input, the simulator goes to one of these states */
+/* After an address is input, the simulator goes to one of these states */
 #define STATE_ADDR_PAGE        0x00000010 /* full (row, column) address is accepted */
 #define STATE_ADDR_SEC         0x00000020 /* sector address was accepted */
 #define STATE_ADDR_ZERO        0x00000030 /* one byte zero address was accepted */
index 66f76e9618ddd9005edcb60faf2b66ea2ec539b2..2bd0737572c6fe9146a5b26d6f4147a2e76daea8 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Changelog:
  *     21-Sep-2004  BJD  Initial version
- *     23-Sep-2004  BJD  Mulitple device support
+ *     23-Sep-2004  BJD  Multiple device support
  *     28-Sep-2004  BJD  Fixed ECC placement for Hardware mode
  *     12-Oct-2004  BJD  Fixed errors in use of platform data
  *     18-Feb-2005  BJD  Fix sparse errors
index 51c7288ab49a0fe4e0d251ba35c680e651378c58..033f8800b1e69224d81c15dd670bc24e95190a7f 100644 (file)
@@ -165,7 +165,7 @@ static int __init sharpsl_nand_init(void)
                return -ENOMEM;
        }
 
-       /* map physical adress */
+       /* map physical address */
        sharpsl_io_base = ioremap(sharpsl_phys_base, 0x1000);
        if (!sharpsl_io_base) {
                printk("ioremap to access Sharp SL NAND chip failed\n");
index 067262ee8df0fa2683c7a7bfd8582919fc0f5909..0513cbc8834d66b78d7e0c85d1f6532447048044 100644 (file)
@@ -429,7 +429,7 @@ static void check_sectors_in_chain(struct NFTLrecord *nftl, unsigned int first_b
        }
 }
 
-/* calc_chain_lenght: Walk through a Virtual Unit Chain and estimate chain length */
+/* calc_chain_length: Walk through a Virtual Unit Chain and estimate chain length */
 static int calc_chain_length(struct NFTLrecord *nftl, unsigned int first_block)
 {
        unsigned int length = 0, block = first_block;
index 389980f0e59e7385d608e3cc2b7aed58ac2be115..f234ba3f040484ef7470d96dcbd4cd9ebe92884a 100644 (file)
@@ -814,8 +814,8 @@ config ULTRA32
          will be called smc-ultra32.
 
 config BFIN_MAC
-       tristate "Blackfin 536/537 on-chip mac support"
-       depends on NET_ETHERNET && (BF537 || BF536) && (!BF537_PORT_H)
+       tristate "Blackfin 527/536/537 on-chip mac support"
+       depends on NET_ETHERNET && (BF527 || BF537 || BF536) && (!BF537_PORT_H)
        select CRC32
        select MII
        select PHYLIB
@@ -828,7 +828,7 @@ config BFIN_MAC
 
 config BFIN_MAC_USE_L1
        bool "Use L1 memory for rx/tx packets"
-       depends on BFIN_MAC && BF537
+       depends on BFIN_MAC && (BF527 || BF537)
        default y
        help
          To get maximum network performance, you should use L1 memory as rx/tx buffers.
@@ -855,7 +855,8 @@ config BFIN_RX_DESC_NUM
 config BFIN_MAC_RMII
        bool "RMII PHY Interface (EXPERIMENTAL)"
        depends on BFIN_MAC && EXPERIMENTAL
-       default n
+       default y if BFIN527_EZKIT
+       default n if BFIN537_STAMP
        help
          Use Reduced PHY MII Interface
 
@@ -1199,7 +1200,7 @@ config NE2_MCA
 
 config IBMLANA
        tristate "IBM LAN Adapter/A support"
-       depends on MCA && MCA_LEGACY
+       depends on MCA
        ---help---
          This is a Micro Channel Ethernet adapter.  You need to set
          CONFIG_MCA to use this driver.  It is both available as an in-kernel
@@ -3113,6 +3114,7 @@ config VIRTIO_NET
        tristate "Virtio network driver (EXPERIMENTAL)"
        depends on EXPERIMENTAL && VIRTIO
        ---help---
-         This is the virtual network driver for lguest.  Say Y or M.
+         This is the virtual network driver for virtio.  It can be used with
+          lguest or QEMU based VMMs (like KVM or Xen).  Say Y or M.
 
 endif # NETDEVICES
index 25b114a4e2b16f57373481da83b6066090518543..0ae0d83e5d2254b1db9b531103a3f88d4b50b7e3 100644 (file)
@@ -384,7 +384,7 @@ static void reset_phy(struct net_device *dev)
        /* Wait until PHY reset is complete */
        do {
                read_phy(lp->phy_address, MII_BMCR, &bmcr);
-       } while (!(bmcr && BMCR_RESET));
+       } while (!(bmcr & BMCR_RESET));
 
        disable_mdi();
        spin_unlock_irq(&lp->lock);
index 7495a9ee8f4bff6dde5b7c7666398d35882059fd..194949afacd05142655f7d1a42e00b8b894f6697 100644 (file)
@@ -137,11 +137,12 @@ static int ax_initial_check(struct net_device *dev)
 static void ax_reset_8390(struct net_device *dev)
 {
        struct ei_device *ei_local = netdev_priv(dev);
+       struct ax_device  *ax = to_ax_dev(dev);
        unsigned long reset_start_time = jiffies;
        void __iomem *addr = (void __iomem *)dev->base_addr;
 
        if (ei_debug > 1)
-               printk(KERN_DEBUG "resetting the 8390 t=%ld...", jiffies);
+               dev_dbg(&ax->dev->dev, "resetting the 8390 t=%ld\n", jiffies);
 
        ei_outb(ei_inb(addr + NE_RESET), addr + NE_RESET);
 
@@ -151,7 +152,7 @@ static void ax_reset_8390(struct net_device *dev)
        /* This check _should_not_ be necessary, omit eventually. */
        while ((ei_inb(addr + EN0_ISR) & ENISR_RESET) == 0) {
                if (jiffies - reset_start_time > 2*HZ/100) {
-                       printk(KERN_WARNING "%s: %s did not complete.\n",
+                       dev_warn(&ax->dev->dev, "%s: %s did not complete.\n",
                               __FUNCTION__, dev->name);
                        break;
                }
@@ -165,13 +166,15 @@ static void ax_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
                            int ring_page)
 {
        struct ei_device *ei_local = netdev_priv(dev);
+       struct ax_device  *ax = to_ax_dev(dev);
        void __iomem *nic_base = ei_local->mem;
 
        /* This *shouldn't* happen. If it does, it's the last thing you'll see */
        if (ei_status.dmaing) {
-               printk(KERN_EMERG "%s: DMAing conflict in %s [DMAstat:%d][irqlock:%d].\n",
+               dev_err(&ax->dev->dev, "%s: DMAing conflict in %s "
+                       "[DMAstat:%d][irqlock:%d].\n",
                        dev->name, __FUNCTION__,
-                      ei_status.dmaing, ei_status.irqlock);
+                       ei_status.dmaing, ei_status.irqlock);
                return;
        }
 
@@ -204,13 +207,16 @@ static void ax_block_input(struct net_device *dev, int count,
                           struct sk_buff *skb, int ring_offset)
 {
        struct ei_device *ei_local = netdev_priv(dev);
+       struct ax_device  *ax = to_ax_dev(dev);
        void __iomem *nic_base = ei_local->mem;
        char *buf = skb->data;
 
        if (ei_status.dmaing) {
-               printk(KERN_EMERG "%s: DMAing conflict in ax_block_input "
+               dev_err(&ax->dev->dev,
+                       "%s: DMAing conflict in %s "
                        "[DMAstat:%d][irqlock:%d].\n",
-                       dev->name, ei_status.dmaing, ei_status.irqlock);
+                       dev->name, __FUNCTION__,
+                       ei_status.dmaing, ei_status.irqlock);
                return;
        }
 
@@ -239,6 +245,7 @@ static void ax_block_output(struct net_device *dev, int count,
                            const unsigned char *buf, const int start_page)
 {
        struct ei_device *ei_local = netdev_priv(dev);
+       struct ax_device  *ax = to_ax_dev(dev);
        void __iomem *nic_base = ei_local->mem;
        unsigned long dma_start;
 
@@ -251,7 +258,7 @@ static void ax_block_output(struct net_device *dev, int count,
 
        /* This *shouldn't* happen. If it does, it's the last thing you'll see */
        if (ei_status.dmaing) {
-               printk(KERN_EMERG "%s: DMAing conflict in %s."
+               dev_err(&ax->dev->dev, "%s: DMAing conflict in %s."
                        "[DMAstat:%d][irqlock:%d]\n",
                        dev->name, __FUNCTION__,
                       ei_status.dmaing, ei_status.irqlock);
@@ -281,7 +288,8 @@ static void ax_block_output(struct net_device *dev, int count,
 
        while ((ei_inb(nic_base + EN0_ISR) & ENISR_RDC) == 0) {
                if (jiffies - dma_start > 2*HZ/100) {           /* 20ms */
-                       printk(KERN_WARNING "%s: timeout waiting for Tx RDC.\n", dev->name);
+                       dev_warn(&ax->dev->dev,
+                                "%s: timeout waiting for Tx RDC.\n", dev->name);
                        ax_reset_8390(dev);
                        ax_NS8390_init(dev,1);
                        break;
@@ -424,10 +432,11 @@ static void
 ax_phy_write(struct net_device *dev, int phy_addr, int reg, int value)
 {
        struct ei_device *ei = (struct ei_device *) netdev_priv(dev);
+       struct ax_device  *ax = to_ax_dev(dev);
        unsigned long flags;
 
-       printk(KERN_DEBUG "%s: %p, %04x, %04x %04x\n",
-              __FUNCTION__, dev, phy_addr, reg, value);
+       dev_dbg(&ax->dev->dev, "%s: %p, %04x, %04x %04x\n",
+               __FUNCTION__, dev, phy_addr, reg, value);
 
        spin_lock_irqsave(&ei->page_lock, flags);
 
@@ -750,14 +759,11 @@ static int ax_init_dev(struct net_device *dev, int first_init)
        ax_NS8390_init(dev, 0);
 
        if (first_init) {
-               printk("AX88796: %dbit, irq %d, %lx, MAC: ",
-                      ei_status.word16 ? 16:8, dev->irq, dev->base_addr);
-
-               for (i = 0; i < ETHER_ADDR_LEN; i++)
-                       printk("%2.2x%c", dev->dev_addr[i],
-                              (i < (ETHER_ADDR_LEN-1) ? ':' : ' '));
+               DECLARE_MAC_BUF(mac);
 
-               printk("\n");
+               dev_info(&ax->dev->dev, "%dbit, irq %d, %lx, MAC: %s\n",
+                        ei_status.word16 ? 16:8, dev->irq, dev->base_addr,
+                        print_mac(mac, dev->dev_addr));
        }
 
        ret = register_netdev(dev);
index eb971755a3ff34c5b8f76d5b8b63bf5f3a83aad0..c993a32b3f50c1b0389a90ee193aa7bb24e94ba4 100644 (file)
@@ -1,34 +1,11 @@
 /*
- * File:       drivers/net/bfin_mac.c
- * Based on:
- * Maintainer:
- *             Bryan Wu <bryan.wu@analog.com>
+ * Blackfin On-Chip MAC Driver
  *
- * Original author:
- *             Luke Yang <luke.yang@analog.com>
+ * Copyright 2004-2007 Analog Devices Inc.
  *
- * Created:
- * Description:
+ * Enter bugs at http://blackfin.uclinux.org/
  *
- * Modified:
- *             Copyright 2004-2006 Analog Devices Inc.
- *
- * Bugs:       Enter bugs at http://blackfin.uclinux.org/
- *
- * This program is free software ;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation ;  either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY ;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program ;  see the file COPYING.
- * If not, write to the Free Software Foundation,
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Licensed under the GPL-2 or later.
  */
 
 #include <linux/init.h>
@@ -65,7 +42,7 @@
 #define DRV_NAME       "bfin_mac"
 #define DRV_VERSION    "1.1"
 #define DRV_AUTHOR     "Bryan Wu, Luke Yang"
-#define DRV_DESC       "Blackfin BF53[67] on-chip Ethernet MAC driver"
+#define DRV_DESC       "Blackfin BF53[67] BF527 on-chip Ethernet MAC driver"
 
 MODULE_AUTHOR(DRV_AUTHOR);
 MODULE_LICENSE("GPL");
@@ -296,7 +273,7 @@ static void mdio_poll(void)
 
        /* poll the STABUSY bit */
        while ((bfin_read_EMAC_STAADD()) & STABUSY) {
-               mdelay(10);
+               udelay(1);
                if (timeout_cnt-- < 0) {
                        printk(KERN_ERR DRV_NAME
                        ": wait MDC/MDIO transaction to complete timeout\n");
@@ -412,20 +389,26 @@ static void bf537_adjust_link(struct net_device *dev)
        spin_unlock_irqrestore(&lp->lock, flags);
 }
 
+/* MDC  = 2.5 MHz */
+#define MDC_CLK 2500000
+
 static int mii_probe(struct net_device *dev)
 {
        struct bf537mac_local *lp = netdev_priv(dev);
        struct phy_device *phydev = NULL;
        unsigned short sysctl;
        int i;
+       u32 sclk, mdc_div;
 
        /* Enable PHY output early */
        if (!(bfin_read_VR_CTL() & PHYCLKOE))
                bfin_write_VR_CTL(bfin_read_VR_CTL() | PHYCLKOE);
 
-       /* MDC  = 2.5 MHz */
+       sclk = get_sclk();
+       mdc_div = ((sclk / MDC_CLK) / 2) - 1;
+
        sysctl = bfin_read_EMAC_SYSCTL();
-       sysctl |= SET_MDCDIV(24);
+       sysctl = (sysctl & ~MDCDIV) | SET_MDCDIV(mdc_div);
        bfin_write_EMAC_SYSCTL(sysctl);
 
        /* search for connect PHY device */
@@ -477,8 +460,10 @@ static int mii_probe(struct net_device *dev)
        lp->phydev = phydev;
 
        printk(KERN_INFO "%s: attached PHY driver [%s] "
-              "(mii_bus:phy_addr=%s, irq=%d)\n",
-              DRV_NAME, phydev->drv->name, phydev->dev.bus_id, phydev->irq);
+              "(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)"
+              "@sclk=%dMHz)\n",
+              DRV_NAME, phydev->drv->name, phydev->dev.bus_id, phydev->irq,
+              MDC_CLK, mdc_div, sclk/1000000);
 
        return 0;
 }
@@ -551,7 +536,7 @@ static void adjust_tx_list(void)
         */
        if (current_tx_ptr->next->next == tx_list_head) {
                while (tx_list_head->status.status_word == 0) {
-                       mdelay(10);
+                       mdelay(1);
                        if (tx_list_head->status.status_word != 0
                            || !(bfin_read_DMA2_IRQ_STATUS() & 0x08)) {
                                goto adjust_head;
@@ -666,6 +651,12 @@ static void bf537mac_rx(struct net_device *dev)
        current_rx_ptr->skb = new_skb;
        current_rx_ptr->desc_a.start_addr = (unsigned long)new_skb->data - 2;
 
+       /* Invidate the data cache of skb->data range when it is write back
+        * cache. It will prevent overwritting the new data from DMA
+        */
+       blackfin_dcache_invalidate_range((unsigned long)new_skb->head,
+                                        (unsigned long)new_skb->end);
+
        len = (unsigned short)((current_rx_ptr->status.status_word) & RX_FRLEN);
        skb_put(skb, len);
        blackfin_dcache_invalidate_range((unsigned long)skb->head,
@@ -767,7 +758,7 @@ static void bf537mac_enable(void)
 
 #if defined(CONFIG_BFIN_MAC_RMII)
        opmode |= RMII; /* For Now only 100MBit are supported */
-#ifdef CONFIG_BF_REV_0_2
+#if (defined(CONFIG_BF537) || defined(CONFIG_BF536)) && CONFIG_BF_REV_0_2
        opmode |= TE;
 #endif
 #endif
@@ -792,6 +783,39 @@ static void bf537mac_timeout(struct net_device *dev)
        netif_wake_queue(dev);
 }
 
+static void bf537mac_multicast_hash(struct net_device *dev)
+{
+       u32 emac_hashhi, emac_hashlo;
+       struct dev_mc_list *dmi = dev->mc_list;
+       char *addrs;
+       int i;
+       u32 crc;
+
+       emac_hashhi = emac_hashlo = 0;
+
+       for (i = 0; i < dev->mc_count; i++) {
+               addrs = dmi->dmi_addr;
+               dmi = dmi->next;
+
+               /* skip non-multicast addresses */
+               if (!(*addrs & 1))
+                       continue;
+
+               crc = ether_crc(ETH_ALEN, addrs);
+               crc >>= 26;
+
+               if (crc & 0x20)
+                       emac_hashhi |= 1 << (crc & 0x1f);
+               else
+                       emac_hashlo |= 1 << (crc & 0x1f);
+       }
+
+       bfin_write_EMAC_HASHHI(emac_hashhi);
+       bfin_write_EMAC_HASHLO(emac_hashlo);
+
+       return;
+}
+
 /*
  * This routine will, depending on the values passed to it,
  * either make it accept multicast packets, go into
@@ -807,11 +831,17 @@ static void bf537mac_set_multicast_list(struct net_device *dev)
                sysctl = bfin_read_EMAC_OPMODE();
                sysctl |= RAF;
                bfin_write_EMAC_OPMODE(sysctl);
-       } else if (dev->flags & IFF_ALLMULTI || dev->mc_count) {
+       } else if (dev->flags & IFF_ALLMULTI) {
                /* accept all multicast */
                sysctl = bfin_read_EMAC_OPMODE();
                sysctl |= PAM;
                bfin_write_EMAC_OPMODE(sysctl);
+       } else if (dev->mc_count) {
+               /* set up multicast hash table */
+               sysctl = bfin_read_EMAC_OPMODE();
+               sysctl |= HM;
+               bfin_write_EMAC_OPMODE(sysctl);
+               bf537mac_multicast_hash(dev);
        } else {
                /* clear promisc or multicast mode */
                sysctl = bfin_read_EMAC_OPMODE();
@@ -860,10 +890,10 @@ static int bf537mac_open(struct net_device *dev)
                return retval;
 
        phy_start(lp->phydev);
+       phy_write(lp->phydev, MII_BMCR, BMCR_RESET);
        setup_system_regs(dev);
        bf537mac_disable();
        bf537mac_enable();
-
        pr_debug("hardware init finished\n");
        netif_start_queue(dev);
        netif_carrier_on(dev);
@@ -886,6 +916,7 @@ static int bf537mac_close(struct net_device *dev)
        netif_carrier_off(dev);
 
        phy_stop(lp->phydev);
+       phy_write(lp->phydev, MII_BMCR, BMCR_PDOWN);
 
        /* clear everything */
        bf537mac_shutdown(dev);
@@ -970,7 +1001,7 @@ static int __init bf537mac_probe(struct net_device *dev)
        /* register irq handler */
        if (request_irq
            (IRQ_MAC_RX, bf537mac_interrupt, IRQF_DISABLED | IRQF_SHARED,
-            "BFIN537_MAC_RX", dev)) {
+            "EMAC_RX", dev)) {
                printk(KERN_WARNING DRV_NAME
                       ": Unable to attach BlackFin MAC RX interrupt\n");
                return -EBUSY;
index 5970ea7142cd53c3e5f1d4234110a484f8af0191..f774d5a36942aa4dcaf6f1e6078b9aa84d521ebf 100644 (file)
@@ -1,34 +1,11 @@
 /*
- * File:       drivers/net/bfin_mac.c
- * Based on:
- * Maintainer:
- *             Bryan Wu <bryan.wu@analog.com>
+ * Blackfin On-Chip MAC Driver
  *
- * Original author:
- *             Luke Yang <luke.yang@analog.com>
+ * Copyright 2004-2007 Analog Devices Inc.
  *
- * Created:
- * Description:
+ * Enter bugs at http://blackfin.uclinux.org/
  *
- * Modified:
- *             Copyright 2004-2006 Analog Devices Inc.
- *
- * Bugs:       Enter bugs at http://blackfin.uclinux.org/
- *
- * This program is free software ;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation ;  either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY ;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program ;  see the file COPYING.
- * If not, write to the Free Software Foundation,
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Licensed under the GPL-2 or later.
  */
 
 #define BFIN_MAC_CSUM_OFFLOAD
index 2039f7838f2df713a0afe9a4bbe1aecc8955e617..0942d82f7cbf721f62c364941a13b31373668c5b 100644 (file)
@@ -1464,10 +1464,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
                        dev_set_allmulti(slave_dev, 1);
                }
 
+               netif_tx_lock_bh(bond_dev);
                /* upload master's mc_list to new slave */
                for (dmi = bond_dev->mc_list; dmi; dmi = dmi->next) {
                        dev_mc_add (slave_dev, dmi->dmi_addr, dmi->dmi_addrlen, 0);
                }
+               netif_tx_unlock_bh(bond_dev);
        }
 
        if (bond->params.mode == BOND_MODE_8023AD) {
@@ -1821,7 +1823,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
                }
 
                /* flush master's mc_list from slave */
+               netif_tx_lock_bh(bond_dev);
                bond_mc_list_flush(bond_dev, slave_dev);
+               netif_tx_unlock_bh(bond_dev);
        }
 
        netdev_set_master(slave_dev, NULL);
@@ -1942,7 +1946,9 @@ static int bond_release_all(struct net_device *bond_dev)
                        }
 
                        /* flush master's mc_list from slave */
+                       netif_tx_lock_bh(bond_dev);
                        bond_mc_list_flush(bond_dev, slave_dev);
+                       netif_tx_unlock_bh(bond_dev);
                }
 
                netdev_set_master(slave_dev, NULL);
@@ -2795,14 +2801,11 @@ void bond_loadbalance_arp_mon(struct work_struct *work)
        }
 
        if (do_failover) {
-               rtnl_lock();
                write_lock_bh(&bond->curr_slave_lock);
 
                bond_select_active_slave(bond);
 
                write_unlock_bh(&bond->curr_slave_lock);
-               rtnl_unlock();
-
        }
 
 re_arm:
@@ -2859,8 +2862,6 @@ void bond_activebackup_arp_mon(struct work_struct *work)
 
                                slave->link = BOND_LINK_UP;
 
-                               rtnl_lock();
-
                                write_lock_bh(&bond->curr_slave_lock);
 
                                if ((!bond->curr_active_slave) &&
@@ -2896,7 +2897,6 @@ void bond_activebackup_arp_mon(struct work_struct *work)
                                }
 
                                write_unlock_bh(&bond->curr_slave_lock);
-                               rtnl_unlock();
                        }
                } else {
                        read_lock(&bond->curr_slave_lock);
@@ -2966,7 +2966,6 @@ void bond_activebackup_arp_mon(struct work_struct *work)
                               bond->dev->name,
                               slave->dev->name);
 
-                       rtnl_lock();
                        write_lock_bh(&bond->curr_slave_lock);
 
                        bond_select_active_slave(bond);
@@ -2974,8 +2973,6 @@ void bond_activebackup_arp_mon(struct work_struct *work)
 
                        write_unlock_bh(&bond->curr_slave_lock);
 
-                       rtnl_unlock();
-
                        bond->current_arp_slave = slave;
 
                        if (slave) {
@@ -2993,13 +2990,10 @@ void bond_activebackup_arp_mon(struct work_struct *work)
                               bond->primary_slave->dev->name);
 
                        /* primary is up so switch to it */
-                       rtnl_lock();
                        write_lock_bh(&bond->curr_slave_lock);
                        bond_change_active_slave(bond, bond->primary_slave);
                        write_unlock_bh(&bond->curr_slave_lock);
 
-                       rtnl_unlock();
-
                        slave = bond->primary_slave;
                        slave->jiffies = jiffies;
                } else {
@@ -3769,42 +3763,45 @@ static struct net_device_stats *bond_get_stats(struct net_device *bond_dev)
 {
        struct bonding *bond = bond_dev->priv;
        struct net_device_stats *stats = &(bond->stats), *sstats;
+       struct net_device_stats local_stats;
        struct slave *slave;
        int i;
 
-       memset(stats, 0, sizeof(struct net_device_stats));
+       memset(&local_stats, 0, sizeof(struct net_device_stats));
 
        read_lock_bh(&bond->lock);
 
        bond_for_each_slave(bond, slave, i) {
                sstats = slave->dev->get_stats(slave->dev);
-               stats->rx_packets += sstats->rx_packets;
-               stats->rx_bytes += sstats->rx_bytes;
-               stats->rx_errors += sstats->rx_errors;
-               stats->rx_dropped += sstats->rx_dropped;
+               local_stats.rx_packets += sstats->rx_packets;
+               local_stats.rx_bytes += sstats->rx_bytes;
+               local_stats.rx_errors += sstats->rx_errors;
+               local_stats.rx_dropped += sstats->rx_dropped;
 
-               stats->tx_packets += sstats->tx_packets;
-               stats->tx_bytes += sstats->tx_bytes;
-               stats->tx_errors += sstats->tx_errors;
-               stats->tx_dropped += sstats->tx_dropped;
+               local_stats.tx_packets += sstats->tx_packets;
+               local_stats.tx_bytes += sstats->tx_bytes;
+               local_stats.tx_errors += sstats->tx_errors;
+               local_stats.tx_dropped += sstats->tx_dropped;
 
-               stats->multicast += sstats->multicast;
-               stats->collisions += sstats->collisions;
+               local_stats.multicast += sstats->multicast;
+               local_stats.collisions += sstats->collisions;
 
-               stats->rx_length_errors += sstats->rx_length_errors;
-               stats->rx_over_errors += sstats->rx_over_errors;
-               stats->rx_crc_errors += sstats->rx_crc_errors;
-               stats->rx_frame_errors += sstats->rx_frame_errors;
-               stats->rx_fifo_errors += sstats->rx_fifo_errors;
-               stats->rx_missed_errors += sstats->rx_missed_errors;
+               local_stats.rx_length_errors += sstats->rx_length_errors;
+               local_stats.rx_over_errors += sstats->rx_over_errors;
+               local_stats.rx_crc_errors += sstats->rx_crc_errors;
+               local_stats.rx_frame_errors += sstats->rx_frame_errors;
+               local_stats.rx_fifo_errors += sstats->rx_fifo_errors;
+               local_stats.rx_missed_errors += sstats->rx_missed_errors;
 
-               stats->tx_aborted_errors += sstats->tx_aborted_errors;
-               stats->tx_carrier_errors += sstats->tx_carrier_errors;
-               stats->tx_fifo_errors += sstats->tx_fifo_errors;
-               stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors;
-               stats->tx_window_errors += sstats->tx_window_errors;
+               local_stats.tx_aborted_errors += sstats->tx_aborted_errors;
+               local_stats.tx_carrier_errors += sstats->tx_carrier_errors;
+               local_stats.tx_fifo_errors += sstats->tx_fifo_errors;
+               local_stats.tx_heartbeat_errors += sstats->tx_heartbeat_errors;
+               local_stats.tx_window_errors += sstats->tx_window_errors;
        }
 
+       memcpy(stats, &local_stats, sizeof(struct net_device_stats));
+
        read_unlock_bh(&bond->lock);
 
        return stats;
@@ -3937,8 +3934,6 @@ static void bond_set_multicast_list(struct net_device *bond_dev)
        struct bonding *bond = bond_dev->priv;
        struct dev_mc_list *dmi;
 
-       write_lock_bh(&bond->lock);
-
        /*
         * Do promisc before checking multicast_mode
         */
@@ -3959,6 +3954,8 @@ static void bond_set_multicast_list(struct net_device *bond_dev)
                bond_set_allmulti(bond, -1);
        }
 
+       read_lock(&bond->lock);
+
        bond->flags = bond_dev->flags;
 
        /* looking for addresses to add to slaves' mc list */
@@ -3979,7 +3976,7 @@ static void bond_set_multicast_list(struct net_device *bond_dev)
        bond_mc_list_destroy(bond);
        bond_mc_list_copy(bond_dev->mc_list, bond, GFP_ATOMIC);
 
-       write_unlock_bh(&bond->lock);
+       read_unlock(&bond->lock);
 }
 
 /*
@@ -4526,7 +4523,9 @@ static void bond_free_all(void)
                struct net_device *bond_dev = bond->dev;
 
                bond_work_cancel_all(bond);
+               netif_tx_lock_bh(bond_dev);
                bond_mc_list_destroy(bond);
+               netif_tx_unlock_bh(bond_dev);
                /* Release the bonded slaves */
                bond_release_all(bond_dev);
                bond_deinit(bond_dev);
@@ -4549,14 +4548,19 @@ static void bond_free_all(void)
 int bond_parse_parm(const char *buf, struct bond_parm_tbl *tbl)
 {
        int mode = -1, i, rv;
-       char modestr[BOND_MAX_MODENAME_LEN + 1] = { 0, };
+       char *p, modestr[BOND_MAX_MODENAME_LEN + 1] = { 0, };
 
-       rv = sscanf(buf, "%d", &mode);
-       if (!rv) {
+       for (p = (char *)buf; *p; p++)
+               if (!(isdigit(*p) || isspace(*p)))
+                       break;
+
+       if (*p)
                rv = sscanf(buf, "%20s", modestr);
-               if (!rv)
-                       return -1;
-       }
+       else
+               rv = sscanf(buf, "%d", &mode);
+
+       if (!rv)
+               return -1;
 
        for (i = 0; tbl[i].modename; i++) {
                if (mode == tbl[i].mode)
@@ -4883,14 +4887,16 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
        down_write(&bonding_rwsem);
 
        /* Check to see if the bond already exists. */
-       list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
-               if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
-                       printk(KERN_ERR DRV_NAME
+       if (name) {
+               list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
+                       if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
+                               printk(KERN_ERR DRV_NAME
                               ": cannot add bond %s; it already exists\n",
-                              name);
-                       res = -EPERM;
-                       goto out_rtnl;
-               }
+                                      name);
+                               res = -EPERM;
+                               goto out_rtnl;
+                       }
+       }
 
        bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
                                ether_setup);
index 6d83be49899a496fe5125ad3e95d081634a7c269..67ccad69d445f097675c9c724b7a632bca10a4cd 100644 (file)
@@ -22,8 +22,8 @@
 #include "bond_3ad.h"
 #include "bond_alb.h"
 
-#define DRV_VERSION    "3.2.3"
-#define DRV_RELDATE    "December 6, 2007"
+#define DRV_VERSION    "3.2.4"
+#define DRV_RELDATE    "January 28, 2008"
 #define DRV_NAME       "bonding"
 #define DRV_DESCRIPTION        "Ethernet Channel Bonding Driver"
 
index 84c1ffa8e2d38561bf68f40b5d506782f2b9aea0..4c4d6e877ea698baf6ed92bbfc606f1b389dc476 100644 (file)
@@ -452,7 +452,7 @@ void t3_mc5_intr_handler(struct mc5 *mc5)
        t3_write_reg(adap, A_MC5_DB_INT_CAUSE, cause);
 }
 
-void __devinit t3_mc5_prep(struct adapter *adapter, struct mc5 *mc5, int mode)
+void t3_mc5_prep(struct adapter *adapter, struct mc5 *mc5, int mode)
 {
 #define K * 1024
 
index cb684d30831fcc228da571e80ec9b96b0ee47a8b..9ca8c66abd16193fddea7d0a5118ba2db2175505 100644 (file)
@@ -2836,7 +2836,7 @@ void t3_sge_init(struct adapter *adap, struct sge_params *p)
  *     defaults for the assorted SGE parameters, which admins can change until
  *     they are used to initialize the SGE.
  */
-void __devinit t3_sge_prep(struct adapter *adap, struct sge_params *p)
+void t3_sge_prep(struct adapter *adap, struct sge_params *p)
 {
        int i;
 
index 7469935877bd746370dc183ec7eaabbfc813b3da..a99496a431c423f260b41fc6ae06fa4cd3ae1dcf 100644 (file)
@@ -2675,7 +2675,7 @@ void t3_tp_set_max_rxsize(struct adapter *adap, unsigned int size)
                     V_PMMAXXFERLEN0(size) | V_PMMAXXFERLEN1(size));
 }
 
-static void __devinit init_mtus(unsigned short mtus[])
+static void init_mtus(unsigned short mtus[])
 {
        /*
         * See draft-mathis-plpmtud-00.txt for the values.  The min is 88 so
@@ -2703,7 +2703,7 @@ static void __devinit init_mtus(unsigned short mtus[])
 /*
  * Initial congestion control parameters.
  */
-static void __devinit init_cong_ctrl(unsigned short *a, unsigned short *b)
+static void init_cong_ctrl(unsigned short *a, unsigned short *b)
 {
        a[0] = a[1] = a[2] = a[3] = a[4] = a[5] = a[6] = a[7] = a[8] = 1;
        a[9] = 2;
@@ -3354,8 +3354,7 @@ out_err:
  *     Determines a card's PCI mode and associated parameters, such as speed
  *     and width.
  */
-static void __devinit get_pci_mode(struct adapter *adapter,
-                                  struct pci_params *p)
+static void get_pci_mode(struct adapter *adapter, struct pci_params *p)
 {
        static unsigned short speed_map[] = { 33, 66, 100, 133 };
        u32 pci_mode, pcie_cap;
@@ -3395,8 +3394,7 @@ static void __devinit get_pci_mode(struct adapter *adapter,
  *     capabilities and default speed/duplex/flow-control/autonegotiation
  *     settings.
  */
-static void __devinit init_link_config(struct link_config *lc,
-                                      unsigned int caps)
+static void init_link_config(struct link_config *lc, unsigned int caps)
 {
        lc->supported = caps;
        lc->requested_speed = lc->speed = SPEED_INVALID;
@@ -3419,7 +3417,7 @@ static void __devinit init_link_config(struct link_config *lc,
  *     Calculates the size of an MC7 memory in bytes from the value of its
  *     configuration register.
  */
-static unsigned int __devinit mc7_calc_size(u32 cfg)
+static unsigned int mc7_calc_size(u32 cfg)
 {
        unsigned int width = G_WIDTH(cfg);
        unsigned int banks = !!(cfg & F_BKS) + 1;
@@ -3430,8 +3428,8 @@ static unsigned int __devinit mc7_calc_size(u32 cfg)
        return MBs << 20;
 }
 
-static void __devinit mc7_prep(struct adapter *adapter, struct mc7 *mc7,
-                              unsigned int base_addr, const char *name)
+static void mc7_prep(struct adapter *adapter, struct mc7 *mc7,
+                    unsigned int base_addr, const char *name)
 {
        u32 cfg;
 
@@ -3517,7 +3515,7 @@ static int t3_reset_adapter(struct adapter *adapter)
        return 0;
 }
 
-static int __devinit init_parity(struct adapter *adap)
+static int init_parity(struct adapter *adap)
 {
                int i, err, addr;
 
@@ -3552,8 +3550,8 @@ static int __devinit init_parity(struct adapter *adap)
  * for some adapter tunables, take PHYs out of reset, and initialize the MDIO
  * interface.
  */
-int __devinit t3_prep_adapter(struct adapter *adapter,
-                             const struct adapter_info *ai, int reset)
+int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai,
+                   int reset)
 {
        int ret;
        unsigned int i, j = 0;
index 51cf577035bed0c466a45a4470102c3db56ef6db..36ba6dc96acc8494605c41315a8acecaa13f702f 100644 (file)
@@ -94,7 +94,7 @@
  *     enabled.  82557 pads with 7Eh, while the later controllers pad
  *     with 00h.
  *
- *     IV.  Recieve
+ *     IV.  Receive
  *
  *     The Receive Frame Area (RFA) comprises a ring of Receive Frame
  *     Descriptors (RFD) + data buffer, thus forming the simplified mode
  *     and Rx indication and re-allocation happen in the same context,
  *     therefore no locking is required.  A software-generated interrupt
  *     is generated from the watchdog to recover from a failed allocation
- *     senario where all Rx resources have been indicated and none re-
+ *     scenario where all Rx resources have been indicated and none re-
  *     placed.
  *
  *     V.   Miscellaneous
@@ -954,7 +954,7 @@ static void e100_get_defaults(struct nic *nic)
        /* Quadwords to DMA into FIFO before starting frame transmit */
        nic->tx_threshold = 0xE0;
 
-       /* no interrupt for every tx completion, delay = 256us if not 557*/
+       /* no interrupt for every tx completion, delay = 256us if not 557 */
        nic->tx_command = cpu_to_le16(cb_tx | cb_tx_sf |
                ((nic->mac >= mac_82558_D101_A4) ? cb_cid : cb_i));
 
@@ -1497,7 +1497,7 @@ static void e100_update_stats(struct nic *nic)
                &s->complete;
 
        /* Device's stats reporting may take several microseconds to
-        * complete, so where always waiting for results of the
+        * complete, so we're always waiting for results of the
         * previous command. */
 
        if(*complete == cpu_to_le32(cuc_dump_reset_complete)) {
@@ -1958,7 +1958,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
 
        if(restart_required) {
                // ack the rnr?
-               writeb(stat_ack_rnr, &nic->csr->scb.stat_ack);
+               iowrite8(stat_ack_rnr, &nic->csr->scb.stat_ack);
                e100_start_receiver(nic, nic->rx_to_clean);
                if(work_done)
                        (*work_done)++;
@@ -2774,7 +2774,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
                struct nic *nic = netdev_priv(netdev);
                unregister_netdev(netdev);
                e100_free(nic);
-               iounmap(nic->csr);
+               pci_iounmap(pdev, nic->csr);
                free_netdev(netdev);
                pci_release_regions(pdev);
                pci_disable_device(pdev);
@@ -2858,17 +2858,17 @@ static void e100_shutdown(struct pci_dev *pdev)
 /**
  * e100_io_error_detected - called when PCI error is detected.
  * @pdev: Pointer to PCI device
- * @state: The current pci conneection state
+ * @state: The current pci connection state
  */
 static pci_ers_result_t e100_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
 {
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct nic *nic = netdev_priv(netdev);
 
-       /* Similar to calling e100_down(), but avoids adpater I/O. */
+       /* Similar to calling e100_down(), but avoids adapter I/O. */
        netdev->stop(netdev);
 
-       /* Detach; put netif into state similar to hotplug unplug. */
+       /* Detach; put netif into state similar to hotplug unplug. */
        napi_enable(&nic->napi);
        netif_device_detach(netdev);
        pci_disable_device(pdev);
index 8c87940a9ce86341eacda17d1a3ad94106e32921..7c5b05a82f0e7c9a27b77a9f3d943fcf3baf2931 100644 (file)
@@ -853,7 +853,7 @@ e1000_reset(struct e1000_adapter *adapter)
 /**
  *  Dump the eeprom for users having checksum issues
  **/
-void e1000_dump_eeprom(struct e1000_adapter *adapter)
+static void e1000_dump_eeprom(struct e1000_adapter *adapter)
 {
        struct net_device *netdev = adapter->netdev;
        struct ethtool_eeprom eeprom;
index f2175ea46b830a438380a54d0571bb3c92683586..6232c3e96689668cb15748e88a82ddc856c1714f 100644 (file)
@@ -63,6 +63,7 @@
 #define E1000_WUFC_EX   0x00000004 /* Directed Exact Wakeup Enable */
 #define E1000_WUFC_MC   0x00000008 /* Directed Multicast Wakeup Enable */
 #define E1000_WUFC_BC   0x00000010 /* Broadcast Wakeup Enable */
+#define E1000_WUFC_ARP  0x00000020 /* ARP Request Packet Wakeup Enable */
 
 /* Extended Device Control */
 #define E1000_CTRL_EXT_SDP7_DATA 0x00000080 /* Value of SW Defineable Pin 7 */
index 6d9c27fd0b53b86953ecf3548d59c4825de1e626..f77a7427d3a079bf9ad714bf9cfc8f416851fb59 100644 (file)
@@ -690,8 +690,8 @@ err_setup:
        return err;
 }
 
-bool reg_pattern_test_array(struct e1000_adapter *adapter, u64 *data,
-                           int reg, int offset, u32 mask, u32 write)
+static bool reg_pattern_test_array(struct e1000_adapter *adapter, u64 *data,
+                                  int reg, int offset, u32 mask, u32 write)
 {
        int i;
        u32 read;
@@ -1632,7 +1632,8 @@ static void e1000_get_wol(struct net_device *netdev,
                return;
 
        wol->supported = WAKE_UCAST | WAKE_MCAST |
-                        WAKE_BCAST | WAKE_MAGIC;
+                        WAKE_BCAST | WAKE_MAGIC |
+                        WAKE_PHY | WAKE_ARP;
 
        /* apply any specific unsupported masks here */
        if (adapter->flags & FLAG_NO_WAKE_UCAST) {
@@ -1651,6 +1652,10 @@ static void e1000_get_wol(struct net_device *netdev,
                wol->wolopts |= WAKE_BCAST;
        if (adapter->wol & E1000_WUFC_MAG)
                wol->wolopts |= WAKE_MAGIC;
+       if (adapter->wol & E1000_WUFC_LNKC)
+               wol->wolopts |= WAKE_PHY;
+       if (adapter->wol & E1000_WUFC_ARP)
+               wol->wolopts |= WAKE_ARP;
 }
 
 static int e1000_set_wol(struct net_device *netdev,
@@ -1658,7 +1663,7 @@ static int e1000_set_wol(struct net_device *netdev,
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
 
-       if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
+       if (wol->wolopts & WAKE_MAGICSECURE)
                return -EOPNOTSUPP;
 
        if (!(adapter->flags & FLAG_HAS_WOL))
@@ -1675,6 +1680,10 @@ static int e1000_set_wol(struct net_device *netdev,
                adapter->wol |= E1000_WUFC_BC;
        if (wol->wolopts & WAKE_MAGIC)
                adapter->wol |= E1000_WUFC_MAG;
+       if (wol->wolopts & WAKE_PHY)
+               adapter->wol |= E1000_WUFC_LNKC;
+       if (wol->wolopts & WAKE_ARP)
+               adapter->wol |= E1000_WUFC_ARP;
 
        return 0;
 }
index 0a2cb7960c9e8d8dcb85063773a3d800068a9a9d..f58f017ee47ae837a45e3f0fcba3e2bafcf81d06 100644 (file)
@@ -945,11 +945,7 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
        int irq_flags = IRQF_SHARED;
        int err;
 
-       err = pci_enable_msi(adapter->pdev);
-       if (err) {
-               ndev_warn(netdev,
-                "Unable to allocate MSI interrupt Error: %d\n", err);
-       } else {
+       if (!pci_enable_msi(adapter->pdev)) {
                adapter->flags |= FLAG_MSI_ENABLED;
                handler = e1000_intr_msi;
                irq_flags = 0;
@@ -958,10 +954,12 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
        err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
                          netdev);
        if (err) {
+               ndev_err(netdev,
+                      "Unable to allocate %s interrupt (return: %d)\n",
+                       adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx",
+                       err);
                if (adapter->flags & FLAG_MSI_ENABLED)
                        pci_disable_msi(adapter->pdev);
-               ndev_err(netdev,
-                      "Unable to allocate interrupt Error: %d\n", err);
        }
 
        return err;
index d5459a8056b1a4f60f8207b1651385e5ff2856d1..2eb82aba4a8bc7c0a2ee5e26b959a1c33dbce4ba 100644 (file)
@@ -9,7 +9,7 @@
  * Many modifications, and currently maintained, by
  *  Philip Blundell <philb@gnu.org>
  * Added the Compaq LTE  Alan Cox <alan@redhat.com>
- * Added MCA support Adam Fritzler <mid@auk.cx>
+ * Added MCA support Adam Fritzler
  *
  * Note - this driver is experimental still - it has problems on faster
  * machines. Someone needs to sit down and go through it line by line with
index 5f82a4647eee4dcec3240be6ec51932926efae16..88fb53eba715368e9685ff5dbd6db275bc826626 100644 (file)
@@ -458,4 +458,7 @@ void ehea_set_ethtool_ops(struct net_device *netdev);
 int ehea_sense_port_attr(struct ehea_port *port);
 int ehea_set_portspeed(struct ehea_port *port, u32 port_speed);
 
+extern u64 ehea_driver_flags;
+extern struct work_struct ehea_rereg_mr_task;
+
 #endif /* __EHEA_H__ */
index 679f40ee957263af5ee375f5e76df76e42b45c52..d768852233663008eaf4cd5a9e324af68da3627b 100644 (file)
@@ -40,7 +40,7 @@ static int ehea_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
                return ret;
 
        if (netif_carrier_ok(dev)) {
-               switch(port->port_speed) {
+               switch (port->port_speed) {
                case EHEA_SPEED_10M: cmd->speed = SPEED_10; break;
                case EHEA_SPEED_100M: cmd->speed = SPEED_100; break;
                case EHEA_SPEED_1G: cmd->speed = SPEED_1000; break;
@@ -78,7 +78,7 @@ static int ehea_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
                goto doit;
        }
 
-       switch(cmd->speed) {
+       switch (cmd->speed) {
        case SPEED_10:
                if (cmd->duplex == DUPLEX_FULL)
                        sp = H_SPEED_10M_F;
index 1af7ca499ec517232e7c83dc845f2f336c07430c..567981b4b2cc351a01a54460ea512f970203ef8a 100644 (file)
 #ifndef __EHEA_HW_H__
 #define __EHEA_HW_H__
 
-#define QPX_SQA_VALUE   EHEA_BMASK_IBM(48,63)
-#define QPX_RQ1A_VALUE  EHEA_BMASK_IBM(48,63)
-#define QPX_RQ2A_VALUE  EHEA_BMASK_IBM(48,63)
-#define QPX_RQ3A_VALUE  EHEA_BMASK_IBM(48,63)
+#define QPX_SQA_VALUE   EHEA_BMASK_IBM(48, 63)
+#define QPX_RQ1A_VALUE  EHEA_BMASK_IBM(48, 63)
+#define QPX_RQ2A_VALUE  EHEA_BMASK_IBM(48, 63)
+#define QPX_RQ3A_VALUE  EHEA_BMASK_IBM(48, 63)
 
 #define QPTEMM_OFFSET(x) offsetof(struct ehea_qptemm, x)
 
index 869e1604b16ea0e4b5555acbe77dff969f42cb5b..c051c7e09b9a0b600f4202e5febba3b5ee0f7723 100644 (file)
@@ -6,9 +6,9 @@
  *  (C) Copyright IBM Corp. 2006
  *
  *  Authors:
- *       Christoph Raisch <raisch@de.ibm.com>
- *       Jan-Bernd Themann <themann@de.ibm.com>
- *       Thomas Klein <tklein@de.ibm.com>
+ *      Christoph Raisch <raisch@de.ibm.com>
+ *      Jan-Bernd Themann <themann@de.ibm.com>
+ *      Thomas Klein <tklein@de.ibm.com>
  *
  *
  * This program is free software; you can redistribute it and/or modify
@@ -54,11 +54,11 @@ static int rq1_entries = EHEA_DEF_ENTRIES_RQ1;
 static int rq2_entries = EHEA_DEF_ENTRIES_RQ2;
 static int rq3_entries = EHEA_DEF_ENTRIES_RQ3;
 static int sq_entries = EHEA_DEF_ENTRIES_SQ;
-static int use_mcs = 0;
-static int use_lro = 0;
+static int use_mcs;
+static int use_lro;
 static int lro_max_aggr = EHEA_LRO_MAX_AGGR;
 static int num_tx_qps = EHEA_NUM_TX_QP;
-static int prop_carrier_state = 0;
+static int prop_carrier_state;
 
 module_param(msg_level, int, 0);
 module_param(rq1_entries, int, 0);
@@ -94,9 +94,9 @@ MODULE_PARM_DESC(lro_max_aggr, " LRO: Max packets to be aggregated. Default = "
 MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, "
                 "Default = 0");
 
-static int port_name_cnt = 0;
+static int port_name_cnt;
 static LIST_HEAD(adapter_list);
-u64 ehea_driver_flags = 0;
+u64 ehea_driver_flags;
 struct work_struct ehea_rereg_mr_task;
 
 struct semaphore dlpar_mem_lock;
@@ -121,12 +121,13 @@ static struct of_platform_driver ehea_driver = {
        .remove = ehea_remove,
 };
 
-void ehea_dump(void *adr, int len, char *msg) {
+void ehea_dump(void *adr, int len, char *msg)
+{
        int x;
        unsigned char *deb = adr;
        for (x = 0; x < len; x += 16) {
                printk(DRV_NAME " %s adr=%p ofs=%04x %016lx %016lx\n", msg,
-                         deb, x, *((u64*)&deb[0]), *((u64*)&deb[8]));
+                         deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8]));
                deb += 16;
        }
 }
@@ -518,7 +519,8 @@ static int ehea_proc_rwqes(struct net_device *dev,
                last_wqe_index = wqe_index;
                rmb();
                if (!ehea_check_cqe(cqe, &rq)) {
-                       if (rq == 1) {  /* LL RQ1 */
+                       if (rq == 1) {
+                               /* LL RQ1 */
                                skb = get_skb_by_index_ll(skb_arr_rq1,
                                                          skb_arr_rq1_len,
                                                          wqe_index);
@@ -531,10 +533,11 @@ static int ehea_proc_rwqes(struct net_device *dev,
                                        if (!skb)
                                                break;
                                }
-                               skb_copy_to_linear_data(skb, ((char*)cqe) + 64,
+                               skb_copy_to_linear_data(skb, ((char *)cqe) + 64,
                                                 cqe->num_bytes_transfered - 4);
                                ehea_fill_skb(dev, skb, cqe);
-                       } else if (rq == 2) {  /* RQ2 */
+                       } else if (rq == 2) {
+                               /* RQ2 */
                                skb = get_skb_by_index(skb_arr_rq2,
                                                       skb_arr_rq2_len, cqe);
                                if (unlikely(!skb)) {
@@ -544,7 +547,8 @@ static int ehea_proc_rwqes(struct net_device *dev,
                                }
                                ehea_fill_skb(dev, skb, cqe);
                                processed_rq2++;
-                       } else {  /* RQ3 */
+                       } else {
+                               /* RQ3 */
                                skb = get_skb_by_index(skb_arr_rq3,
                                                       skb_arr_rq3_len, cqe);
                                if (unlikely(!skb)) {
@@ -592,7 +596,7 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
        unsigned long flags;
 
        cqe = ehea_poll_cq(send_cq);
-       while(cqe && (quota > 0)) {
+       while (cqe && (quota > 0)) {
                ehea_inc_cq(send_cq);
 
                cqe_counter++;
@@ -643,7 +647,8 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
 
 static int ehea_poll(struct napi_struct *napi, int budget)
 {
-       struct ehea_port_res *pr = container_of(napi, struct ehea_port_res, napi);
+       struct ehea_port_res *pr = container_of(napi, struct ehea_port_res,
+                                               napi);
        struct net_device *dev = pr->port->netdev;
        struct ehea_cqe *cqe;
        struct ehea_cqe *cqe_skb = NULL;
@@ -743,8 +748,9 @@ int ehea_sense_port_attr(struct ehea_port *port)
        u64 hret;
        struct hcp_ehea_port_cb0 *cb0;
 
-       cb0 = kzalloc(PAGE_SIZE, GFP_ATOMIC);   /* May be called via */
-       if (!cb0) {                             /* ehea_neq_tasklet() */
+       /* may be called via ehea_neq_tasklet() */
+       cb0 = kzalloc(PAGE_SIZE, GFP_ATOMIC);
+       if (!cb0) {
                ehea_error("no mem for cb0");
                ret = -ENOMEM;
                goto out;
@@ -762,7 +768,7 @@ int ehea_sense_port_attr(struct ehea_port *port)
        /* MAC address */
        port->mac_addr = cb0->port_mac_addr << 16;
 
-       if (!is_valid_ether_addr((u8*)&port->mac_addr)) {
+       if (!is_valid_ether_addr((u8 *)&port->mac_addr)) {
                ret = -EADDRNOTAVAIL;
                goto out_free;
        }
@@ -994,7 +1000,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe)
 
 static void ehea_neq_tasklet(unsigned long data)
 {
-       struct ehea_adapter *adapter = (struct ehea_adapter*)data;
+       struct ehea_adapter *adapter = (struct ehea_adapter *)data;
        struct ehea_eqe *eqe;
        u64 event_mask;
 
@@ -1204,7 +1210,7 @@ int ehea_rem_smrs(struct ehea_port_res *pr)
 
 static int ehea_init_q_skba(struct ehea_q_skb_arr *q_skba, int max_q_entries)
 {
-       int arr_size = sizeof(void*) * max_q_entries;
+       int arr_size = sizeof(void *) * max_q_entries;
 
        q_skba->arr = vmalloc(arr_size);
        if (!q_skba->arr)
@@ -1489,7 +1495,7 @@ static inline void write_swqe2_data(struct sk_buff *skb, struct net_device *dev,
 
        nfrags = skb_shinfo(skb)->nr_frags;
        sg1entry = &swqe->u.immdata_desc.sg_entry;
-       sg_list = (struct ehea_vsgentry*)&swqe->u.immdata_desc.sg_list;
+       sg_list = (struct ehea_vsgentry *)&swqe->u.immdata_desc.sg_list;
        swqe->descriptors = 0;
        sg1entry_contains_frag_data = 0;
 
@@ -1542,7 +1548,7 @@ static int ehea_broadcast_reg_helper(struct ehea_port *port, u32 hcallid)
                                     reg_type, port->mac_addr, 0, hcallid);
        if (hret != H_SUCCESS) {
                ehea_error("%sregistering bc address failed (tagged)",
-                           hcallid == H_REG_BCMC ? "" : "de");
+                          hcallid == H_REG_BCMC ? "" : "de");
                ret = -EIO;
                goto out_herr;
        }
@@ -1732,7 +1738,7 @@ static void ehea_allmulti(struct net_device *dev, int enable)
                }
 }
 
-static void ehea_add_multicast_entry(struct ehea_port* port, u8* mc_mac_addr)
+static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr)
 {
        struct ehea_mc_list *ehea_mcl_entry;
        u64 hret;
@@ -1791,11 +1797,10 @@ static void ehea_set_multicast_list(struct net_device *dev)
                        goto out;
                }
 
-               for (i = 0, k_mcl_entry = dev->mc_list;
-                    i < dev->mc_count;
-                    i++, k_mcl_entry = k_mcl_entry->next) {
+               for (i = 0, k_mcl_entry = dev->mc_list; i < dev->mc_count; i++,
+                            k_mcl_entry = k_mcl_entry->next)
                        ehea_add_multicast_entry(port, k_mcl_entry->dmi_addr);
-               }
+
        }
 out:
        return;
@@ -1925,12 +1930,12 @@ static inline int ehea_hash_skb(struct sk_buff *skb, int num_qps)
 
        if ((skb->protocol == htons(ETH_P_IP)) &&
            (ip_hdr(skb)->protocol == IPPROTO_TCP)) {
-               tcp = (struct tcphdr*)(skb_network_header(skb) + (ip_hdr(skb)->ihl * 4));
+               tcp = (struct tcphdr *)(skb_network_header(skb) +
+                                       (ip_hdr(skb)->ihl * 4));
                tmp = (tcp->source + (tcp->dest << 16)) % 31;
                tmp += ip_hdr(skb)->daddr % 31;
                return tmp % num_qps;
-       }
-       else
+       } else
                return 0;
 }
 
@@ -2122,7 +2127,7 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp)
        u64 hret;
        u16 dummy16 = 0;
        u64 dummy64 = 0;
-       struct hcp_modify_qp_cb0cb0;
+       struct hcp_modify_qp_cb0 *cb0;
 
        cb0 = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!cb0) {
@@ -2248,7 +2253,7 @@ static int ehea_clean_all_portres(struct ehea_port *port)
        int ret = 0;
        int i;
 
-       for(i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+       for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
                ret |= ehea_clean_portres(port, &port->port_res[i]);
 
        ret |= ehea_destroy_eq(port->qp_eq);
@@ -2300,7 +2305,7 @@ static int ehea_up(struct net_device *dev)
                goto out_clean_pr;
        }
 
-       for(i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
+       for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
                ret = ehea_activate_qp(port->adapter, port->port_res[i].qp);
                if (ret) {
                        ehea_error("activate_qp failed");
@@ -2308,7 +2313,7 @@ static int ehea_up(struct net_device *dev)
                }
        }
 
-       for(i = 0; i < port->num_def_qps; i++) {
+       for (i = 0; i < port->num_def_qps; i++) {
                ret = ehea_fill_port_res(&port->port_res[i]);
                if (ret) {
                        ehea_error("out_free_irqs");
@@ -2425,7 +2430,7 @@ int ehea_stop_qps(struct net_device *dev)
 {
        struct ehea_port *port = netdev_priv(dev);
        struct ehea_adapter *adapter = port->adapter;
-       struct hcp_modify_qp_cb0cb0;
+       struct hcp_modify_qp_cb0 *cb0;
        int ret = -EIO;
        int dret;
        int i;
@@ -2490,7 +2495,7 @@ out:
        return ret;
 }
 
-void ehea_update_rqs(struct ehea_qp *orig_qp, struct ehea_port_res * pr)
+void ehea_update_rqs(struct ehea_qp *orig_qp, struct ehea_port_res *pr)
 {
        struct ehea_qp qp = *orig_qp;
        struct ehea_qp_init_attr *init_attr = &qp.init_attr;
@@ -2530,7 +2535,7 @@ int ehea_restart_qps(struct net_device *dev)
        int ret = 0;
        int i;
 
-       struct hcp_modify_qp_cb0cb0;
+       struct hcp_modify_qp_cb0 *cb0;
        u64 hret;
        u64 dummy64 = 0;
        u16 dummy16 = 0;
@@ -2804,34 +2809,6 @@ static void __devinit logical_port_release(struct device *dev)
        of_node_put(port->ofdev.node);
 }
 
-static int ehea_driver_sysfs_add(struct device *dev,
-                                struct device_driver *driver)
-{
-       int ret;
-
-       ret = sysfs_create_link(&driver->kobj, &dev->kobj,
-                               kobject_name(&dev->kobj));
-       if (ret == 0) {
-               ret = sysfs_create_link(&dev->kobj, &driver->kobj,
-                                       "driver");
-               if (ret)
-                       sysfs_remove_link(&driver->kobj,
-                                         kobject_name(&dev->kobj));
-       }
-       return ret;
-}
-
-static void ehea_driver_sysfs_remove(struct device *dev,
-                                    struct device_driver *driver)
-{
-       struct device_driver *drv = driver;
-
-       if (drv) {
-               sysfs_remove_link(&drv->kobj, kobject_name(&dev->kobj));
-               sysfs_remove_link(&dev->kobj, "driver");
-       }
-}
-
 static struct device *ehea_register_port(struct ehea_port *port,
                                         struct device_node *dn)
 {
@@ -2856,16 +2833,8 @@ static struct device *ehea_register_port(struct ehea_port *port,
                goto out_unreg_of_dev;
        }
 
-       ret = ehea_driver_sysfs_add(&port->ofdev.dev, &ehea_driver.driver);
-       if (ret) {
-               ehea_error("failed to register sysfs driver link");
-               goto out_rem_dev_file;
-       }
-
        return &port->ofdev.dev;
 
-out_rem_dev_file:
-       device_remove_file(&port->ofdev.dev, &dev_attr_log_port_id);
 out_unreg_of_dev:
        of_device_unregister(&port->ofdev);
 out:
@@ -2874,7 +2843,6 @@ out:
 
 static void ehea_unregister_port(struct ehea_port *port)
 {
-       ehea_driver_sysfs_remove(&port->ofdev.dev, &ehea_driver.driver);
        device_remove_file(&port->ofdev.dev, &dev_attr_log_port_id);
        of_device_unregister(&port->ofdev);
 }
@@ -3109,7 +3077,7 @@ static ssize_t ehea_probe_port(struct device *dev,
        of_node_put(eth_dn);
 
        if (port) {
-               for (i=0; i < EHEA_MAX_PORTS; i++)
+               for (i = 0; i < EHEA_MAX_PORTS; i++)
                        if (!adapter->port[i]) {
                                adapter->port[i] = port;
                                break;
@@ -3144,7 +3112,7 @@ static ssize_t ehea_remove_port(struct device *dev,
 
                ehea_shutdown_single_port(port);
 
-               for (i=0; i < EHEA_MAX_PORTS; i++)
+               for (i = 0; i < EHEA_MAX_PORTS; i++)
                        if (adapter->port[i] == port) {
                                adapter->port[i] = NULL;
                                break;
@@ -3313,7 +3281,7 @@ static int ehea_reboot_notifier(struct notifier_block *nb,
 }
 
 static struct notifier_block ehea_reboot_nb = {
-        .notifier_call = ehea_reboot_notifier,
+       .notifier_call = ehea_reboot_notifier,
 };
 
 static int check_module_parm(void)
index 95c4a7f9cc88aacbaf64cbbbec35f089bcc2adbd..156eb6320b4ee209369a80f5ec83f4740b7c63bf 100644 (file)
@@ -6,9 +6,9 @@
  *  (C) Copyright IBM Corp. 2006
  *
  *  Authors:
- *       Christoph Raisch <raisch@de.ibm.com>
- *       Jan-Bernd Themann <themann@de.ibm.com>
- *       Thomas Klein <tklein@de.ibm.com>
+ *      Christoph Raisch <raisch@de.ibm.com>
+ *      Jan-Bernd Themann <themann@de.ibm.com>
+ *      Thomas Klein <tklein@de.ibm.com>
  *
  *
  * This program is free software; you can redistribute it and/or modify
@@ -38,11 +38,11 @@ static inline u16 get_order_of_qentries(u16 queue_entries)
 }
 
 /* Defines for H_CALL H_ALLOC_RESOURCE */
-#define H_ALL_RES_TYPE_QP        1
-#define H_ALL_RES_TYPE_CQ        2
-#define H_ALL_RES_TYPE_EQ        3
-#define H_ALL_RES_TYPE_MR        5
-#define H_ALL_RES_TYPE_MW        6
+#define H_ALL_RES_TYPE_QP       1
+#define H_ALL_RES_TYPE_CQ       2
+#define H_ALL_RES_TYPE_EQ       3
+#define H_ALL_RES_TYPE_MR       5
+#define H_ALL_RES_TYPE_MW       6
 
 static long ehea_plpar_hcall_norets(unsigned long opcode,
                                    unsigned long arg1,
@@ -137,77 +137,77 @@ u64 ehea_h_query_ehea_qp(const u64 adapter_handle, const u8 qp_category,
                         const u64 qp_handle, const u64 sel_mask, void *cb_addr)
 {
        return ehea_plpar_hcall_norets(H_QUERY_HEA_QP,
-                                      adapter_handle,          /* R4 */
-                                      qp_category,             /* R5 */
-                                      qp_handle,               /* R6 */
-                                      sel_mask,                /* R7 */
+                                      adapter_handle,          /* R4 */
+                                      qp_category,             /* R5 */
+                                      qp_handle,               /* R6 */
+                                      sel_mask,                /* R7 */
                                       virt_to_abs(cb_addr),    /* R8 */
                                       0, 0);
 }
 
 /* input param R5 */
-#define H_ALL_RES_QP_EQPO         EHEA_BMASK_IBM(9, 11)
-#define H_ALL_RES_QP_QPP          EHEA_BMASK_IBM(12, 12)
-#define H_ALL_RES_QP_RQR          EHEA_BMASK_IBM(13, 15)
-#define H_ALL_RES_QP_EQEG         EHEA_BMASK_IBM(16, 16)
-#define H_ALL_RES_QP_LL_QP        EHEA_BMASK_IBM(17, 17)
-#define H_ALL_RES_QP_DMA128       EHEA_BMASK_IBM(19, 19)
-#define H_ALL_RES_QP_HSM          EHEA_BMASK_IBM(20, 21)
-#define H_ALL_RES_QP_SIGT         EHEA_BMASK_IBM(22, 23)
-#define H_ALL_RES_QP_TENURE       EHEA_BMASK_IBM(48, 55)
-#define H_ALL_RES_QP_RES_TYP      EHEA_BMASK_IBM(56, 63)
+#define H_ALL_RES_QP_EQPO        EHEA_BMASK_IBM(9, 11)
+#define H_ALL_RES_QP_QPP         EHEA_BMASK_IBM(12, 12)
+#define H_ALL_RES_QP_RQR         EHEA_BMASK_IBM(13, 15)
+#define H_ALL_RES_QP_EQEG        EHEA_BMASK_IBM(16, 16)
+#define H_ALL_RES_QP_LL_QP       EHEA_BMASK_IBM(17, 17)
+#define H_ALL_RES_QP_DMA128      EHEA_BMASK_IBM(19, 19)
+#define H_ALL_RES_QP_HSM         EHEA_BMASK_IBM(20, 21)
+#define H_ALL_RES_QP_SIGT        EHEA_BMASK_IBM(22, 23)
+#define H_ALL_RES_QP_TENURE      EHEA_BMASK_IBM(48, 55)
+#define H_ALL_RES_QP_RES_TYP     EHEA_BMASK_IBM(56, 63)
 
 /* input param R9  */
-#define H_ALL_RES_QP_TOKEN        EHEA_BMASK_IBM(0, 31)
-#define H_ALL_RES_QP_PD           EHEA_BMASK_IBM(32,63)
+#define H_ALL_RES_QP_TOKEN       EHEA_BMASK_IBM(0, 31)
+#define H_ALL_RES_QP_PD                  EHEA_BMASK_IBM(32, 63)
 
 /* input param R10 */
-#define H_ALL_RES_QP_MAX_SWQE     EHEA_BMASK_IBM(4, 7)
-#define H_ALL_RES_QP_MAX_R1WQE    EHEA_BMASK_IBM(12, 15)
-#define H_ALL_RES_QP_MAX_R2WQE    EHEA_BMASK_IBM(20, 23)
-#define H_ALL_RES_QP_MAX_R3WQE    EHEA_BMASK_IBM(28, 31)
+#define H_ALL_RES_QP_MAX_SWQE    EHEA_BMASK_IBM(4, 7)
+#define H_ALL_RES_QP_MAX_R1WQE   EHEA_BMASK_IBM(12, 15)
+#define H_ALL_RES_QP_MAX_R2WQE   EHEA_BMASK_IBM(20, 23)
+#define H_ALL_RES_QP_MAX_R3WQE   EHEA_BMASK_IBM(28, 31)
 /* Max Send Scatter Gather Elements */
-#define H_ALL_RES_QP_MAX_SSGE     EHEA_BMASK_IBM(37, 39)
-#define H_ALL_RES_QP_MAX_R1SGE    EHEA_BMASK_IBM(45, 47)
+#define H_ALL_RES_QP_MAX_SSGE    EHEA_BMASK_IBM(37, 39)
+#define H_ALL_RES_QP_MAX_R1SGE   EHEA_BMASK_IBM(45, 47)
 /* Max Receive SG Elements RQ1 */
-#define H_ALL_RES_QP_MAX_R2SGE    EHEA_BMASK_IBM(53, 55)
-#define H_ALL_RES_QP_MAX_R3SGE    EHEA_BMASK_IBM(61, 63)
+#define H_ALL_RES_QP_MAX_R2SGE   EHEA_BMASK_IBM(53, 55)
+#define H_ALL_RES_QP_MAX_R3SGE   EHEA_BMASK_IBM(61, 63)
 
 /* input param R11 */
-#define H_ALL_RES_QP_SWQE_IDL     EHEA_BMASK_IBM(0, 7)
+#define H_ALL_RES_QP_SWQE_IDL    EHEA_BMASK_IBM(0, 7)
 /* max swqe immediate data length */
-#define H_ALL_RES_QP_PORT_NUM     EHEA_BMASK_IBM(48, 63)
+#define H_ALL_RES_QP_PORT_NUM    EHEA_BMASK_IBM(48, 63)
 
 /* input param R12 */
-#define H_ALL_RES_QP_TH_RQ2       EHEA_BMASK_IBM(0, 15)
+#define H_ALL_RES_QP_TH_RQ2      EHEA_BMASK_IBM(0, 15)
 /* Threshold RQ2 */
-#define H_ALL_RES_QP_TH_RQ3       EHEA_BMASK_IBM(16, 31)
+#define H_ALL_RES_QP_TH_RQ3      EHEA_BMASK_IBM(16, 31)
 /* Threshold RQ3 */
 
 /* output param R6 */
-#define H_ALL_RES_QP_ACT_SWQE     EHEA_BMASK_IBM(0, 15)
-#define H_ALL_RES_QP_ACT_R1WQE    EHEA_BMASK_IBM(16, 31)
-#define H_ALL_RES_QP_ACT_R2WQE    EHEA_BMASK_IBM(32, 47)
-#define H_ALL_RES_QP_ACT_R3WQE    EHEA_BMASK_IBM(48, 63)
+#define H_ALL_RES_QP_ACT_SWQE    EHEA_BMASK_IBM(0, 15)
+#define H_ALL_RES_QP_ACT_R1WQE   EHEA_BMASK_IBM(16, 31)
+#define H_ALL_RES_QP_ACT_R2WQE   EHEA_BMASK_IBM(32, 47)
+#define H_ALL_RES_QP_ACT_R3WQE   EHEA_BMASK_IBM(48, 63)
 
 /* output param, R7 */
-#define H_ALL_RES_QP_ACT_SSGE     EHEA_BMASK_IBM(0, 7)
-#define H_ALL_RES_QP_ACT_R1SGE    EHEA_BMASK_IBM(8, 15)
-#define H_ALL_RES_QP_ACT_R2SGE    EHEA_BMASK_IBM(16, 23)
-#define H_ALL_RES_QP_ACT_R3SGE    EHEA_BMASK_IBM(24, 31)
+#define H_ALL_RES_QP_ACT_SSGE    EHEA_BMASK_IBM(0, 7)
+#define H_ALL_RES_QP_ACT_R1SGE   EHEA_BMASK_IBM(8, 15)
+#define H_ALL_RES_QP_ACT_R2SGE   EHEA_BMASK_IBM(16, 23)
+#define H_ALL_RES_QP_ACT_R3SGE   EHEA_BMASK_IBM(24, 31)
 #define H_ALL_RES_QP_ACT_SWQE_IDL EHEA_BMASK_IBM(32, 39)
 
 /* output param R8,R9 */
-#define H_ALL_RES_QP_SIZE_SQ      EHEA_BMASK_IBM(0, 31)
-#define H_ALL_RES_QP_SIZE_RQ1     EHEA_BMASK_IBM(32, 63)
-#define H_ALL_RES_QP_SIZE_RQ2     EHEA_BMASK_IBM(0, 31)
-#define H_ALL_RES_QP_SIZE_RQ3     EHEA_BMASK_IBM(32, 63)
+#define H_ALL_RES_QP_SIZE_SQ     EHEA_BMASK_IBM(0, 31)
+#define H_ALL_RES_QP_SIZE_RQ1    EHEA_BMASK_IBM(32, 63)
+#define H_ALL_RES_QP_SIZE_RQ2    EHEA_BMASK_IBM(0, 31)
+#define H_ALL_RES_QP_SIZE_RQ3    EHEA_BMASK_IBM(32, 63)
 
 /* output param R11,R12 */
-#define H_ALL_RES_QP_LIOBN_SQ     EHEA_BMASK_IBM(0, 31)
-#define H_ALL_RES_QP_LIOBN_RQ1    EHEA_BMASK_IBM(32, 63)
-#define H_ALL_RES_QP_LIOBN_RQ2    EHEA_BMASK_IBM(0, 31)
-#define H_ALL_RES_QP_LIOBN_RQ3    EHEA_BMASK_IBM(32, 63)
+#define H_ALL_RES_QP_LIOBN_SQ    EHEA_BMASK_IBM(0, 31)
+#define H_ALL_RES_QP_LIOBN_RQ1   EHEA_BMASK_IBM(32, 63)
+#define H_ALL_RES_QP_LIOBN_RQ2   EHEA_BMASK_IBM(0, 31)
+#define H_ALL_RES_QP_LIOBN_RQ3   EHEA_BMASK_IBM(32, 63)
 
 u64 ehea_h_alloc_resource_qp(const u64 adapter_handle,
                             struct ehea_qp_init_attr *init_attr, const u32 pd,
@@ -334,28 +334,28 @@ u64 ehea_h_alloc_resource_cq(const u64 adapter_handle,
 }
 
 /* Defines for H_CALL H_ALLOC_RESOURCE */
-#define H_ALL_RES_TYPE_QP        1
-#define H_ALL_RES_TYPE_CQ        2
-#define H_ALL_RES_TYPE_EQ        3
-#define H_ALL_RES_TYPE_MR        5
-#define H_ALL_RES_TYPE_MW        6
+#define H_ALL_RES_TYPE_QP       1
+#define H_ALL_RES_TYPE_CQ       2
+#define H_ALL_RES_TYPE_EQ       3
+#define H_ALL_RES_TYPE_MR       5
+#define H_ALL_RES_TYPE_MW       6
 
 /*  input param R5 */
-#define H_ALL_RES_EQ_NEQ             EHEA_BMASK_IBM(0, 0)
+#define H_ALL_RES_EQ_NEQ            EHEA_BMASK_IBM(0, 0)
 #define H_ALL_RES_EQ_NON_NEQ_ISN     EHEA_BMASK_IBM(6, 7)
 #define H_ALL_RES_EQ_INH_EQE_GEN     EHEA_BMASK_IBM(16, 16)
-#define H_ALL_RES_EQ_RES_TYPE        EHEA_BMASK_IBM(56, 63)
+#define H_ALL_RES_EQ_RES_TYPE       EHEA_BMASK_IBM(56, 63)
 /*  input param R6 */
-#define H_ALL_RES_EQ_MAX_EQE         EHEA_BMASK_IBM(32, 63)
+#define H_ALL_RES_EQ_MAX_EQE        EHEA_BMASK_IBM(32, 63)
 
 /*  output param R6 */
-#define H_ALL_RES_EQ_LIOBN           EHEA_BMASK_IBM(32, 63)
+#define H_ALL_RES_EQ_LIOBN          EHEA_BMASK_IBM(32, 63)
 
 /*  output param R7 */
-#define H_ALL_RES_EQ_ACT_EQE         EHEA_BMASK_IBM(32, 63)
+#define H_ALL_RES_EQ_ACT_EQE        EHEA_BMASK_IBM(32, 63)
 
 /*  output param R8 */
-#define H_ALL_RES_EQ_ACT_PS          EHEA_BMASK_IBM(32, 63)
+#define H_ALL_RES_EQ_ACT_PS         EHEA_BMASK_IBM(32, 63)
 
 /*  output param R9 */
 #define H_ALL_RES_EQ_ACT_EQ_IST_C    EHEA_BMASK_IBM(30, 31)
@@ -453,12 +453,12 @@ u64 ehea_h_register_smr(const u64 adapter_handle, const u64 orig_mr_handle,
 
        hret = ehea_plpar_hcall9(H_REGISTER_SMR,
                                 outs,
-                                adapter_handle       ,          /* R4 */
-                                orig_mr_handle,                 /* R5 */
-                                vaddr_in,                       /* R6 */
-                                (((u64)access_ctrl) << 32ULL),  /* R7 */
-                                pd,                             /* R8 */
-                                0, 0, 0, 0);                    /* R9-R12 */
+                                adapter_handle       ,          /* R4 */
+                                orig_mr_handle,                 /* R5 */
+                                vaddr_in,                       /* R6 */
+                                (((u64)access_ctrl) << 32ULL),  /* R7 */
+                                pd,                             /* R8 */
+                                0, 0, 0, 0);                    /* R9-R12 */
 
        mr->handle = outs[0];
        mr->lkey = (u32)outs[2];
@@ -471,11 +471,11 @@ u64 ehea_h_disable_and_get_hea(const u64 adapter_handle, const u64 qp_handle)
        u64 outs[PLPAR_HCALL9_BUFSIZE];
 
        return ehea_plpar_hcall9(H_DISABLE_AND_GET_HEA,
-                                        outs,
+                                outs,
                                 adapter_handle,                /* R4 */
                                 H_DISABLE_GET_EHEA_WQE_P,      /* R5 */
                                 qp_handle,                     /* R6 */
-                                0, 0, 0, 0, 0, 0);             /* R7-R12 */
+                                0, 0, 0, 0, 0, 0);             /* R7-R12 */
 }
 
 u64 ehea_h_free_resource(const u64 adapter_handle, const u64 res_handle,
@@ -483,9 +483,9 @@ u64 ehea_h_free_resource(const u64 adapter_handle, const u64 res_handle,
 {
        return ehea_plpar_hcall_norets(H_FREE_RESOURCE,
                                       adapter_handle,     /* R4 */
-                                      res_handle,         /* R5 */
+                                      res_handle,         /* R5 */
                                       force_bit,
-                                      0, 0, 0, 0);        /* R7-R10 */
+                                      0, 0, 0, 0);        /* R7-R10 */
 }
 
 u64 ehea_h_alloc_resource_mr(const u64 adapter_handle, const u64 vaddr,
@@ -493,13 +493,13 @@ u64 ehea_h_alloc_resource_mr(const u64 adapter_handle, const u64 vaddr,
                             const u32 pd, u64 *mr_handle, u32 *lkey)
 {
        u64 hret;
-       u64 outs[PLPAR_HCALL9_BUFSIZE];
+       u64 outs[PLPAR_HCALL9_BUFSIZE];
 
        hret = ehea_plpar_hcall9(H_ALLOC_HEA_RESOURCE,
                                 outs,
                                 adapter_handle,                   /* R4 */
                                 5,                                /* R5 */
-                                vaddr,                            /* R6 */
+                                vaddr,                            /* R6 */
                                 length,                           /* R7 */
                                 (((u64) access_ctrl) << 32ULL),   /* R8 */
                                 pd,                               /* R9 */
@@ -619,8 +619,8 @@ u64 ehea_h_error_data(const u64 adapter_handle, const u64 ressource_handle,
                      void *rblock)
 {
        return ehea_plpar_hcall_norets(H_ERROR_DATA,
-                                      adapter_handle,          /* R4 */
-                                      ressource_handle,        /* R5 */
-                                      virt_to_abs(rblock),     /* R6 */
-                                      0, 0, 0, 0);             /* R7-R12 */
+                                      adapter_handle,          /* R4 */
+                                      ressource_handle,        /* R5 */
+                                      virt_to_abs(rblock),     /* R6 */
+                                      0, 0, 0, 0);             /* R7-R12 */
 }
index faa191d23b8614f095bb0a39bc93673304cb330d..f3628c803567674c4b5650a9d71389b5aea0290e 100644 (file)
@@ -93,7 +93,7 @@ static inline void hcp_epas_ctor(struct h_epas *epas, u64 paddr_kernel,
 static inline void hcp_epas_dtor(struct h_epas *epas)
 {
        if (epas->kernel.addr)
-               iounmap((void __iomem*)((u64)epas->kernel.addr & PAGE_MASK));
+               iounmap((void __iomem *)((u64)epas->kernel.addr & PAGE_MASK));
 
        epas->user.addr = 0;
        epas->kernel.addr = 0;
@@ -388,23 +388,23 @@ u64 ehea_h_modify_ehea_qp(const u64 adapter_handle,
                          const u64 qp_handle,
                          const u64 sel_mask,
                          void *cb_addr,
-                         u64 * inv_attr_id,
-                         u64 * proc_mask, u16 * out_swr, u16 * out_rwr);
+                         u64 *inv_attr_id,
+                         u64 *proc_mask, u16 *out_swr, u16 *out_rwr);
 
 u64 ehea_h_alloc_resource_eq(const u64 adapter_handle,
-                            struct ehea_eq_attr *eq_attr, u64 * eq_handle);
+                            struct ehea_eq_attr *eq_attr, u64 *eq_handle);
 
 u64 ehea_h_alloc_resource_cq(const u64 adapter_handle,
                             struct ehea_cq_attr *cq_attr,
-                            u64 * cq_handle, struct h_epas *epas);
+                            u64 *cq_handle, struct h_epas *epas);
 
 u64 ehea_h_alloc_resource_qp(const u64 adapter_handle,
                             struct ehea_qp_init_attr *init_attr,
                             const u32 pd,
-                            u64 * qp_handle, struct h_epas *h_epas);
+                            u64 *qp_handle, struct h_epas *h_epas);
 
-#define H_REG_RPAGE_PAGE_SIZE          EHEA_BMASK_IBM(48,55)
-#define H_REG_RPAGE_QT                 EHEA_BMASK_IBM(62,63)
+#define H_REG_RPAGE_PAGE_SIZE          EHEA_BMASK_IBM(48, 55)
+#define H_REG_RPAGE_QT                 EHEA_BMASK_IBM(62, 63)
 
 u64 ehea_h_register_rpage(const u64 adapter_handle,
                          const u8 pagesize,
@@ -426,7 +426,7 @@ u64 ehea_h_free_resource(const u64 adapter_handle, const u64 res_handle,
 
 u64 ehea_h_alloc_resource_mr(const u64 adapter_handle, const u64 vaddr,
                             const u64 length, const u32 access_ctrl,
-                            const u32 pd, u64 * mr_handle, u32 * lkey);
+                            const u32 pd, u64 *mr_handle, u32 *lkey);
 
 u64 ehea_h_register_rpage_mr(const u64 adapter_handle, const u64 mr_handle,
                             const u8 pagesize, const u8 queue_type,
@@ -439,8 +439,8 @@ u64 ehea_h_register_smr(const u64 adapter_handle, const u64 orig_mr_handle,
 u64 ehea_h_query_ehea(const u64 adapter_handle, void *cb_addr);
 
 /* output param R5 */
-#define H_MEHEAPORT_CAT                EHEA_BMASK_IBM(40,47)
-#define H_MEHEAPORT_PN         EHEA_BMASK_IBM(48,63)
+#define H_MEHEAPORT_CAT                EHEA_BMASK_IBM(40, 47)
+#define H_MEHEAPORT_PN         EHEA_BMASK_IBM(48, 63)
 
 u64 ehea_h_query_ehea_port(const u64 adapter_handle, const u16 port_num,
                           const u8 cb_cat, const u64 select_mask,
index 83b76432b41a8cc6c299ad3530b4e4bd98b5ac2a..d522e905f460585364a659d8f8cfb2c11d818d14 100644 (file)
@@ -33,8 +33,6 @@
 
 
 struct ehea_busmap ehea_bmap = { 0, 0, NULL };
-extern u64 ehea_driver_flags;
-extern struct work_struct ehea_rereg_mr_task;
 
 
 static void *hw_qpageit_get_inc(struct hw_queue *queue)
@@ -65,7 +63,7 @@ static int hw_queue_ctor(struct hw_queue *queue, const u32 nr_of_pages,
        }
 
        queue->queue_length = nr_of_pages * pagesize;
-       queue->queue_pages = kmalloc(nr_of_pages * sizeof(void*), GFP_KERNEL);
+       queue->queue_pages = kmalloc(nr_of_pages * sizeof(void *), GFP_KERNEL);
        if (!queue->queue_pages) {
                ehea_error("no mem for queue_pages");
                return -ENOMEM;
@@ -78,11 +76,11 @@ static int hw_queue_ctor(struct hw_queue *queue, const u32 nr_of_pages,
         */
        i = 0;
        while (i < nr_of_pages) {
-               u8 *kpage = (u8*)get_zeroed_page(GFP_KERNEL);
+               u8 *kpage = (u8 *)get_zeroed_page(GFP_KERNEL);
                if (!kpage)
                        goto out_nomem;
                for (k = 0; k < pages_per_kpage && i < nr_of_pages; k++) {
-                       (queue->queue_pages)[i] = (struct ehea_page*)kpage;
+                       (queue->queue_pages)[i] = (struct ehea_page *)kpage;
                        kpage += pagesize;
                        i++;
                }
@@ -235,8 +233,8 @@ int ehea_destroy_cq(struct ehea_cq *cq)
                return 0;
 
        hcp_epas_dtor(&cq->epas);
-
-       if ((hret = ehea_destroy_cq_res(cq, NORMAL_FREE)) == H_R_STATE) {
+       hret = ehea_destroy_cq_res(cq, NORMAL_FREE);
+       if (hret == H_R_STATE) {
                ehea_error_data(cq->adapter, cq->fw_handle);
                hret = ehea_destroy_cq_res(cq, FORCE_FREE);
        }
@@ -301,13 +299,13 @@ struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter,
                if (i == (eq->attr.nr_pages - 1)) {
                        /* last page */
                        vpage = hw_qpageit_get_inc(&eq->hw_queue);
-                       if ((hret != H_SUCCESS) || (vpage)) {
+                       if ((hret != H_SUCCESS) || (vpage))
                                goto out_kill_hwq;
-                       }
+
                } else {
-                       if ((hret != H_PAGE_REGISTERED) || (!vpage)) {
+                       if ((hret != H_PAGE_REGISTERED) || (!vpage))
                                goto out_kill_hwq;
-                       }
+
                }
        }
 
@@ -331,7 +329,7 @@ struct ehea_eqe *ehea_poll_eq(struct ehea_eq *eq)
        unsigned long flags;
 
        spin_lock_irqsave(&eq->spinlock, flags);
-       eqe = (struct ehea_eqe*)hw_eqit_eq_get_inc_valid(&eq->hw_queue);
+       eqe = (struct ehea_eqe *)hw_eqit_eq_get_inc_valid(&eq->hw_queue);
        spin_unlock_irqrestore(&eq->spinlock, flags);
 
        return eqe;
@@ -364,7 +362,8 @@ int ehea_destroy_eq(struct ehea_eq *eq)
 
        hcp_epas_dtor(&eq->epas);
 
-       if ((hret = ehea_destroy_eq_res(eq, NORMAL_FREE)) == H_R_STATE) {
+       hret = ehea_destroy_eq_res(eq, NORMAL_FREE);
+       if (hret == H_R_STATE) {
                ehea_error_data(eq->adapter, eq->fw_handle);
                hret = ehea_destroy_eq_res(eq, FORCE_FREE);
        }
@@ -546,7 +545,8 @@ int ehea_destroy_qp(struct ehea_qp *qp)
 
        hcp_epas_dtor(&qp->epas);
 
-       if ((hret = ehea_destroy_qp_res(qp, NORMAL_FREE)) == H_R_STATE) {
+       hret = ehea_destroy_qp_res(qp, NORMAL_FREE);
+       if (hret == H_R_STATE) {
                ehea_error_data(qp->adapter, qp->fw_handle);
                hret = ehea_destroy_qp_res(qp, FORCE_FREE);
        }
@@ -559,7 +559,7 @@ int ehea_destroy_qp(struct ehea_qp *qp)
        return 0;
 }
 
-int ehea_create_busmap( void )
+int ehea_create_busmap(void)
 {
        u64 vaddr = EHEA_BUSMAP_START;
        unsigned long high_section_index = 0;
@@ -595,7 +595,7 @@ int ehea_create_busmap( void )
        return 0;
 }
 
-void ehea_destroy_busmap( void )
+void ehea_destroy_busmap(void)
 {
        vfree(ehea_bmap.vaddr);
 }
index bc62d389c166578fe179567968009bc8b6752b60..0bb6f92fa2f8ed7743c07dd883d67bfcb7e74b6e 100644 (file)
@@ -41,8 +41,8 @@
 #define EHEA_SECTSIZE          (1UL << 24)
 #define EHEA_PAGES_PER_SECTION (EHEA_SECTSIZE >> EHEA_PAGESHIFT)
 
-#if (1UL << SECTION_SIZE_BITS) < EHEA_SECTSIZE
-#error eHEA module can't work if kernel sectionsize < ehea sectionsize
+#if ((1UL << SECTION_SIZE_BITS) < EHEA_SECTSIZE)
+#error eHEA module cannot work if kernel sectionsize < ehea sectionsize
 #endif
 
 /* Some abbreviations used here:
@@ -188,8 +188,8 @@ struct ehea_eqe {
        u64 entry;
 };
 
-#define ERROR_DATA_LENGTH  EHEA_BMASK_IBM(52,63)
-#define ERROR_DATA_TYPE    EHEA_BMASK_IBM(0,7)
+#define ERROR_DATA_LENGTH  EHEA_BMASK_IBM(52, 63)
+#define ERROR_DATA_TYPE    EHEA_BMASK_IBM(0, 7)
 
 static inline void *hw_qeit_calc(struct hw_queue *queue, u64 q_offset)
 {
@@ -279,7 +279,7 @@ static inline void *hw_qeit_eq_get_inc(struct hw_queue *queue)
 static inline void *hw_eqit_eq_get_inc_valid(struct hw_queue *queue)
 {
        void *retvalue = hw_qeit_get(queue);
-       u32 qe = *(u8*)retvalue;
+       u32 qe = *(u8 *)retvalue;
        if ((qe >> 7) == (queue->toggle_state & 1))
                hw_qeit_eq_get_inc(queue);
        else
@@ -364,7 +364,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, int cqe,
 
 int ehea_destroy_cq(struct ehea_cq *cq);
 
-struct ehea_qp *ehea_create_qp(struct ehea_adapter * adapter, u32 pd,
+struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter, u32 pd,
                               struct ehea_qp_init_attr *init_attr);
 
 int ehea_destroy_qp(struct ehea_qp *qp);
@@ -378,8 +378,8 @@ int ehea_rem_mr(struct ehea_mr *mr);
 
 void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle);
 
-int ehea_create_busmap( void );
-void ehea_destroy_busmap( void );
+int ehea_create_busmap(void);
+void ehea_destroy_busmap(void);
 u64 ehea_map_vaddr(void *caddr);
 
 #endif /* __EHEA_QMR_H__ */
index 7667a62ac31f33c822c03f6ad11619d54e91d7ac..36342230a6deeb79ea89c5cb011c1724b1040bca 100644 (file)
@@ -13,7 +13,7 @@
  * Copyright (C) 2004 Andrew de Quincey (wol support)
  * Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane
  *             IRQ rate fixes, bigendian fixes, cleanups, verification)
- * Copyright (c) 2004,5,6 NVIDIA Corporation
+ * Copyright (c) 2004,2005,2006,2007,2008 NVIDIA Corporation
  *
  * 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
@@ -226,7 +226,7 @@ enum {
 #define NVREG_MISC1_HD         0x02
 #define NVREG_MISC1_FORCE      0x3b0f3c
 
-       NvRegMacReset = 0x3c,
+       NvRegMacReset = 0x34,
 #define NVREG_MAC_RESET_ASSERT 0x0F3
        NvRegTransmitterControl = 0x084,
 #define NVREG_XMITCTL_START    0x01
@@ -277,7 +277,9 @@ enum {
 #define NVREG_MCASTADDRA_FORCE 0x01
        NvRegMulticastAddrB = 0xB4,
        NvRegMulticastMaskA = 0xB8,
+#define NVREG_MCASTMASKA_NONE          0xffffffff
        NvRegMulticastMaskB = 0xBC,
+#define NVREG_MCASTMASKB_NONE          0xffff
 
        NvRegPhyInterface = 0xC0,
 #define PHY_RGMII              0x10000000
@@ -316,8 +318,8 @@ enum {
        NvRegTxRingPhysAddrHigh = 0x148,
        NvRegRxRingPhysAddrHigh = 0x14C,
        NvRegTxPauseFrame = 0x170,
-#define NVREG_TX_PAUSEFRAME_DISABLE    0x1ff0080
-#define NVREG_TX_PAUSEFRAME_ENABLE     0x0c00030
+#define NVREG_TX_PAUSEFRAME_DISABLE    0x01ff0080
+#define NVREG_TX_PAUSEFRAME_ENABLE     0x01800010
        NvRegMIIStatus = 0x180,
 #define NVREG_MIISTAT_ERROR            0x0001
 #define NVREG_MIISTAT_LINKCHANGE       0x0008
@@ -471,9 +473,9 @@ union ring_type {
 #define NV_RX_AVAIL            (1<<31)
 
 #define NV_RX2_CHECKSUMMASK    (0x1C000000)
-#define NV_RX2_CHECKSUMOK1     (0x10000000)
-#define NV_RX2_CHECKSUMOK2     (0x14000000)
-#define NV_RX2_CHECKSUMOK3     (0x18000000)
+#define NV_RX2_CHECKSUM_IP     (0x10000000)
+#define NV_RX2_CHECKSUM_IP_TCP (0x14000000)
+#define NV_RX2_CHECKSUM_IP_UDP (0x18000000)
 #define NV_RX2_DESCRIPTORVALID (1<<29)
 #define NV_RX2_SUBSTRACT1      (1<<25)
 #define NV_RX2_ERROR1          (1<<18)
@@ -2375,14 +2377,9 @@ static int nv_rx_process(struct net_device *dev, int limit)
                                                goto next_pkt;
                                        }
                                }
-                               if ((flags & NV_RX2_CHECKSUMMASK) == NV_RX2_CHECKSUMOK2)/*ip and tcp */ {
+                               if (((flags & NV_RX2_CHECKSUMMASK) == NV_RX2_CHECKSUM_IP_TCP) || /*ip and tcp */
+                                   ((flags & NV_RX2_CHECKSUMMASK) == NV_RX2_CHECKSUM_IP_UDP))   /*ip and udp */
                                        skb->ip_summed = CHECKSUM_UNNECESSARY;
-                               } else {
-                                       if ((flags & NV_RX2_CHECKSUMMASK) == NV_RX2_CHECKSUMOK1 ||
-                                           (flags & NV_RX2_CHECKSUMMASK) == NV_RX2_CHECKSUMOK3) {
-                                               skb->ip_summed = CHECKSUM_UNNECESSARY;
-                                       }
-                               }
                        } else {
                                dev_kfree_skb(skb);
                                goto next_pkt;
@@ -2474,14 +2471,9 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
                                }
                        }
 
-                       if ((flags & NV_RX2_CHECKSUMMASK) == NV_RX2_CHECKSUMOK2)/*ip and tcp */ {
+                       if (((flags & NV_RX2_CHECKSUMMASK) == NV_RX2_CHECKSUM_IP_TCP) || /*ip and tcp */
+                           ((flags & NV_RX2_CHECKSUMMASK) == NV_RX2_CHECKSUM_IP_UDP))   /*ip and udp */
                                skb->ip_summed = CHECKSUM_UNNECESSARY;
-                       } else {
-                               if ((flags & NV_RX2_CHECKSUMMASK) == NV_RX2_CHECKSUMOK1 ||
-                                   (flags & NV_RX2_CHECKSUMMASK) == NV_RX2_CHECKSUMOK3) {
-                                       skb->ip_summed = CHECKSUM_UNNECESSARY;
-                               }
-                       }
 
                        /* got a valid packet - forward it to the network core */
                        skb_put(skb, len);
@@ -2703,6 +2695,9 @@ static void nv_set_multicast(struct net_device *dev)
                        addr[1] = alwaysOn[1];
                        mask[0] = alwaysOn[0] | alwaysOff[0];
                        mask[1] = alwaysOn[1] | alwaysOff[1];
+               } else {
+                       mask[0] = NVREG_MCASTMASKA_NONE;
+                       mask[1] = NVREG_MCASTMASKB_NONE;
                }
        }
        addr[0] |= NVREG_MCASTADDRA_FORCE;
@@ -4813,8 +4808,8 @@ static int nv_open(struct net_device *dev)
                nv_mac_reset(dev);
        writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA);
        writel(0, base + NvRegMulticastAddrB);
-       writel(0, base + NvRegMulticastMaskA);
-       writel(0, base + NvRegMulticastMaskB);
+       writel(NVREG_MCASTMASKA_NONE, base + NvRegMulticastMaskA);
+       writel(NVREG_MCASTMASKB_NONE, base + NvRegMulticastMaskB);
        writel(0, base + NvRegPacketFilterFlags);
 
        writel(0, base + NvRegTransmitterControl);
@@ -4908,8 +4903,8 @@ static int nv_open(struct net_device *dev)
        spin_lock_irq(&np->lock);
        writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA);
        writel(0, base + NvRegMulticastAddrB);
-       writel(0, base + NvRegMulticastMaskA);
-       writel(0, base + NvRegMulticastMaskB);
+       writel(NVREG_MCASTMASKA_NONE, base + NvRegMulticastMaskA);
+       writel(NVREG_MCASTMASKB_NONE, base + NvRegMulticastMaskB);
        writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
        /* One manual link speed update: Interrupts are enabled, future link
         * speed changes cause interrupts and are handled by nv_link_irq().
@@ -5603,35 +5598,35 @@ static struct pci_device_id pci_tbl[] = {
        },
        {       /* MCP77 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_32),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
        },
        {       /* MCP77 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_33),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
        },
        {       /* MCP77 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_34),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
        },
        {       /* MCP77 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_35),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
        },
        {       /* MCP79 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_36),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
        },
        {       /* MCP79 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_37),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
        },
        {       /* MCP79 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_38),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
        },
        {       /* MCP79 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_39),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
        },
        {0,},
 };
index 46e2c52c7862f436248d85942e6c4cb418b16023..95e3464068db540c1d2a3f530960586ee2d0cfe0 100644 (file)
@@ -901,12 +901,12 @@ static short ibmlana_adapter_ids[] __initdata = {
        0x0000
 };
 
-static char *ibmlana_adapter_names[] __initdata = {
+static char *ibmlana_adapter_names[] __devinitdata = {
        "IBM LAN Adapter/A",
        NULL
 };
 
-static int ibmlana_init_one(struct device *kdev)
+static int __devinit ibmlana_init_one(struct device *kdev)
 {
        struct mca_device *mdev = to_mca_device(kdev);
        struct net_device *dev;
index f3c144d5d72fb5606d3c621ef3bc1b6c22660900..d4eb8e2d87202b681cff99ff6cd8ec1eec1f3664 100644 (file)
@@ -438,7 +438,6 @@ static int igb_request_irq(struct igb_adapter *adapter)
        if (adapter->msix_entries) {
                err = igb_request_msix(adapter);
                if (!err) {
-                       struct e1000_hw *hw = &adapter->hw;
                        /* enable IAM, auto-mask,
                         * DO NOT USE EIAME or IAME in legacy mode */
                        wr32(E1000_IAM, IMS_ENABLE_MASK);
index e489c6661ee8b6372dd63860cdf039f0c7389c9e..07876578887fb66661cdbcfb925aa2ba29619c28 100644 (file)
@@ -173,13 +173,13 @@ struct st_fifo {
 
 struct frame_cb {
        void *start; /* Start of frame in DMA mem */
-       int len;     /* Lenght of frame in DMA mem */
+       int len;     /* Length of frame in DMA mem */
 };
 
 struct tx_fifo {
        struct frame_cb queue[MAX_TX_WINDOW]; /* Info about frames in queue */
        int             ptr;                  /* Currently being sent */
-       int             len;                  /* Lenght of queue */
+       int             len;                  /* Length of queue */
        int             free;                 /* Next free slot */
        void           *tail;                 /* Next free start in DMA mem */
 };
index bbdc97ff83cae11df92933f9cb7cb4b55cef2f5e..29398a4f73fd2cd004005846076f4bef1137470d 100644 (file)
@@ -231,13 +231,13 @@ struct st_fifo {
 
 struct frame_cb {
        void *start; /* Start of frame in DMA mem */
-       int len;     /* Lenght of frame in DMA mem */
+       int len;     /* Length of frame in DMA mem */
 };
 
 struct tx_fifo {
        struct frame_cb queue[MAX_TX_WINDOW]; /* Info about frames in queue */
        int             ptr;                  /* Currently being sent */
-       int             len;                  /* Lenght of queue */
+       int             len;                  /* Length of queue */
        int             free;                 /* Next free slot */
        void           *tail;                 /* Next free start in DMA mem */
 };
index 204b1b34ffc7a69a7b7908049529018e7a93026b..9d012f0dbd3089594d7d38cd1845886d06373d83 100644 (file)
@@ -54,13 +54,13 @@ struct st_fifo {
 
 struct frame_cb {
        void *start;            /* Start of frame in DMA mem */
-       int len;                /* Lenght of frame in DMA mem */
+       int len;                /* Length of frame in DMA mem */
 };
 
 struct tx_fifo {
        struct frame_cb queue[MAX_TX_WINDOW + 2];       /* Info about frames in queue */
        int ptr;                /* Currently being sent */
-       int len;                /* Lenght of queue */
+       int len;                /* Length of queue */
        int free;               /* Next free slot */
        void *tail;             /* Next free start in DMA mem */
 };
index c429a5002dd6c3116b343d2ab7e1100314a70d87..0c5447dac03b4a483c8294fe2cfb3b23fab7f1e4 100644 (file)
@@ -148,7 +148,7 @@ static void __NS8390_init(struct net_device *dev, int startp);
  *
  *     "The author (me) didn't use spin_lock_irqsave because the slowness of the
  *     card means that approach caused horrible problems like losing serial data
- *     at 38400 baud on some chips. Rememeber many 8390 nics on PCI were ISA
+ *     at 38400 baud on some chips. Remember many 8390 nics on PCI were ISA
  *     chips with FPGA front ends.
  *     
  *     Ok the logic behind the 8390 is very simple:
index e10528ed90814b626751d5488e5bb26233bed360..81bf005ff280dd4b556c0c599a9670bc473c47bd 100644 (file)
@@ -1084,7 +1084,7 @@ static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        return phy_mii_ioctl(phydev, if_mii(rq), cmd);
 }
 
-static int __devinit macb_probe(struct platform_device *pdev)
+static int __init macb_probe(struct platform_device *pdev)
 {
        struct eth_platform_data *pdata;
        struct resource *regs;
@@ -1248,7 +1248,7 @@ err_out:
        return err;
 }
 
-static int __devexit macb_remove(struct platform_device *pdev)
+static int __exit macb_remove(struct platform_device *pdev)
 {
        struct net_device *dev;
        struct macb *bp;
@@ -1276,8 +1276,7 @@ static int __devexit macb_remove(struct platform_device *pdev)
 }
 
 static struct platform_driver macb_driver = {
-       .probe          = macb_probe,
-       .remove         = __devexit_p(macb_remove),
+       .remove         = __exit_p(macb_remove),
        .driver         = {
                .name           = "macb",
        },
@@ -1285,7 +1284,7 @@ static struct platform_driver macb_driver = {
 
 static int __init macb_init(void)
 {
-       return platform_driver_register(&macb_driver);
+       return platform_driver_probe(&macb_driver, macb_probe);
 }
 
 static void __exit macb_exit(void)
index aafc3ce59cbbd78206ee3121477aa16723bbeb82..6d343efb2717311c1049d4962e7ae9a1ca042653 100644 (file)
@@ -4,8 +4,6 @@
  * for more details.
  */
 
-#define DEBUG
-
 #include <linux/init.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <asm/mips-boards/simint.h>
 
-#include "mipsnet.h"           /* actual device IO mapping */
+#define MIPSNET_VERSION "2007-11-17"
+
+/*
+ * Net status/control block as seen by sw in the core.
+ */
+struct mipsnet_regs {
+       /*
+        * Device info for probing, reads as MIPSNET%d where %d is some
+        * form of version.
+        */
+       u64 devId;              /*0x00 */
 
-#define MIPSNET_VERSION "2005-06-20"
+       /*
+        * read only busy flag.
+        * Set and cleared by the Net Device to indicate that an rx or a tx
+        * is in progress.
+        */
+       u32 busy;               /*0x08 */
 
-#define mipsnet_reg_address(dev, field) (dev->base_addr + field_offset(field))
+       /*
+        * Set by the Net Device.
+        * The device will set it once data has been received.
+        * The value is the number of bytes that should be read from
+        * rxDataBuffer.  The value will decrease till 0 until all the data
+        * from rxDataBuffer has been read.
+        */
+       u32 rxDataCount;        /*0x0c */
+#define MIPSNET_MAX_RXTX_DATACOUNT (1 << 16)
+
+       /*
+        * Settable from the MIPS core, cleared by the Net Device.
+        * The core should set the number of bytes it wants to send,
+        * then it should write those bytes of data to txDataBuffer.
+        * The device will clear txDataCount has been processed (not
+        * necessarily sent).
+        */
+       u32 txDataCount;        /*0x10 */
+
+       /*
+        * Interrupt control
+        *
+        * Used to clear the interrupted generated by this dev.
+        * Write a 1 to clear the interrupt. (except bit31).
+        *
+        * Bit0 is set if it was a tx-done interrupt.
+        * Bit1 is set when new rx-data is available.
+        *    Until this bit is cleared there will be no other RXs.
+        *
+        * Bit31 is used for testing, it clears after a read.
+        *    Writing 1 to this bit will cause an interrupt to be generated.
+        *    To clear the test interrupt, write 0 to this register.
+        */
+       u32 interruptControl;   /*0x14 */
+#define MIPSNET_INTCTL_TXDONE     (1u << 0)
+#define MIPSNET_INTCTL_RXDONE     (1u << 1)
+#define MIPSNET_INTCTL_TESTBIT    (1u << 31)
+
+       /*
+        * Readonly core-specific interrupt info for the device to signal
+        * the core. The meaning of the contents of this field might change.
+        */
+       /* XXX: the whole memIntf interrupt scheme is messy: the device
+        * should have no control what so ever of what VPE/register set is
+        * being used.
+        * The MemIntf should only expose interrupt lines, and something in
+        * the config should be responsible for the line<->core/vpe bindings.
+        */
+       u32 interruptInfo;      /*0x18 */
+
+       /*
+        * This is where the received data is read out.
+        * There is more data to read until rxDataReady is 0.
+        * Only 1 byte at this regs offset is used.
+        */
+       u32 rxDataBuffer;       /*0x1c */
+
+       /*
+        * This is where the data to transmit is written.
+        * Data should be written for the amount specified in the
+        * txDataCount register.
+        * Only 1 byte at this regs offset is used.
+        */
+       u32 txDataBuffer;       /*0x20 */
+};
+
+#define regaddr(dev, field) \
+  (dev->base_addr + offsetof(struct mipsnet_regs, field))
 
 static char mipsnet_string[] = "mipsnet";
 
@@ -29,32 +109,27 @@ static char mipsnet_string[] = "mipsnet";
 static int ioiocpy_frommipsnet(struct net_device *dev, unsigned char *kdata,
                        int len)
 {
-       uint32_t available_len = inl(mipsnet_reg_address(dev, rxDataCount));
-
-       if (available_len < len)
-               return -EFAULT;
-
        for (; len > 0; len--, kdata++)
-               *kdata = inb(mipsnet_reg_address(dev, rxDataBuffer));
+               *kdata = inb(regaddr(dev, rxDataBuffer));
 
-       return inl(mipsnet_reg_address(dev, rxDataCount));
+       return inl(regaddr(dev, rxDataCount));
 }
 
-static inline ssize_t mipsnet_put_todevice(struct net_device *dev,
+static inline void mipsnet_put_todevice(struct net_device *dev,
        struct sk_buff *skb)
 {
        int count_to_go = skb->len;
        char *buf_ptr = skb->data;
 
-       outl(skb->len, mipsnet_reg_address(dev, txDataCount));
+       outl(skb->len, regaddr(dev, txDataCount));
 
        for (; count_to_go; buf_ptr++, count_to_go--)
-               outb(*buf_ptr, mipsnet_reg_address(dev, txDataBuffer));
+               outb(*buf_ptr, regaddr(dev, txDataBuffer));
 
        dev->stats.tx_packets++;
        dev->stats.tx_bytes += skb->len;
 
-       return skb->len;
+       dev_kfree_skb(skb);
 }
 
 static int mipsnet_xmit(struct sk_buff *skb, struct net_device *dev)
@@ -69,18 +144,20 @@ static int mipsnet_xmit(struct sk_buff *skb, struct net_device *dev)
        return 0;
 }
 
-static inline ssize_t mipsnet_get_fromdev(struct net_device *dev, size_t count)
+static inline ssize_t mipsnet_get_fromdev(struct net_device *dev, size_t len)
 {
        struct sk_buff *skb;
-       size_t len = count;
 
-       skb = alloc_skb(len + 2, GFP_KERNEL);
+       if (!len)
+               return len;
+
+       skb = dev_alloc_skb(len + NET_IP_ALIGN);
        if (!skb) {
                dev->stats.rx_dropped++;
                return -ENOMEM;
        }
 
-       skb_reserve(skb, 2);
+       skb_reserve(skb, NET_IP_ALIGN);
        if (ioiocpy_frommipsnet(dev, skb_put(skb, len), len))
                return -EFAULT;
 
@@ -92,50 +169,42 @@ static inline ssize_t mipsnet_get_fromdev(struct net_device *dev, size_t count)
        dev->stats.rx_packets++;
        dev->stats.rx_bytes += len;
 
-       return count;
+       return len;
 }
 
 static irqreturn_t mipsnet_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = dev_id;
-
-       irqreturn_t retval = IRQ_NONE;
-       uint64_t interruptFlags;
-
-       if (irq == dev->irq) {
-               retval = IRQ_HANDLED;
-
-               interruptFlags =
-                   inl(mipsnet_reg_address(dev, interruptControl));
-
-               if (interruptFlags & MIPSNET_INTCTL_TXDONE) {
-                       outl(MIPSNET_INTCTL_TXDONE,
-                            mipsnet_reg_address(dev, interruptControl));
-                       /* only one packet at a time, we are done. */
-                       netif_wake_queue(dev);
-               } else if (interruptFlags & MIPSNET_INTCTL_RXDONE) {
-                       mipsnet_get_fromdev(dev,
-                                   inl(mipsnet_reg_address(dev, rxDataCount)));
-                       outl(MIPSNET_INTCTL_RXDONE,
-                            mipsnet_reg_address(dev, interruptControl));
-
-               } else if (interruptFlags & MIPSNET_INTCTL_TESTBIT) {
-                       /*
-                        * TESTBIT is cleared on read.
-                        * And takes effect after a write with 0
-                        */
-                       outl(0, mipsnet_reg_address(dev, interruptControl));
-               } else {
-                       /* Maybe shared IRQ, just ignore, no clearing. */
-                       retval = IRQ_NONE;
-               }
-
-       } else {
-               printk(KERN_INFO "%s: %s(): irq %d for unknown device\n",
-                      dev->name, __FUNCTION__, irq);
-               retval = IRQ_NONE;
+       u32 int_flags;
+       irqreturn_t ret = IRQ_NONE;
+
+       if (irq != dev->irq)
+               goto out_badirq;
+
+       /* TESTBIT is cleared on read. */
+       int_flags = inl(regaddr(dev, interruptControl));
+       if (int_flags & MIPSNET_INTCTL_TESTBIT) {
+               /* TESTBIT takes effect after a write with 0. */
+               outl(0, regaddr(dev, interruptControl));
+               ret = IRQ_HANDLED;
+       } else if (int_flags & MIPSNET_INTCTL_TXDONE) {
+               /* Only one packet at a time, we are done. */
+               dev->stats.tx_packets++;
+               netif_wake_queue(dev);
+               outl(MIPSNET_INTCTL_TXDONE,
+                    regaddr(dev, interruptControl));
+               ret = IRQ_HANDLED;
+       } else if (int_flags & MIPSNET_INTCTL_RXDONE) {
+               mipsnet_get_fromdev(dev, inl(regaddr(dev, rxDataCount)));
+               outl(MIPSNET_INTCTL_RXDONE, regaddr(dev, interruptControl));
+               ret = IRQ_HANDLED;
        }
-       return retval;
+       return ret;
+
+out_badirq:
+       printk(KERN_INFO "%s: %s(): irq %d for unknown device\n",
+              dev->name, __FUNCTION__, irq);
+       return ret;
 }
 
 static int mipsnet_open(struct net_device *dev)
@@ -144,18 +213,15 @@ static int mipsnet_open(struct net_device *dev)
 
        err = request_irq(dev->irq, &mipsnet_interrupt,
                          IRQF_SHARED, dev->name, (void *) dev);
-
        if (err) {
-               release_region(dev->base_addr, MIPSNET_IO_EXTENT);
+               release_region(dev->base_addr, sizeof(struct mipsnet_regs));
                return err;
        }
 
        netif_start_queue(dev);
 
        /* test interrupt handler */
-       outl(MIPSNET_INTCTL_TESTBIT,
-            mipsnet_reg_address(dev, interruptControl));
-
+       outl(MIPSNET_INTCTL_TESTBIT, regaddr(dev, interruptControl));
 
        return 0;
 }
@@ -163,7 +229,7 @@ static int mipsnet_open(struct net_device *dev)
 static int mipsnet_close(struct net_device *dev)
 {
        netif_stop_queue(dev);
-
+       free_irq(dev->irq, dev);
        return 0;
 }
 
@@ -194,10 +260,11 @@ static int __init mipsnet_probe(struct device *dev)
         */
        netdev->base_addr = 0x4200;
        netdev->irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_MB0 +
-                     inl(mipsnet_reg_address(netdev, interruptInfo));
+                     inl(regaddr(netdev, interruptInfo));
 
        /* Get the io region now, get irq on open() */
-       if (!request_region(netdev->base_addr, MIPSNET_IO_EXTENT, "mipsnet")) {
+       if (!request_region(netdev->base_addr, sizeof(struct mipsnet_regs),
+                           "mipsnet")) {
                err = -EBUSY;
                goto out_free_netdev;
        }
@@ -217,7 +284,7 @@ static int __init mipsnet_probe(struct device *dev)
        return 0;
 
 out_free_region:
-       release_region(netdev->base_addr, MIPSNET_IO_EXTENT);
+       release_region(netdev->base_addr, sizeof(struct mipsnet_regs));
 
 out_free_netdev:
        free_netdev(netdev);
@@ -231,7 +298,7 @@ static int __devexit mipsnet_device_remove(struct device *device)
        struct net_device *dev = dev_get_drvdata(device);
 
        unregister_netdev(dev);
-       release_region(dev->base_addr, MIPSNET_IO_EXTENT);
+       release_region(dev->base_addr, sizeof(struct mipsnet_regs));
        free_netdev(dev);
        dev_set_drvdata(device, NULL);
 
diff --git a/drivers/net/mipsnet.h b/drivers/net/mipsnet.h
deleted file mode 100644 (file)
index 0132c67..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- */
-#ifndef __MIPSNET_H
-#define __MIPSNET_H
-
-/*
- *  Id of this Net device, as seen by the core.
- */
-#define MIPS_NET_DEV_ID ((uint64_t)       \
-                            ((uint64_t) 'M' <<  0)| \
-                            ((uint64_t) 'I' <<  8)| \
-                            ((uint64_t) 'P' << 16)| \
-                            ((uint64_t) 'S' << 24)| \
-                            ((uint64_t) 'N' << 32)| \
-                            ((uint64_t) 'E' << 40)| \
-                            ((uint64_t) 'T' << 48)| \
-                            ((uint64_t) '0' << 56))
-
-/*
- * Net status/control block as seen by sw in the core.
- * (Why not use bit fields? can't be bothered with cross-platform struct
- *  packing.)
- */
-struct net_control_block {
-       /*
-        * dev info for probing
-        * reads as MIPSNET%d where %d is some form of version
-        */
-       uint64_t devId;         /* 0x00 */
-
-       /*
-        * read only busy flag.
-        * Set and cleared by the Net Device to indicate that an rx or a tx
-        * is in progress.
-        */
-       uint32_t busy;          /* 0x08 */
-
-       /*
-        * Set by the Net Device.
-        * The device will set it once data has been received.
-        * The value is the number of bytes that should be read from
-        * rxDataBuffer.  The value will decrease till 0 until all the data
-        * from rxDataBuffer has been read.
-        */
-       uint32_t rxDataCount;   /* 0x0c */
-#define MIPSNET_MAX_RXTX_DATACOUNT (1<<16)
-
-       /*
-        * Settable from the MIPS core, cleared by the Net Device.  The core
-        * should set the number of bytes it wants to send, then it should
-        * write those bytes of data to txDataBuffer.  The device will clear
-        * txDataCount has been processed (not necessarily sent).
-        */
-       uint32_t txDataCount;   /* 0x10 */
-
-       /*
-        * Interrupt control
-        *
-        * Used to clear the interrupted generated by this dev.
-        * Write a 1 to clear the interrupt. (except bit31).
-        *
-        * Bit0 is set if it was a tx-done interrupt.
-        * Bit1 is set when new rx-data is available.
-        *      Until this bit is cleared there will be no other RXs.
-        *
-        * Bit31 is used for testing, it clears after a read.
-        *    Writing 1 to this bit will cause an interrupt to be generated.
-        *    To clear the test interrupt, write 0 to this register.
-        */
-       uint32_t interruptControl;      /*0x14 */
-#define MIPSNET_INTCTL_TXDONE     ((uint32_t)(1 <<  0))
-#define MIPSNET_INTCTL_RXDONE     ((uint32_t)(1 <<  1))
-#define MIPSNET_INTCTL_TESTBIT    ((uint32_t)(1 << 31))
-#define MIPSNET_INTCTL_ALLSOURCES      (MIPSNET_INTCTL_TXDONE | \
-                                        MIPSNET_INTCTL_RXDONE | \
-                                        MIPSNET_INTCTL_TESTBIT)
-
-       /*
-        * Readonly core-specific interrupt info for the device to signal the
-        * core.  The meaning of the contents of this field might change.
-        *
-        * TODO: the whole memIntf interrupt scheme is messy: the device should
-        *       have no control what so ever of what VPE/register set is being
-        *       used.  The MemIntf should only expose interrupt lines, and
-        *       something in the config should be responsible for the
-        *       line<->core/vpe bindings.
-        */
-       uint32_t interruptInfo; /* 0x18 */
-
-       /*
-        *  This is where the received data is read out.
-        *  There is more data to read until rxDataReady is 0.
-        *  Only 1 byte at this regs offset is used.
-        */
-       uint32_t rxDataBuffer;  /* 0x1c */
-
-       /*
-        * This is where the data to transmit is written.  Data should be
-        * written for the amount specified in the txDataCount register.  Only
-        * 1 byte at this regs offset is used.
-        */
-       uint32_t txDataBuffer;  /* 0x20 */
-};
-
-#define MIPSNET_IO_EXTENT 0x40 /* being generous */
-
-#define field_offset(field) (offsetof(struct net_control_block, field))
-
-#endif /* __MIPSNET_H */
index c329a4f5840c7c22ee80a2882343888ea13ffbde..0a3e60418e53372beec40c8d50a1a78e086c8534 100644 (file)
@@ -203,22 +203,8 @@ skbuff at an offset of "+2", 16-byte aligning the IP header.
 IIId. Synchronization
 
 Most operations are synchronized on the np->lock irq spinlock, except the
-performance critical codepaths:
-
-The rx process only runs in the interrupt handler. Access from outside
-the interrupt handler is only permitted after disable_irq().
-
-The rx process usually runs under the netif_tx_lock. If np->intr_tx_reap
-is set, then access is permitted under spin_lock_irq(&np->lock).
-
-Thus configuration functions that want to access everything must call
-       disable_irq(dev->irq);
-       netif_tx_lock_bh(dev);
-       spin_lock_irq(&np->lock);
-
-IV. Notes
-
-NatSemi PCI network controllers are very uncommon.
+recieve and transmit paths which are synchronised using a combination of
+hardware descriptor ownership, disabling interrupts and NAPI poll scheduling.
 
 IVb. References
 
index bb88a41b759103e5601b22a4831f81f225513245..2e39e0285d8f9d2a6a9712ce33249749ede49377 100644 (file)
 
 #define LRO_MAX_AGGR 64
 
+#define PE_MIN_MTU     64
+#define PE_MAX_MTU     1500
+#define PE_DEF_MTU     ETH_DATA_LEN
+
 #define DEFAULT_MSG_ENABLE       \
        (NETIF_MSG_DRV          | \
         NETIF_MSG_PROBE        | \
@@ -82,8 +86,6 @@
                                 & ((ring)->size - 1))
 #define RING_AVAIL(ring)       ((ring->size) - RING_USED(ring))
 
-#define BUF_SIZE 1646 /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */
-
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
 MODULE_DESCRIPTION("PA Semi PWRficient Ethernet driver");
@@ -175,6 +177,24 @@ static int mac_to_intf(struct pasemi_mac *mac)
        return -1;
 }
 
+static void pasemi_mac_intf_disable(struct pasemi_mac *mac)
+{
+       unsigned int flags;
+
+       flags = read_mac_reg(mac, PAS_MAC_CFG_PCFG);
+       flags &= ~PAS_MAC_CFG_PCFG_PE;
+       write_mac_reg(mac, PAS_MAC_CFG_PCFG, flags);
+}
+
+static void pasemi_mac_intf_enable(struct pasemi_mac *mac)
+{
+       unsigned int flags;
+
+       flags = read_mac_reg(mac, PAS_MAC_CFG_PCFG);
+       flags |= PAS_MAC_CFG_PCFG_PE;
+       write_mac_reg(mac, PAS_MAC_CFG_PCFG, flags);
+}
+
 static int pasemi_get_mac_addr(struct pasemi_mac *mac)
 {
        struct pci_dev *pdev = mac->pdev;
@@ -221,6 +241,33 @@ static int pasemi_get_mac_addr(struct pasemi_mac *mac)
        return 0;
 }
 
+static int pasemi_mac_set_mac_addr(struct net_device *dev, void *p)
+{
+       struct pasemi_mac *mac = netdev_priv(dev);
+       struct sockaddr *addr = p;
+       unsigned int adr0, adr1;
+
+       if (!is_valid_ether_addr(addr->sa_data))
+               return -EINVAL;
+
+       memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+
+       adr0 = dev->dev_addr[2] << 24 |
+              dev->dev_addr[3] << 16 |
+              dev->dev_addr[4] << 8 |
+              dev->dev_addr[5];
+       adr1 = read_mac_reg(mac, PAS_MAC_CFG_ADR1);
+       adr1 &= ~0xffff;
+       adr1 |= dev->dev_addr[0] << 8 | dev->dev_addr[1];
+
+       pasemi_mac_intf_disable(mac);
+       write_mac_reg(mac, PAS_MAC_CFG_ADR0, adr0);
+       write_mac_reg(mac, PAS_MAC_CFG_ADR1, adr1);
+       pasemi_mac_intf_enable(mac);
+
+       return 0;
+}
+
 static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
                       void **tcph, u64 *hdr_flags, void *data)
 {
@@ -453,7 +500,7 @@ static void pasemi_mac_free_tx_resources(struct pasemi_mac *mac)
 
 }
 
-static void pasemi_mac_free_rx_resources(struct pasemi_mac *mac)
+static void pasemi_mac_free_rx_buffers(struct pasemi_mac *mac)
 {
        struct pasemi_mac_rxring *rx = rx_ring(mac);
        unsigned int i;
@@ -473,7 +520,12 @@ static void pasemi_mac_free_rx_resources(struct pasemi_mac *mac)
        }
 
        for (i = 0; i < RX_RING_SIZE; i++)
-               RX_DESC(rx, i) = 0;
+               RX_BUFF(rx, i) = 0;
+}
+
+static void pasemi_mac_free_rx_resources(struct pasemi_mac *mac)
+{
+       pasemi_mac_free_rx_buffers(mac);
 
        dma_free_coherent(&mac->dma_pdev->dev, RX_RING_SIZE * sizeof(u64),
                          rx_ring(mac)->buffers, rx_ring(mac)->buf_dma);
@@ -503,14 +555,14 @@ static void pasemi_mac_replenish_rx_ring(const struct net_device *dev,
                /* Entry in use? */
                WARN_ON(*buff);
 
-               skb = dev_alloc_skb(BUF_SIZE);
+               skb = dev_alloc_skb(mac->bufsz);
                skb_reserve(skb, LOCAL_SKB_ALIGN);
 
                if (unlikely(!skb))
                        break;
 
                dma = pci_map_single(mac->dma_pdev, skb->data,
-                                    BUF_SIZE - LOCAL_SKB_ALIGN,
+                                    mac->bufsz - LOCAL_SKB_ALIGN,
                                     PCI_DMA_FROMDEVICE);
 
                if (unlikely(dma_mapping_error(dma))) {
@@ -520,7 +572,7 @@ static void pasemi_mac_replenish_rx_ring(const struct net_device *dev,
 
                info->skb = skb;
                info->dma = dma;
-               *buff = XCT_RXB_LEN(BUF_SIZE) | XCT_RXB_ADDR(dma);
+               *buff = XCT_RXB_LEN(mac->bufsz) | XCT_RXB_ADDR(dma);
                fill++;
        }
 
@@ -650,7 +702,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac_rxring *rx,
 
                len = (macrx & XCT_MACRX_LLEN_M) >> XCT_MACRX_LLEN_S;
 
-               pci_unmap_single(pdev, dma, BUF_SIZE-LOCAL_SKB_ALIGN,
+               pci_unmap_single(pdev, dma, mac->bufsz - LOCAL_SKB_ALIGN,
                                 PCI_DMA_FROMDEVICE);
 
                if (macrx & XCT_MACRX_CRC) {
@@ -874,24 +926,6 @@ static irqreturn_t pasemi_mac_tx_intr(int irq, void *data)
        return IRQ_HANDLED;
 }
 
-static void pasemi_mac_intf_disable(struct pasemi_mac *mac)
-{
-       unsigned int flags;
-
-       flags = read_mac_reg(mac, PAS_MAC_CFG_PCFG);
-       flags &= ~PAS_MAC_CFG_PCFG_PE;
-       write_mac_reg(mac, PAS_MAC_CFG_PCFG, flags);
-}
-
-static void pasemi_mac_intf_enable(struct pasemi_mac *mac)
-{
-       unsigned int flags;
-
-       flags = read_mac_reg(mac, PAS_MAC_CFG_PCFG);
-       flags |= PAS_MAC_CFG_PCFG_PE;
-       write_mac_reg(mac, PAS_MAC_CFG_PCFG, flags);
-}
-
 static void pasemi_adjust_link(struct net_device *dev)
 {
        struct pasemi_mac *mac = netdev_priv(dev);
@@ -1148,11 +1182,71 @@ out_rx_resources:
 
 #define MAX_RETRIES 5000
 
+static void pasemi_mac_pause_txchan(struct pasemi_mac *mac)
+{
+       unsigned int sta, retries;
+       int txch = tx_ring(mac)->chan.chno;
+
+       write_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(txch),
+                     PAS_DMA_TXCHAN_TCMDSTA_ST);
+
+       for (retries = 0; retries < MAX_RETRIES; retries++) {
+               sta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(txch));
+               if (!(sta & PAS_DMA_TXCHAN_TCMDSTA_ACT))
+                       break;
+               cond_resched();
+       }
+
+       if (sta & PAS_DMA_TXCHAN_TCMDSTA_ACT)
+               dev_err(&mac->dma_pdev->dev,
+                       "Failed to stop tx channel, tcmdsta %08x\n", sta);
+
+       write_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(txch), 0);
+}
+
+static void pasemi_mac_pause_rxchan(struct pasemi_mac *mac)
+{
+       unsigned int sta, retries;
+       int rxch = rx_ring(mac)->chan.chno;
+
+       write_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(rxch),
+                     PAS_DMA_RXCHAN_CCMDSTA_ST);
+       for (retries = 0; retries < MAX_RETRIES; retries++) {
+               sta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(rxch));
+               if (!(sta & PAS_DMA_RXCHAN_CCMDSTA_ACT))
+                       break;
+               cond_resched();
+       }
+
+       if (sta & PAS_DMA_RXCHAN_CCMDSTA_ACT)
+               dev_err(&mac->dma_pdev->dev,
+                       "Failed to stop rx channel, ccmdsta 08%x\n", sta);
+       write_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(rxch), 0);
+}
+
+static void pasemi_mac_pause_rxint(struct pasemi_mac *mac)
+{
+       unsigned int sta, retries;
+
+       write_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if),
+                     PAS_DMA_RXINT_RCMDSTA_ST);
+       for (retries = 0; retries < MAX_RETRIES; retries++) {
+               sta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if));
+               if (!(sta & PAS_DMA_RXINT_RCMDSTA_ACT))
+                       break;
+               cond_resched();
+       }
+
+       if (sta & PAS_DMA_RXINT_RCMDSTA_ACT)
+               dev_err(&mac->dma_pdev->dev,
+                       "Failed to stop rx interface, rcmdsta %08x\n", sta);
+       write_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if), 0);
+}
+
 static int pasemi_mac_close(struct net_device *dev)
 {
        struct pasemi_mac *mac = netdev_priv(dev);
        unsigned int sta;
-       int retries;
        int rxch, txch;
 
        rxch = rx_ring(mac)->chan.chno;
@@ -1190,51 +1284,10 @@ static int pasemi_mac_close(struct net_device *dev)
        pasemi_mac_clean_tx(tx_ring(mac));
        pasemi_mac_clean_rx(rx_ring(mac), RX_RING_SIZE);
 
-       /* Disable interface */
-       write_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(txch),
-                     PAS_DMA_TXCHAN_TCMDSTA_ST);
-       write_dma_reg( PAS_DMA_RXINT_RCMDSTA(mac->dma_if),
-                     PAS_DMA_RXINT_RCMDSTA_ST);
-       write_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(rxch),
-                     PAS_DMA_RXCHAN_CCMDSTA_ST);
-
-       for (retries = 0; retries < MAX_RETRIES; retries++) {
-               sta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(rxch));
-               if (!(sta & PAS_DMA_TXCHAN_TCMDSTA_ACT))
-                       break;
-               cond_resched();
-       }
-
-       if (sta & PAS_DMA_TXCHAN_TCMDSTA_ACT)
-               dev_err(&mac->dma_pdev->dev, "Failed to stop tx channel\n");
-
-       for (retries = 0; retries < MAX_RETRIES; retries++) {
-               sta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(rxch));
-               if (!(sta & PAS_DMA_RXCHAN_CCMDSTA_ACT))
-                       break;
-               cond_resched();
-       }
-
-       if (sta & PAS_DMA_RXCHAN_CCMDSTA_ACT)
-               dev_err(&mac->dma_pdev->dev, "Failed to stop rx channel\n");
-
-       for (retries = 0; retries < MAX_RETRIES; retries++) {
-               sta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if));
-               if (!(sta & PAS_DMA_RXINT_RCMDSTA_ACT))
-                       break;
-               cond_resched();
-       }
-
-       if (sta & PAS_DMA_RXINT_RCMDSTA_ACT)
-               dev_err(&mac->dma_pdev->dev, "Failed to stop rx interface\n");
-
-       /* Then, disable the channel. This must be done separately from
-        * stopping, since you can't disable when active.
-        */
-
-       write_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(txch), 0);
-       write_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(rxch), 0);
-       write_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if), 0);
+       pasemi_mac_pause_txchan(mac);
+       pasemi_mac_pause_rxint(mac);
+       pasemi_mac_pause_rxchan(mac);
+       pasemi_mac_intf_disable(mac);
 
        free_irq(mac->tx->chan.irq, mac->tx);
        free_irq(mac->rx->chan.irq, mac->rx);
@@ -1388,6 +1441,62 @@ static int pasemi_mac_poll(struct napi_struct *napi, int budget)
        return pkts;
 }
 
+static int pasemi_mac_change_mtu(struct net_device *dev, int new_mtu)
+{
+       struct pasemi_mac *mac = netdev_priv(dev);
+       unsigned int reg;
+       unsigned int rcmdsta;
+       int running;
+
+       if (new_mtu < PE_MIN_MTU || new_mtu > PE_MAX_MTU)
+               return -EINVAL;
+
+       running = netif_running(dev);
+
+       if (running) {
+               /* Need to stop the interface, clean out all already
+                * received buffers, free all unused buffers on the RX
+                * interface ring, then finally re-fill the rx ring with
+                * the new-size buffers and restart.
+                */
+
+               napi_disable(&mac->napi);
+               netif_tx_disable(dev);
+               pasemi_mac_intf_disable(mac);
+
+               rcmdsta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if));
+               pasemi_mac_pause_rxint(mac);
+               pasemi_mac_clean_rx(rx_ring(mac), RX_RING_SIZE);
+               pasemi_mac_free_rx_buffers(mac);
+       }
+
+       /* Change maxf, i.e. what size frames are accepted.
+        * Need room for ethernet header and CRC word
+        */
+       reg = read_mac_reg(mac, PAS_MAC_CFG_MACCFG);
+       reg &= ~PAS_MAC_CFG_MACCFG_MAXF_M;
+       reg |= PAS_MAC_CFG_MACCFG_MAXF(new_mtu + ETH_HLEN + 4);
+       write_mac_reg(mac, PAS_MAC_CFG_MACCFG, reg);
+
+       dev->mtu = new_mtu;
+       /* MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */
+       mac->bufsz = new_mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128;
+
+       if (running) {
+               write_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if),
+                             rcmdsta | PAS_DMA_RXINT_RCMDSTA_EN);
+
+               rx_ring(mac)->next_to_fill = 0;
+               pasemi_mac_replenish_rx_ring(dev, RX_RING_SIZE-1);
+
+               napi_enable(&mac->napi);
+               netif_start_queue(dev);
+               pasemi_mac_intf_enable(mac);
+       }
+
+       return 0;
+}
+
 static int __devinit
 pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
@@ -1475,6 +1584,12 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        dev->stop = pasemi_mac_close;
        dev->hard_start_xmit = pasemi_mac_start_tx;
        dev->set_multicast_list = pasemi_mac_set_rx_mode;
+       dev->set_mac_address = pasemi_mac_set_mac_addr;
+       dev->mtu = PE_DEF_MTU;
+       /* 1500 MTU + ETH_HLEN + VLAN_HLEN + 2 64B cachelines */
+       mac->bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128;
+
+       dev->change_mtu = pasemi_mac_change_mtu;
 
        if (err)
                goto out;
index 8bee2a664c83760d12a897eb4230331f6e99c229..99e7b9329a6fb5366936d62f399b513a676b5897 100644 (file)
@@ -59,6 +59,7 @@ struct pasemi_mac {
        struct phy_device *phydev;
        struct napi_struct napi;
 
+       int             bufsz; /* RX ring buffer size */
        u8              type;
 #define MAC_TYPE_GMAC  1
 #define MAC_TYPE_XAUI  2
@@ -96,6 +97,9 @@ struct pasemi_mac_buffer {
 /* MAC CFG register offsets */
 enum {
        PAS_MAC_CFG_PCFG = 0x80,
+       PAS_MAC_CFG_MACCFG = 0x84,
+       PAS_MAC_CFG_ADR0 = 0x8c,
+       PAS_MAC_CFG_ADR1 = 0x90,
        PAS_MAC_CFG_TXP = 0x98,
        PAS_MAC_IPC_CHNL = 0x208,
 };
@@ -130,6 +134,18 @@ enum {
 #define PAS_MAC_CFG_PCFG_SPD_100M      0x00000001
 #define PAS_MAC_CFG_PCFG_SPD_1G                0x00000002
 #define PAS_MAC_CFG_PCFG_SPD_10G       0x00000003
+
+#define PAS_MAC_CFG_MACCFG_TXT_M       0x70000000
+#define PAS_MAC_CFG_MACCFG_TXT_S       28
+#define PAS_MAC_CFG_MACCFG_PRES_M      0x0f000000
+#define PAS_MAC_CFG_MACCFG_PRES_S      24
+#define PAS_MAC_CFG_MACCFG_MAXF_M      0x00ffff00
+#define PAS_MAC_CFG_MACCFG_MAXF_S      8
+#define PAS_MAC_CFG_MACCFG_MAXF(x)     (((x) << PAS_MAC_CFG_MACCFG_MAXF_S) & \
+                                        PAS_MAC_CFG_MACCFG_MAXF_M)
+#define PAS_MAC_CFG_MACCFG_MINF_M      0x000000ff
+#define PAS_MAC_CFG_MACCFG_MINF_S      0
+
 #define PAS_MAC_CFG_TXP_FCF            0x01000000
 #define PAS_MAC_CFG_TXP_FCE            0x00800000
 #define PAS_MAC_CFG_TXP_FC             0x00400000
index ed402e00e730e1c0c2eadfa1ac13a5cfe3cb9aa9..fffc49befe042c7b514745d688cfd5817a44a9dc 100644 (file)
@@ -541,7 +541,7 @@ static void netdrv_hw_start (struct net_device *dev);
 #define NETDRV_W32_F(reg, val32)       do { writel ((val32), ioaddr + (reg)); readl (ioaddr + (reg)); } while (0)
 
 
-#if MMIO_FLUSH_AUDIT_COMPLETE
+#ifdef MMIO_FLUSH_AUDIT_COMPLETE
 
 /* write MMIO register */
 #define NETDRV_W8(reg, val8)   writeb ((val8), ioaddr + (reg))
@@ -603,7 +603,7 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
                return -ENOMEM;
        }
        SET_NETDEV_DEV(dev, &pdev->dev);
-       tp = dev->priv;
+       tp = netdev_priv(dev);
 
        /* enable device (incl. PCI PM wakeup), and bus-mastering */
        rc = pci_enable_device (pdev);
@@ -759,7 +759,7 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
                return i;
        }
 
-       tp = dev->priv;
+       tp = netdev_priv(dev);
 
        assert (ioaddr != NULL);
        assert (dev != NULL);
@@ -783,7 +783,7 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
        dev->base_addr = (unsigned long) ioaddr;
 
        /* dev->priv/tp zeroed and aligned in alloc_etherdev */
-       tp = dev->priv;
+       tp = netdev_priv(dev);
 
        /* note: tp->chipset set in netdrv_init_board */
        tp->drv_flags = PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
@@ -841,7 +841,7 @@ static void __devexit netdrv_remove_one (struct pci_dev *pdev)
 
        assert (dev != NULL);
 
-       np = dev->priv;
+       np = netdev_priv(dev);
        assert (np != NULL);
 
        unregister_netdev (dev);
@@ -974,7 +974,7 @@ static void mdio_sync (void *mdio_addr)
 
 static int mdio_read (struct net_device *dev, int phy_id, int location)
 {
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        void *mdio_addr = tp->mmio_addr + Config4;
        int mii_cmd = (0xf6 << 10) | (phy_id << 5) | location;
        int retval = 0;
@@ -1017,7 +1017,7 @@ static int mdio_read (struct net_device *dev, int phy_id, int location)
 static void mdio_write (struct net_device *dev, int phy_id, int location,
                        int value)
 {
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        void *mdio_addr = tp->mmio_addr + Config4;
        int mii_cmd =
            (0x5002 << 16) | (phy_id << 23) | (location << 18) | value;
@@ -1060,7 +1060,7 @@ static void mdio_write (struct net_device *dev, int phy_id, int location,
 
 static int netdrv_open (struct net_device *dev)
 {
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        int retval;
 #ifdef NETDRV_DEBUG
        void *ioaddr = tp->mmio_addr;
@@ -1121,7 +1121,7 @@ static int netdrv_open (struct net_device *dev)
 /* Start the hardware at open or resume. */
 static void netdrv_hw_start (struct net_device *dev)
 {
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        void *ioaddr = tp->mmio_addr;
        u32 i;
 
@@ -1191,7 +1191,7 @@ static void netdrv_hw_start (struct net_device *dev)
 /* Initialize the Rx and Tx rings, along with various 'dev' bits. */
 static void netdrv_init_ring (struct net_device *dev)
 {
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        int i;
 
        DPRINTK ("ENTER\n");
@@ -1213,7 +1213,7 @@ static void netdrv_init_ring (struct net_device *dev)
 static void netdrv_timer (unsigned long data)
 {
        struct net_device *dev = (struct net_device *) data;
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        void *ioaddr = tp->mmio_addr;
        int next_tick = 60 * HZ;
        int mii_lpa;
@@ -1252,9 +1252,10 @@ static void netdrv_timer (unsigned long data)
 }
 
 
-static void netdrv_tx_clear (struct netdrv_private *tp)
+static void netdrv_tx_clear (struct net_device *dev)
 {
        int i;
+       struct netdrv_private *tp = netdev_priv(dev);
 
        atomic_set (&tp->cur_tx, 0);
        atomic_set (&tp->dirty_tx, 0);
@@ -1278,7 +1279,7 @@ static void netdrv_tx_clear (struct netdrv_private *tp)
 
 static void netdrv_tx_timeout (struct net_device *dev)
 {
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        void *ioaddr = tp->mmio_addr;
        int i;
        u8 tmp8;
@@ -1311,7 +1312,7 @@ static void netdrv_tx_timeout (struct net_device *dev)
        /* Stop a shared interrupt from scavenging while we are. */
        spin_lock_irqsave (&tp->lock, flags);
 
-       netdrv_tx_clear (tp);
+       netdrv_tx_clear (dev);
 
        spin_unlock_irqrestore (&tp->lock, flags);
 
@@ -1325,7 +1326,7 @@ static void netdrv_tx_timeout (struct net_device *dev)
 
 static int netdrv_start_xmit (struct sk_buff *skb, struct net_device *dev)
 {
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        void *ioaddr = tp->mmio_addr;
        int entry;
 
@@ -1525,7 +1526,7 @@ static void netdrv_rx_interrupt (struct net_device *dev,
                DPRINTK ("%s:  netdrv_rx() status %4.4x, size %4.4x,"
                         " cur %4.4x.\n", dev->name, rx_status,
                         rx_size, cur_rx);
-#if NETDRV_DEBUG > 2
+#if defined(NETDRV_DEBUG) && (NETDRV_DEBUG > 2)
                {
                        int i;
                        DPRINTK ("%s: Frame contents ", dev->name);
@@ -1648,7 +1649,7 @@ static void netdrv_weird_interrupt (struct net_device *dev,
 static irqreturn_t netdrv_interrupt (int irq, void *dev_instance)
 {
        struct net_device *dev = (struct net_device *) dev_instance;
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        int boguscnt = max_interrupt_work;
        void *ioaddr = tp->mmio_addr;
        int status = 0, link_changed = 0; /* avoid bogus "uninit" warning */
@@ -1711,7 +1712,7 @@ static irqreturn_t netdrv_interrupt (int irq, void *dev_instance)
 
 static int netdrv_close (struct net_device *dev)
 {
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        void *ioaddr = tp->mmio_addr;
        unsigned long flags;
 
@@ -1738,10 +1739,10 @@ static int netdrv_close (struct net_device *dev)
 
        spin_unlock_irqrestore (&tp->lock, flags);
 
-       synchronize_irq ();
+       synchronize_irq (dev->irq);
        free_irq (dev->irq, dev);
 
-       netdrv_tx_clear (tp);
+       netdrv_tx_clear (dev);
 
        pci_free_consistent(tp->pci_dev, RX_BUF_TOT_LEN,
                            tp->rx_ring, tp->rx_ring_dma);
@@ -1762,7 +1763,7 @@ static int netdrv_close (struct net_device *dev)
 
 static int netdrv_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 {
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        struct mii_ioctl_data *data = if_mii(rq);
        unsigned long flags;
        int rc = 0;
@@ -1805,7 +1806,7 @@ static int netdrv_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
 
 static void netdrv_set_rx_mode (struct net_device *dev)
 {
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        void *ioaddr = tp->mmio_addr;
        u32 mc_filter[2];       /* Multicast hash filter */
        int i, rx_mode;
@@ -1862,7 +1863,7 @@ static void netdrv_set_rx_mode (struct net_device *dev)
 static int netdrv_suspend (struct pci_dev *pdev, pm_message_t state)
 {
        struct net_device *dev = pci_get_drvdata (pdev);
-       struct netdrv_private *tp = dev->priv;
+       struct netdrv_private *tp = netdev_priv(dev);
        void *ioaddr = tp->mmio_addr;
        unsigned long flags;
 
@@ -1892,7 +1893,7 @@ static int netdrv_suspend (struct pci_dev *pdev, pm_message_t state)
 static int netdrv_resume (struct pci_dev *pdev)
 {
        struct net_device *dev = pci_get_drvdata (pdev);
-       struct netdrv_private *tp = dev->priv;
+       /*struct netdrv_private *tp = netdev_priv(dev);*/
 
        if (!netif_running(dev))
                return 0;
index 7fe03ce774b1e99d4c07f3b877f6a8a7d3d06841..f4ca0591231d233f63a2d98cb6036f106fde21c4 100644 (file)
@@ -60,6 +60,11 @@ config ICPLUS_PHY
        ---help---
          Currently supports the IP175C PHY.
 
+config REALTEK_PHY
+       tristate "Drivers for Realtek PHYs"
+       ---help---
+         Supports the Realtek 821x PHY.
+
 config FIXED_PHY
        bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs"
        ---help---
index 3d6cc7b67a800f209fc26b354a69c2eba3e8501c..5997d6ef702b979742d30642099411bb6aea815c 100644 (file)
@@ -12,5 +12,6 @@ obj-$(CONFIG_SMSC_PHY)                += smsc.o
 obj-$(CONFIG_VITESSE_PHY)      += vitesse.o
 obj-$(CONFIG_BROADCOM_PHY)     += broadcom.o
 obj-$(CONFIG_ICPLUS_PHY)       += icplus.o
+obj-$(CONFIG_REALTEK_PHY)      += realtek.o
 obj-$(CONFIG_FIXED_PHY)                += fixed.o
 obj-$(CONFIG_MDIO_BITBANG)     += mdio-bitbang.o
index 29666c85ed55936683e4cfc4b7dc0a1f03efb8dd..5b80358af65840926a1de33d4517e41396d6f835 100644 (file)
@@ -141,6 +141,20 @@ static struct phy_driver bcm5461_driver = {
        .driver         = { .owner = THIS_MODULE },
 };
 
+static struct phy_driver bcm5482_driver = {
+    .phy_id            = 0x0143bcb0,
+       .phy_id_mask    = 0xfffffff0,
+       .name           = "Broadcom BCM5482",
+       .features       = PHY_GBIT_FEATURES,
+       .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
+       .config_init    = bcm54xx_config_init,
+       .config_aneg    = genphy_config_aneg,
+       .read_status    = genphy_read_status,
+       .ack_interrupt  = bcm54xx_ack_interrupt,
+       .config_intr    = bcm54xx_config_intr,
+       .driver         = { .owner = THIS_MODULE },
+};
+
 static int __init broadcom_init(void)
 {
        int ret;
@@ -154,8 +168,13 @@ static int __init broadcom_init(void)
        ret = phy_driver_register(&bcm5461_driver);
        if (ret)
                goto out_5461;
+       ret = phy_driver_register(&bcm5482_driver);
+       if (ret)
+               goto out_5482;
        return ret;
 
+out_5482:
+       phy_driver_unregister(&bcm5461_driver);
 out_5461:
        phy_driver_unregister(&bcm5421_driver);
 out_5421:
@@ -166,6 +185,7 @@ out_5411:
 
 static void __exit broadcom_exit(void)
 {
+       phy_driver_unregister(&bcm5482_driver);
        phy_driver_unregister(&bcm5461_driver);
        phy_driver_unregister(&bcm5421_driver);
        phy_driver_unregister(&bcm5411_driver);
index c30196d0ad1681de95f5c14df66d8568c1200bd9..6e9f619c491f74837a7f356943683094169e28bf 100644 (file)
@@ -49,7 +49,7 @@ int mdiobus_register(struct mii_bus *bus)
        int i;
        int err = 0;
 
-       spin_lock_init(&bus->mdio_lock);
+       mutex_init(&bus->mdio_lock);
 
        if (NULL == bus || NULL == bus->name ||
                        NULL == bus->read ||
index 7c9e6e349503eaf2a7b91448a05a73d19e499bb8..12fccb1c76dc0c147e3291aaad803c8d5dbc9caf 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
-#include <linux/spinlock.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/mii.h>
@@ -72,9 +71,11 @@ int phy_read(struct phy_device *phydev, u16 regnum)
        int retval;
        struct mii_bus *bus = phydev->bus;
 
-       spin_lock_bh(&bus->mdio_lock);
+       BUG_ON(in_interrupt());
+
+       mutex_lock(&bus->mdio_lock);
        retval = bus->read(bus, phydev->addr, regnum);
-       spin_unlock_bh(&bus->mdio_lock);
+       mutex_unlock(&bus->mdio_lock);
 
        return retval;
 }
@@ -95,9 +96,11 @@ int phy_write(struct phy_device *phydev, u16 regnum, u16 val)
        int err;
        struct mii_bus *bus = phydev->bus;
 
-       spin_lock_bh(&bus->mdio_lock);
+       BUG_ON(in_interrupt());
+
+       mutex_lock(&bus->mdio_lock);
        err = bus->write(bus, phydev->addr, regnum, val);
-       spin_unlock_bh(&bus->mdio_lock);
+       mutex_unlock(&bus->mdio_lock);
 
        return err;
 }
@@ -428,7 +431,7 @@ int phy_start_aneg(struct phy_device *phydev)
 {
        int err;
 
-       spin_lock_bh(&phydev->lock);
+       mutex_lock(&phydev->lock);
 
        if (AUTONEG_DISABLE == phydev->autoneg)
                phy_sanitize_settings(phydev);
@@ -449,13 +452,14 @@ int phy_start_aneg(struct phy_device *phydev)
        }
 
 out_unlock:
-       spin_unlock_bh(&phydev->lock);
+       mutex_unlock(&phydev->lock);
        return err;
 }
 EXPORT_SYMBOL(phy_start_aneg);
 
 
 static void phy_change(struct work_struct *work);
+static void phy_state_machine(struct work_struct *work);
 static void phy_timer(unsigned long data);
 
 /**
@@ -476,6 +480,7 @@ void phy_start_machine(struct phy_device *phydev,
 {
        phydev->adjust_state = handler;
 
+       INIT_WORK(&phydev->state_queue, phy_state_machine);
        init_timer(&phydev->phy_timer);
        phydev->phy_timer.function = &phy_timer;
        phydev->phy_timer.data = (unsigned long) phydev;
@@ -493,11 +498,12 @@ void phy_start_machine(struct phy_device *phydev,
 void phy_stop_machine(struct phy_device *phydev)
 {
        del_timer_sync(&phydev->phy_timer);
+       cancel_work_sync(&phydev->state_queue);
 
-       spin_lock_bh(&phydev->lock);
+       mutex_lock(&phydev->lock);
        if (phydev->state > PHY_UP)
                phydev->state = PHY_UP;
-       spin_unlock_bh(&phydev->lock);
+       mutex_unlock(&phydev->lock);
 
        phydev->adjust_state = NULL;
 }
@@ -541,9 +547,9 @@ static void phy_force_reduction(struct phy_device *phydev)
  */
 void phy_error(struct phy_device *phydev)
 {
-       spin_lock_bh(&phydev->lock);
+       mutex_lock(&phydev->lock);
        phydev->state = PHY_HALTED;
-       spin_unlock_bh(&phydev->lock);
+       mutex_unlock(&phydev->lock);
 }
 
 /**
@@ -705,10 +711,10 @@ static void phy_change(struct work_struct *work)
        if (err)
                goto phy_err;
 
-       spin_lock_bh(&phydev->lock);
+       mutex_lock(&phydev->lock);
        if ((PHY_RUNNING == phydev->state) || (PHY_NOLINK == phydev->state))
                phydev->state = PHY_CHANGELINK;
-       spin_unlock_bh(&phydev->lock);
+       mutex_unlock(&phydev->lock);
 
        atomic_dec(&phydev->irq_disable);
        enable_irq(phydev->irq);
@@ -735,7 +741,7 @@ phy_err:
  */
 void phy_stop(struct phy_device *phydev)
 {
-       spin_lock_bh(&phydev->lock);
+       mutex_lock(&phydev->lock);
 
        if (PHY_HALTED == phydev->state)
                goto out_unlock;
@@ -751,7 +757,7 @@ void phy_stop(struct phy_device *phydev)
        phydev->state = PHY_HALTED;
 
 out_unlock:
-       spin_unlock_bh(&phydev->lock);
+       mutex_unlock(&phydev->lock);
 
        /*
         * Cannot call flush_scheduled_work() here as desired because
@@ -773,7 +779,7 @@ out_unlock:
  */
 void phy_start(struct phy_device *phydev)
 {
-       spin_lock_bh(&phydev->lock);
+       mutex_lock(&phydev->lock);
 
        switch (phydev->state) {
                case PHY_STARTING:
@@ -787,19 +793,26 @@ void phy_start(struct phy_device *phydev)
                default:
                        break;
        }
-       spin_unlock_bh(&phydev->lock);
+       mutex_unlock(&phydev->lock);
 }
 EXPORT_SYMBOL(phy_stop);
 EXPORT_SYMBOL(phy_start);
 
-/* PHY timer which handles the state machine */
-static void phy_timer(unsigned long data)
+/**
+ * phy_state_machine - Handle the state machine
+ * @work: work_struct that describes the work to be done
+ *
+ * Description: Scheduled by the state_queue workqueue each time
+ *   phy_timer is triggered.
+ */
+static void phy_state_machine(struct work_struct *work)
 {
-       struct phy_device *phydev = (struct phy_device *)data;
+       struct phy_device *phydev =
+                       container_of(work, struct phy_device, state_queue);
        int needs_aneg = 0;
        int err = 0;
 
-       spin_lock_bh(&phydev->lock);
+       mutex_lock(&phydev->lock);
 
        if (phydev->adjust_state)
                phydev->adjust_state(phydev->attached_dev);
@@ -965,7 +978,7 @@ static void phy_timer(unsigned long data)
                        break;
        }
 
-       spin_unlock_bh(&phydev->lock);
+       mutex_unlock(&phydev->lock);
 
        if (needs_aneg)
                err = phy_start_aneg(phydev);
@@ -976,3 +989,14 @@ static void phy_timer(unsigned long data)
        mod_timer(&phydev->phy_timer, jiffies + PHY_STATE_TIME * HZ);
 }
 
+/* PHY timer which schedules the state machine work */
+static void phy_timer(unsigned long data)
+{
+       struct phy_device *phydev = (struct phy_device *)data;
+
+       /*
+        * PHY I/O operations can potentially sleep so we ensure that
+        * it's done from a process context
+        */
+       schedule_work(&phydev->state_queue);
+}
index 5b9e1751e1b414fc0e50a99b13e0770cf69811a0..f4c4fd85425f6807bf8258da78cb14bb7ee7bd35 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
-#include <linux/spinlock.h>
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/mii.h>
@@ -80,7 +79,7 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
 
        dev->state = PHY_DOWN;
 
-       spin_lock_init(&dev->lock);
+       mutex_init(&dev->lock);
 
        return dev;
 }
@@ -656,7 +655,7 @@ static int phy_probe(struct device *dev)
        if (!(phydrv->flags & PHY_HAS_INTERRUPT))
                phydev->irq = PHY_POLL;
 
-       spin_lock_bh(&phydev->lock);
+       mutex_lock(&phydev->lock);
 
        /* Start out supporting everything. Eventually,
         * a controller will attach, and may modify one
@@ -670,7 +669,7 @@ static int phy_probe(struct device *dev)
        if (phydev->drv->probe)
                err = phydev->drv->probe(phydev);
 
-       spin_unlock_bh(&phydev->lock);
+       mutex_unlock(&phydev->lock);
 
        return err;
 
@@ -682,9 +681,9 @@ static int phy_remove(struct device *dev)
 
        phydev = to_phy_device(dev);
 
-       spin_lock_bh(&phydev->lock);
+       mutex_lock(&phydev->lock);
        phydev->state = PHY_DOWN;
-       spin_unlock_bh(&phydev->lock);
+       mutex_unlock(&phydev->lock);
 
        if (phydev->drv->remove)
                phydev->drv->remove(phydev);
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
new file mode 100644 (file)
index 0000000..a052a67
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * drivers/net/phy/realtek.c
+ *
+ * Driver for Realtek PHYs
+ *
+ * Author: Johnson Leung <r58129@freescale.com>
+ *
+ * Copyright (c) 2004 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+#include <linux/phy.h>
+
+#define RTL821x_PHYSR          0x11
+#define RTL821x_PHYSR_DUPLEX   0x2000
+#define RTL821x_PHYSR_SPEED    0xc000
+#define RTL821x_INER           0x12
+#define RTL821x_INER_INIT      0x6400
+#define RTL821x_INSR           0x13
+
+MODULE_DESCRIPTION("Realtek PHY driver");
+MODULE_AUTHOR("Johnson Leung");
+MODULE_LICENSE("GPL");
+
+static int rtl821x_ack_interrupt(struct phy_device *phydev)
+{
+       int err;
+
+       err = phy_read(phydev, RTL821x_INSR);
+
+       return (err < 0) ? err : 0;
+}
+
+static int rtl821x_config_intr(struct phy_device *phydev)
+{
+       int err;
+
+       if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
+               err = phy_write(phydev, RTL821x_INER,
+                               RTL821x_INER_INIT);
+       else
+               err = phy_write(phydev, RTL821x_INER, 0);
+
+       return err;
+}
+
+/* RTL8211B */
+static struct phy_driver rtl821x_driver = {
+       .phy_id         = 0x001cc912,
+       .name           = "RTL821x Gigabit Ethernet",
+       .phy_id_mask    = 0x001fffff,
+       .features       = PHY_GBIT_FEATURES,
+       .flags          = PHY_HAS_INTERRUPT,
+       .config_aneg    = &genphy_config_aneg,
+       .read_status    = &genphy_read_status,
+       .ack_interrupt  = &rtl821x_ack_interrupt,
+       .config_intr    = &rtl821x_config_intr,
+       .driver         = { .owner = THIS_MODULE,},
+};
+
+static int __init realtek_init(void)
+{
+       int ret;
+
+       ret = phy_driver_register(&rtl821x_driver);
+
+       return ret;
+}
+
+static void __exit realtek_exit(void)
+{
+       phy_driver_unregister(&rtl821x_driver);
+}
+
+module_init(realtek_init);
+module_exit(realtek_exit);
index 5fab7d7b5d74a430dd9e72870ba347fa38d07f47..6179a0a2032c0ec50681d8f02bb5a693baf6b8d4 100644 (file)
@@ -8118,7 +8118,7 @@ static void initiate_new_session(struct lro *lro, u8 *l2h,
        lro->iph = ip;
        lro->tcph = tcp;
        lro->tcp_next_seq = tcp_pyld_len + ntohl(tcp->seq);
-       lro->tcp_ack = ntohl(tcp->ack_seq);
+       lro->tcp_ack = tcp->ack_seq;
        lro->sg_num = 1;
        lro->total_len = ntohs(ip->tot_len);
        lro->frags_len = 0;
@@ -8127,10 +8127,10 @@ static void initiate_new_session(struct lro *lro, u8 *l2h,
         * already been done.
         */
        if (tcp->doff == 8) {
-               u32 *ptr;
-               ptr = (u32 *)(tcp+1);
+               __be32 *ptr;
+               ptr = (__be32 *)(tcp+1);
                lro->saw_ts = 1;
-               lro->cur_tsval = *(ptr+1);
+               lro->cur_tsval = ntohl(*(ptr+1));
                lro->cur_tsecr = *(ptr+2);
        }
        lro->in_use = 1;
@@ -8156,7 +8156,7 @@ static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro)
 
        /* Update tsecr field if this session has timestamps enabled */
        if (lro->saw_ts) {
-               u32 *ptr = (u32 *)(tcp + 1);
+               __be32 *ptr = (__be32 *)(tcp + 1);
                *(ptr+2) = lro->cur_tsecr;
        }
 
@@ -8181,10 +8181,10 @@ static void aggregate_new_rx(struct lro *lro, struct iphdr *ip,
        lro->window = tcp->window;
 
        if (lro->saw_ts) {
-               u32 *ptr;
+               __be32 *ptr;
                /* Update tsecr and tsval from this packet */
-               ptr = (u32 *) (tcp + 1);
-               lro->cur_tsval = *(ptr + 1);
+               ptr = (__be32 *)(tcp+1);
+               lro->cur_tsval = ntohl(*(ptr+1));
                lro->cur_tsecr = *(ptr + 2);
        }
 }
@@ -8235,11 +8235,11 @@ static int verify_l3_l4_lro_capable(struct lro *l_lro, struct iphdr *ip,
 
                /* Ensure timestamp value increases monotonically */
                if (l_lro)
-                       if (l_lro->cur_tsval > *((u32 *)(ptr+2)))
+                       if (l_lro->cur_tsval > ntohl(*((__be32 *)(ptr+2))))
                                return -1;
 
                /* timestamp echo reply should be non-zero */
-               if (*((u32 *)(ptr+6)) == 0)
+               if (*((__be32 *)(ptr+6)) == 0)
                        return -1;
        }
 
index 9f6016c6f135a1fc9c7336bf8fd0df4ebba98b76..64b88eb48287d2d583897af67889e6474beebaa6 100644 (file)
@@ -809,7 +809,7 @@ struct lro {
        int             in_use;
        __be16          window;
        u32             cur_tsval;
-       u32             cur_tsecr;
+       __be32          cur_tsecr;
        u8              saw_ts;
 };
 
index b570402f7feda2a06fc975a5aaf82e19b1f45432..2e9e88be7b33f59558a06a22f06fee363805755d 100644 (file)
@@ -326,7 +326,7 @@ static const struct {
        { "SiS 191 PCI Gigabit Ethernet adapter" },
 };
 
-static struct pci_device_id sis190_pci_tbl[] __devinitdata = {
+static struct pci_device_id sis190_pci_tbl[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0190), 0, 0, 0 },
        { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x0191), 0, 0, 1 },
        { 0, },
index 62b01328c496c4e3678bf8b5b7fe7e1950470895..889f987246104a7765930e2b953e4c0826d9e2e3 100644 (file)
@@ -598,7 +598,7 @@ static void ess_send_alc_req(struct s_smc *smc)
        req->cmd.sba_cmd = REQUEST_ALLOCATION ;
 
        /*
-        * set the parameter type and parameter lenght of all used
+        * set the parameter type and parameter length of all used
         * parameters
         */
 
index a45205da8033d6eb8aea4d56df39fe4375ffb99b..76dc8adc9441ea3f563d72b63491259d2ad3563f 100644 (file)
@@ -398,7 +398,7 @@ static void copy_tx_mac(struct s_smc *smc, u_long td, struct fddi_mac *mac,
 /* u_long td;           transmit descriptor */
 /* struct fddi_mac *mac; mac frame pointer */
 /* unsigned off;        start address within buffer memory */
-/* int len ;            lenght of the frame including the FC */
+/* int len ;            length of the frame including the FC */
 {
        int     i ;
        u_int   *p ;
index 8a430a36654705fdc5fba5be36b20d3342db5aa4..46e339315656b793315097cc722b1cf726b29791 100644 (file)
@@ -1185,7 +1185,7 @@ void process_receive(struct s_smc *smc)
 
                DB_RX("frame length = %d",len,0,4) ;
                /*
-                * check the frame_lenght and all error flags
+                * check the frame_length and all error flags
                 */
                if (rfsw & (RX_MSRABT|RX_FS_E|RX_FS_CRC|RX_FS_IMPL)){
                        if (rfsw & RD_S_MSRABT) {
index 626190eb91e7ba567ea3c35ef9d26dac2aaf9b7e..dc062367a1c8b515138b7023921d81e31eac82d4 100644 (file)
@@ -623,6 +623,7 @@ static void sky2_phy_power(struct sky2_hw *hw, unsigned port, int onoff)
        static const u32 phy_power[] = { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD };
        static const u32 coma_mode[] = { PCI_Y2_PHY1_COMA, PCI_Y2_PHY2_COMA };
 
+       sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
        reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
        /* Turn on/off phy power saving */
        if (onoff)
@@ -634,7 +635,8 @@ static void sky2_phy_power(struct sky2_hw *hw, unsigned port, int onoff)
                reg1 |= coma_mode[port];
 
        sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
-       reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+       sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
+       sky2_pci_read32(hw, PCI_DEV_REG1);
 
        udelay(100);
 }
@@ -1422,6 +1424,7 @@ static int sky2_up(struct net_device *dev)
        imask |= portirq_msk[port];
        sky2_write32(hw, B0_IMSK, imask);
 
+       sky2_set_multicast(dev);
        return 0;
 
 err_out:
@@ -2436,6 +2439,7 @@ static void sky2_hw_intr(struct sky2_hw *hw)
        if (status & (Y2_IS_MST_ERR | Y2_IS_IRQ_STAT)) {
                u16 pci_err;
 
+               sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
                pci_err = sky2_pci_read16(hw, PCI_STATUS);
                if (net_ratelimit())
                        dev_err(&pdev->dev, "PCI hardware error (0x%x)\n",
@@ -2443,12 +2447,14 @@ static void sky2_hw_intr(struct sky2_hw *hw)
 
                sky2_pci_write16(hw, PCI_STATUS,
                                      pci_err | PCI_STATUS_ERROR_BITS);
+               sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
        }
 
        if (status & Y2_IS_PCI_EXP) {
                /* PCI-Express uncorrectable Error occurred */
                u32 err;
 
+               sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
                err = sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
                sky2_write32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS,
                             0xfffffffful);
@@ -2456,6 +2462,7 @@ static void sky2_hw_intr(struct sky2_hw *hw)
                        dev_err(&pdev->dev, "PCI Express error (0x%x)\n", err);
 
                sky2_read32(hw, Y2_CFG_AER + PCI_ERR_UNCOR_STATUS);
+               sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
        }
 
        if (status & Y2_HWE_L1_MASK)
@@ -2831,6 +2838,7 @@ static void sky2_reset(struct sky2_hw *hw)
        }
 
        sky2_power_on(hw);
+       sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
 
        for (i = 0; i < hw->ports; i++) {
                sky2_write8(hw, SK_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET);
@@ -3554,8 +3562,6 @@ static int sky2_set_ringparam(struct net_device *dev,
                err = sky2_up(dev);
                if (err)
                        dev_close(dev);
-               else
-                       sky2_set_multicast(dev);
        }
 
        return err;
@@ -4389,8 +4395,6 @@ static int sky2_resume(struct pci_dev *pdev)
                                dev_close(dev);
                                goto out;
                        }
-
-                       sky2_set_multicast(dev);
                }
        }
 
index fe3ac6f9ae89cd77d26328f50654ba95b180ddd9..0e4a88d16327914a42af9116cdbc8db42443dd27 100644 (file)
@@ -1075,7 +1075,7 @@ static const struct ethtool_ops bigmac_ethtool_ops = {
        .get_link               = bigmac_get_link,
 };
 
-static int __init bigmac_ether_init(struct sbus_dev *qec_sdev)
+static int __devinit bigmac_ether_init(struct sbus_dev *qec_sdev)
 {
        struct net_device *dev;
        static int version_printed;
index ff23c6489efd33033d4cfd3f287cdd343805f0a7..e811331d4608a86abc8514848cdacddf73b83123 100644 (file)
@@ -747,7 +747,7 @@ static inline void qec_init_once(struct sunqec *qecp, struct sbus_dev *qsdev)
                    qecp->gregs + GLOB_RSIZE);
 }
 
-static u8 __init qec_get_burst(struct device_node *dp)
+static u8 __devinit qec_get_burst(struct device_node *dp)
 {
        u8 bsizes, bsizes_more;
 
@@ -767,7 +767,7 @@ static u8 __init qec_get_burst(struct device_node *dp)
        return bsizes;
 }
 
-static struct sunqec * __init get_qec(struct sbus_dev *child_sdev)
+static struct sunqec * __devinit get_qec(struct sbus_dev *child_sdev)
 {
        struct sbus_dev *qec_sdev = child_sdev->parent;
        struct sunqec *qecp;
@@ -823,7 +823,7 @@ fail:
        return NULL;
 }
 
-static int __init qec_ether_init(struct sbus_dev *sdev)
+static int __devinit qec_ether_init(struct sbus_dev *sdev)
 {
        static unsigned version_printed;
        struct net_device *dev;
index 4a0035f7a842471df9e39e0dfd8bef3d896b24cc..6415ce15c2efef51721b0a50b181ee296f98ad28 100644 (file)
@@ -1130,7 +1130,7 @@ static struct vio_driver_ops vnet_vio_ops = {
        .handshake_complete     = vnet_handshake_complete,
 };
 
-static void print_version(void)
+static void __devinit print_version(void)
 {
        static int version_printed;
 
index 124cfd4fbcf4f7004941dadefff88345c9320a11..7a7de0469eae098412036df35e8b9b636e291622 100644 (file)
@@ -10,7 +10,7 @@
  *      - Madge Smart 16/4 PCI Mk2
  *
  *  Maintainer(s):
- *    AF       Adam Fritzler           mid@auk.cx
+ *    AF       Adam Fritzler
  *
  *  Modification History:
  *     30-Dec-99       AF      Split off from the tms380tr driver.
index 0ee6e4f085b157dedcb306337011c7043f016fc6..b0a473b89133b03199a6822de64cd37592418556 100644 (file)
@@ -2,7 +2,7 @@
  * abyss.h: Header for the abyss tms380tr module
  *
  * Authors:
- * - Adam Fritzler <mid@auk.cx>
+ * - Adam Fritzler
  */
 
 #ifndef __LINUX_MADGETR_H
index 5a4151362fc064034389861794e2cee6cc0e0ddb..c9c5a2b1ed9e9ea6a49d8e5f2af22e9799adb403 100644 (file)
@@ -11,7 +11,7 @@
  *     - Madge Smart 16/4 Ringnode MC32 (??)
  *
  *  Maintainer(s):
- *    AF       Adam Fritzler           mid@auk.cx
+ *    AF       Adam Fritzler
  *
  *  Modification History:
  *     16-Jan-00       AF      Created
index 2dd822203809053248721d79f93d65a869c7cfca..fe88e272c531c85020204516e0aeae60853938d9 100644 (file)
@@ -2,7 +2,7 @@
  * madgemc.h: Header for the madgemc tms380tr module
  *
  * Authors:
- * - Adam Fritzler <mid@auk.cx>
+ * - Adam Fritzler
  */
 
 #ifndef __LINUX_MADGEMC_H
index e7b4adc5c4e79d3ed3faee86b992669b895c56e3..433c994ea9d87e2daf5aa2504e42a8f4b791a8d3 100644 (file)
@@ -434,7 +434,7 @@ static int __devinit olympic_init(struct net_device *dev)
 
 }
 
-static int olympic_open(struct net_device *dev) 
+static int __devinit olympic_open(struct net_device *dev) 
 {
        struct olympic_private *olympic_priv=netdev_priv(dev);
        u8 __iomem *olympic_mmio=olympic_priv->olympic_mmio,*init_srb;
index ca6b65919b3d0bf00806b64349cef355a7edb919..00ea94513460d5e118b811a3496625b98ad4a9cb 100644 (file)
@@ -12,7 +12,7 @@
  *     - Proteon 1392, 1392+
  *
  *  Maintainer(s):
- *    AF        Adam Fritzler           mid@auk.cx
+ *    AF        Adam Fritzler
  *    JF       Jochen Friedrich        jochen@scram.de
  *
  *  Modification History:
index 32e8d5a9f958fa354067b98da188dbebe5a23b57..41b6999a0f33487719f56898a489c9748b975f7f 100644 (file)
@@ -13,7 +13,7 @@
  *     - SysKonnect TR4/16(+) ISA      (SK-4190)
  *
  *  Maintainer(s):
- *    AF        Adam Fritzler           mid@auk.cx
+ *    AF        Adam Fritzler
  *    JF       Jochen Friedrich        jochen@scram.de
  *
  *  Modification History:
index d5fa36d3651591d62b8f1fb3cb305500b187d551..d07c4523c847a1ceb3c4e98876c1cce025459b2c 100644 (file)
@@ -30,7 +30,7 @@
  *  Maintainer(s):
  *    JS       Jay Schulist            jschlst@samba.org
  *    CG       Christoph Goos          cgoos@syskonnect.de
- *    AF       Adam Fritzler           mid@auk.cx
+ *    AF       Adam Fritzler
  *    MLP       Mike Phillips           phillim@amtrak.com
  *    JF       Jochen Friedrich        jochen@scram.de
  *     
index 7daf74e31ccd58a2426c5c33512e93ecec2f2e7e..7af76d7088490f61b57af4adcf832c7b16a018f7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Authors:
  * - Christoph Goos <cgoos@syskonnect.de>
- * - Adam Fritzler <mid@auk.cx>
+ * - Adam Fritzler
  */
 
 #ifndef __LINUX_TMS380TR_H
index 1c18f782f522225fb0467b8fcb460a4aa33afa98..5f0ee880cfff1f7fa4d7c5096265322f043bef39 100644 (file)
@@ -14,7 +14,7 @@
  *      - 3Com 3C339 Token Link Velocity
  *
  *  Maintainer(s):
- *    AF       Adam Fritzler           mid@auk.cx
+ *    AF       Adam Fritzler
  *
  *  Modification History:
  *     30-Dec-99       AF      Split off from the tms380tr driver.
index 4ffd8739f8b72aacaff9f0aa908b0b3cc00e135f..fba0811d2608824bfebd0535b37cc21d14dd9859 100644 (file)
@@ -2084,8 +2084,10 @@ static void ucc_geth_memclean(struct ucc_geth_private *ugeth)
        if (!ugeth)
                return;
 
-       if (ugeth->uccf)
+       if (ugeth->uccf) {
                ucc_fast_free(ugeth->uccf);
+               ugeth->uccf = NULL;
+       }
 
        if (ugeth->p_thread_data_tx) {
                qe_muram_free(ugeth->thread_dat_tx_offset);
@@ -2305,10 +2307,6 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth)
        ug_info = ugeth->ug_info;
        uf_info = &ug_info->uf_info;
 
-       /* Create CQs for hash tables */
-       INIT_LIST_HEAD(&ugeth->group_hash_q);
-       INIT_LIST_HEAD(&ugeth->ind_hash_q);
-
        if (!((uf_info->bd_mem_part == MEM_PART_SYSTEM) ||
              (uf_info->bd_mem_part == MEM_PART_MURAM))) {
                if (netif_msg_probe(ugeth))
@@ -3668,6 +3666,23 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info)
        return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+/*
+ * Polling 'interrupt' - used by things like netconsole to send skbs
+ * without having to re-enable interrupts. It's not called while
+ * the interrupt routine is executing.
+ */
+static void ucc_netpoll(struct net_device *dev)
+{
+       struct ucc_geth_private *ugeth = netdev_priv(dev);
+       int irq = ugeth->ug_info->uf_info.irq;
+
+       disable_irq(irq);
+       ucc_geth_irq_handler(irq, dev);
+       enable_irq(irq);
+}
+#endif /* CONFIG_NET_POLL_CONTROLLER */
+
 /* Called when something needs to use the ethernet device */
 /* Returns 0 for success. */
 static int ucc_geth_open(struct net_device *dev)
@@ -3990,6 +4005,10 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
        ugeth = netdev_priv(dev);
        spin_lock_init(&ugeth->lock);
 
+       /* Create CQs for hash tables */
+       INIT_LIST_HEAD(&ugeth->group_hash_q);
+       INIT_LIST_HEAD(&ugeth->ind_hash_q);
+
        dev_set_drvdata(device, dev);
 
        /* Set the dev->base_addr to the gfar reg region */
@@ -4006,6 +4025,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 #ifdef CONFIG_UGETH_NAPI
        netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, UCC_GETH_DEV_WEIGHT);
 #endif                         /* CONFIG_UGETH_NAPI */
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       dev->poll_controller = ucc_netpoll;
+#endif
        dev->stop = ucc_geth_close;
 //    dev->change_mtu = ucc_geth_change_mtu;
        dev->mtu = 1500;
@@ -4040,9 +4062,10 @@ static int ucc_geth_remove(struct of_device* ofdev)
        struct net_device *dev = dev_get_drvdata(device);
        struct ucc_geth_private *ugeth = netdev_priv(dev);
 
-       dev_set_drvdata(device, NULL);
-       ucc_geth_memclean(ugeth);
+       unregister_netdev(dev);
        free_netdev(dev);
+       ucc_geth_memclean(ugeth);
+       dev_set_drvdata(device, NULL);
 
        return 0;
 }
index 33cbc306226c67a9a98019d34c4b7eb1ba52b0d5..7e1f00131f91160833e023f416ae2834afeb52cf 100644 (file)
@@ -926,7 +926,6 @@ static int rtl8150_probe(struct usb_interface *intf,
        netdev->set_multicast_list = rtl8150_set_multicast;
        netdev->set_mac_address = rtl8150_set_mac_address;
        netdev->get_stats = rtl8150_netdev_stats;
-       netdev->mtu = RTL8150_MTU;
        SET_ETHTOOL_OPS(netdev, &ops);
        dev->intr_interval = 100;       /* 100ms */
 
index 87c180b563d36dc6623c52df7a5fb2111e8155c1..7c851b1e6daa4ba99e4d107213fca4abb34c76b4 100644 (file)
@@ -606,7 +606,7 @@ static int rhine_napipoll(struct napi_struct *napi, int budget)
 }
 #endif
 
-static void rhine_hw_init(struct net_device *dev, long pioaddr)
+static void __devinit rhine_hw_init(struct net_device *dev, long pioaddr)
 {
        struct rhine_private *rp = netdev_priv(dev);
 
index 35cd65d6b9edcdad5080e31ba52cc56b77b6b777..8c9fb824cbd4015afe9685ba9b8bc20a0c4b13e8 100644 (file)
@@ -8,7 +8,6 @@
  * for 64bit hardware platforms.
  *
  * TODO
- *     Big-endian support
  *     rx_copybreak/alignment
  *     Scatter gather
  *     More testing
@@ -681,7 +680,7 @@ static void velocity_rx_reset(struct velocity_info *vptr)
         *      Init state, all RD entries belong to the NIC
         */
        for (i = 0; i < vptr->options.numrx; ++i)
-               vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC;
+               vptr->rd_ring[i].rdesc0.len |= OWNED_BY_NIC;
 
        writew(vptr->options.numrx, &regs->RBRDU);
        writel(vptr->rd_pool_dma, &regs->RDBaseLo);
@@ -777,7 +776,7 @@ static void velocity_init_registers(struct velocity_info *vptr,
 
                vptr->int_mask = INT_MASK_DEF;
 
-               writel(cpu_to_le32(vptr->rd_pool_dma), &regs->RDBaseLo);
+               writel(vptr->rd_pool_dma, &regs->RDBaseLo);
                writew(vptr->options.numrx - 1, &regs->RDCSize);
                mac_rx_queue_run(regs);
                mac_rx_queue_wake(regs);
@@ -785,7 +784,7 @@ static void velocity_init_registers(struct velocity_info *vptr,
                writew(vptr->options.numtx - 1, &regs->TDCSize);
 
                for (i = 0; i < vptr->num_txq; i++) {
-                       writel(cpu_to_le32(vptr->td_pool_dma[i]), &(regs->TDBaseLo[i]));
+                       writel(vptr->td_pool_dma[i], &regs->TDBaseLo[i]);
                        mac_tx_queue_run(regs, i);
                }
 
@@ -1195,7 +1194,7 @@ static inline void velocity_give_many_rx_descs(struct velocity_info *vptr)
        dirty = vptr->rd_dirty - unusable;
        for (avail = vptr->rd_filled & 0xfffc; avail; avail--) {
                dirty = (dirty > 0) ? dirty - 1 : vptr->options.numrx - 1;
-               vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC;
+               vptr->rd_ring[dirty].rdesc0.len |= OWNED_BY_NIC;
        }
 
        writew(vptr->rd_filled & 0xfffc, &regs->RBRDU);
@@ -1210,7 +1209,7 @@ static int velocity_rx_refill(struct velocity_info *vptr)
                struct rx_desc *rd = vptr->rd_ring + dirty;
 
                /* Fine for an all zero Rx desc at init time as well */
-               if (rd->rdesc0.owner == OWNED_BY_NIC)
+               if (rd->rdesc0.len & OWNED_BY_NIC)
                        break;
 
                if (!vptr->rd_info[dirty].skb) {
@@ -1413,7 +1412,7 @@ static int velocity_rx_srv(struct velocity_info *vptr, int status)
                if (!vptr->rd_info[rd_curr].skb)
                        break;
 
-               if (rd->rdesc0.owner == OWNED_BY_NIC)
+               if (rd->rdesc0.len & OWNED_BY_NIC)
                        break;
 
                rmb();
@@ -1421,7 +1420,7 @@ static int velocity_rx_srv(struct velocity_info *vptr, int status)
                /*
                 *      Don't drop CE or RL error frame although RXOK is off
                 */
-               if ((rd->rdesc0.RSR & RSR_RXOK) || (!(rd->rdesc0.RSR & RSR_RXOK) && (rd->rdesc0.RSR & (RSR_CE | RSR_RL)))) {
+               if (rd->rdesc0.RSR & (RSR_RXOK | RSR_CE | RSR_RL)) {
                        if (velocity_receive_frame(vptr, rd_curr) < 0)
                                stats->rx_dropped++;
                } else {
@@ -1433,7 +1432,7 @@ static int velocity_rx_srv(struct velocity_info *vptr, int status)
                        stats->rx_dropped++;
                }
 
-               rd->inten = 1;
+               rd->size |= RX_INTEN;
 
                vptr->dev->last_rx = jiffies;
 
@@ -1554,7 +1553,7 @@ static int velocity_receive_frame(struct velocity_info *vptr, int idx)
        struct net_device_stats *stats = &vptr->stats;
        struct velocity_rd_info *rd_info = &(vptr->rd_info[idx]);
        struct rx_desc *rd = &(vptr->rd_ring[idx]);
-       int pkt_len = rd->rdesc0.len;
+       int pkt_len = le16_to_cpu(rd->rdesc0.len) & 0x3fff;
        struct sk_buff *skb;
 
        if (rd->rdesc0.RSR & (RSR_STP | RSR_EDP)) {
@@ -1637,8 +1636,7 @@ static int velocity_alloc_rx_buf(struct velocity_info *vptr, int idx)
         */
 
        *((u32 *) & (rd->rdesc0)) = 0;
-       rd->len = cpu_to_le32(vptr->rx_buf_sz);
-       rd->inten = 1;
+       rd->size = cpu_to_le16(vptr->rx_buf_sz) | RX_INTEN;
        rd->pa_low = cpu_to_le32(rd_info->skb_dma);
        rd->pa_high = 0;
        return 0;
@@ -1674,7 +1672,7 @@ static int velocity_tx_srv(struct velocity_info *vptr, u32 status)
                        td = &(vptr->td_rings[qnum][idx]);
                        tdinfo = &(vptr->td_infos[qnum][idx]);
 
-                       if (td->tdesc0.owner == OWNED_BY_NIC)
+                       if (td->tdesc0.len & OWNED_BY_NIC)
                                break;
 
                        if ((works++ > 15))
@@ -1874,7 +1872,7 @@ static void velocity_free_tx_buf(struct velocity_info *vptr, struct velocity_td_
 
                for (i = 0; i < tdinfo->nskb_dma; i++) {
 #ifdef VELOCITY_ZERO_COPY_SUPPORT
-                       pci_unmap_single(vptr->pdev, tdinfo->skb_dma[i], td->tdesc1.len, PCI_DMA_TODEVICE);
+                       pci_unmap_single(vptr->pdev, tdinfo->skb_dma[i], le16_to_cpu(td->tdesc1.len), PCI_DMA_TODEVICE);
 #else
                        pci_unmap_single(vptr->pdev, tdinfo->skb_dma[i], skb->len, PCI_DMA_TODEVICE);
 #endif
@@ -2067,8 +2065,8 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
        struct velocity_td_info *tdinfo;
        unsigned long flags;
        int index;
-
        int pktlen = skb->len;
+       __le16 len = cpu_to_le16(pktlen);
 
 #ifdef VELOCITY_ZERO_COPY_SUPPORT
        if (skb_shinfo(skb)->nr_frags > 6 && __skb_linearize(skb)) {
@@ -2083,9 +2081,8 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
        td_ptr = &(vptr->td_rings[qnum][index]);
        tdinfo = &(vptr->td_infos[qnum][index]);
 
-       td_ptr->tdesc1.TCPLS = TCPLS_NORMAL;
        td_ptr->tdesc1.TCR = TCR0_TIC;
-       td_ptr->td_buf[0].queue = 0;
+       td_ptr->td_buf[0].size &= ~TD_QUEUE;
 
        /*
         *      Pad short frames.
@@ -2093,16 +2090,16 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
        if (pktlen < ETH_ZLEN) {
                /* Cannot occur until ZC support */
                pktlen = ETH_ZLEN;
+               len = cpu_to_le16(ETH_ZLEN);
                skb_copy_from_linear_data(skb, tdinfo->buf, skb->len);
                memset(tdinfo->buf + skb->len, 0, ETH_ZLEN - skb->len);
                tdinfo->skb = skb;
                tdinfo->skb_dma[0] = tdinfo->buf_dma;
-               td_ptr->tdesc0.pktsize = pktlen;
+               td_ptr->tdesc0.len = len;
                td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
                td_ptr->td_buf[0].pa_high = 0;
-               td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+               td_ptr->td_buf[0].size = len;   /* queue is 0 anyway */
                tdinfo->nskb_dma = 1;
-               td_ptr->tdesc1.CMDZ = 2;
        } else
 #ifdef VELOCITY_ZERO_COPY_SUPPORT
        if (skb_shinfo(skb)->nr_frags > 0) {
@@ -2111,36 +2108,35 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
                if (nfrags > 6) {
                        skb_copy_from_linear_data(skb, tdinfo->buf, skb->len);
                        tdinfo->skb_dma[0] = tdinfo->buf_dma;
-                       td_ptr->tdesc0.pktsize =
+                       td_ptr->tdesc0.len = len;
                        td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
                        td_ptr->td_buf[0].pa_high = 0;
-                       td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+                       td_ptr->td_buf[0].size = len;   /* queue is 0 anyway */
                        tdinfo->nskb_dma = 1;
-                       td_ptr->tdesc1.CMDZ = 2;
                } else {
                        int i = 0;
                        tdinfo->nskb_dma = 0;
-                       tdinfo->skb_dma[i] = pci_map_single(vptr->pdev, skb->data, skb->len - skb->data_len, PCI_DMA_TODEVICE);
+                       tdinfo->skb_dma[i] = pci_map_single(vptr->pdev, skb->data,
+                                               skb_headlen(skb), PCI_DMA_TODEVICE);
 
-                       td_ptr->tdesc0.pktsize = pktlen;
+                       td_ptr->tdesc0.len = len;
 
                        /* FIXME: support 48bit DMA later */
                        td_ptr->td_buf[i].pa_low = cpu_to_le32(tdinfo->skb_dma);
                        td_ptr->td_buf[i].pa_high = 0;
-                       td_ptr->td_buf[i].bufsize = skb->len->skb->data_len;
+                       td_ptr->td_buf[i].size = cpu_to_le16(skb_headlen(skb));
 
                        for (i = 0; i < nfrags; i++) {
                                skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
-                               void *addr = ((void *) page_address(frag->page + frag->page_offset));
+                               void *addr = (void *)page_address(frag->page) + frag->page_offset;
 
                                tdinfo->skb_dma[i + 1] = pci_map_single(vptr->pdev, addr, frag->size, PCI_DMA_TODEVICE);
 
                                td_ptr->td_buf[i + 1].pa_low = cpu_to_le32(tdinfo->skb_dma[i + 1]);
                                td_ptr->td_buf[i + 1].pa_high = 0;
-                               td_ptr->td_buf[i + 1].bufsize = frag->size;
+                               td_ptr->td_buf[i + 1].size = cpu_to_le16(frag->size);
                        }
                        tdinfo->nskb_dma = i - 1;
-                       td_ptr->tdesc1.CMDZ = i;
                }
 
        } else
@@ -2152,18 +2148,16 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
                 */
                tdinfo->skb = skb;
                tdinfo->skb_dma[0] = pci_map_single(vptr->pdev, skb->data, pktlen, PCI_DMA_TODEVICE);
-               td_ptr->tdesc0.pktsize = pktlen;
+               td_ptr->tdesc0.len = len;
                td_ptr->td_buf[0].pa_low = cpu_to_le32(tdinfo->skb_dma[0]);
                td_ptr->td_buf[0].pa_high = 0;
-               td_ptr->td_buf[0].bufsize = td_ptr->tdesc0.pktsize;
+               td_ptr->td_buf[0].size = len;
                tdinfo->nskb_dma = 1;
-               td_ptr->tdesc1.CMDZ = 2;
        }
+       td_ptr->tdesc1.cmd = TCPLS_NORMAL + (tdinfo->nskb_dma + 1) * 16;
 
        if (vptr->vlgrp && vlan_tx_tag_present(skb)) {
-               td_ptr->tdesc1.pqinf.VID = vlan_tx_tag_get(skb);
-               td_ptr->tdesc1.pqinf.priority = 0;
-               td_ptr->tdesc1.pqinf.CFI = 0;
+               td_ptr->tdesc1.vlan = cpu_to_le16(vlan_tx_tag_get(skb));
                td_ptr->tdesc1.TCR |= TCR0_VETAG;
        }
 
@@ -2185,7 +2179,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
 
                if (prev < 0)
                        prev = vptr->options.numtx - 1;
-               td_ptr->tdesc0.owner = OWNED_BY_NIC;
+               td_ptr->tdesc0.len |= OWNED_BY_NIC;
                vptr->td_used[qnum]++;
                vptr->td_curr[qnum] = (index + 1) % vptr->options.numtx;
 
@@ -2193,7 +2187,7 @@ static int velocity_xmit(struct sk_buff *skb, struct net_device *dev)
                        netif_stop_queue(dev);
 
                td_ptr = &(vptr->td_rings[qnum][prev]);
-               td_ptr->td_buf[0].queue = 1;
+               td_ptr->td_buf[0].size |= TD_QUEUE;
                mac_tx_queue_wake(vptr->mac_regs, qnum);
        }
        dev->trans_start = jiffies;
@@ -3410,7 +3404,7 @@ static int velocity_suspend(struct pci_dev *pdev, pm_message_t state)
                velocity_save_context(vptr, &vptr->context);
                velocity_shutdown(vptr);
                velocity_set_wol(vptr);
-               pci_enable_wake(pdev, 3, 1);
+               pci_enable_wake(pdev, PCI_D3hot, 1);
                pci_set_power_state(pdev, PCI_D3hot);
        } else {
                velocity_save_context(vptr, &vptr->context);
index aa9179623d9048957f50037cd0c7f7a285532342..7387be4f428d66aa1ea29324c718e498303b25d9 100644 (file)
  * Bits in the RSR0 register
  */
 
-#define RSR_DETAG          0x0080
-#define RSR_SNTAG          0x0040
-#define RSR_RXER           0x0020
-#define RSR_RL             0x0010
-#define RSR_CE             0x0008
-#define RSR_FAE            0x0004
-#define RSR_CRC            0x0002
-#define RSR_VIDM           0x0001
+#define RSR_DETAG      cpu_to_le16(0x0080)
+#define RSR_SNTAG      cpu_to_le16(0x0040)
+#define RSR_RXER       cpu_to_le16(0x0020)
+#define RSR_RL         cpu_to_le16(0x0010)
+#define RSR_CE         cpu_to_le16(0x0008)
+#define RSR_FAE                cpu_to_le16(0x0004)
+#define RSR_CRC                cpu_to_le16(0x0002)
+#define RSR_VIDM       cpu_to_le16(0x0001)
 
 /*
  * Bits in the RSR1 register
  */
 
-#define RSR_RXOK           0x8000      // rx OK
-#define RSR_PFT            0x4000      // Perfect filtering address match
-#define RSR_MAR            0x2000      // MAC accept multicast address packet
-#define RSR_BAR            0x1000      // MAC accept broadcast address packet
-#define RSR_PHY            0x0800      // MAC accept physical address packet
-#define RSR_VTAG           0x0400      // 802.1p/1q tagging packet indicator
-#define RSR_STP            0x0200      // start of packet
-#define RSR_EDP            0x0100      // end of packet
-
-/*
- * Bits in the RSR1 register
- */
-
-#define RSR1_RXOK           0x80       // rx OK
-#define RSR1_PFT            0x40       // Perfect filtering address match
-#define RSR1_MAR            0x20       // MAC accept multicast address packet
-#define RSR1_BAR            0x10       // MAC accept broadcast address packet
-#define RSR1_PHY            0x08       // MAC accept physical address packet
-#define RSR1_VTAG           0x04       // 802.1p/1q tagging packet indicator
-#define RSR1_STP            0x02       // start of packet
-#define RSR1_EDP            0x01       // end of packet
+#define RSR_RXOK       cpu_to_le16(0x8000) // rx OK
+#define RSR_PFT                cpu_to_le16(0x4000) // Perfect filtering address match
+#define RSR_MAR                cpu_to_le16(0x2000) // MAC accept multicast address packet
+#define RSR_BAR                cpu_to_le16(0x1000) // MAC accept broadcast address packet
+#define RSR_PHY                cpu_to_le16(0x0800) // MAC accept physical address packet
+#define RSR_VTAG       cpu_to_le16(0x0400) // 802.1p/1q tagging packet indicator
+#define RSR_STP                cpu_to_le16(0x0200) // start of packet
+#define RSR_EDP                cpu_to_le16(0x0100) // end of packet
 
 /*
  * Bits in the CSM register
  * Bits in the TSR0 register
  */
 
-#define TSR0_ABT            0x0080     // Tx abort because of excessive collision
-#define TSR0_OWT            0x0040     // Jumbo frame Tx abort
-#define TSR0_OWC            0x0020     // Out of window collision
-#define TSR0_COLS           0x0010     // experience collision in this transmit event
-#define TSR0_NCR3           0x0008     // collision retry counter[3]
-#define TSR0_NCR2           0x0004     // collision retry counter[2]
-#define TSR0_NCR1           0x0002     // collision retry counter[1]
-#define TSR0_NCR0           0x0001     // collision retry counter[0]
-#define TSR0_TERR           0x8000     //
-#define TSR0_FDX            0x4000     // current transaction is serviced by full duplex mode
-#define TSR0_GMII           0x2000     // current transaction is serviced by GMII mode
-#define TSR0_LNKFL          0x1000     // packet serviced during link down
-#define TSR0_SHDN           0x0400     // shutdown case
-#define TSR0_CRS            0x0200     // carrier sense lost
-#define TSR0_CDH            0x0100     // AQE test fail (CD heartbeat)
-
-/*
- * Bits in the TSR1 register
- */
-
-#define TSR1_TERR           0x80       //
-#define TSR1_FDX            0x40       // current transaction is serviced by full duplex mode
-#define TSR1_GMII           0x20       // current transaction is serviced by GMII mode
-#define TSR1_LNKFL          0x10       // packet serviced during link down
-#define TSR1_SHDN           0x04       // shutdown case
-#define TSR1_CRS            0x02       // carrier sense lost
-#define TSR1_CDH            0x01       // AQE test fail (CD heartbeat)
+#define TSR0_ABT       cpu_to_le16(0x0080) // Tx abort because of excessive collision
+#define TSR0_OWT       cpu_to_le16(0x0040) // Jumbo frame Tx abort
+#define TSR0_OWC       cpu_to_le16(0x0020) // Out of window collision
+#define TSR0_COLS      cpu_to_le16(0x0010) // experience collision in this transmit event
+#define TSR0_NCR3      cpu_to_le16(0x0008) // collision retry counter[3]
+#define TSR0_NCR2      cpu_to_le16(0x0004) // collision retry counter[2]
+#define TSR0_NCR1      cpu_to_le16(0x0002) // collision retry counter[1]
+#define TSR0_NCR0      cpu_to_le16(0x0001) // collision retry counter[0]
+#define TSR0_TERR      cpu_to_le16(0x8000) //
+#define TSR0_FDX       cpu_to_le16(0x4000) // current transaction is serviced by full duplex mode
+#define TSR0_GMII      cpu_to_le16(0x2000) // current transaction is serviced by GMII mode
+#define TSR0_LNKFL     cpu_to_le16(0x1000) // packet serviced during link down
+#define TSR0_SHDN      cpu_to_le16(0x0400) // shutdown case
+#define TSR0_CRS       cpu_to_le16(0x0200) // carrier sense lost
+#define TSR0_CDH       cpu_to_le16(0x0100) // AQE test fail (CD heartbeat)
 
 //
 // Bits in the TCR0 register
  */
 
 struct rdesc0 {
-       u16 RSR;                /* Receive status */
-       u16 len:14;             /* Received packet length */
-       u16 reserved:1;
-       u16 owner:1;            /* Who owns this buffer ? */
+       __le16 RSR;             /* Receive status */
+       __le16 len;             /* bits 0--13; bit 15 - owner */
 };
 
 struct rdesc1 {
-       u16 PQTAG;
+       __le16 PQTAG;
        u8 CSM;
        u8 IPKT;
 };
 
+enum {
+       RX_INTEN = __constant_cpu_to_le16(0x8000)
+};
+
 struct rx_desc {
        struct rdesc0 rdesc0;
        struct rdesc1 rdesc1;
-       u32 pa_low;             /* Low 32 bit PCI address */
-       u16 pa_high;            /* Next 16 bit PCI address (48 total) */
-       u16 len:15;             /* Frame size */
-       u16 inten:1;            /* Enable interrupt */
+       __le32 pa_low;          /* Low 32 bit PCI address */
+       __le16 pa_high;         /* Next 16 bit PCI address (48 total) */
+       __le16 size;            /* bits 0--14 - frame size, bit 15 - enable int. */
 } __attribute__ ((__packed__));
 
 /*
@@ -223,32 +199,24 @@ struct rx_desc {
  */
 
 struct tdesc0 {
-       u16 TSR;                /* Transmit status register */
-       u16 pktsize:14;         /* Size of frame */
-       u16 reserved:1;
-       u16 owner:1;            /* Who owns the buffer */
+       __le16 TSR;             /* Transmit status register */
+       __le16 len;             /* bits 0--13 - size of frame, bit 15 - owner */
 };
 
-struct pqinf {                 /* Priority queue info */
-       u16 VID:12;
-       u16 CFI:1;
-       u16 priority:3;
-} __attribute__ ((__packed__));
-
 struct tdesc1 {
-       struct pqinf pqinf;
+       __le16 vlan;
        u8 TCR;
-       u8 TCPLS:2;
-       u8 reserved:2;
-       u8 CMDZ:4;
+       u8 cmd;                 /* bits 0--1 - TCPLS, bits 4--7 - CMDZ */
 } __attribute__ ((__packed__));
 
+enum {
+       TD_QUEUE = __constant_cpu_to_le16(0x8000)
+};
+
 struct td_buf {
-       u32 pa_low;
-       u16 pa_high;
-       u16 bufsize:14;
-       u16 reserved:1;
-       u16 queue:1;
+       __le32 pa_low;
+       __le16 pa_high;
+       __le16 size;            /* bits 0--13 - size, bit 15 - queue */
 } __attribute__ ((__packed__));
 
 struct tx_desc {
@@ -276,7 +244,7 @@ struct velocity_td_info {
 
 enum  velocity_owner {
        OWNED_BY_HOST = 0,
-       OWNED_BY_NIC = 1
+       OWNED_BY_NIC = __constant_cpu_to_le16(0x8000)
 };
 
 
@@ -1012,45 +980,45 @@ struct mac_regs {
        volatile u8 RCR;
        volatile u8 TCR;
 
-       volatile u32 CR0Set;            /* 0x08 */
-       volatile u32 CR0Clr;            /* 0x0C */
+       volatile __le32 CR0Set;         /* 0x08 */
+       volatile __le32 CR0Clr;         /* 0x0C */
 
        volatile u8 MARCAM[8];          /* 0x10 */
 
-       volatile u32 DecBaseHi;         /* 0x18 */
-       volatile u16 DbfBaseHi;         /* 0x1C */
-       volatile u16 reserved_1E;
+       volatile __le32 DecBaseHi;      /* 0x18 */
+       volatile __le16 DbfBaseHi;      /* 0x1C */
+       volatile __le16 reserved_1E;
 
-       volatile u16 ISRCTL;            /* 0x20 */
+       volatile __le16 ISRCTL;         /* 0x20 */
        volatile u8 TXESR;
        volatile u8 RXESR;
 
-       volatile u32 ISR;               /* 0x24 */
-       volatile u32 IMR;
+       volatile __le32 ISR;            /* 0x24 */
+       volatile __le32 IMR;
 
-       volatile u32 TDStatusPort;      /* 0x2C */
+       volatile __le32 TDStatusPort;   /* 0x2C */
 
-       volatile u16 TDCSRSet;          /* 0x30 */
+       volatile __le16 TDCSRSet;       /* 0x30 */
        volatile u8 RDCSRSet;
        volatile u8 reserved_33;
-       volatile u16 TDCSRClr;
+       volatile __le16 TDCSRClr;
        volatile u8 RDCSRClr;
        volatile u8 reserved_37;
 
-       volatile u32 RDBaseLo;          /* 0x38 */
-       volatile u16 RDIdx;             /* 0x3C */
-       volatile u16 reserved_3E;
+       volatile __le32 RDBaseLo;       /* 0x38 */
+       volatile __le16 RDIdx;          /* 0x3C */
+       volatile __le16 reserved_3E;
 
-       volatile u32 TDBaseLo[4];       /* 0x40 */
+       volatile __le32 TDBaseLo[4];    /* 0x40 */
 
-       volatile u16 RDCSize;           /* 0x50 */
-       volatile u16 TDCSize;           /* 0x52 */
-       volatile u16 TDIdx[4];          /* 0x54 */
-       volatile u16 tx_pause_timer;    /* 0x5C */
-       volatile u16 RBRDU;             /* 0x5E */
+       volatile __le16 RDCSize;        /* 0x50 */
+       volatile __le16 TDCSize;        /* 0x52 */
+       volatile __le16 TDIdx[4];       /* 0x54 */
+       volatile __le16 tx_pause_timer; /* 0x5C */
+       volatile __le16 RBRDU;          /* 0x5E */
 
-       volatile u32 FIFOTest0;         /* 0x60 */
-       volatile u32 FIFOTest1;         /* 0x64 */
+       volatile __le32 FIFOTest0;      /* 0x60 */
+       volatile __le32 FIFOTest1;      /* 0x64 */
 
        volatile u8 CAMADDR;            /* 0x68 */
        volatile u8 CAMCR;              /* 0x69 */
@@ -1063,18 +1031,18 @@ struct mac_regs {
        volatile u8 PHYSR1;
        volatile u8 MIICR;
        volatile u8 MIIADR;
-       volatile u16 MIIDATA;
+       volatile __le16 MIIDATA;
 
-       volatile u16 SoftTimer0;        /* 0x74 */
-       volatile u16 SoftTimer1;
+       volatile __le16 SoftTimer0;     /* 0x74 */
+       volatile __le16 SoftTimer1;
 
        volatile u8 CFGA;               /* 0x78 */
        volatile u8 CFGB;
        volatile u8 CFGC;
        volatile u8 CFGD;
 
-       volatile u16 DCFG;              /* 0x7C */
-       volatile u16 MCFG;
+       volatile __le16 DCFG;           /* 0x7C */
+       volatile __le16 MCFG;
 
        volatile u8 TBIST;              /* 0x80 */
        volatile u8 RBIST;
@@ -1086,9 +1054,9 @@ struct mac_regs {
        volatile u8 rev_id;
        volatile u8 PORSTS;
 
-       volatile u32 MIBData;           /* 0x88 */
+       volatile __le32 MIBData;        /* 0x88 */
 
-       volatile u16 EEWrData;
+       volatile __le16 EEWrData;
 
        volatile u8 reserved_8E;
        volatile u8 BPMDWr;
@@ -1098,7 +1066,7 @@ struct mac_regs {
        volatile u8 EECHKSUM;           /* 0x92 */
        volatile u8 EECSR;
 
-       volatile u16 EERdData;          /* 0x94 */
+       volatile __le16 EERdData;       /* 0x94 */
        volatile u8 EADDR;
        volatile u8 EMBCMD;
 
@@ -1112,22 +1080,22 @@ struct mac_regs {
        volatile u8 DEBUG;
        volatile u8 CHIPGCR;
 
-       volatile u16 WOLCRSet;          /* 0xA0 */
+       volatile __le16 WOLCRSet;       /* 0xA0 */
        volatile u8 PWCFGSet;
        volatile u8 WOLCFGSet;
 
-       volatile u16 WOLCRClr;          /* 0xA4 */
+       volatile __le16 WOLCRClr;       /* 0xA4 */
        volatile u8 PWCFGCLR;
        volatile u8 WOLCFGClr;
 
-       volatile u16 WOLSRSet;          /* 0xA8 */
-       volatile u16 reserved_AA;
+       volatile __le16 WOLSRSet;       /* 0xA8 */
+       volatile __le16 reserved_AA;
 
-       volatile u16 WOLSRClr;          /* 0xAC */
-       volatile u16 reserved_AE;
+       volatile __le16 WOLSRClr;       /* 0xAC */
+       volatile __le16 reserved_AE;
 
-       volatile u16 PatternCRC[8];     /* 0xB0 */
-       volatile u32 ByteMask[4][4];    /* 0xC0 */
+       volatile __le16 PatternCRC[8];  /* 0xB0 */
+       volatile __le32 ByteMask[4][4]; /* 0xC0 */
 } __attribute__ ((__packed__));
 
 
@@ -1238,12 +1206,12 @@ typedef u8 MCAM_ADDR[ETH_ALEN];
 struct arp_packet {
        u8 dest_mac[ETH_ALEN];
        u8 src_mac[ETH_ALEN];
-       u16 type;
-       u16 ar_hrd;
-       u16 ar_pro;
+       __be16 type;
+       __be16 ar_hrd;
+       __be16 ar_pro;
        u8 ar_hln;
        u8 ar_pln;
-       u16 ar_op;
+       __be16 ar_op;
        u8 ar_sha[ETH_ALEN];
        u8 ar_sip[4];
        u8 ar_tha[ETH_ALEN];
@@ -1253,7 +1221,7 @@ struct arp_packet {
 struct _magic_packet {
        u8 dest_mac[6];
        u8 src_mac[6];
-       u16 type;
+       __be16 type;
        u8 MAC[16][6];
        u8 password[6];
 } __attribute__ ((__packed__));
index 5413dbf3d4ac25ab688bb1a965ccf981f230addc..e66de0c12fc10e1455e4137f8f68271ca44505b5 100644 (file)
 #include <linux/virtio_net.h>
 #include <linux/scatterlist.h>
 
+static int napi_weight = 128;
+module_param(napi_weight, int, 0444);
+
+static int csum = 1, gso = 1;
+module_param(csum, bool, 0444);
+module_param(gso, bool, 0444);
+
 /* FIXME: MTU in config. */
 #define MAX_PACKET_LEN (ETH_HLEN+ETH_DATA_LEN)
 
@@ -52,13 +59,14 @@ static inline void vnet_hdr_to_sg(struct scatterlist *sg, struct sk_buff *skb)
        sg_init_one(sg, skb_vnet_hdr(skb), sizeof(struct virtio_net_hdr));
 }
 
-static bool skb_xmit_done(struct virtqueue *rvq)
+static void skb_xmit_done(struct virtqueue *svq)
 {
-       struct virtnet_info *vi = rvq->vdev->priv;
+       struct virtnet_info *vi = svq->vdev->priv;
 
-       /* In case we were waiting for output buffers. */
+       /* Suppress further interrupts. */
+       svq->vq_ops->disable_cb(svq);
+       /* We were waiting for more output buffers. */
        netif_wake_queue(vi->dev);
-       return true;
 }
 
 static void receive_skb(struct net_device *dev, struct sk_buff *skb,
@@ -83,28 +91,16 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
 
        if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
                pr_debug("Needs csum!\n");
-               skb->ip_summed = CHECKSUM_PARTIAL;
-               skb->csum_start = hdr->csum_start;
-               skb->csum_offset = hdr->csum_offset;
-               if (skb->csum_start > skb->len - 2
-                   || skb->csum_offset > skb->len - 2) {
-                       if (net_ratelimit())
-                               printk(KERN_WARNING "%s: csum=%u/%u len=%u\n",
-                                      dev->name, skb->csum_start,
-                                      skb->csum_offset, skb->len);
+               if (!skb_partial_csum_set(skb,hdr->csum_start,hdr->csum_offset))
                        goto frame_err;
-               }
        }
 
        if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
                pr_debug("GSO!\n");
-               switch (hdr->gso_type) {
+               switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
                case VIRTIO_NET_HDR_GSO_TCPV4:
                        skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
                        break;
-               case VIRTIO_NET_HDR_GSO_TCPV4_ECN:
-                       skb_shinfo(skb)->gso_type = SKB_GSO_TCP_ECN;
-                       break;
                case VIRTIO_NET_HDR_GSO_UDP:
                        skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
                        break;
@@ -118,6 +114,9 @@ static void receive_skb(struct net_device *dev, struct sk_buff *skb,
                        goto frame_err;
                }
 
+               if (hdr->gso_type & VIRTIO_NET_HDR_GSO_ECN)
+                       skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN;
+
                skb_shinfo(skb)->gso_size = hdr->gso_size;
                if (skb_shinfo(skb)->gso_size == 0) {
                        if (net_ratelimit())
@@ -170,12 +169,14 @@ static void try_fill_recv(struct virtnet_info *vi)
        vi->rvq->vq_ops->kick(vi->rvq);
 }
 
-static bool skb_recv_done(struct virtqueue *rvq)
+static void skb_recv_done(struct virtqueue *rvq)
 {
        struct virtnet_info *vi = rvq->vdev->priv;
-       netif_rx_schedule(vi->dev, &vi->napi);
-       /* Suppress further interrupts. */
-       return false;
+       /* Schedule NAPI, Suppress further interrupts if successful. */
+       if (netif_rx_schedule_prep(vi->dev, &vi->napi)) {
+               rvq->vq_ops->disable_cb(rvq);
+               __netif_rx_schedule(vi->dev, &vi->napi);
+       }
 }
 
 static int virtnet_poll(struct napi_struct *napi, int budget)
@@ -201,7 +202,7 @@ again:
        /* Out of packets? */
        if (received < budget) {
                netif_rx_complete(vi->dev, napi);
-               if (unlikely(!vi->rvq->vq_ops->restart(vi->rvq))
+               if (unlikely(!vi->rvq->vq_ops->enable_cb(vi->rvq))
                    && netif_rx_reschedule(vi->dev, napi))
                        goto again;
        }
@@ -236,8 +237,6 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev)
 
        pr_debug("%s: xmit %p %s\n", dev->name, skb, print_mac(mac, dest));
 
-       free_old_xmit_skbs(vi);
-
        /* Encode metadata header at front. */
        hdr = skb_vnet_hdr(skb);
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
@@ -250,10 +249,9 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        if (skb_is_gso(skb)) {
+               hdr->hdr_len = skb_transport_header(skb) - skb->data;
                hdr->gso_size = skb_shinfo(skb)->gso_size;
-               if (skb_shinfo(skb)->gso_type & SKB_GSO_TCP_ECN)
-                       hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4_ECN;
-               else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4)
+               if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV4)
                        hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
                else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6)
                        hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
@@ -261,19 +259,34 @@ static int start_xmit(struct sk_buff *skb, struct net_device *dev)
                        hdr->gso_type = VIRTIO_NET_HDR_GSO_UDP;
                else
                        BUG();
+               if (skb_shinfo(skb)->gso_type & SKB_GSO_TCP_ECN)
+                       hdr->gso_type |= VIRTIO_NET_HDR_GSO_ECN;
        } else {
                hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE;
-               hdr->gso_size = 0;
+               hdr->gso_size = hdr->hdr_len = 0;
        }
 
        vnet_hdr_to_sg(sg, skb);
        num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1;
        __skb_queue_head(&vi->send, skb);
+
+again:
+       /* Free up any pending old buffers before queueing new ones. */
+       free_old_xmit_skbs(vi);
        err = vi->svq->vq_ops->add_buf(vi->svq, sg, num, 0, skb);
        if (err) {
                pr_debug("%s: virtio not prepared to send\n", dev->name);
-               skb_unlink(skb, &vi->send);
                netif_stop_queue(dev);
+
+               /* Activate callback for using skbs: if this fails it
+                * means some were used in the meantime. */
+               if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) {
+                       printk("Unlikely: restart svq failed\n");
+                       netif_start_queue(dev);
+                       goto again;
+               }
+               __skb_unlink(skb, &vi->send);
+
                return NETDEV_TX_BUSY;
        }
        vi->svq->vq_ops->kick(vi->svq);
@@ -285,45 +298,31 @@ static int virtnet_open(struct net_device *dev)
 {
        struct virtnet_info *vi = netdev_priv(dev);
 
-       try_fill_recv(vi);
+       napi_enable(&vi->napi);
 
-       /* If we didn't even get one input buffer, we're useless. */
-       if (vi->num == 0)
-               return -ENOMEM;
+       /* If all buffers were filled by other side before we napi_enabled, we
+        * won't get another interrupt, so process any outstanding packets
+        * now.  virtnet_poll wants re-enable the queue, so we disable here. */
+       vi->rvq->vq_ops->disable_cb(vi->rvq);
+       netif_rx_schedule(vi->dev, &vi->napi);
 
-       napi_enable(&vi->napi);
        return 0;
 }
 
 static int virtnet_close(struct net_device *dev)
 {
        struct virtnet_info *vi = netdev_priv(dev);
-       struct sk_buff *skb;
 
        napi_disable(&vi->napi);
 
-       /* networking core has neutered skb_xmit_done/skb_recv_done, so don't
-        * worry about races vs. get(). */
-       vi->rvq->vq_ops->shutdown(vi->rvq);
-       while ((skb = __skb_dequeue(&vi->recv)) != NULL) {
-               kfree_skb(skb);
-               vi->num--;
-       }
-       vi->svq->vq_ops->shutdown(vi->svq);
-       while ((skb = __skb_dequeue(&vi->send)) != NULL)
-               kfree_skb(skb);
-
-       BUG_ON(vi->num != 0);
        return 0;
 }
 
 static int virtnet_probe(struct virtio_device *vdev)
 {
        int err;
-       unsigned int len;
        struct net_device *dev;
        struct virtnet_info *vi;
-       void *token;
 
        /* Allocate ourselves a network device with room for our info */
        dev = alloc_etherdev(sizeof(struct virtnet_info));
@@ -331,7 +330,6 @@ static int virtnet_probe(struct virtio_device *vdev)
                return -ENOMEM;
 
        /* Set up network device as normal. */
-       ether_setup(dev);
        dev->open = virtnet_open;
        dev->stop = virtnet_close;
        dev->hard_start_xmit = start_xmit;
@@ -339,42 +337,37 @@ static int virtnet_probe(struct virtio_device *vdev)
        SET_NETDEV_DEV(dev, &vdev->dev);
 
        /* Do we support "hardware" checksums? */
-       token = vdev->config->find(vdev, VIRTIO_CONFIG_NET_F, &len);
-       if (virtio_use_bit(vdev, token, len, VIRTIO_NET_F_NO_CSUM)) {
+       if (csum && vdev->config->feature(vdev, VIRTIO_NET_F_CSUM)) {
                /* This opens up the world of extra features. */
                dev->features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST;
-               if (virtio_use_bit(vdev, token, len, VIRTIO_NET_F_TSO4))
-                       dev->features |= NETIF_F_TSO;
-               if (virtio_use_bit(vdev, token, len, VIRTIO_NET_F_UFO))
-                       dev->features |= NETIF_F_UFO;
-               if (virtio_use_bit(vdev, token, len, VIRTIO_NET_F_TSO4_ECN))
-                       dev->features |= NETIF_F_TSO_ECN;
-               if (virtio_use_bit(vdev, token, len, VIRTIO_NET_F_TSO6))
-                       dev->features |= NETIF_F_TSO6;
+               if (gso && vdev->config->feature(vdev, VIRTIO_NET_F_GSO)) {
+                       dev->features |= NETIF_F_TSO | NETIF_F_UFO
+                               | NETIF_F_TSO_ECN | NETIF_F_TSO6;
+               }
        }
 
        /* Configuration may specify what MAC to use.  Otherwise random. */
-       token = vdev->config->find(vdev, VIRTIO_CONFIG_NET_MAC_F, &len);
-       if (token) {
-               dev->addr_len = len;
-               vdev->config->get(vdev, token, dev->dev_addr, len);
+       if (vdev->config->feature(vdev, VIRTIO_NET_F_MAC)) {
+               vdev->config->get(vdev,
+                                 offsetof(struct virtio_net_config, mac),
+                                 dev->dev_addr, dev->addr_len);
        } else
                random_ether_addr(dev->dev_addr);
 
        /* Set up our device-specific information */
        vi = netdev_priv(dev);
-       netif_napi_add(dev, &vi->napi, virtnet_poll, 16);
+       netif_napi_add(dev, &vi->napi, virtnet_poll, napi_weight);
        vi->dev = dev;
        vi->vdev = vdev;
 
        /* We expect two virtqueues, receive then send. */
-       vi->rvq = vdev->config->find_vq(vdev, skb_recv_done);
+       vi->rvq = vdev->config->find_vq(vdev, 0, skb_recv_done);
        if (IS_ERR(vi->rvq)) {
                err = PTR_ERR(vi->rvq);
                goto free;
        }
 
-       vi->svq = vdev->config->find_vq(vdev, skb_xmit_done);
+       vi->svq = vdev->config->find_vq(vdev, 1, skb_xmit_done);
        if (IS_ERR(vi->svq)) {
                err = PTR_ERR(vi->svq);
                goto free_recv;
@@ -389,10 +382,22 @@ static int virtnet_probe(struct virtio_device *vdev)
                pr_debug("virtio_net: registering device failed\n");
                goto free_send;
        }
+
+       /* Last of all, set up some receive buffers. */
+       try_fill_recv(vi);
+
+       /* If we didn't even get one input buffer, we're useless. */
+       if (vi->num == 0) {
+               err = -ENOMEM;
+               goto unregister;
+       }
+
        pr_debug("virtnet: registered device %s\n", dev->name);
        vdev->priv = vi;
        return 0;
 
+unregister:
+       unregister_netdev(dev);
 free_send:
        vdev->config->del_vq(vi->svq);
 free_recv:
@@ -405,6 +410,20 @@ free:
 static void virtnet_remove(struct virtio_device *vdev)
 {
        struct virtnet_info *vi = vdev->priv;
+       struct sk_buff *skb;
+
+       /* Stop all the virtqueues. */
+       vdev->config->reset(vdev);
+
+       /* Free our skbs in send and recv queues, if any. */
+       while ((skb = __skb_dequeue(&vi->recv)) != NULL) {
+               kfree_skb(skb);
+               vi->num--;
+       }
+       while ((skb = __skb_dequeue(&vi->send)) != NULL)
+               kfree_skb(skb);
+
+       BUG_ON(vi->num != 0);
 
        vdev->config->del_vq(vi->svq);
        vdev->config->del_vq(vi->rvq);
index d347d59db656057cffdc3c27260d8866188374be..d14e6678deed2456be4df506a4094aaf4be20f68 100644 (file)
@@ -322,7 +322,7 @@ static int cycx_data_boot(void __iomem *addr, u8 *code, u32 len)
        void __iomem *pt_boot_cmd = addr + CMD_OFFSET;
        u32 i;
 
-       /* boot buffer lenght */
+       /* boot buffer length */
        writew(CFM_LOAD_BUFSZ, pt_boot_cmd + sizeof(u16));
        writew(GEN_DEFPAR, pt_boot_cmd);
 
@@ -353,7 +353,7 @@ static int cycx_code_boot(void __iomem *addr, u8 *code, u32 len)
        void __iomem *pt_boot_cmd = addr + CMD_OFFSET;
        u32 i;
 
-       /* boot buffer lenght */
+       /* boot buffer length */
        writew(CFM_LOAD_BUFSZ, pt_boot_cmd + sizeof(u16));
        writew(GEN_DEFPAR, pt_boot_cmd);
 
index d6599d219193aab8aa1abb3ed85d8908a332bbe9..ddc87149fe31d098730a27eee9b7df871f5d18f9 100644 (file)
@@ -153,7 +153,7 @@ static int          ath5k_pci_resume(struct pci_dev *pdev);
 #define ath5k_pci_resume NULL
 #endif /* CONFIG_PM */
 
-static struct pci_driver ath5k_pci_drv_id = {
+static struct pci_driver ath5k_pci_driver = {
        .name           = "ath5k_pci",
        .id_table       = ath5k_pci_id_table,
        .probe          = ath5k_pci_probe,
@@ -329,7 +329,7 @@ init_ath5k_pci(void)
 
        ath5k_debug_init();
 
-       ret = pci_register_driver(&ath5k_pci_drv_id);
+       ret = pci_register_driver(&ath5k_pci_driver);
        if (ret) {
                printk(KERN_ERR "ath5k_pci: can't register pci driver\n");
                return ret;
@@ -341,7 +341,7 @@ init_ath5k_pci(void)
 static void __exit
 exit_ath5k_pci(void)
 {
-       pci_unregister_driver(&ath5k_pci_drv_id);
+       pci_unregister_driver(&ath5k_pci_driver);
 
        ath5k_debug_finish();
 }
index 4fdeb53232486a1fac23eae1735c53fc338fd8f8..8d4d91d35fd29f14ed3b8c21323da34c7122c264 100644 (file)
@@ -238,9 +238,10 @@ void iwl3945_hw_rx_statistics(struct iwl3945_priv *priv, struct iwl3945_rx_mem_b
        priv->last_statistics_time = jiffies;
 }
 
-void iwl3945_add_radiotap(struct iwl3945_priv *priv, struct sk_buff *skb,
-                         struct iwl3945_rx_frame_hdr *rx_hdr,
-                         struct ieee80211_rx_status *stats)
+static void iwl3945_add_radiotap(struct iwl3945_priv *priv,
+                                struct sk_buff *skb,
+                                struct iwl3945_rx_frame_hdr *rx_hdr,
+                                struct ieee80211_rx_status *stats)
 {
        /* First cache any information we need before we overwrite
         * the information provided in the skb from the hardware */
index 569347ff377b18e7cb494152734f471f454fd3f0..d727de8b96fef956d3020bdde0428336ebb9d7a1 100644 (file)
@@ -4658,17 +4658,30 @@ void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index,
                                struct ieee80211_ht_info *sta_ht_inf)
 {
        __le32 sta_flags;
+       u8 mimo_ps_mode;
 
        if (!sta_ht_inf || !sta_ht_inf->ht_supported)
                goto done;
 
+       mimo_ps_mode = (sta_ht_inf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2;
+
        sta_flags = priv->stations[index].sta.station_flags;
 
-       if (((sta_ht_inf->cap & IEEE80211_HT_CAP_MIMO_PS >> 2))
-                                               == IWL_MIMO_PS_DYNAMIC)
+       sta_flags &= ~(STA_FLG_RTS_MIMO_PROT_MSK | STA_FLG_MIMO_DIS_MSK);
+
+       switch (mimo_ps_mode) {
+       case WLAN_HT_CAP_MIMO_PS_STATIC:
+               sta_flags |= STA_FLG_MIMO_DIS_MSK;
+               break;
+       case WLAN_HT_CAP_MIMO_PS_DYNAMIC:
                sta_flags |= STA_FLG_RTS_MIMO_PROT_MSK;
-       else
-               sta_flags &= ~STA_FLG_RTS_MIMO_PROT_MSK;
+               break;
+       case WLAN_HT_CAP_MIMO_PS_DISABLED:
+               break;
+       default:
+               IWL_WARNING("Invalid MIMO PS mode %d", mimo_ps_mode);
+               break;
+       }
 
        sta_flags |= cpu_to_le32(
              (u32)sta_ht_inf->ampdu_factor << STA_FLG_MAX_AGG_SIZE_POS);
@@ -4679,7 +4692,7 @@ void iwl4965_set_ht_add_station(struct iwl4965_priv *priv, u8 index,
        if (iwl4965_is_fat_tx_allowed(priv, sta_ht_inf))
                sta_flags |= STA_FLG_FAT_EN_MSK;
        else
-               sta_flags &= (~STA_FLG_FAT_EN_MSK);
+               sta_flags &= ~STA_FLG_FAT_EN_MSK;
 
        priv->stations[index].sta.station_flags = sta_flags;
  done:
index cb009f4c401fd9db96d5b2129eed5e02980f41d9..8993cca81b40c033cb561188aeb37210caaffa57 100644 (file)
@@ -147,9 +147,6 @@ static inline struct ieee80211_conf *ieee80211_get_hw_conf(
 
 #define QOS_CONTROL_LEN 2
 
-#define IEEE80211_STYPE_BACK_REQ       0x0080
-#define IEEE80211_STYPE_BACK           0x0090
-
 
 static inline int ieee80211_is_management(u16 fc)
 {
index 33239f197984302f53125191546a176f67b46892..f55c75712b555bfc179628964cff723cd6fa85ff 100644 (file)
@@ -6330,6 +6330,11 @@ static int __iwl3945_up(struct iwl3945_priv *priv)
                return -ENODEV;
        }
 
+       if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
+               IWL_ERROR("ucode not available for device bringup\n");
+               return -EIO;
+       }
+
        /* If platform's RF_KILL switch is NOT set to KILL */
        if (iwl3945_read32(priv, CSR_GP_CNTRL) &
                                CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
@@ -6342,11 +6347,6 @@ static int __iwl3945_up(struct iwl3945_priv *priv)
                }
        }
 
-       if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
-               IWL_ERROR("ucode not available for device bringup\n");
-               return -EIO;
-       }
-
        iwl3945_write32(priv, CSR_INT, 0xFFFFFFFF);
 
        rc = iwl3945_hw_nic_init(priv);
index bf3a60c037aa915b8a6f67fe2a045221b26d9770..f423241b95674ad7cca340fa591f27c48a10bd13 100644 (file)
@@ -6755,6 +6755,11 @@ static int __iwl4965_up(struct iwl4965_priv *priv)
                return -ENODEV;
        }
 
+       if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
+               IWL_ERROR("ucode not available for device bringup\n");
+               return -EIO;
+       }
+
        /* If platform's RF_KILL switch is NOT set to KILL */
        if (iwl4965_read32(priv, CSR_GP_CNTRL) &
                                CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW)
@@ -6767,11 +6772,6 @@ static int __iwl4965_up(struct iwl4965_priv *priv)
                }
        }
 
-       if (!priv->ucode_data_backup.v_addr || !priv->ucode_data.v_addr) {
-               IWL_ERROR("ucode not available for device bringup\n");
-               return -EIO;
-       }
-
        iwl4965_write32(priv, CSR_INT, 0xFFFFFFFF);
 
        rc = iwl4965_hw_nic_init(priv);
index 9a61188b62e92cf2fe9984c5ca58f4ac8cbd8570..69f94c92b32d8986a5221658b180d09c94b0a6d7 100644 (file)
@@ -1473,7 +1473,7 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
  *  Called via lbs_prepare_and_send_command(priv, CMD_802_11_SCAN, ...)
  *  from cmd.c
  *
- *  Sends a fixed lenght data part (specifying the BSS type and BSSID filters)
+ *  Sends a fixed length data part (specifying the BSS type and BSSID filters)
  *  as well as a variable number/length of TLVs to the firmware.
  *
  *  @param priv       A pointer to struct lbs_private structure
index e503c9c980321ccb81e11c3a5efa0eae780c6da3..f4076aeb20984bed429f4b8406c876e54f6ff026 100644 (file)
@@ -352,7 +352,7 @@ nubus_find_rsrc(struct nubus_dir* dir, unsigned char rsrc_type,
    resource blocks. */
 
 /* FIXME: A lot of this stuff will eventually be useful after
-   initializaton, for intelligently probing Ethernet and video chips,
+   initialization, for intelligently probing Ethernet and video chips,
    among other things.  The rest of it should go in the /proc code.
    For now, we just use it to give verbose boot logs. */
 
index 7c60cbd85dc8505883e14ad9091f456badfdb427..ca52307b8f40c66adc672877c5e7f86bcd938b2f 100644 (file)
@@ -363,7 +363,7 @@ ccio_alloc_range(struct ioc *ioc, size_t size)
        if (pages_needed <= 8) {
                /*
                 * LAN traffic will not thrash the TLB IFF the same NIC
-                * uses 8 adjacent pages to map seperate payload data.
+                * uses 8 adjacent pages to map separate payload data.
                 * ie the same byte in the resource bit map.
                 */
 #if 0
@@ -1589,7 +1589,7 @@ static int __init ccio_probe(struct parisc_device *dev)
 }
 
 /**
- * ccio_init - ccio initalization procedure.
+ * ccio_init - ccio initialization procedure.
  *
  * Register this driver.
  */
index a728a7cd2fc80156ae3fd1b1d358e6b87934eb87..65eee67aa2ae66d9ac9130c9ee7efb6fab896a74 100644 (file)
@@ -95,7 +95,7 @@ static struct parisc_driver hppb_driver = {
 };
 
 /**
- * hppb_init - HP-PB bus initalization procedure.
+ * hppb_init - HP-PB bus initialization procedure.
  *
  * Register this driver.   
  */
index 853a15f44f8889f7f1b5d401df730677633232f6..cd565bb4e1a990ba303aa308a6094c7466b3e331 100644 (file)
@@ -163,7 +163,7 @@ static ssize_t parport_read_device_id (struct parport *port, char *buffer,
        idlens[1] = idlens[0]+2;
        if (belen != lelen) {
                int off = 2;
-               /* Don't try lenghts of 0x100 and 0x200 as 1 and 2 */
+               /* Don't try lengths of 0x100 and 0x200 as 1 and 2 */
                if (idlens[0] <= 2)
                        off = 0;
                idlens[off] = max(belen, lelen);
index f697f3d728eb6317ad048cd087ceb26af8962117..9f04d17576d6fb37e1f58368dfa5326264369208 100644 (file)
@@ -13,6 +13,9 @@ obj-$(CONFIG_HOTPLUG) += hotplug.o
 
 # Build the PCI Hotplug drivers if we were asked to
 obj-$(CONFIG_HOTPLUG_PCI) += hotplug/
+ifdef CONFIG_HOTPLUG_PCI
+obj-y += hotplug-pci.o
+endif
 
 # Build the PCI MSI interrupt support
 obj-$(CONFIG_PCI_MSI) += msi.o
diff --git a/drivers/pci/hotplug-pci.c b/drivers/pci/hotplug-pci.c
new file mode 100644 (file)
index 0000000..a590ef6
--- /dev/null
@@ -0,0 +1,20 @@
+/* Core PCI functionality used only by PCI hotplug */
+
+#include <linux/pci.h>
+#include "pci.h"
+
+
+unsigned int pci_do_scan_bus(struct pci_bus *bus)
+{
+       unsigned int max;
+
+       max = pci_scan_child_bus(bus);
+
+       /*
+        * Make the discovered devices available.
+        */
+       pci_bus_add_devices(bus);
+
+       return max;
+}
+EXPORT_SYMBOL(pci_do_scan_bus);
index abf4203304e405269dc111afbe19b02d1e14ff4d..8dcf1458aa2fafe6e0433efd1dfb515ce503271a 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/topology.h>
 #include <linux/mm.h>
 #include <linux/capability.h>
-#include <linux/aspm.h>
 #include "pci.h"
 
 static int sysfs_initialized;  /* = 0 */
@@ -651,8 +650,6 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
        if (pcibios_add_platform_entries(pdev))
                goto err_rom_file;
 
-       pcie_aspm_create_sysfs_dev_files(pdev);
-
        return 0;
 
 err_rom_file:
@@ -682,8 +679,6 @@ void pci_remove_sysfs_dev_files(struct pci_dev *pdev)
        if (!sysfs_initialized)
                return;
 
-       pcie_aspm_remove_sysfs_dev_files(pdev);
-
        if (pdev->cfg_size < 4096)
                sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
        else
index b3e9294e4a0ede470f1c537e4b48e5b77380a175..04aac77824681a10582f1382a1c06771d2c3179e 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/spinlock.h>
 #include <linux/string.h>
 #include <linux/log2.h>
-#include <linux/aspm.h>
 #include <asm/dma.h>   /* isa_dma_bridge_buggy */
 #include "pci.h"
 
@@ -520,9 +519,6 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
        if (need_restore)
                pci_restore_bars(dev);
 
-       if (dev->bus->self)
-               pcie_aspm_pm_state_change(dev->bus->self);
-
        return 0;
 }
 
index 60104cf987966eb09f7cef369c680ad897b70408..287a9311716c66b98fd06e7a44a3dff43738f27f 100644 (file)
@@ -26,23 +26,3 @@ config HOTPLUG_PCI_PCIE
          When in doubt, say N.
 
 source "drivers/pci/pcie/aer/Kconfig"
-
-#
-# PCI Express ASPM
-#
-config PCIEASPM
-       bool "PCI Express ASPM support(Experimental)"
-       depends on PCI && EXPERIMENTAL
-       default y
-       help
-         This enables PCI Express ASPM (Active State Power Management) and
-         Clock Power Management. ASPM supports state L0/L0s/L1.
-
-         When in doubt, say N.
-config PCIEASPM_DEBUG
-       bool "Debug PCI Express ASPM"
-       depends on PCIEASPM
-       default n
-       help
-         This enables PCI Express ASPM debug support. It will add per-device
-         interface to control ASPM.
index 11f6bb1eae24b5816f37181fdbf6021add41099a..e00fb99acf44434934d05db3dc33959eeebd5650 100644 (file)
@@ -2,9 +2,6 @@
 # Makefile for PCI-Express PORT Driver
 #
 
-# Build PCI Express ASPM if needed
-obj-$(CONFIG_PCIEASPM)         += aspm.o
-
 pcieportdrv-y                  := portdrv_core.o portdrv_pci.o portdrv_bus.o
 
 obj-$(CONFIG_PCIEPORTBUS)      += pcieportdrv.o
diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
deleted file mode 100644 (file)
index 1a5adeb..0000000
+++ /dev/null
@@ -1,802 +0,0 @@
-/*
- * File:       drivers/pci/pcie/aspm.c
- * Enabling PCIE link L0s/L1 state and Clock Power Management
- *
- * Copyright (C) 2007 Intel
- * Copyright (C) Zhang Yanmin (yanmin.zhang@intel.com)
- * Copyright (C) Shaohua Li (shaohua.li@intel.com)
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/pci.h>
-#include <linux/pci_regs.h>
-#include <linux/errno.h>
-#include <linux/pm.h>
-#include <linux/init.h>
-#include <linux/slab.h>
-#include <linux/aspm.h>
-#include <acpi/acpi_bus.h>
-#include <linux/pci-acpi.h>
-#include "../pci.h"
-
-#ifdef MODULE_PARAM_PREFIX
-#undef MODULE_PARAM_PREFIX
-#endif
-#define MODULE_PARAM_PREFIX "pcie_aspm."
-
-struct endpoint_state {
-       unsigned int l0s_acceptable_latency;
-       unsigned int l1_acceptable_latency;
-};
-
-struct pcie_link_state {
-       struct list_head sibiling;
-       struct pci_dev *pdev;
-
-       /* ASPM state */
-       unsigned int support_state;
-       unsigned int enabled_state;
-       unsigned int bios_aspm_state;
-       /* upstream component */
-       unsigned int l0s_upper_latency;
-       unsigned int l1_upper_latency;
-       /* downstream component */
-       unsigned int l0s_down_latency;
-       unsigned int l1_down_latency;
-       /* Clock PM state*/
-       unsigned int clk_pm_capable;
-       unsigned int clk_pm_enabled;
-       unsigned int bios_clk_state;
-
-       /*
-        * A pcie downstream port only has one slot under it, so at most there
-        * are 8 functions
-        */
-       struct endpoint_state endpoints[8];
-};
-
-static int aspm_disabled;
-static DEFINE_MUTEX(aspm_lock);
-static LIST_HEAD(link_list);
-
-#define POLICY_DEFAULT 0       /* BIOS default setting */
-#define POLICY_PERFORMANCE 1   /* high performance */
-#define POLICY_POWERSAVE 2     /* high power saving */
-static int aspm_policy;
-static const char *policy_str[] = {
-       [POLICY_DEFAULT] = "default",
-       [POLICY_PERFORMANCE] = "performance",
-       [POLICY_POWERSAVE] = "powersave"
-};
-
-static int policy_to_aspm_state(struct pci_dev *pdev)
-{
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       switch (aspm_policy) {
-       case POLICY_PERFORMANCE:
-               /* Disable ASPM and Clock PM */
-               return 0;
-       case POLICY_POWERSAVE:
-               /* Enable ASPM L0s/L1 */
-               return PCIE_LINK_STATE_L0S|PCIE_LINK_STATE_L1;
-       case POLICY_DEFAULT:
-               return link_state->bios_aspm_state;
-       }
-       return 0;
-}
-
-static int policy_to_clkpm_state(struct pci_dev *pdev)
-{
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       switch (aspm_policy) {
-       case POLICY_PERFORMANCE:
-               /* Disable ASPM and Clock PM */
-               return 0;
-       case POLICY_POWERSAVE:
-               /* Disable Clock PM */
-               return 1;
-       case POLICY_DEFAULT:
-               return link_state->bios_clk_state;
-       }
-       return 0;
-}
-
-static void pcie_set_clock_pm(struct pci_dev *pdev, int enable)
-{
-       struct pci_dev *child_dev;
-       int pos;
-       u16 reg16;
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       list_for_each_entry(child_dev, &pdev->subordinate->devices, bus_list) {
-               pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP);
-               if (!pos)
-                       return;
-               pci_read_config_word(child_dev, pos + PCI_EXP_LNKCTL, &reg16);
-               if (enable)
-                       reg16 |= PCI_EXP_LNKCTL_CLKREQ_EN;
-               else
-                       reg16 &= ~PCI_EXP_LNKCTL_CLKREQ_EN;
-               pci_write_config_word(child_dev, pos + PCI_EXP_LNKCTL, reg16);
-       }
-       link_state->clk_pm_enabled = !!enable;
-}
-
-static void pcie_check_clock_pm(struct pci_dev *pdev)
-{
-       int pos;
-       u32 reg32;
-       u16 reg16;
-       int capable = 1, enabled = 1;
-       struct pci_dev *child_dev;
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       /* All functions should have the same cap and state, take the worst */
-       list_for_each_entry(child_dev, &pdev->subordinate->devices, bus_list) {
-               pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP);
-               if (!pos)
-                       return;
-               pci_read_config_dword(child_dev, pos + PCI_EXP_LNKCAP, &reg32);
-               if (!(reg32 & PCI_EXP_LNKCAP_CLKPM)) {
-                       capable = 0;
-                       enabled = 0;
-                       break;
-               }
-               pci_read_config_word(child_dev, pos + PCI_EXP_LNKCTL, &reg16);
-               if (!(reg16 & PCI_EXP_LNKCTL_CLKREQ_EN))
-                       enabled = 0;
-       }
-       link_state->clk_pm_capable = capable;
-       link_state->clk_pm_enabled = enabled;
-       link_state->bios_clk_state = enabled;
-       pcie_set_clock_pm(pdev, policy_to_clkpm_state(pdev));
-}
-
-/*
- * pcie_aspm_configure_common_clock: check if the 2 ends of a link
- *   could use common clock. If they are, configure them to use the
- *   common clock. That will reduce the ASPM state exit latency.
- */
-static void pcie_aspm_configure_common_clock(struct pci_dev *pdev)
-{
-       int pos, child_pos;
-       u16 reg16 = 0;
-       struct pci_dev *child_dev;
-       int same_clock = 1;
-
-       /*
-        * all functions of a slot should have the same Slot Clock
-        * Configuration, so just check one function
-        * */
-       child_dev = list_entry(pdev->subordinate->devices.next, struct pci_dev,
-               bus_list);
-       BUG_ON(!child_dev->is_pcie);
-
-       /* Check downstream component if bit Slot Clock Configuration is 1 */
-       child_pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP);
-       pci_read_config_word(child_dev, child_pos + PCI_EXP_LNKSTA, &reg16);
-       if (!(reg16 & PCI_EXP_LNKSTA_SLC))
-               same_clock = 0;
-
-       /* Check upstream component if bit Slot Clock Configuration is 1 */
-       pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
-       pci_read_config_word(pdev, pos + PCI_EXP_LNKSTA, &reg16);
-       if (!(reg16 & PCI_EXP_LNKSTA_SLC))
-               same_clock = 0;
-
-       /* Configure downstream component, all functions */
-       list_for_each_entry(child_dev, &pdev->subordinate->devices, bus_list) {
-               child_pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP);
-               pci_read_config_word(child_dev, child_pos + PCI_EXP_LNKCTL,
-                       &reg16);
-               if (same_clock)
-                       reg16 |= PCI_EXP_LNKCTL_CCC;
-               else
-                       reg16 &= ~PCI_EXP_LNKCTL_CCC;
-               pci_write_config_word(child_dev, child_pos + PCI_EXP_LNKCTL,
-                       reg16);
-       }
-
-       /* Configure upstream component */
-       pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &reg16);
-       if (same_clock)
-               reg16 |= PCI_EXP_LNKCTL_CCC;
-       else
-               reg16 &= ~PCI_EXP_LNKCTL_CCC;
-       pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16);
-
-       /* retrain link */
-       reg16 |= PCI_EXP_LNKCTL_RL;
-       pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16);
-
-       /* Wait for link training end */
-       while (1) {
-               pci_read_config_word(pdev, pos + PCI_EXP_LNKSTA, &reg16);
-               if (!(reg16 & PCI_EXP_LNKSTA_LT))
-                       break;
-               cpu_relax();
-       }
-}
-
-/*
- * calc_L0S_latency: Convert L0s latency encoding to ns
- */
-static unsigned int calc_L0S_latency(unsigned int latency_encoding, int ac)
-{
-       unsigned int ns = 64;
-
-       if (latency_encoding == 0x7) {
-               if (ac)
-                       ns = -1U;
-               else
-                       ns = 5*1000; /* > 4us */
-       } else
-               ns *= (1 << latency_encoding);
-       return ns;
-}
-
-/*
- * calc_L1_latency: Convert L1 latency encoding to ns
- */
-static unsigned int calc_L1_latency(unsigned int latency_encoding, int ac)
-{
-       unsigned int ns = 1000;
-
-       if (latency_encoding == 0x7) {
-               if (ac)
-                       ns = -1U;
-               else
-                       ns = 65*1000; /* > 64us */
-       } else
-               ns *= (1 << latency_encoding);
-       return ns;
-}
-
-static void pcie_aspm_get_cap_device(struct pci_dev *pdev, u32 *state,
-       unsigned int *l0s, unsigned int *l1, unsigned int *enabled)
-{
-       int pos;
-       u16 reg16;
-       u32 reg32;
-       unsigned int latency;
-
-       pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
-       pci_read_config_dword(pdev, pos + PCI_EXP_LNKCAP, &reg32);
-       *state = (reg32 & PCI_EXP_LNKCAP_ASPMS) >> 10;
-       if (*state != PCIE_LINK_STATE_L0S &&
-               *state != (PCIE_LINK_STATE_L1|PCIE_LINK_STATE_L0S))
-               * state = 0;
-       if (*state == 0)
-               return;
-
-       latency = (reg32 & PCI_EXP_LNKCAP_L0SEL) >> 12;
-       *l0s = calc_L0S_latency(latency, 0);
-       if (*state & PCIE_LINK_STATE_L1) {
-               latency = (reg32 & PCI_EXP_LNKCAP_L1EL) >> 15;
-               *l1 = calc_L1_latency(latency, 0);
-       }
-       pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &reg16);
-       *enabled = reg16 & (PCIE_LINK_STATE_L0S|PCIE_LINK_STATE_L1);
-}
-
-static void pcie_aspm_cap_init(struct pci_dev *pdev)
-{
-       struct pci_dev *child_dev;
-       u32 state, tmp;
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       /* upstream component states */
-       pcie_aspm_get_cap_device(pdev, &link_state->support_state,
-               &link_state->l0s_upper_latency,
-               &link_state->l1_upper_latency,
-               &link_state->enabled_state);
-       /* downstream component states, all functions have the same setting */
-       child_dev = list_entry(pdev->subordinate->devices.next, struct pci_dev,
-               bus_list);
-       pcie_aspm_get_cap_device(child_dev, &state,
-               &link_state->l0s_down_latency,
-               &link_state->l1_down_latency,
-               &tmp);
-       link_state->support_state &= state;
-       if (!link_state->support_state)
-               return;
-       link_state->enabled_state &= link_state->support_state;
-       link_state->bios_aspm_state = link_state->enabled_state;
-
-       /* ENDPOINT states*/
-       list_for_each_entry(child_dev, &pdev->subordinate->devices, bus_list) {
-               int pos;
-               u32 reg32;
-               unsigned int latency;
-               struct endpoint_state *ep_state =
-                       &link_state->endpoints[PCI_FUNC(child_dev->devfn)];
-
-               if (child_dev->pcie_type != PCI_EXP_TYPE_ENDPOINT &&
-                       child_dev->pcie_type != PCI_EXP_TYPE_LEG_END)
-                       continue;
-
-               pos = pci_find_capability(child_dev, PCI_CAP_ID_EXP);
-               pci_read_config_dword(child_dev, pos + PCI_EXP_DEVCAP, &reg32);
-               latency = (reg32 & PCI_EXP_DEVCAP_L0S) >> 6;
-               latency = calc_L0S_latency(latency, 1);
-               ep_state->l0s_acceptable_latency = latency;
-               if (link_state->support_state & PCIE_LINK_STATE_L1) {
-                       latency = (reg32 & PCI_EXP_DEVCAP_L1) >> 9;
-                       latency = calc_L1_latency(latency, 1);
-                       ep_state->l1_acceptable_latency = latency;
-               }
-       }
-}
-
-static unsigned int __pcie_aspm_check_state_one(struct pci_dev *pdev,
-       unsigned int state)
-{
-       struct pci_dev *parent_dev, *tmp_dev;
-       unsigned int latency, l1_latency = 0;
-       struct pcie_link_state *link_state;
-       struct endpoint_state *ep_state;
-
-       parent_dev = pdev->bus->self;
-       link_state = parent_dev->link_state;
-       state &= link_state->support_state;
-       if (state == 0)
-               return 0;
-       ep_state = &link_state->endpoints[PCI_FUNC(pdev->devfn)];
-
-       /*
-        * Check latency for endpoint device.
-        * TBD: The latency from the endpoint to root complex vary per
-        * switch's upstream link state above the device. Here we just do a
-        * simple check which assumes all links above the device can be in L1
-        * state, that is we just consider the worst case. If switch's upstream
-        * link can't be put into L0S/L1, then our check is too strictly.
-        */
-       tmp_dev = pdev;
-       while (state & (PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1)) {
-               parent_dev = tmp_dev->bus->self;
-               link_state = parent_dev->link_state;
-               if (state & PCIE_LINK_STATE_L0S) {
-                       latency = max_t(unsigned int,
-                                       link_state->l0s_upper_latency,
-                                       link_state->l0s_down_latency);
-                       if (latency > ep_state->l0s_acceptable_latency)
-                               state &= ~PCIE_LINK_STATE_L0S;
-               }
-               if (state & PCIE_LINK_STATE_L1) {
-                       latency = max_t(unsigned int,
-                                       link_state->l1_upper_latency,
-                                       link_state->l1_down_latency);
-                       if (latency + l1_latency >
-                                       ep_state->l1_acceptable_latency)
-                               state &= ~PCIE_LINK_STATE_L1;
-               }
-               if (!parent_dev->bus->self) /* parent_dev is a root port */
-                       break;
-               else {
-                       /*
-                        * parent_dev is the downstream port of a switch, make
-                        * tmp_dev the upstream port of the switch
-                        */
-                       tmp_dev = parent_dev->bus->self;
-                       /*
-                        * every switch on the path to root complex need 1 more
-                        * microsecond for L1. Spec doesn't mention L0S.
-                        */
-                       if (state & PCIE_LINK_STATE_L1)
-                               l1_latency += 1000;
-               }
-       }
-       return state;
-}
-
-static unsigned int pcie_aspm_check_state(struct pci_dev *pdev,
-       unsigned int state)
-{
-       struct pci_dev *child_dev;
-
-       /* If no child, disable the link */
-       if (list_empty(&pdev->subordinate->devices))
-               return 0;
-       list_for_each_entry(child_dev, &pdev->subordinate->devices, bus_list) {
-               if (child_dev->pcie_type == PCI_EXP_TYPE_PCI_BRIDGE) {
-                       /*
-                        * If downstream component of a link is pci bridge, we
-                        * disable ASPM for now for the link
-                        * */
-                       state = 0;
-                       break;
-               }
-               if ((child_dev->pcie_type != PCI_EXP_TYPE_ENDPOINT &&
-                       child_dev->pcie_type != PCI_EXP_TYPE_LEG_END))
-                       continue;
-               /* Device not in D0 doesn't need check latency */
-               if (child_dev->current_state == PCI_D1 ||
-                       child_dev->current_state == PCI_D2 ||
-                       child_dev->current_state == PCI_D3hot ||
-                       child_dev->current_state == PCI_D3cold)
-                       continue;
-               state = __pcie_aspm_check_state_one(child_dev, state);
-       }
-       return state;
-}
-
-static void __pcie_aspm_config_one_dev(struct pci_dev *pdev, unsigned int state)
-{
-       u16 reg16;
-       int pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
-
-       pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &reg16);
-       reg16 &= ~0x3;
-       reg16 |= state;
-       pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16);
-}
-
-static void __pcie_aspm_config_link(struct pci_dev *pdev, unsigned int state)
-{
-       struct pci_dev *child_dev;
-       int valid = 1;
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       /*
-        * if the downstream component has pci bridge function, don't do ASPM
-        * now
-        */
-       list_for_each_entry(child_dev, &pdev->subordinate->devices, bus_list) {
-               if (child_dev->pcie_type == PCI_EXP_TYPE_PCI_BRIDGE) {
-                       valid = 0;
-                       break;
-               }
-       }
-       if (!valid)
-               return;
-
-       /*
-        * spec 2.0 suggests all functions should be configured the same
-        * setting for ASPM. Enabling ASPM L1 should be done in upstream
-        * component first and then downstream, and vice versa for disabling
-        * ASPM L1. Spec doesn't mention L0S.
-        */
-       if (state & PCIE_LINK_STATE_L1)
-               __pcie_aspm_config_one_dev(pdev, state);
-
-       list_for_each_entry(child_dev, &pdev->subordinate->devices, bus_list)
-               __pcie_aspm_config_one_dev(child_dev, state);
-
-       if (!(state & PCIE_LINK_STATE_L1))
-               __pcie_aspm_config_one_dev(pdev, state);
-
-       link_state->enabled_state = state;
-}
-
-static void __pcie_aspm_configure_link_state(struct pci_dev *pdev,
-       unsigned int state)
-{
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       if (link_state->support_state == 0)
-               return;
-       state &= PCIE_LINK_STATE_L0S|PCIE_LINK_STATE_L1;
-
-       /* state 0 means disabling aspm */
-       state = pcie_aspm_check_state(pdev, state);
-       if (link_state->enabled_state == state)
-               return;
-       __pcie_aspm_config_link(pdev, state);
-}
-
-/*
- * pcie_aspm_configure_link_state: enable/disable PCI express link state
- * @pdev: the root port or switch downstream port
- */
-static void pcie_aspm_configure_link_state(struct pci_dev *pdev,
-       unsigned int state)
-{
-       down_read(&pci_bus_sem);
-       mutex_lock(&aspm_lock);
-       __pcie_aspm_configure_link_state(pdev, state);
-       mutex_unlock(&aspm_lock);
-       up_read(&pci_bus_sem);
-}
-
-static void free_link_state(struct pci_dev *pdev)
-{
-       kfree(pdev->link_state);
-       pdev->link_state = NULL;
-}
-
-/*
- * pcie_aspm_init_link_state: Initiate PCI express link state.
- * It is called after the pcie and its children devices are scaned.
- * @pdev: the root port or switch downstream port
- */
-void pcie_aspm_init_link_state(struct pci_dev *pdev)
-{
-       unsigned int state;
-       struct pcie_link_state *link_state;
-       int error = 0;
-
-       if (aspm_disabled || !pdev->is_pcie || pdev->link_state)
-               return;
-       if (pdev->pcie_type != PCI_EXP_TYPE_ROOT_PORT &&
-               pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM)
-               return;
-       down_read(&pci_bus_sem);
-       if (list_empty(&pdev->subordinate->devices))
-               goto out;
-
-       mutex_lock(&aspm_lock);
-
-       link_state = kzalloc(sizeof(*link_state), GFP_KERNEL);
-       if (!link_state)
-               goto unlock_out;
-       pdev->link_state = link_state;
-
-       pcie_aspm_configure_common_clock(pdev);
-
-       pcie_aspm_cap_init(pdev);
-
-       /* config link state to avoid BIOS error */
-       state = pcie_aspm_check_state(pdev, policy_to_aspm_state(pdev));
-       __pcie_aspm_config_link(pdev, state);
-
-       pcie_check_clock_pm(pdev);
-
-       link_state->pdev = pdev;
-       list_add(&link_state->sibiling, &link_list);
-
-unlock_out:
-       if (error)
-               free_link_state(pdev);
-       mutex_unlock(&aspm_lock);
-out:
-       up_read(&pci_bus_sem);
-}
-
-/* @pdev: the endpoint device */
-void pcie_aspm_exit_link_state(struct pci_dev *pdev)
-{
-       struct pci_dev *parent = pdev->bus->self;
-       struct pcie_link_state *link_state = parent->link_state;
-
-       if (aspm_disabled || !pdev->is_pcie || !parent || !link_state)
-               return;
-       if (parent->pcie_type != PCI_EXP_TYPE_ROOT_PORT &&
-               parent->pcie_type != PCI_EXP_TYPE_DOWNSTREAM)
-               return;
-       down_read(&pci_bus_sem);
-       mutex_lock(&aspm_lock);
-
-       /*
-        * All PCIe functions are in one slot, remove one function will remove
-        * the the whole slot, so just wait
-        */
-       if (!list_empty(&parent->subordinate->devices))
-               goto out;
-
-       /* All functions are removed, so just disable ASPM for the link */
-       __pcie_aspm_config_one_dev(parent, 0);
-       list_del(&link_state->sibiling);
-       /* Clock PM is for endpoint device */
-
-       free_link_state(parent);
-out:
-       mutex_unlock(&aspm_lock);
-       up_read(&pci_bus_sem);
-}
-
-/* @pdev: the root port or switch downstream port */
-void pcie_aspm_pm_state_change(struct pci_dev *pdev)
-{
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       if (aspm_disabled || !pdev->is_pcie || !pdev->link_state)
-               return;
-       if (pdev->pcie_type != PCI_EXP_TYPE_ROOT_PORT &&
-               pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM)
-               return;
-       /*
-        * devices changed PM state, we should recheck if latency meets all
-        * functions' requirement
-        */
-       pcie_aspm_configure_link_state(pdev, link_state->enabled_state);
-}
-
-/*
- * pci_disable_link_state - disable pci device's link state, so the link will
- * never enter specific states
- */
-void pci_disable_link_state(struct pci_dev *pdev, int state)
-{
-       struct pci_dev *parent = pdev->bus->self;
-       struct pcie_link_state *link_state;
-
-       if (aspm_disabled || !pdev->is_pcie)
-               return;
-       if (pdev->pcie_type == PCI_EXP_TYPE_ROOT_PORT ||
-           pdev->pcie_type == PCI_EXP_TYPE_DOWNSTREAM)
-               parent = pdev;
-       if (!parent)
-               return;
-
-       down_read(&pci_bus_sem);
-       mutex_lock(&aspm_lock);
-       link_state = parent->link_state;
-       link_state->support_state &=
-               ~(state & (PCIE_LINK_STATE_L0S|PCIE_LINK_STATE_L1));
-       if (state & PCIE_LINK_STATE_CLKPM)
-               link_state->clk_pm_capable = 0;
-
-       __pcie_aspm_configure_link_state(parent, link_state->enabled_state);
-       if (!link_state->clk_pm_capable && link_state->clk_pm_enabled)
-               pcie_set_clock_pm(parent, 0);
-       mutex_unlock(&aspm_lock);
-       up_read(&pci_bus_sem);
-}
-EXPORT_SYMBOL(pci_disable_link_state);
-
-static int pcie_aspm_set_policy(const char *val, struct kernel_param *kp)
-{
-       int i;
-       struct pci_dev *pdev;
-       struct pcie_link_state *link_state;
-
-       for (i = 0; i < ARRAY_SIZE(policy_str); i++)
-               if (!strncmp(val, policy_str[i], strlen(policy_str[i])))
-                       break;
-       if (i >= ARRAY_SIZE(policy_str))
-               return -EINVAL;
-       if (i == aspm_policy)
-               return 0;
-
-       down_read(&pci_bus_sem);
-       mutex_lock(&aspm_lock);
-       aspm_policy = i;
-       list_for_each_entry(link_state, &link_list, sibiling) {
-               pdev = link_state->pdev;
-               __pcie_aspm_configure_link_state(pdev,
-                       policy_to_aspm_state(pdev));
-               if (link_state->clk_pm_capable &&
-                   link_state->clk_pm_enabled != policy_to_clkpm_state(pdev))
-                       pcie_set_clock_pm(pdev, policy_to_clkpm_state(pdev));
-
-       }
-       mutex_unlock(&aspm_lock);
-       up_read(&pci_bus_sem);
-       return 0;
-}
-
-static int pcie_aspm_get_policy(char *buffer, struct kernel_param *kp)
-{
-       int i, cnt = 0;
-       for (i = 0; i < ARRAY_SIZE(policy_str); i++)
-               if (i == aspm_policy)
-                       cnt += sprintf(buffer + cnt, "[%s] ", policy_str[i]);
-               else
-                       cnt += sprintf(buffer + cnt, "%s ", policy_str[i]);
-       return cnt;
-}
-
-module_param_call(policy, pcie_aspm_set_policy, pcie_aspm_get_policy,
-       NULL, 0644);
-
-#ifdef CONFIG_PCIEASPM_DEBUG
-static ssize_t link_state_show(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
-{
-       struct pci_dev *pci_device = to_pci_dev(dev);
-       struct pcie_link_state *link_state = pci_device->link_state;
-
-       return sprintf(buf, "%d\n", link_state->enabled_state);
-}
-
-static ssize_t link_state_store(struct device *dev,
-               struct device_attribute *attr,
-               const char *buf,
-               size_t n)
-{
-       struct pci_dev *pci_device = to_pci_dev(dev);
-       int state;
-
-       if (n < 1)
-               return -EINVAL;
-       state = buf[0]-'0';
-       if (state >= 0 && state <= 3) {
-               /* setup link aspm state */
-               pcie_aspm_configure_link_state(pci_device, state);
-               return n;
-       }
-
-       return -EINVAL;
-}
-
-static ssize_t clk_ctl_show(struct device *dev,
-               struct device_attribute *attr,
-               char *buf)
-{
-       struct pci_dev *pci_device = to_pci_dev(dev);
-       struct pcie_link_state *link_state = pci_device->link_state;
-
-       return sprintf(buf, "%d\n", link_state->clk_pm_enabled);
-}
-
-static ssize_t clk_ctl_store(struct device *dev,
-               struct device_attribute *attr,
-               const char *buf,
-               size_t n)
-{
-       struct pci_dev *pci_device = to_pci_dev(dev);
-       int state;
-
-       if (n < 1)
-               return -EINVAL;
-       state = buf[0]-'0';
-
-       down_read(&pci_bus_sem);
-       mutex_lock(&aspm_lock);
-       pcie_set_clock_pm(pci_device, !!state);
-       mutex_unlock(&aspm_lock);
-       up_read(&pci_bus_sem);
-
-       return n;
-}
-
-static DEVICE_ATTR(link_state, 0644, link_state_show, link_state_store);
-static DEVICE_ATTR(clk_ctl, 0644, clk_ctl_show, clk_ctl_store);
-
-static char power_group[] = "power";
-void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev)
-{
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       if (!pdev->is_pcie || (pdev->pcie_type != PCI_EXP_TYPE_ROOT_PORT &&
-               pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM))
-               return;
-
-       if (link_state->support_state)
-               sysfs_add_file_to_group(&pdev->dev.kobj,
-                       &dev_attr_link_state.attr, power_group);
-       if (link_state->clk_pm_capable)
-               sysfs_add_file_to_group(&pdev->dev.kobj,
-                       &dev_attr_clk_ctl.attr, power_group);
-}
-
-void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev)
-{
-       struct pcie_link_state *link_state = pdev->link_state;
-
-       if (!pdev->is_pcie || (pdev->pcie_type != PCI_EXP_TYPE_ROOT_PORT &&
-               pdev->pcie_type != PCI_EXP_TYPE_DOWNSTREAM))
-               return;
-
-       if (link_state->support_state)
-               sysfs_remove_file_from_group(&pdev->dev.kobj,
-                       &dev_attr_link_state.attr, power_group);
-       if (link_state->clk_pm_capable)
-               sysfs_remove_file_from_group(&pdev->dev.kobj,
-                       &dev_attr_clk_ctl.attr, power_group);
-}
-#endif
-
-static int __init pcie_aspm_disable(char *str)
-{
-       aspm_disabled = 1;
-       return 1;
-}
-
-__setup("pcie_noaspm", pcie_aspm_disable);
-
-static int __init pcie_aspm_init(void)
-{
-       if (aspm_disabled)
-               return 0;
-       pci_osc_support_set(OSC_ACTIVE_STATE_PWR_SUPPORT|
-               OSC_CLOCK_PWR_CAPABILITY_SUPPORT);
-       return 0;
-}
-
-fs_initcall(pcie_aspm_init);
index 8b505bd925aa31895df3eafd4c47cb40b5d24bc3..7f5dab34d315fe504dd0b79312543a12336a6596 100644 (file)
@@ -9,7 +9,6 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/cpumask.h>
-#include <linux/aspm.h>
 #include "pci.h"
 
 #define CARDBUS_LATENCY_TIMER  176     /* secondary latency timer */
@@ -434,7 +433,7 @@ pci_alloc_child_bus(struct pci_bus *parent, struct pci_dev *bridge, int busnr)
        return child;
 }
 
-struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr)
+struct pci_bus *__ref pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int busnr)
 {
        struct pci_bus *child;
 
@@ -949,7 +948,7 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
        up_write(&pci_bus_sem);
 }
 
-struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn)
+struct pci_dev *__ref pci_scan_single_device(struct pci_bus *bus, int devfn)
 {
        struct pci_dev *dev;
 
@@ -1002,10 +1001,6 @@ int pci_scan_slot(struct pci_bus *bus, int devfn)
                                break;
                }
        }
-
-       if (bus->self)
-               pcie_aspm_init_link_state(bus->self);
-
        return nr;
 }
 
@@ -1045,20 +1040,6 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
        return max;
 }
 
-unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
-{
-       unsigned int max;
-
-       max = pci_scan_child_bus(bus);
-
-       /*
-        * Make the discovered devices available.
-        */
-       pci_bus_add_devices(bus);
-
-       return max;
-}
-
 struct pci_bus * pci_create_bus(struct device *parent,
                int bus, struct pci_ops *ops, void *sysdata)
 {
@@ -1145,7 +1126,6 @@ EXPORT_SYMBOL(pci_scan_bus_parented);
 
 #ifdef CONFIG_HOTPLUG
 EXPORT_SYMBOL(pci_add_new_bus);
-EXPORT_SYMBOL(pci_do_scan_bus);
 EXPORT_SYMBOL(pci_scan_slot);
 EXPORT_SYMBOL(pci_scan_bridge);
 EXPORT_SYMBOL_GPL(pci_scan_child_bus);
index ec4a82ba29a8d04b6739462e846395388cace68d..9684e1bde277a1e012fae641363178f394071323 100644 (file)
@@ -1,6 +1,5 @@
 #include <linux/pci.h>
 #include <linux/module.h>
-#include <linux/aspm.h>
 #include "pci.h"
 
 static void pci_free_resources(struct pci_dev *dev)
@@ -31,9 +30,6 @@ static void pci_stop_dev(struct pci_dev *dev)
                dev->global_list.next = dev->global_list.prev = NULL;
                up_write(&pci_bus_sem);
        }
-
-       if (dev->bus->self)
-               pcie_aspm_exit_link_state(dev);
 }
 
 static void pci_destroy_dev(struct pci_dev *dev)
index 8a7232feb553ffefd7dfe8f6207bcc0722dc186f..262b0439abe9e41a476629d9ac35927f2491620f 100644 (file)
@@ -456,7 +456,7 @@ pci_bus_size_cardbus(struct pci_bus *bus)
        }
 }
 
-void pci_bus_size_bridges(struct pci_bus *bus)
+void __ref pci_bus_size_bridges(struct pci_bus *bus)
 {
        struct pci_dev *dev;
        unsigned long mask, prefmask;
@@ -511,7 +511,7 @@ void pci_bus_size_bridges(struct pci_bus *bus)
 }
 EXPORT_SYMBOL(pci_bus_size_bridges);
 
-void pci_bus_assign_resources(struct pci_bus *bus)
+void __ref pci_bus_assign_resources(struct pci_bus *bus)
 {
        struct pci_bus *b;
        struct pci_dev *dev;
index c5e0d89c3ecefecf09cc03e5558b4c0aff4ca315..ec4c1253ebbb1d24273256ed23bd0ddd1ec2e020 100644 (file)
@@ -368,7 +368,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
                        handled = 1;
                        irc = pcc_get(i, PCIRC);
                        irc >>=16;
-                       debug(2, "m32r-pcc:interrput: socket %d pcirc 0x%02x ", i, irc);
+                       debug(2, "m32r-pcc:interrupt: socket %d pcirc 0x%02x ", i, irc);
                        if (!irc)
                                continue;
 
index d182760f035b1e7f8fed9d516ec4d02bdf9baa0b..4ea426a25909cdaa4082ca9e09ca2682eb239690 100644 (file)
@@ -851,7 +851,7 @@ static int m8xx_set_socket(struct pcmcia_socket *sock, socket_state_t * state)
           I tried to control the CxOE signal with SS_OUTPUT_ENA,
           but the reset signal seems connected via the 541.
           If the CxOE is left high are some signals tristated and
-          no pullups are present -> the cards act wierd.
+          no pullups are present -> the cards act weird.
           So right now the buffers are enabled if the power is on. */
 
        if (state->Vcc || state->Vpp)
index d85cb73a9f69f217cdcf9e9c779bde8dc3da3947..00a0ba040dba58ad7203d392123077bd629a7812 100644 (file)
@@ -1,6 +1,6 @@
 /* NCR53C9x.c:  Defines and structures for the NCR53C9x generic driver.
  *
- * Originaly esp.h:  Defines and structures for the Sparc ESP 
+ * Originally esp.h:  Defines and structures for the Sparc ESP 
  *                   (Enhanced SCSI Processor) driver under Linux.
  *
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
index 190568ebea3c12e15131bfb6868c212c9463caa0..5a1471c370fa70f601a845fb66e762701bc2d1a8 100644 (file)
@@ -21,7 +21,7 @@
  *  Modified by Chris Faulhaber <jedgar@fxp.org>
  *        Added module command-line options
  *        19-Jul-99
- *  Modified by Adam Fritzler <mid@auk.cx>
+ *  Modified by Adam Fritzler
  *        Added proper detection of the AHA-1640 (MCA version of AHA-1540)
  */
 
index e4f70c563bc295cc6b0a6a022f83998708964183..4c549540a35dcccfce967d2e53f498a8a987801c 100644 (file)
@@ -44,13 +44,8 @@ clean-files += aic79xx_seq.h aic79xx_reg.h aic79xx_reg_print.c
 
 # Dependencies for generated files need to be listed explicitly
 
-$(obj)/aic7xxx_core.o: $(obj)/aic7xxx_seq.h
-$(obj)/aic7xxx_core.o: $(obj)/aic7xxx_reg.h
-$(obj)/aic79xx_core.o: $(obj)/aic79xx_seq.h
-$(obj)/aic79xx_core.o: $(obj)/aic79xx_reg.h
-
-$(addprefix $(obj)/,$(aic7xxx-y)): $(obj)/aic7xxx_seq.h
-$(addprefix $(obj)/,$(aic79xx-y)): $(obj)/aic79xx_seq.h
+$(addprefix $(src)/,$(aic7xxx-y:.o=.c)): $(obj)/aic7xxx_seq.h $(obj)/aic7xxx_reg.h
+$(addprefix $(src)/,$(aic79xx-y:.o=.c)): $(obj)/aic79xx_seq.h $(obj)/aic79xx_reg.h
 
 aic7xxx-gen-$(CONFIG_AIC7XXX_BUILD_FIRMWARE)   := $(obj)/aic7xxx_reg.h
 aic7xxx-gen-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) += $(obj)/aic7xxx_reg_print.c
index 2ceb67f4af2a6ab1cfb7dac81fe3e86b4a2d5c2d..45e55575a0fad6c997f725d1489e815af31c4fff 100644 (file)
@@ -417,7 +417,7 @@ ahd_targetcmd_offset(struct ahd_softc *ahd, u_int index)
               - (uint8_t *)ahd->qoutfifo);
 }
 
-/*********************** Miscelaneous Support Functions ***********************/
+/*********************** Miscellaneous Support Functions ***********************/
 static __inline struct ahd_initiator_tinfo *
                        ahd_fetch_transinfo(struct ahd_softc *ahd,
                                            char channel, u_int our_id,
index 01465479290135bcd4d03719880bc360fc28947e..72fccd9f40df544e0686f8ea2681c34efb7bb448 100644 (file)
@@ -325,7 +325,7 @@ MODULE_PARM_DESC(aic79xx,
 "      verbose                 Enable verbose/diagnostic logging\n"
 "      allow_memio             Allow device registers to be memory mapped\n"
 "      debug                   Bitmask of debug values to enable\n"
-"      no_reset                Supress initial bus resets\n"
+"      no_reset                Suppress initial bus resets\n"
 "      extended                Enable extended geometry on all controllers\n"
 "      periodic_otag           Send an ordered tagged transaction\n"
 "                              periodically to prevent tag starvation.\n"
index df853676e66a8d7174c81862e65559c99fd45121..c9f79fdf913105d77046db61619c6432a4123dd6 100644 (file)
@@ -979,7 +979,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd)
                          |  AHD_FAINT_LED_BUG;
 
                /*
-                * IO Cell paramter setup.
+                * IO Cell parameter setup.
                 */
                AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29);
 
@@ -1006,7 +1006,7 @@ ahd_aic790X_setup(struct ahd_softc *ahd)
                        ahd->bugs |= AHD_INTCOLLISION_BUG|AHD_ABORT_LQI_BUG;
 
                /*
-                * IO Cell paramter setup.
+                * IO Cell parameter setup.
                 */
                AHD_SET_PRECOMP(ahd, AHD_PRECOMP_CUTBACK_29);
                AHD_SET_SLEWRATE(ahd, AHD_SLEWRATE_DEF_REVB);
index 8e1954cdd84f67cd114491ad0c0072d3aaec175f..cba2f23bbe7954974aab44408b480269d16bae92 100644 (file)
@@ -229,7 +229,7 @@ ahc_name(struct ahc_softc *ahc)
        return (ahc->name);
 }
 
-/*********************** Miscelaneous Support Functions ***********************/
+/*********************** Miscellaneous Support Functions ***********************/
 
 static __inline void   ahc_update_residual(struct ahc_softc *ahc,
                                            struct scb *scb);
index 99a3b33a3233591834e670c95b8152af9df3d12d..282aff6f852e85bb5b9bae950e2da1f423e5df34 100644 (file)
@@ -347,7 +347,7 @@ MODULE_PARM_DESC(aic7xxx,
 "      debug                   Bitmask of debug values to enable\n"
 "      no_probe                Toggle EISA/VLB controller probing\n"
 "      probe_eisa_vl           Toggle EISA/VLB controller probing\n"
-"      no_reset                Supress initial bus resets\n"
+"      no_reset                Suppress initial bus resets\n"
 "      extended                Enable extended geometry on all controllers\n"
 "      periodic_otag           Send an ordered tagged transaction\n"
 "                              periodically to prevent tag starvation.\n"
index 73270ff892d9699c63cd5388ae0ace773dcfc3de..2074701f7e7612959568535cfaec21bdc05b76b7 100644 (file)
@@ -7053,7 +7053,7 @@ static pci_ers_result_t ipr_pci_error_detected(struct pci_dev *pdev,
  * where it can accept new commands.
 
  * Return value:
- *     0 on sucess / -EIO on failure
+ *     0 on success / -EIO on failure
  **/
 static int __devinit ipr_probe_ioa_part2(struct ipr_ioa_cfg *ioa_cfg)
 {
index 7505cca8e68e3d1825e06c9a977e948c3a0dacf2..bb152fb9fec7dc4b3260c2b4add978ba4af0e314 100644 (file)
@@ -1309,7 +1309,7 @@ ips_intr_copperhead(ips_ha_t * ha)
                        cstatus.value = (*ha->func.statupd) (ha);
 
                if (cstatus.fields.command_id > (IPS_MAX_CMDS - 1)) {
-                       /* Spurious Interupt ? */
+                       /* Spurious Interrupt ? */
                        continue;
                }
 
index f26b9538affe232079d94cd4b9179815af441958..83567b9755b4bf9946f0be2764715d7e85c2f9d2 100644 (file)
@@ -325,7 +325,7 @@ struct lpfc_vport {
 
 #define WORKER_MBOX_TMO                0x100   /* hba: MBOX timeout */
 #define WORKER_HB_TMO                  0x200   /* hba: Heart beat timeout */
-#define WORKER_FABRIC_BLOCK_TMO        0x400   /* hba: fabric block timout */
+#define WORKER_FABRIC_BLOCK_TMO        0x400   /* hba: fabric block timeout */
 #define WORKER_RAMP_DOWN_QUEUE         0x800   /* hba: Decrease Q depth */
 #define WORKER_RAMP_UP_QUEUE           0x1000  /* hba: Increase Q depth */
 
index 29b4cf9e059ba1d149f2995316c0af6aeb96419c..6cfeba7454d46e534b35f88b36d50a20d73f721e 100644 (file)
@@ -1894,7 +1894,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
        uint16_t iotag;
        int bars = pci_select_bars(pdev, IORESOURCE_MEM);
 
-       if (pci_enable_device_bars(pdev, bars))
+       if (pci_enable_device_mem(pdev))
                goto out;
        if (pci_request_selected_regions(pdev, bars, LPFC_DRIVER_NAME))
                goto out_disable_device;
index dfc63f6ccd7bac89c8a98a41afa5e7042cea2250..7a9be4c5b7cb224128faaacba8d4dc8f9cbb3a0a 100644 (file)
@@ -880,7 +880,7 @@ lpfc_mbox_get(struct lpfc_hba * phba)
 void
 lpfc_mbox_cmpl_put(struct lpfc_hba * phba, LPFC_MBOXQ_t * mbq)
 {
-       /* This function expects to be called from interupt context */
+       /* This function expects to be called from interrupt context */
        spin_lock(&phba->hbalock);
        list_add_tail(&mbq->list, &phba->sli.mboxq_cmpl);
        spin_unlock(&phba->hbalock);
index 6db77c00e3eed4b802eeab7b9ec662194522d526..9f041929aca52ee1d978c2652c995125798fa9ce 100644 (file)
@@ -3464,12 +3464,12 @@ megaraid_mbox_setup_device_map(adapter_t *adapter)
 /*
  * START: Interface for the common management module
  *
- * This is the module, which interfaces with the common mangement module to
+ * This is the module, which interfaces with the common management module to
  * provide support for ioctl and sysfs
  */
 
 /**
- * megaraid_cmm_register - register with the mangement module
+ * megaraid_cmm_register - register with the management module
  * @adapter            : HBA soft state
  *
  * Register with the management module, which allows applications to issue
@@ -3557,7 +3557,7 @@ megaraid_cmm_register(adapter_t *adapter)
 
 
 /**
- * megaraid_cmm_unregister - un-register with the mangement module
+ * megaraid_cmm_unregister - un-register with the management module
  * @adapter            : HBA soft state
  *
  * Un-register with the management module.
@@ -3579,7 +3579,7 @@ megaraid_cmm_unregister(adapter_t *adapter)
  * @kioc               : CMM interface packet
  * @action             : command action
  *
- * This routine is invoked whenever the Common Mangement Module (CMM) has a
+ * This routine is invoked whenever the Common Management Module (CMM) has a
  * command for us. The 'action' parameter specifies if this is a new command
  * or otherwise.
  */
@@ -3944,7 +3944,7 @@ megaraid_sysfs_get_ldmap_timeout(unsigned long data)
  *
  * This routine will be called whenever user reads the logical drive
  * attributes, go get the current logical drive mapping table from the
- * firmware. We use the managment API's to issue commands to the controller.
+ * firmware. We use the management API's to issue commands to the controller.
  *
  * NOTE: The commands issuance functionality is not generalized and
  * implemented in context of "get ld map" command only. If required, the
index eb0784c9ff83af88fa9c291eaed5281041cb541b..6226d88479f59fa2a1ded8423180281a98393ab0 100644 (file)
@@ -1094,7 +1094,7 @@ qla2x00_sns_rnn_id(scsi_qla_host_t *ha)
 }
 
 /**
- * qla2x00_mgmt_svr_login() - Login to fabric Managment Service.
+ * qla2x00_mgmt_svr_login() - Login to fabric Management Service.
  * @ha: HA context
  *
  * Returns 0 on success.
index accaf690eaf0c393f620750d705c650cbee04705..d6be0762eb918977b27bd428f7057a8e25bba3af 100644 (file)
 #define MAX_REQS_SERVICED_PER_INTR     16
 
 #define ISCSI_IPADDR_SIZE              4       /* IP address size */
-#define ISCSI_ALIAS_SIZE               32      /* ISCSI Alais name size */
+#define ISCSI_ALIAS_SIZE               32      /* ISCSI Alias name size */
 #define ISCSI_NAME_SIZE                        0xE0    /* ISCSI Name size */
 
 #define LSDW(x) ((u32)((u64)(x)))
index cbe0a17ced5f9b97cde9e21e8c41640b41b16c3b..49925f92555e8a3b485316d5963bc0dd8ef6d49f 100644 (file)
@@ -1098,7 +1098,7 @@ static int qla4xxx_start_firmware(struct scsi_qla_host *ha)
                }
                config_chip = 1;
 
-               /* Reset clears the semaphore, so aquire again */
+               /* Reset clears the semaphore, so acquire again */
                if (ql4xxx_lock_drvr_wait(ha) != QLA_SUCCESS)
                        return QLA_ERROR;
        }
index 91630baea532e0656883ee2c427b21467a9bf629..3677fbb30b720d50b6777a395125ba03ae1c492b 100644 (file)
@@ -320,7 +320,7 @@ int scsi_tgt_queue_command(struct scsi_cmnd *cmd, u64 itn_id,
 EXPORT_SYMBOL_GPL(scsi_tgt_queue_command);
 
 /*
- * This is run from a interrpt handler normally and the unmap
+ * This is run from a interrupt handler normally and the unmap
  * needs process context so we must queue
  */
 static void scsi_tgt_cmd_done(struct scsi_cmnd *cmd)
index f2149d0bb9997a4caff68d9900eeb6da8de8832a..43a964d635b4e19b30d5d76c4dafcc090e8a5a14 100644 (file)
@@ -6,7 +6,7 @@
  *
  * The SAS transport class contains common code to deal with SAS HBAs,
  * an aproximated representation of SAS topologies in the driver model,
- * and various sysfs attributes to expose these topologies and managment
+ * and various sysfs attributes to expose these topologies and management
  * interfaces to userspace.
  *
  * In addition to the basic SCSI core objects this transport class
index 8a053ea21e1d57f9a8e3f41ac6e5dbced679504c..4fa7927997ad53319af9ae03fee86932dac18b6d 100644 (file)
@@ -1295,8 +1295,8 @@ config SERIAL_NETX_CONSOLE
        depends on SERIAL_NETX
        select SERIAL_CORE_CONSOLE
        help
-         If you have enabled the serial port on the Motorola IMX
-         CPU you can make it the console by answering Y to this option.
+         If you have enabled the serial port on the Hilscher NetX SoC
+         you can make it the console by answering Y to this option.
 
 config SERIAL_OF_PLATFORM
        tristate "Serial port on Open Firmware platform bus"
index 0274554967453b632be192c2ae180877d865d73b..c8029e0025c97e400ad8f674dc48d87a49982a4c 100644 (file)
@@ -20,7 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#include<linux/serial_core.h>
+#include <linux/serial_core.h>
 
 #define BAUD_TABLE_LIMIT       ((sizeof(icom_acfg_baud)/sizeof(int)) - 1)
 static int icom_acfg_baud[] = {
index 83211013deb87603e3f764106509e4454afad569..e94031731a4797af1d94b9f47db6fc51d0a8bc8c 100644 (file)
@@ -582,7 +582,7 @@ static struct parisc_driver serial_mux_driver = {
 };
 
 /**
- * mux_init - Serial MUX initalization procedure.
+ * mux_init - Serial MUX initialization procedure.
  *
  * Register the Serial MUX driver.
  */
index 2cd8573fb09c0a5f514440de93c8dd6459e6ed6e..639963eb1ac124d21d53628e052e10ac5be3f59d 100644 (file)
 #define SPI_FIFO_BYTE_WIDTH            (2)
 #define SPI_FIFO_OVERFLOW_MARGIN       (2)
 
-/* DMA burst lenght for half full/empty request trigger */
+/* DMA burst length for half full/empty request trigger */
 #define SPI_DMA_BLR                    (SPI_FIFO_DEPTH * SPI_FIFO_BYTE_WIDTH / 2)
 
 /* Dummy char output to achieve reads.
index 1a31f7a72848d0cb8329c95c73b94f18efe27b51..2d27d6d6d08ebe40fdf4b02e4c4a66b601307e11 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Broadcom 43xx PCI-SSB bridge module
  *
- * This technically is a seperate PCI driver module, but
+ * This technically is a separate PCI driver module, but
  * because of its small size we include it in the SSB core
  * instead of creating a standalone module.
  *
index 83ee3e75386cf7a4d1676a60d30b3f621d580989..675abdafc2d8d047741ed3b8fdf2c0291343440c 100644 (file)
@@ -2561,7 +2561,7 @@ static void radeon_set_suspend(struct radeonfb_info *rinfo, int suspend)
                        pci_read_config_dword(rinfo->pdev, i * 4,
                                              &rinfo->cfg_save[i]);
 
-               /* Switch PCI power managment to D2. */
+               /* Switch PCI power management to D2. */
                pci_disable_device(rinfo->pdev);
                for (;;) {
                        pci_read_config_word(
index e23324d10be269cf60767e2a486de897e39edb37..9704b73135f54588e08c1c57075bf61491c67dd7 100644 (file)
@@ -1156,7 +1156,7 @@ static struct fb_ops cyblafb_ops __devinitdata = {
 // need altered timings to display correctly. So I decided that it is much
 // better to provide a limited optimized set of modes plus the option of
 // using the mode in effect at startup time (might be selected using the
-// vga=??? paramter). After that the user might use fbset to select any
+// vga=??? parameter). After that the user might use fbset to select any
 // mode he likes, check_var will not try to alter geometry parameters as
 // it would be necessary otherwise.
 //
index 2fe3f7def5305ed5c422c0bed9db2a558bf591b4..8367961779420c275b0b5e2f0a693b2f702fa73c 100644 (file)
 
 #define FIXED_MODE(d) ((d)->fixed_mode)
 
-/*** Driver paramters ***/
+/*** Driver parameters ***/
 
 #define RINGBUFFER_SIZE                KB(64)
 #define HW_CURSOR_SIZE         KB(4)
index 9085188d815e0bd1e301523351f71eed38bb25cb..fb19ed4992dbc670d9f89c017995bd8c8faa9d5d 100644 (file)
@@ -312,7 +312,7 @@ static irqreturn_t lcdc_irq_handler(int irq, void *dev_id)
 /*
  * Change to a new video mode. We defer this to a later time to avoid any
  * flicker and not to mess up the current LCD DMA context. For this we disable
- * the LCD controler, which will generate a DONE irq after the last frame has
+ * the LCD controller, which will generate a DONE irq after the last frame has
  * been transferred. Then it'll be safe to reconfigure both the LCD controller
  * as well as the LCD DMA.
  */
index 1be95a68d69678d4ba05400bedd506467826cb99..58f200c69be31378585fa34961439c584ef3a441 100644 (file)
@@ -48,7 +48,7 @@ enum sm501_controller {
        HEAD_PANEL      = 1,
 };
 
-/* SM501 memory adress */
+/* SM501 memory address */
 struct sm501_mem {
        unsigned long    size;
        unsigned long    sm_addr;
index 9e33fc4da875010f11b95e1512f57ba69c593e01..3dd6294d10b64066b1660a33542ce2c726c2aa84 100644 (file)
@@ -1,8 +1,35 @@
 # Virtio always gets selected by whoever wants it.
 config VIRTIO
-       bool
+       tristate
 
 # Similarly the virtio ring implementation.
 config VIRTIO_RING
-       bool
+       tristate
        depends on VIRTIO
+
+config VIRTIO_PCI
+       tristate "PCI driver for virtio devices (EXPERIMENTAL)"
+       depends on PCI && EXPERIMENTAL
+       select VIRTIO
+       select VIRTIO_RING
+       ---help---
+         This drivers provides support for virtio based paravirtual device
+         drivers over PCI.  This requires that your VMM has appropriate PCI
+         virtio backends.  Most QEMU based VMMs should support these devices
+         (like KVM or Xen).
+
+         Currently, the ABI is not considered stable so there is no guarantee
+         that this version of the driver will work with your VMM.
+
+         If unsure, say M.
+
+config VIRTIO_BALLOON
+       tristate "Virtio balloon driver (EXPERIMENTAL)"
+       select VIRTIO
+       select VIRTIO_RING
+       ---help---
+        This driver supports increasing and decreasing the amount
+        of memory within a KVM guest.
+
+        If unsure, say M.
+
index f70e40971dd9bc93221aff170949f6d6674e1af2..6738c446c199e5af4ebfdb655166c1d7dc2fa065 100644 (file)
@@ -1,2 +1,4 @@
 obj-$(CONFIG_VIRTIO) += virtio.o
 obj-$(CONFIG_VIRTIO_RING) += virtio_ring.o
+obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o
+obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o
index 69d7ea02cd489bac96c3e3051678b669547e0211..b535483bc556f5f153eb434583c8dc6593377164 100644 (file)
@@ -102,9 +102,13 @@ static int virtio_dev_remove(struct device *_d)
        struct virtio_driver *drv = container_of(dev->dev.driver,
                                                 struct virtio_driver, driver);
 
-       dev->config->set_status(dev, dev->config->get_status(dev)
-                               & ~VIRTIO_CONFIG_S_DRIVER);
        drv->remove(dev);
+
+       /* Driver should have reset device. */
+       BUG_ON(dev->config->get_status(dev));
+
+       /* Acknowledge the device's existence again. */
+       add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE);
        return 0;
 }
 
@@ -130,6 +134,10 @@ int register_virtio_device(struct virtio_device *dev)
        dev->dev.bus = &virtio_bus;
        sprintf(dev->dev.bus_id, "%u", dev->index);
 
+       /* We always start by resetting the device, in case a previous
+        * driver messed it up.  This also tests that code path a little. */
+       dev->config->reset(dev);
+
        /* Acknowledge that we've seen the device. */
        add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE);
 
@@ -148,55 +156,18 @@ void unregister_virtio_device(struct virtio_device *dev)
 }
 EXPORT_SYMBOL_GPL(unregister_virtio_device);
 
-int __virtio_config_val(struct virtio_device *vdev,
-                       u8 type, void *val, size_t size)
-{
-       void *token;
-       unsigned int len;
-
-       token = vdev->config->find(vdev, type, &len);
-       if (!token)
-               return -ENOENT;
-
-       if (len != size)
-               return -EIO;
-
-       vdev->config->get(vdev, token, val, size);
-       return 0;
-}
-EXPORT_SYMBOL_GPL(__virtio_config_val);
-
-int virtio_use_bit(struct virtio_device *vdev,
-                  void *token, unsigned int len, unsigned int bitnum)
-{
-       unsigned long bits[16];
-
-       /* This makes it convenient to pass-through find() results. */
-       if (!token)
-               return 0;
-
-       /* bit not in range of this bitfield? */
-       if (bitnum * 8 >= len / 2)
-               return 0;
-
-       /* Giant feature bitfields are silly. */
-       BUG_ON(len > sizeof(bits));
-       vdev->config->get(vdev, token, bits, len);
-
-       if (!test_bit(bitnum, bits))
-               return 0;
-
-       /* Set acknowledge bit, and write it back. */
-       set_bit(bitnum + len * 8 / 2, bits);
-       vdev->config->set(vdev, token, bits, len);
-       return 1;
-}
-EXPORT_SYMBOL_GPL(virtio_use_bit);
-
 static int virtio_init(void)
 {
        if (bus_register(&virtio_bus) != 0)
                panic("virtio bus registration failed");
        return 0;
 }
+
+static void __exit virtio_exit(void)
+{
+       bus_unregister(&virtio_bus);
+}
 core_initcall(virtio_init);
+module_exit(virtio_exit);
+
+MODULE_LICENSE("GPL");
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
new file mode 100644 (file)
index 0000000..622aece
--- /dev/null
@@ -0,0 +1,284 @@
+/* Virtio balloon implementation, inspired by Dor Loar and Marcelo
+ * Tosatti's implementations.
+ *
+ *  Copyright 2008 Rusty Russell IBM Corporation
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+//#define DEBUG
+#include <linux/virtio.h>
+#include <linux/virtio_balloon.h>
+#include <linux/swap.h>
+#include <linux/kthread.h>
+#include <linux/freezer.h>
+
+struct virtio_balloon
+{
+       struct virtio_device *vdev;
+       struct virtqueue *inflate_vq, *deflate_vq;
+
+       /* Where the ballooning thread waits for config to change. */
+       wait_queue_head_t config_change;
+
+       /* The thread servicing the balloon. */
+       struct task_struct *thread;
+
+       /* Waiting for host to ack the pages we released. */
+       struct completion acked;
+
+       /* Do we have to tell Host *before* we reuse pages? */
+       bool tell_host_first;
+
+       /* The pages we've told the Host we're not using. */
+       unsigned int num_pages;
+       struct list_head pages;
+
+       /* The array of pfns we tell the Host about. */
+       unsigned int num_pfns;
+       u32 pfns[256];
+};
+
+static struct virtio_device_id id_table[] = {
+       { VIRTIO_ID_BALLOON, VIRTIO_DEV_ANY_ID },
+       { 0 },
+};
+
+static void balloon_ack(struct virtqueue *vq)
+{
+       struct virtio_balloon *vb;
+       unsigned int len;
+
+       vb = vq->vq_ops->get_buf(vq, &len);
+       if (vb)
+               complete(&vb->acked);
+}
+
+static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
+{
+       struct scatterlist sg;
+
+       sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns);
+
+       init_completion(&vb->acked);
+
+       /* We should always be able to add one buffer to an empty queue. */
+       if (vq->vq_ops->add_buf(vq, &sg, 1, 0, vb) != 0)
+               BUG();
+       vq->vq_ops->kick(vq);
+
+       /* When host has read buffer, this completes via balloon_ack */
+       wait_for_completion(&vb->acked);
+}
+
+static void fill_balloon(struct virtio_balloon *vb, size_t num)
+{
+       /* We can only do one array worth at a time. */
+       num = min(num, ARRAY_SIZE(vb->pfns));
+
+       for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
+               struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY);
+               if (!page) {
+                       if (printk_ratelimit())
+                               dev_printk(KERN_INFO, &vb->vdev->dev,
+                                          "Out of puff! Can't get %zu pages\n",
+                                          num);
+                       /* Sleep for at least 1/5 of a second before retry. */
+                       msleep(200);
+                       break;
+               }
+               vb->pfns[vb->num_pfns] = page_to_pfn(page);
+               totalram_pages--;
+               vb->num_pages++;
+               list_add(&page->lru, &vb->pages);
+       }
+
+       /* Didn't get any?  Oh well. */
+       if (vb->num_pfns == 0)
+               return;
+
+       tell_host(vb, vb->inflate_vq);
+}
+
+static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
+{
+       unsigned int i;
+
+       for (i = 0; i < num; i++) {
+               __free_page(pfn_to_page(pfns[i]));
+               totalram_pages++;
+       }
+}
+
+static void leak_balloon(struct virtio_balloon *vb, size_t num)
+{
+       struct page *page;
+
+       /* We can only do one array worth at a time. */
+       num = min(num, ARRAY_SIZE(vb->pfns));
+
+       for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
+               page = list_first_entry(&vb->pages, struct page, lru);
+               list_del(&page->lru);
+               vb->pfns[vb->num_pfns] = page_to_pfn(page);
+               vb->num_pages--;
+       }
+
+       if (vb->tell_host_first) {
+               tell_host(vb, vb->deflate_vq);
+               release_pages_by_pfn(vb->pfns, vb->num_pfns);
+       } else {
+               release_pages_by_pfn(vb->pfns, vb->num_pfns);
+               tell_host(vb, vb->deflate_vq);
+       }
+}
+
+static void virtballoon_changed(struct virtio_device *vdev)
+{
+       struct virtio_balloon *vb = vdev->priv;
+
+       wake_up(&vb->config_change);
+}
+
+static inline int towards_target(struct virtio_balloon *vb)
+{
+       u32 v;
+       __virtio_config_val(vb->vdev,
+                           offsetof(struct virtio_balloon_config, num_pages),
+                           &v);
+       return v - vb->num_pages;
+}
+
+static void update_balloon_size(struct virtio_balloon *vb)
+{
+       __le32 actual = cpu_to_le32(vb->num_pages);
+
+       vb->vdev->config->set(vb->vdev,
+                             offsetof(struct virtio_balloon_config, actual),
+                             &actual, sizeof(actual));
+}
+
+static int balloon(void *_vballoon)
+{
+       struct virtio_balloon *vb = _vballoon;
+
+       set_freezable();
+       while (!kthread_should_stop()) {
+               int diff;
+
+               try_to_freeze();
+               wait_event_interruptible(vb->config_change,
+                                        (diff = towards_target(vb)) != 0
+                                        || kthread_should_stop());
+               if (diff > 0)
+                       fill_balloon(vb, diff);
+               else if (diff < 0)
+                       leak_balloon(vb, -diff);
+               update_balloon_size(vb);
+       }
+       return 0;
+}
+
+static int virtballoon_probe(struct virtio_device *vdev)
+{
+       struct virtio_balloon *vb;
+       int err;
+
+       vdev->priv = vb = kmalloc(sizeof(*vb), GFP_KERNEL);
+       if (!vb) {
+               err = -ENOMEM;
+               goto out;
+       }
+
+       INIT_LIST_HEAD(&vb->pages);
+       vb->num_pages = 0;
+       init_waitqueue_head(&vb->config_change);
+       vb->vdev = vdev;
+
+       /* We expect two virtqueues. */
+       vb->inflate_vq = vdev->config->find_vq(vdev, 0, balloon_ack);
+       if (IS_ERR(vb->inflate_vq)) {
+               err = PTR_ERR(vb->inflate_vq);
+               goto out_free_vb;
+       }
+
+       vb->deflate_vq = vdev->config->find_vq(vdev, 1, balloon_ack);
+       if (IS_ERR(vb->deflate_vq)) {
+               err = PTR_ERR(vb->deflate_vq);
+               goto out_del_inflate_vq;
+       }
+
+       vb->thread = kthread_run(balloon, vb, "vballoon");
+       if (IS_ERR(vb->thread)) {
+               err = PTR_ERR(vb->thread);
+               goto out_del_deflate_vq;
+       }
+
+       vb->tell_host_first
+               = vdev->config->feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST);
+
+       return 0;
+
+out_del_deflate_vq:
+       vdev->config->del_vq(vb->deflate_vq);
+out_del_inflate_vq:
+       vdev->config->del_vq(vb->inflate_vq);
+out_free_vb:
+       kfree(vb);
+out:
+       return err;
+}
+
+static void virtballoon_remove(struct virtio_device *vdev)
+{
+       struct virtio_balloon *vb = vdev->priv;
+
+       kthread_stop(vb->thread);
+
+       /* There might be pages left in the balloon: free them. */
+       while (vb->num_pages)
+               leak_balloon(vb, vb->num_pages);
+
+       /* Now we reset the device so we can clean up the queues. */
+       vdev->config->reset(vdev);
+
+       vdev->config->del_vq(vb->deflate_vq);
+       vdev->config->del_vq(vb->inflate_vq);
+       kfree(vb);
+}
+
+static struct virtio_driver virtio_balloon = {
+       .driver.name =  KBUILD_MODNAME,
+       .driver.owner = THIS_MODULE,
+       .id_table =     id_table,
+       .probe =        virtballoon_probe,
+       .remove =       __devexit_p(virtballoon_remove),
+       .config_changed = virtballoon_changed,
+};
+
+static int __init init(void)
+{
+       return register_virtio_driver(&virtio_balloon);
+}
+
+static void __exit fini(void)
+{
+       unregister_virtio_driver(&virtio_balloon);
+}
+module_init(init);
+module_exit(fini);
+
+MODULE_DEVICE_TABLE(virtio, id_table);
+MODULE_DESCRIPTION("Virtio balloon driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
new file mode 100644 (file)
index 0000000..26f787d
--- /dev/null
@@ -0,0 +1,446 @@
+/*
+ * Virtio PCI driver
+ *
+ * This module allows virtio devices to be used over a virtual PCI device.
+ * This can be used with QEMU based VMMs like KVM or Xen.
+ *
+ * Copyright IBM Corp. 2007
+ *
+ * Authors:
+ *  Anthony Liguori  <aliguori@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/list.h>
+#include <linux/pci.h>
+#include <linux/interrupt.h>
+#include <linux/virtio.h>
+#include <linux/virtio_config.h>
+#include <linux/virtio_ring.h>
+#include <linux/virtio_pci.h>
+#include <linux/highmem.h>
+#include <linux/spinlock.h>
+
+MODULE_AUTHOR("Anthony Liguori <aliguori@us.ibm.com>");
+MODULE_DESCRIPTION("virtio-pci");
+MODULE_LICENSE("GPL");
+MODULE_VERSION("1");
+
+/* Our device structure */
+struct virtio_pci_device
+{
+       struct virtio_device vdev;
+       struct pci_dev *pci_dev;
+
+       /* the IO mapping for the PCI config space */
+       void *ioaddr;
+
+       /* a list of queues so we can dispatch IRQs */
+       spinlock_t lock;
+       struct list_head virtqueues;
+};
+
+struct virtio_pci_vq_info
+{
+       /* the actual virtqueue */
+       struct virtqueue *vq;
+
+       /* the number of entries in the queue */
+       int num;
+
+       /* the index of the queue */
+       int queue_index;
+
+       /* the virtual address of the ring queue */
+       void *queue;
+
+       /* the list node for the virtqueues list */
+       struct list_head node;
+};
+
+/* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. */
+static struct pci_device_id virtio_pci_id_table[] = {
+       { 0x1af4, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0 },
+};
+
+MODULE_DEVICE_TABLE(pci, virtio_pci_id_table);
+
+/* A PCI device has it's own struct device and so does a virtio device so
+ * we create a place for the virtio devices to show up in sysfs.  I think it
+ * would make more sense for virtio to not insist on having it's own device. */
+static struct device virtio_pci_root = {
+       .parent         = NULL,
+       .bus_id         = "virtio-pci",
+};
+
+/* Unique numbering for devices under the kvm root */
+static unsigned int dev_index;
+
+/* Convert a generic virtio device to our structure */
+static struct virtio_pci_device *to_vp_device(struct virtio_device *vdev)
+{
+       return container_of(vdev, struct virtio_pci_device, vdev);
+}
+
+/* virtio config->feature() implementation */
+static bool vp_feature(struct virtio_device *vdev, unsigned bit)
+{
+       struct virtio_pci_device *vp_dev = to_vp_device(vdev);
+       u32 mask;
+
+       /* Since this function is supposed to have the side effect of
+        * enabling a queried feature, we simulate that by doing a read
+        * from the host feature bitmask and then writing to the guest
+        * feature bitmask */
+       mask = ioread32(vp_dev->ioaddr + VIRTIO_PCI_HOST_FEATURES);
+       if (mask & (1 << bit)) {
+               mask |= (1 << bit);
+               iowrite32(mask, vp_dev->ioaddr + VIRTIO_PCI_GUEST_FEATURES);
+       }
+
+       return !!(mask & (1 << bit));
+}
+
+/* virtio config->get() implementation */
+static void vp_get(struct virtio_device *vdev, unsigned offset,
+                  void *buf, unsigned len)
+{
+       struct virtio_pci_device *vp_dev = to_vp_device(vdev);
+       void *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset;
+       u8 *ptr = buf;
+       int i;
+
+       for (i = 0; i < len; i++)
+               ptr[i] = ioread8(ioaddr + i);
+}
+
+/* the config->set() implementation.  it's symmetric to the config->get()
+ * implementation */
+static void vp_set(struct virtio_device *vdev, unsigned offset,
+                  const void *buf, unsigned len)
+{
+       struct virtio_pci_device *vp_dev = to_vp_device(vdev);
+       void *ioaddr = vp_dev->ioaddr + VIRTIO_PCI_CONFIG + offset;
+       const u8 *ptr = buf;
+       int i;
+
+       for (i = 0; i < len; i++)
+               iowrite8(ptr[i], ioaddr + i);
+}
+
+/* config->{get,set}_status() implementations */
+static u8 vp_get_status(struct virtio_device *vdev)
+{
+       struct virtio_pci_device *vp_dev = to_vp_device(vdev);
+       return ioread8(vp_dev->ioaddr + VIRTIO_PCI_STATUS);
+}
+
+static void vp_set_status(struct virtio_device *vdev, u8 status)
+{
+       struct virtio_pci_device *vp_dev = to_vp_device(vdev);
+       /* We should never be setting status to 0. */
+       BUG_ON(status == 0);
+       return iowrite8(status, vp_dev->ioaddr + VIRTIO_PCI_STATUS);
+}
+
+static void vp_reset(struct virtio_device *vdev)
+{
+       struct virtio_pci_device *vp_dev = to_vp_device(vdev);
+       /* 0 status means a reset. */
+       return iowrite8(0, vp_dev->ioaddr + VIRTIO_PCI_STATUS);
+}
+
+/* the notify function used when creating a virt queue */
+static void vp_notify(struct virtqueue *vq)
+{
+       struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev);
+       struct virtio_pci_vq_info *info = vq->priv;
+
+       /* we write the queue's selector into the notification register to
+        * signal the other end */
+       iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NOTIFY);
+}
+
+/* A small wrapper to also acknowledge the interrupt when it's handled.
+ * I really need an EIO hook for the vring so I can ack the interrupt once we
+ * know that we'll be handling the IRQ but before we invoke the callback since
+ * the callback may notify the host which results in the host attempting to
+ * raise an interrupt that we would then mask once we acknowledged the
+ * interrupt. */
+static irqreturn_t vp_interrupt(int irq, void *opaque)
+{
+       struct virtio_pci_device *vp_dev = opaque;
+       struct virtio_pci_vq_info *info;
+       irqreturn_t ret = IRQ_NONE;
+       u8 isr;
+
+       /* reading the ISR has the effect of also clearing it so it's very
+        * important to save off the value. */
+       isr = ioread8(vp_dev->ioaddr + VIRTIO_PCI_ISR);
+
+       /* It's definitely not us if the ISR was not high */
+       if (!isr)
+               return IRQ_NONE;
+
+       /* Configuration change?  Tell driver if it wants to know. */
+       if (isr & VIRTIO_PCI_ISR_CONFIG) {
+               struct virtio_driver *drv;
+               drv = container_of(vp_dev->vdev.dev.driver,
+                                  struct virtio_driver, driver);
+
+               if (drv->config_changed)
+                       drv->config_changed(&vp_dev->vdev);
+       }
+
+       spin_lock(&vp_dev->lock);
+       list_for_each_entry(info, &vp_dev->virtqueues, node) {
+               if (vring_interrupt(irq, info->vq) == IRQ_HANDLED)
+                       ret = IRQ_HANDLED;
+       }
+       spin_unlock(&vp_dev->lock);
+
+       return ret;
+}
+
+/* the config->find_vq() implementation */
+static struct virtqueue *vp_find_vq(struct virtio_device *vdev, unsigned index,
+                                   void (*callback)(struct virtqueue *vq))
+{
+       struct virtio_pci_device *vp_dev = to_vp_device(vdev);
+       struct virtio_pci_vq_info *info;
+       struct virtqueue *vq;
+       u16 num;
+       int err;
+
+       /* Select the queue we're interested in */
+       iowrite16(index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL);
+
+       /* Check if queue is either not available or already active. */
+       num = ioread16(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_NUM);
+       if (!num || ioread32(vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN))
+               return ERR_PTR(-ENOENT);
+
+       /* allocate and fill out our structure the represents an active
+        * queue */
+       info = kmalloc(sizeof(struct virtio_pci_vq_info), GFP_KERNEL);
+       if (!info)
+               return ERR_PTR(-ENOMEM);
+
+       info->queue_index = index;
+       info->num = num;
+
+       info->queue = kzalloc(PAGE_ALIGN(vring_size(num,PAGE_SIZE)), GFP_KERNEL);
+       if (info->queue == NULL) {
+               err = -ENOMEM;
+               goto out_info;
+       }
+
+       /* activate the queue */
+       iowrite32(virt_to_phys(info->queue) >> PAGE_SHIFT,
+                 vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);
+
+       /* create the vring */
+       vq = vring_new_virtqueue(info->num, vdev, info->queue,
+                                vp_notify, callback);
+       if (!vq) {
+               err = -ENOMEM;
+               goto out_activate_queue;
+       }
+
+       vq->priv = info;
+       info->vq = vq;
+
+       spin_lock(&vp_dev->lock);
+       list_add(&info->node, &vp_dev->virtqueues);
+       spin_unlock(&vp_dev->lock);
+
+       return vq;
+
+out_activate_queue:
+       iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);
+       kfree(info->queue);
+out_info:
+       kfree(info);
+       return ERR_PTR(err);
+}
+
+/* the config->del_vq() implementation */
+static void vp_del_vq(struct virtqueue *vq)
+{
+       struct virtio_pci_device *vp_dev = to_vp_device(vq->vdev);
+       struct virtio_pci_vq_info *info = vq->priv;
+
+       spin_lock(&vp_dev->lock);
+       list_del(&info->node);
+       spin_unlock(&vp_dev->lock);
+
+       vring_del_virtqueue(vq);
+
+       /* Select and deactivate the queue */
+       iowrite16(info->queue_index, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_SEL);
+       iowrite32(0, vp_dev->ioaddr + VIRTIO_PCI_QUEUE_PFN);
+
+       kfree(info->queue);
+       kfree(info);
+}
+
+static struct virtio_config_ops virtio_pci_config_ops = {
+       .feature        = vp_feature,
+       .get            = vp_get,
+       .set            = vp_set,
+       .get_status     = vp_get_status,
+       .set_status     = vp_set_status,
+       .reset          = vp_reset,
+       .find_vq        = vp_find_vq,
+       .del_vq         = vp_del_vq,
+};
+
+/* the PCI probing function */
+static int __devinit virtio_pci_probe(struct pci_dev *pci_dev,
+                                     const struct pci_device_id *id)
+{
+       struct virtio_pci_device *vp_dev;
+       int err;
+
+       /* We only own devices >= 0x1000 and <= 0x103f: leave the rest. */
+       if (pci_dev->device < 0x1000 || pci_dev->device > 0x103f)
+               return -ENODEV;
+
+       if (pci_dev->revision != VIRTIO_PCI_ABI_VERSION) {
+               printk(KERN_ERR "virtio_pci: expected ABI version %d, got %d\n",
+                      VIRTIO_PCI_ABI_VERSION, pci_dev->revision);
+               return -ENODEV;
+       }
+
+       /* allocate our structure and fill it out */
+       vp_dev = kzalloc(sizeof(struct virtio_pci_device), GFP_KERNEL);
+       if (vp_dev == NULL)
+               return -ENOMEM;
+
+       snprintf(vp_dev->vdev.dev.bus_id, BUS_ID_SIZE, "virtio%d", dev_index);
+       vp_dev->vdev.index = dev_index;
+       dev_index++;
+
+       vp_dev->vdev.dev.parent = &virtio_pci_root;
+       vp_dev->vdev.config = &virtio_pci_config_ops;
+       vp_dev->pci_dev = pci_dev;
+       INIT_LIST_HEAD(&vp_dev->virtqueues);
+       spin_lock_init(&vp_dev->lock);
+
+       /* enable the device */
+       err = pci_enable_device(pci_dev);
+       if (err)
+               goto out;
+
+       err = pci_request_regions(pci_dev, "virtio-pci");
+       if (err)
+               goto out_enable_device;
+
+       vp_dev->ioaddr = pci_iomap(pci_dev, 0, 0);
+       if (vp_dev->ioaddr == NULL)
+               goto out_req_regions;
+
+       pci_set_drvdata(pci_dev, vp_dev);
+
+       /* we use the subsystem vendor/device id as the virtio vendor/device
+        * id.  this allows us to use the same PCI vendor/device id for all
+        * virtio devices and to identify the particular virtio driver by
+        * the subsytem ids */
+       vp_dev->vdev.id.vendor = pci_dev->subsystem_vendor;
+       vp_dev->vdev.id.device = pci_dev->subsystem_device;
+
+       /* register a handler for the queue with the PCI device's interrupt */
+       err = request_irq(vp_dev->pci_dev->irq, vp_interrupt, IRQF_SHARED,
+                         vp_dev->vdev.dev.bus_id, vp_dev);
+       if (err)
+               goto out_set_drvdata;
+
+       /* finally register the virtio device */
+       err = register_virtio_device(&vp_dev->vdev);
+       if (err)
+               goto out_req_irq;
+
+       return 0;
+
+out_req_irq:
+       free_irq(pci_dev->irq, vp_dev);
+out_set_drvdata:
+       pci_set_drvdata(pci_dev, NULL);
+       pci_iounmap(pci_dev, vp_dev->ioaddr);
+out_req_regions:
+       pci_release_regions(pci_dev);
+out_enable_device:
+       pci_disable_device(pci_dev);
+out:
+       kfree(vp_dev);
+       return err;
+}
+
+static void __devexit virtio_pci_remove(struct pci_dev *pci_dev)
+{
+       struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
+
+       free_irq(pci_dev->irq, vp_dev);
+       pci_set_drvdata(pci_dev, NULL);
+       pci_iounmap(pci_dev, vp_dev->ioaddr);
+       pci_release_regions(pci_dev);
+       pci_disable_device(pci_dev);
+       kfree(vp_dev);
+}
+
+#ifdef CONFIG_PM
+static int virtio_pci_suspend(struct pci_dev *pci_dev, pm_message_t state)
+{
+       pci_save_state(pci_dev);
+       pci_set_power_state(pci_dev, PCI_D3hot);
+       return 0;
+}
+
+static int virtio_pci_resume(struct pci_dev *pci_dev)
+{
+       pci_restore_state(pci_dev);
+       pci_set_power_state(pci_dev, PCI_D0);
+       return 0;
+}
+#endif
+
+static struct pci_driver virtio_pci_driver = {
+       .name           = "virtio-pci",
+       .id_table       = virtio_pci_id_table,
+       .probe          = virtio_pci_probe,
+       .remove         = virtio_pci_remove,
+#ifdef CONFIG_PM
+       .suspend        = virtio_pci_suspend,
+       .resume         = virtio_pci_resume,
+#endif
+};
+
+static int __init virtio_pci_init(void)
+{
+       int err;
+
+       err = device_register(&virtio_pci_root);
+       if (err)
+               return err;
+
+       err = pci_register_driver(&virtio_pci_driver);
+       if (err)
+               device_unregister(&virtio_pci_root);
+
+       return err;
+}
+
+module_init(virtio_pci_init);
+
+static void __exit virtio_pci_exit(void)
+{
+       device_unregister(&virtio_pci_root);
+       pci_unregister_driver(&virtio_pci_driver);
+}
+
+module_exit(virtio_pci_exit);
index 1dc04b6684e6a3ce03451923d09164480932eebd..3a28c1382131d04940035448d24aada5244e7589 100644 (file)
@@ -87,6 +87,8 @@ static int vring_add_buf(struct virtqueue *_vq,
        if (vq->num_free < out + in) {
                pr_debug("Can't add buf len %i - avail = %i\n",
                         out + in, vq->num_free);
+               /* We notify *even if* VRING_USED_F_NO_NOTIFY is set here. */
+               vq->notify(&vq->vq);
                END_USE(vq);
                return -ENOSPC;
        }
@@ -97,16 +99,14 @@ static int vring_add_buf(struct virtqueue *_vq,
        head = vq->free_head;
        for (i = vq->free_head; out; i = vq->vring.desc[i].next, out--) {
                vq->vring.desc[i].flags = VRING_DESC_F_NEXT;
-               vq->vring.desc[i].addr = (page_to_pfn(sg_page(sg))<<PAGE_SHIFT)
-                       + sg->offset;
+               vq->vring.desc[i].addr = sg_phys(sg);
                vq->vring.desc[i].len = sg->length;
                prev = i;
                sg++;
        }
        for (; in; i = vq->vring.desc[i].next, in--) {
                vq->vring.desc[i].flags = VRING_DESC_F_NEXT|VRING_DESC_F_WRITE;
-               vq->vring.desc[i].addr = (page_to_pfn(sg_page(sg))<<PAGE_SHIFT)
-                       + sg->offset;
+               vq->vring.desc[i].addr = sg_phys(sg);
                vq->vring.desc[i].len = sg->length;
                prev = i;
                sg++;
@@ -171,16 +171,6 @@ static void detach_buf(struct vring_virtqueue *vq, unsigned int head)
        vq->num_free++;
 }
 
-/* FIXME: We need to tell other side about removal, to synchronize. */
-static void vring_shutdown(struct virtqueue *_vq)
-{
-       struct vring_virtqueue *vq = to_vvq(_vq);
-       unsigned int i;
-
-       for (i = 0; i < vq->vring.num; i++)
-               detach_buf(vq, i);
-}
-
 static inline bool more_used(const struct vring_virtqueue *vq)
 {
        return vq->last_used_idx != vq->vring.used->idx;
@@ -220,7 +210,17 @@ static void *vring_get_buf(struct virtqueue *_vq, unsigned int *len)
        return ret;
 }
 
-static bool vring_restart(struct virtqueue *_vq)
+static void vring_disable_cb(struct virtqueue *_vq)
+{
+       struct vring_virtqueue *vq = to_vvq(_vq);
+
+       START_USE(vq);
+       BUG_ON(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT);
+       vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
+       END_USE(vq);
+}
+
+static bool vring_enable_cb(struct virtqueue *_vq)
 {
        struct vring_virtqueue *vq = to_vvq(_vq);
 
@@ -253,26 +253,34 @@ irqreturn_t vring_interrupt(int irq, void *_vq)
        if (unlikely(vq->broken))
                return IRQ_HANDLED;
 
+       /* Other side may have missed us turning off the interrupt,
+        * but we should preserve disable semantic for virtio users. */
+       if (unlikely(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)) {
+               pr_debug("virtqueue interrupt after disable for %p\n", vq);
+               return IRQ_HANDLED;
+       }
+
        pr_debug("virtqueue callback for %p (%p)\n", vq, vq->vq.callback);
-       if (vq->vq.callback && !vq->vq.callback(&vq->vq))
-               vq->vring.avail->flags |= VRING_AVAIL_F_NO_INTERRUPT;
+       if (vq->vq.callback)
+               vq->vq.callback(&vq->vq);
 
        return IRQ_HANDLED;
 }
+EXPORT_SYMBOL_GPL(vring_interrupt);
 
 static struct virtqueue_ops vring_vq_ops = {
        .add_buf = vring_add_buf,
        .get_buf = vring_get_buf,
        .kick = vring_kick,
-       .restart = vring_restart,
-       .shutdown = vring_shutdown,
+       .disable_cb = vring_disable_cb,
+       .enable_cb = vring_enable_cb,
 };
 
 struct virtqueue *vring_new_virtqueue(unsigned int num,
                                      struct virtio_device *vdev,
                                      void *pages,
                                      void (*notify)(struct virtqueue *),
-                                     bool (*callback)(struct virtqueue *))
+                                     void (*callback)(struct virtqueue *))
 {
        struct vring_virtqueue *vq;
        unsigned int i;
@@ -311,9 +319,12 @@ struct virtqueue *vring_new_virtqueue(unsigned int num,
 
        return &vq->vq;
 }
+EXPORT_SYMBOL_GPL(vring_new_virtqueue);
 
 void vring_del_virtqueue(struct virtqueue *vq)
 {
        kfree(to_vvq(vq));
 }
+EXPORT_SYMBOL_GPL(vring_del_virtqueue);
 
+MODULE_LICENSE("GPL");
index cecbedd473a4392436ea150e1446b66c0a4c4601..61dde863bd40c2da42f04a6472a8407249fd961d 100644 (file)
@@ -52,7 +52,7 @@
  * overflow periods respectively.
  *
  * Also, since we can't really expect userspace to be responsive enough
- * before the overflow happens, we maintain two seperate timers .. One in
+ * before the overflow happens, we maintain two separate timers .. One in
  * the kernel for clearing out WOVF every 2ms or so (again, this depends on
  * HZ == 1000), and another for monitoring userspace writes to the WDT device.
  *
index af5bb93276f855ab6a3bdc8ec9cf632be8b5e22c..4202db7496cb51eb07cf3dfd7322b40dcc16ad08 100644 (file)
@@ -232,7 +232,7 @@ befs_bt_read_node(struct super_block *sb, befs_data_stream * ds,
  * @key: Key string to lookup in btree
  * @value: Value stored with @key
  *
- * On sucess, returns BEFS_OK and sets *@value to the value stored
+ * On success, returns BEFS_OK and sets *@value to the value stored
  * with @key (usually the disk block number of an inode).
  *
  * On failure, returns BEFS_ERR or BEFS_BT_NOT_FOUND.
index aacb4da6298aefe41200fb587784e09ce7d842ae..e3287d0d1a58815020044ef9f47383eec92cddcb 100644 (file)
@@ -236,7 +236,7 @@ befs_count_blocks(struct super_block * sb, befs_data_stream * ds)
        as in the indirect region code).
        
        When/if blockno is found, if blockno is inside of a block 
-       run as stored on disk, we offset the start and lenght members 
+       run as stored on disk, we offset the start and length members
        of the block run, so that blockno is the start and len is
        still valid (the run ends in the same place).
        
index 18ed6dd906c150208a4beb9230676a5a95de06d6..4628c42ca892ef9248dc7a6dc0f1ed2134211de6 100644 (file)
@@ -117,7 +117,7 @@ static int padzero(unsigned long elf_bss)
        return 0;
 }
 
-/* Let's use some macros to make this stack manipulation a litle clearer */
+/* Let's use some macros to make this stack manipulation a little clearer */
 #ifdef CONFIG_STACK_GROWSUP
 #define STACK_ADD(sp, items) ((elf_addr_t __user *)(sp) + (items))
 #define STACK_ROUND(sp, items) \
index 3c96d6e6397868e28550c986a35ee6f4df5beefc..aaf1fb098639553fc6ad7a8d6c9e0ccd7162a9ce 100644 (file)
@@ -41,7 +41,7 @@
  * VxFS directory block header.
  *
  * This entry is the head of every filesystem block in a directory.
- * It is used for free space managment and additionally includes
+ * It is used for free space management and additionally includes
  * a hash for speeding up directory search (lookup).
  *
  * The hash may be empty and in fact we do not use it all in the
index 24b5a775ff960493a60df4d6c1cb36bdf54010be..8a5959a61ba9dbff4b9b713efa1f5d42da003e1f 100644 (file)
@@ -54,7 +54,7 @@ const struct inode_operations vxfs_immed_symlink_iops = {
 };
 
 /*
- * Adress space operations for immed files and directories.
+ * Address space operations for immed files and directories.
  */
 const struct address_space_operations vxfs_immed_aops = {
        .readpage =             vxfs_immed_readpage,
index b249e294a95bfa76cde2699716a3e96f817d6e03..6fb07d67ca8a41bef05b1940a6831fb2b2764139 100644 (file)
@@ -450,7 +450,7 @@ int gfs2_recover_journal(struct gfs2_jdesc *jd)
                fs_info(sdp, "jid=%u: Trying to acquire journal lock...\n",
                        jd->jd_jid);
 
-               /* Aquire the journal lock so we can do recovery */
+               /* Acquire the journal lock so we can do recovery */
 
                error = gfs2_glock_nq_num(sdp, jd->jd_jid, &gfs2_journal_glops,
                                          LM_ST_EXCLUSIVE,
index 2eae5d2dbebed3707bf9805675822527a922045e..6c1ba3566f58b4c498c1cfa7a3a627db9e089eeb 100644 (file)
@@ -741,7 +741,7 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
                         * are not obsolete.
                         *
                         * Of course, this optimization only makes sense in case
-                        * of NAND flashes (or other flashes whith
+                        * of NAND flashes (or other flashes with
                         * !jffs2_can_mark_obsolete()), since on NOR flashes
                         * nodes are marked obsolete physically.
                         *
index 1543906a2e0dd29ac7008ac1204c490b765ba14b..a000aaa75136d68f9b064197af05388b2acf93cf 100644 (file)
@@ -3965,7 +3965,7 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
  *     xtTruncate_pmap()
  *
  * function:
- *     Perform truncate to zero lenghth for deleted file, leaving the
+ *     Perform truncate to zero length for deleted file, leaving the
  *     the xtree and working map untouched.  This allows the file to
  *     be accessed via open file handles, while the delete of the file
  *     is committed to disk.
index 8b8388eca05e88bde827d97bc71193247c190e86..49354b9c7dc1234779a7c21114e0c976d12e7e1d 100644 (file)
 #include <linux/syscalls.h>
 #include <linux/time.h>
 #include <linux/rcupdate.h>
+#include <linux/pid_namespace.h>
 
 #include <asm/semaphore.h>
 #include <asm/uaccess.h>
@@ -185,6 +186,7 @@ void locks_init_lock(struct file_lock *fl)
        fl->fl_fasync = NULL;
        fl->fl_owner = NULL;
        fl->fl_pid = 0;
+       fl->fl_nspid = NULL;
        fl->fl_file = NULL;
        fl->fl_flags = 0;
        fl->fl_type = 0;
@@ -553,6 +555,8 @@ static void locks_insert_lock(struct file_lock **pos, struct file_lock *fl)
 {
        list_add(&fl->fl_link, &file_lock_list);
 
+       fl->fl_nspid = get_pid(task_tgid(current));
+
        /* insert into file's list */
        fl->fl_next = *pos;
        *pos = fl;
@@ -584,6 +588,11 @@ static void locks_delete_lock(struct file_lock **thisfl_p)
        if (fl->fl_ops && fl->fl_ops->fl_remove)
                fl->fl_ops->fl_remove(fl);
 
+       if (fl->fl_nspid) {
+               put_pid(fl->fl_nspid);
+               fl->fl_nspid = NULL;
+       }
+
        locks_wake_up_blocks(fl);
        locks_free_lock(fl);
 }
@@ -634,33 +643,6 @@ static int flock_locks_conflict(struct file_lock *caller_fl, struct file_lock *s
        return (locks_conflict(caller_fl, sys_fl));
 }
 
-static int interruptible_sleep_on_locked(wait_queue_head_t *fl_wait, int timeout)
-{
-       int result = 0;
-       DECLARE_WAITQUEUE(wait, current);
-
-       __set_current_state(TASK_INTERRUPTIBLE);
-       add_wait_queue(fl_wait, &wait);
-       if (timeout == 0)
-               schedule();
-       else
-               result = schedule_timeout(timeout);
-       if (signal_pending(current))
-               result = -ERESTARTSYS;
-       remove_wait_queue(fl_wait, &wait);
-       __set_current_state(TASK_RUNNING);
-       return result;
-}
-
-static int locks_block_on_timeout(struct file_lock *blocker, struct file_lock *waiter, int time)
-{
-       int result;
-       locks_insert_block(blocker, waiter);
-       result = interruptible_sleep_on_locked(&waiter->fl_wait, time);
-       __locks_delete_block(waiter);
-       return result;
-}
-
 void
 posix_test_lock(struct file *filp, struct file_lock *fl)
 {
@@ -673,55 +655,67 @@ posix_test_lock(struct file *filp, struct file_lock *fl)
                if (posix_locks_conflict(fl, cfl))
                        break;
        }
-       if (cfl)
+       if (cfl) {
                __locks_copy_lock(fl, cfl);
-       else
+               if (cfl->fl_nspid)
+                       fl->fl_pid = pid_nr_ns(cfl->fl_nspid,
+                                               task_active_pid_ns(current));
+       } else
                fl->fl_type = F_UNLCK;
        unlock_kernel();
        return;
 }
-
 EXPORT_SYMBOL(posix_test_lock);
 
-/* This function tests for deadlock condition before putting a process to
- * sleep. The detection scheme is no longer recursive. Recursive was neat,
- * but dangerous - we risked stack corruption if the lock data was bad, or
- * if the recursion was too deep for any other reason.
+/*
+ * Deadlock detection:
+ *
+ * We attempt to detect deadlocks that are due purely to posix file
+ * locks.
  *
- * We rely on the fact that a task can only be on one lock's wait queue
- * at a time. When we find blocked_task on a wait queue we can re-search
- * with blocked_task equal to that queue's owner, until either blocked_task
- * isn't found, or blocked_task is found on a queue owned by my_task.
+ * We assume that a task can be waiting for at most one lock at a time.
+ * So for any acquired lock, the process holding that lock may be
+ * waiting on at most one other lock.  That lock in turns may be held by
+ * someone waiting for at most one other lock.  Given a requested lock
+ * caller_fl which is about to wait for a conflicting lock block_fl, we
+ * follow this chain of waiters to ensure we are not about to create a
+ * cycle.
  *
- * Note: the above assumption may not be true when handling lock requests
- * from a broken NFS client. But broken NFS clients have a lot more to
- * worry about than proper deadlock detection anyway... --okir
+ * Since we do this before we ever put a process to sleep on a lock, we
+ * are ensured that there is never a cycle; that is what guarantees that
+ * the while() loop in posix_locks_deadlock() eventually completes.
  *
- * However, the failure of this assumption (also possible in the case of
- * multiple tasks sharing the same open file table) also means there's no
- * guarantee that the loop below will terminate.  As a hack, we give up
- * after a few iterations.
+ * Note: the above assumption may not be true when handling lock
+ * requests from a broken NFS client. It may also fail in the presence
+ * of tasks (such as posix threads) sharing the same open file table.
+ *
+ * To handle those cases, we just bail out after a few iterations.
  */
 
 #define MAX_DEADLK_ITERATIONS 10
 
+/* Find a lock that the owner of the given block_fl is blocking on. */
+static struct file_lock *what_owner_is_waiting_for(struct file_lock *block_fl)
+{
+       struct file_lock *fl;
+
+       list_for_each_entry(fl, &blocked_list, fl_link) {
+               if (posix_same_owner(fl, block_fl))
+                       return fl->fl_next;
+       }
+       return NULL;
+}
+
 static int posix_locks_deadlock(struct file_lock *caller_fl,
                                struct file_lock *block_fl)
 {
-       struct file_lock *fl;
        int i = 0;
 
-next_task:
-       if (posix_same_owner(caller_fl, block_fl))
-               return 1;
-       list_for_each_entry(fl, &blocked_list, fl_link) {
-               if (posix_same_owner(fl, block_fl)) {
-                       if (i++ > MAX_DEADLK_ITERATIONS)
-                               return 0;
-                       fl = fl->fl_next;
-                       block_fl = fl;
-                       goto next_task;
-               }
+       while ((block_fl = what_owner_is_waiting_for(block_fl))) {
+               if (i++ > MAX_DEADLK_ITERATIONS)
+                       return 0;
+               if (posix_same_owner(caller_fl, block_fl))
+                       return 1;
        }
        return 0;
 }
@@ -1256,7 +1250,10 @@ restart:
                if (break_time == 0)
                        break_time++;
        }
-       error = locks_block_on_timeout(flock, new_fl, break_time);
+       locks_insert_block(flock, new_fl);
+       error = wait_event_interruptible_timeout(new_fl->fl_wait,
+                                               !new_fl->fl_next, break_time);
+       __locks_delete_block(new_fl);
        if (error >= 0) {
                if (error == 0)
                        time_out_leases(inode);
@@ -2084,6 +2081,12 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
                                                        int id, char *pfx)
 {
        struct inode *inode = NULL;
+       unsigned int fl_pid;
+
+       if (fl->fl_nspid)
+               fl_pid = pid_nr_ns(fl->fl_nspid, task_active_pid_ns(current));
+       else
+               fl_pid = fl->fl_pid;
 
        if (fl->fl_file != NULL)
                inode = fl->fl_file->f_path.dentry->d_inode;
@@ -2124,16 +2127,16 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
        }
        if (inode) {
 #ifdef WE_CAN_BREAK_LSLK_NOW
-               seq_printf(f, "%d %s:%ld ", fl->fl_pid,
+               seq_printf(f, "%d %s:%ld ", fl_pid,
                                inode->i_sb->s_id, inode->i_ino);
 #else
                /* userspace relies on this representation of dev_t ;-( */
-               seq_printf(f, "%d %02x:%02x:%ld ", fl->fl_pid,
+               seq_printf(f, "%d %02x:%02x:%ld ", fl_pid,
                                MAJOR(inode->i_sb->s_dev),
                                MINOR(inode->i_sb->s_dev), inode->i_ino);
 #endif
        } else {
-               seq_printf(f, "%d <none>:0 ", fl->fl_pid);
+               seq_printf(f, "%d <none>:0 ", fl_pid);
        }
        if (IS_POSIX(fl)) {
                if (fl->fl_end == OFFSET_MAX)
index a94473d3072c606784f86cb058f5371e8b183ff1..5d8dcb9ee326ffcbb3b747666a9f44f1431f7bb8 100644 (file)
@@ -50,10 +50,6 @@ static int ncp_file_mmap_fault(struct vm_area_struct *area,
        pos = vmf->pgoff << PAGE_SHIFT;
 
        count = PAGE_SIZE;
-       if ((unsigned long)vmf->virtual_address + PAGE_SIZE > area->vm_end) {
-               WARN_ON(1); /* shouldn't happen? */
-               count = area->vm_end - (unsigned long)vmf->virtual_address;
-       }
        /* what we can read in one go */
        bufsize = NCP_SERVER(inode)->buffer_size;
 
index e6df06ac64059bb495a742f892530e1dd3212f3b..64713e149e46b3f4f9a6c4b265eb1ddca4ab25a6 100644 (file)
@@ -3338,7 +3338,7 @@ static int ocfs2_insert_path(struct inode *inode,
        if (insert->ins_split != SPLIT_NONE) {
                /*
                 * We could call ocfs2_insert_at_leaf() for some types
-                * of splits, but it's easier to just let one seperate
+                * of splits, but it's easier to just let one separate
                 * function sort it all out.
                 */
                ocfs2_split_record(inode, left_path, right_path,
index 6b0107f21344734f583ea103b56cc10bee7d6b74..e280833ceb9aa76bd8404ded84b6047948b0ca9d 100644 (file)
@@ -1215,7 +1215,7 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh,
        down_write(&oi->ip_alloc_sem);
 
        /*
-        * Prepare for worst case allocation scenario of two seperate
+        * Prepare for worst case allocation scenario of two separate
         * extents.
         */
        if (alloc == 2)
index 0b499bccec5ae5be5771ddf22d10461a252bfc47..dfb313bda5dd618b95e431568bc818dcc34a1c3f 100644 (file)
@@ -77,7 +77,7 @@ struct ocfs1_disk_lock
 {
 /*00*/ __u32 curr_master;
        __u8 file_lock;
-       __u8 compat_pad[3];  /* Not in orignal definition.  Used to
+       __u8 compat_pad[3];  /* Not in original definition.  Used to
                                make the already existing alignment
                                explicit */
        __u64 last_write_time;
index 7e397e2c25dd219fd55e3f16c363488fb57223e6..72c198a004df46744c1c025e253763727ce635bb 100644 (file)
@@ -646,7 +646,7 @@ bail:
  * sync-data inodes."
  *
  * Note: OCFS2 already does this differently for metadata vs data
- * allocations, as those bitmaps are seperate and undo access is never
+ * allocations, as those bitmaps are separate and undo access is never
  * called on a metadata group descriptor.
  */
 static int ocfs2_test_bg_bit_allocatable(struct buffer_head *bg_bh,
index 16b331dd9913a93f6575d8ec38dd9b63dcf05251..f491ceb5af02d9a8c089066e8a3ca908c641acaa 100644 (file)
@@ -272,7 +272,7 @@ static inline int block_group_used(struct super_block *s, u32 id)
 
        /* If we don't have cached information on this bitmap block, we're
         * going to have to load it later anyway. Loading it here allows us
-        * to make a better decision. This favors long-term performace gain
+        * to make a better decision. This favors long-term performance gain
         * with a better on-disk layout vs. a short term gain of skipping the
         * read and potentially having a bad placement. */
        if (info->free_count == UINT_MAX) {
@@ -663,7 +663,7 @@ static inline void new_hashed_relocation(reiserfs_blocknr_hint_t * hint)
 
 /*
  * Relocation based on dirid, hashing them into a given bitmap block
- * files. Formatted nodes are unaffected, a seperate policy covers them
+ * files. Formatted nodes are unaffected, a separate policy covers them
  */
 static void dirid_groups(reiserfs_blocknr_hint_t * hint)
 {
@@ -688,7 +688,7 @@ static void dirid_groups(reiserfs_blocknr_hint_t * hint)
 
 /*
  * Relocation based on oid, hashing them into a given bitmap block
- * files. Formatted nodes are unaffected, a seperate policy covers them
+ * files. Formatted nodes are unaffected, a separate policy covers them
  */
 static void oid_groups(reiserfs_blocknr_hint_t * hint)
 {
index fb7f7e8034df512db10978276d7c2cf8f9cc0a75..2d3e107da2d3d009d49b505e1110c711f8d25112 100644 (file)
@@ -66,7 +66,7 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
        BUILD_BUG_ON(sizeof(struct signalfd_siginfo) != 128);
 
        /*
-        * Unused memebers should be zero ...
+        * Unused members should be zero ...
         */
        err = __clear_user(uinfo, sizeof(*uinfo));
 
index b729e64d0d4c9ff04ed49bac9387ca97d2a1e2c0..d970f7f99549639183b73d8324043c2805020dd5 100644 (file)
@@ -85,7 +85,7 @@ acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
 #endif
 
 /*
- * ACPI Memory managment
+ * ACPI Memory management
  */
 void *acpi_allocate(u32 size);
 
index 76411b1fc4fd4778e2e35cda00da46ead7b7dd5e..6e253b5b0f3bc33ba5d7c622bb0d689ee4df2c12 100644 (file)
@@ -182,7 +182,7 @@ struct acpi_processor_throttling {
 /* Limit Interface */
 
 struct acpi_processor_lx {
-       int px;                 /* performace state */
+       int px;                 /* performance state */
        int tx;                 /* throttle level */
 };
 
index 5d949d763a918810571f46f5b163cb61a740ca2a..1205c28a2078229b739f5983d833a91b082dbbda 100644 (file)
 #define UICR1_IM14     (1 << 6)        /* Interrupt mask ep 14 */
 #define UICR1_IM15     (1 << 7)        /* Interrupt mask ep 15 */
 
-#define USIR0_IR0      (1 << 0)        /* Interrup request ep 0 */
-#define USIR0_IR1      (1 << 1)        /* Interrup request ep 1 */
-#define USIR0_IR2      (1 << 2)        /* Interrup request ep 2 */
-#define USIR0_IR3      (1 << 3)        /* Interrup request ep 3 */
-#define USIR0_IR4      (1 << 4)        /* Interrup request ep 4 */
-#define USIR0_IR5      (1 << 5)        /* Interrup request ep 5 */
-#define USIR0_IR6      (1 << 6)        /* Interrup request ep 6 */
-#define USIR0_IR7      (1 << 7)        /* Interrup request ep 7 */
-
-#define USIR1_IR8      (1 << 0)        /* Interrup request ep 8 */
-#define USIR1_IR9      (1 << 1)        /* Interrup request ep 9 */
-#define USIR1_IR10     (1 << 2)        /* Interrup request ep 10 */
-#define USIR1_IR11     (1 << 3)        /* Interrup request ep 11 */
-#define USIR1_IR12     (1 << 4)        /* Interrup request ep 12 */
-#define USIR1_IR13     (1 << 5)        /* Interrup request ep 13 */
-#define USIR1_IR14     (1 << 6)        /* Interrup request ep 14 */
-#define USIR1_IR15     (1 << 7)        /* Interrup request ep 15 */
+#define USIR0_IR0      (1 << 0)        /* Interrupt request ep 0 */
+#define USIR0_IR1      (1 << 1)        /* Interrupt request ep 1 */
+#define USIR0_IR2      (1 << 2)        /* Interrupt request ep 2 */
+#define USIR0_IR3      (1 << 3)        /* Interrupt request ep 3 */
+#define USIR0_IR4      (1 << 4)        /* Interrupt request ep 4 */
+#define USIR0_IR5      (1 << 5)        /* Interrupt request ep 5 */
+#define USIR0_IR6      (1 << 6)        /* Interrupt request ep 6 */
+#define USIR0_IR7      (1 << 7)        /* Interrupt request ep 7 */
+
+#define USIR1_IR8      (1 << 0)        /* Interrupt request ep 8 */
+#define USIR1_IR9      (1 << 1)        /* Interrupt request ep 9 */
+#define USIR1_IR10     (1 << 2)        /* Interrupt request ep 10 */
+#define USIR1_IR11     (1 << 3)        /* Interrupt request ep 11 */
+#define USIR1_IR12     (1 << 4)        /* Interrupt request ep 12 */
+#define USIR1_IR13     (1 << 5)        /* Interrupt request ep 13 */
+#define USIR1_IR14     (1 << 6)        /* Interrupt request ep 14 */
+#define USIR1_IR15     (1 << 7)        /* Interrupt request ep 15 */
 
 #define DCMD_LENGTH    0x01fff         /* length mask (max = 8K - 1) */
 
index 442494d71f12d38ff4dfefb8b5e9246447b73201..16ed24dbda4e3d832008554c1f4cbbbaec4b07e8 100644 (file)
 
 #define USIR0          __REG(0x40600058)  /* UDC Status Interrupt Register 0 */
 
-#define USIR0_IR0      (1 << 0)        /* Interrup request ep 0 */
-#define USIR0_IR1      (1 << 1)        /* Interrup request ep 1 */
-#define USIR0_IR2      (1 << 2)        /* Interrup request ep 2 */
-#define USIR0_IR3      (1 << 3)        /* Interrup request ep 3 */
-#define USIR0_IR4      (1 << 4)        /* Interrup request ep 4 */
-#define USIR0_IR5      (1 << 5)        /* Interrup request ep 5 */
-#define USIR0_IR6      (1 << 6)        /* Interrup request ep 6 */
-#define USIR0_IR7      (1 << 7)        /* Interrup request ep 7 */
+#define USIR0_IR0      (1 << 0)        /* Interrupt request ep 0 */
+#define USIR0_IR1      (1 << 1)        /* Interrupt request ep 1 */
+#define USIR0_IR2      (1 << 2)        /* Interrupt request ep 2 */
+#define USIR0_IR3      (1 << 3)        /* Interrupt request ep 3 */
+#define USIR0_IR4      (1 << 4)        /* Interrupt request ep 4 */
+#define USIR0_IR5      (1 << 5)        /* Interrupt request ep 5 */
+#define USIR0_IR6      (1 << 6)        /* Interrupt request ep 6 */
+#define USIR0_IR7      (1 << 7)        /* Interrupt request ep 7 */
 
 #define USIR1          __REG(0x4060005C)  /* UDC Status Interrupt Register 1 */
 
-#define USIR1_IR8      (1 << 0)        /* Interrup request ep 8 */
-#define USIR1_IR9      (1 << 1)        /* Interrup request ep 9 */
-#define USIR1_IR10     (1 << 2)        /* Interrup request ep 10 */
-#define USIR1_IR11     (1 << 3)        /* Interrup request ep 11 */
-#define USIR1_IR12     (1 << 4)        /* Interrup request ep 12 */
-#define USIR1_IR13     (1 << 5)        /* Interrup request ep 13 */
-#define USIR1_IR14     (1 << 6)        /* Interrup request ep 14 */
-#define USIR1_IR15     (1 << 7)        /* Interrup request ep 15 */
+#define USIR1_IR8      (1 << 0)        /* Interrupt request ep 8 */
+#define USIR1_IR9      (1 << 1)        /* Interrupt request ep 9 */
+#define USIR1_IR10     (1 << 2)        /* Interrupt request ep 10 */
+#define USIR1_IR11     (1 << 3)        /* Interrupt request ep 11 */
+#define USIR1_IR12     (1 << 4)        /* Interrupt request ep 12 */
+#define USIR1_IR13     (1 << 5)        /* Interrupt request ep 13 */
+#define USIR1_IR14     (1 << 6)        /* Interrupt request ep 14 */
+#define USIR1_IR15     (1 << 7)        /* Interrupt request ep 15 */
 
 #elif defined(CONFIG_PXA27x)
 
 #define ICSR0          __REG(0x40800014)  /* ICP Status Register 0 */
 #define ICSR1          __REG(0x40800018)  /* ICP Status Register 1 */
 
-#define ICCR0_AME      (1 << 7)        /* Adress match enable */
+#define ICCR0_AME      (1 << 7)        /* Address match enable */
 #define ICCR0_TIE      (1 << 6)        /* Transmit FIFO interrupt enable */
 #define ICCR0_RIE      (1 << 5)        /* Recieve FIFO interrupt enable */
 #define ICCR0_RXE      (1 << 4)        /* Receive enable */
index 745aa841b31ae8824739edc5678a8b4141650db2..f7263b99403b9b8cfc5cd014300b882a81fd6c28 100644 (file)
@@ -22,7 +22,7 @@
 #include <asm/arch/platform.h>
 
 /* 
- *  IRQ interrupts definitions are the same the INT definitions
+ *  IRQ interrupts definitions are the same as the INT definitions
  *  held within platform.h
  */
 #define IRQ_VIC_START          0
@@ -94,7 +94,7 @@
 #define IRQMASK_VICSOURCE31    INTMASK_VICSOURCE31
 
 /* 
- *  FIQ interrupts definitions are the same the INT definitions.
+ *  FIQ interrupts definitions are the same as the INT definitions.
  */
 #define FIQ_WDOGINT            INT_WDOGINT
 #define FIQ_SOFTINT            INT_SOFTINT
index aaebb61aca4872cb7147a25653072db98c436e5b..74b5fff7f57575f3f67e3f085d6befb51a682d48 100644 (file)
@@ -42,7 +42,7 @@ extern unsigned long it8152_base_address;
 #define IT8152_GPIO_GPDR               __REG_IT8152(0x3f00500)
 
 /*
-  Interrup contoler per register summary:
+  Interrupt controller per register summary:
   ---------------------------------------
   LCDNIRR:
   IT8152_LD_IRQ(8) PCICLK stop
index f191e147ea90aed42aa691fa37f043ad7cc897e2..f9f3606986c27fedea03382b9de34ba1a7667e89 100644 (file)
@@ -16,7 +16,7 @@ struct pxa2xx_udc_mach_info {
 #define        PXA2XX_UDC_CMD_DISCONNECT       1       /* so host won't see us */
 
        /* Boards following the design guidelines in the developer's manual,
-        * with on-chip GPIOs not Lubbock's wierd hardware, can have a sane
+        * with on-chip GPIOs not Lubbock's weird hardware, can have a sane
         * VBUS IRQ and omit the methods above.  Store the GPIO number
         * here; for GPIO 0, also mask in one of the pxa_gpio_mode() bits.
         * Note that sometimes the signals go through inverters...
index d425d8d0ad7758c73d40000a9a792f740ff78a5d..6ec494a5bc5ad91ccbbc7d40749a8b92e9fba913 100644 (file)
@@ -1,7 +1,7 @@
 /* atomic.h: atomic operation emulation for FR-V
  *
  * For an explanation of how atomic ops work in this arch, see:
- *   Documentation/fujitsu/frv/atomic-ops.txt
+ *   Documentation/frv/atomic-ops.txt
  *
  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
index e29de7131b79dcca7250aad73b3d603fb1f53458..5f86b876b298b1382a6167e119cc29ea33d26aa2 100644 (file)
@@ -1,7 +1,7 @@
 /* bitops.h: bit operations for the Fujitsu FR-V CPUs
  *
  * For an explanation of how atomic ops work in this arch, see:
- *   Documentation/fujitsu/frv/atomic-ops.txt
+ *   Documentation/frv/atomic-ops.txt
  *
  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
  * Written by David Howells (dhowells@redhat.com)
index 02500405a6fb26317ad2def7ea098ed3e93a3e0f..432a69e7f3d491488631a270b1cff0e8f2ac6daa 100644 (file)
@@ -29,7 +29,7 @@
 #define flush_dcache_mmap_unlock(mapping)      do {} while(0)
 
 /*
- * physically-indexed cache managment
+ * physically-indexed cache management
  * - see arch/frv/lib/cache.S
  */
 extern void frv_dcache_writeback(unsigned long start, unsigned long size);
index ff4d6cdeb1522811bd4131da61d68575ff55502b..26cefcde5cee9abba5df2dc5627d4f38b4016f05 100644 (file)
@@ -4,7 +4,7 @@
  * Written by David Howells (dhowells@redhat.com)
  * - Derived from include/asm-i386/highmem.h
  *
- * See Documentation/fujitsu/frv/mmu-layout.txt for more information.
+ * See Documentation/frv/mmu-layout.txt for more information.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index aaf2a773d9d3d42070f221ca3443b24821a372cc..83532252b8be17f401d380ed78a0d5df5bbf7b42 100644 (file)
@@ -39,7 +39,7 @@
 
 #ifdef CONFIG_MMU
 
-/* see Documentation/fujitsu/frv/mmu-layout.txt */
+/* see Documentation/frv/mmu-layout.txt */
 #define KERNEL_LOWMEM_START            __UL(0xc0000000)
 #define KERNEL_LOWMEM_END              __UL(0xd0000000)
 #define VMALLOC_START                  __UL(0xd0000000)
index 147e995bec24e0b058c4a0911f92e8d1706c8763..3c402afb9e7415db351b19e21a2a9c7ecd2b740b 100644 (file)
@@ -93,7 +93,7 @@ extern unsigned long empty_zero_page;
 
 /*
  * we use 2-level page tables, folding the PMD (mid-level table) into the PGE (top-level entry)
- * [see Documentation/fujitsu/frv/mmu-layout.txt]
+ * [see Documentation/frv/mmu-layout.txt]
  *
  * Page Directory:
  *  - Size: 16KB
index 0f6e5264ab8fcccefa2da67faa794fec3d79d206..dfcf75b8426d8bde81dd8b7fda51ad5f12df137c 100644 (file)
@@ -181,7 +181,7 @@ struct compat_shmid64_ds {
 /*
  * A pointer passed in from user mode. This should not be used for syscall parameters,
  * just declare them as pointers because the syscall entry code will have appropriately
- * comverted them already.
+ * converted them already.
  */
 typedef        u32             compat_uptr_t;
 
index f43afe1fc3b33940dc1c46178045830f4bf01b44..c142fbf2f376b0abc4767f5c6c048130d5fcd8f2 100644 (file)
@@ -262,7 +262,7 @@ static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned lon
                 * tmp = __swab32(*(p++));
                 * tmp |= ~0UL >> (32-offset);
                 *
-                * but this would decrease preformance, so we change the
+                * but this would decrease performance, so we change the
                 * shift:
                 */
                tmp = *(p++);
index 0161ebb5d883f903e9bef07371ba2dbd5b79331f..36e870b468ef0fa1546890f5b8b05516eab60398 100644 (file)
@@ -715,7 +715,7 @@ extern void cpm_install_handler(int vec, void (*handler)(void *), void *dev_id);
 #define        CICR_SCC_SCC3           ((uint)0x00200000)      /* SCC3 @ SCCc */
 #define        CICR_SCB_SCC2           ((uint)0x00040000)      /* SCC2 @ SCCb */
 #define        CICR_SCA_SCC1           ((uint)0x00000000)      /* SCC1 @ SCCa */
-#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrrupt */
+#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrupt */
 #define CICR_HP_MASK           ((uint)0x00001f00)      /* Hi-pri int. */
 #define CICR_IEN               ((uint)0x00000080)      /* Int. enable */
 #define CICR_SPS               ((uint)0x00000001)      /* SCC Spread */
index 04a20fd051cfa5685ad7a144d027d449a9fce771..55cbd6294ab68508492d3143fa49c2d6a306611c 100644 (file)
@@ -68,7 +68,7 @@ static inline void _udelay(unsigned long usecs)
 /*
  *     Moved the udelay() function into library code, no longer inlined.
  *     I had to change the algorithm because we are overflowing now on
- *     the faster ColdFire parts. The code is a little biger, so it makes
+ *     the faster ColdFire parts. The code is a little bigger, so it makes
  *     sense to library it.
  */
 extern void udelay(unsigned long usecs);
index 399814f0b219fee7468f84321064aa58f2ac9020..366eb8602d2fb124aee5eab7b59341e49b41cf41 100644 (file)
 #define MCFSIM_CSAR1           0x8c            /* CS 1 Address reg (r/w) */
 #define MCFSIM_CSMR1           0x90            /* CS 1 Mask reg (r/w) */
 #define MCFSIM_CSCR1           0x96            /* CS 1 Control reg (r/w) */
-#define MCFSIM_CSAR2           0x98            /* CS 2 Adress reg (r/w) */
+#define MCFSIM_CSAR2           0x98            /* CS 2 Address reg (r/w) */
 #define MCFSIM_CSMR2           0x9c            /* CS 2 Mask reg (r/w) */
 #define MCFSIM_CSCR2           0xa2            /* CS 2 Control reg (r/w) */
-#define MCFSIM_CSAR3           0xa4            /* CS 3 Adress reg (r/w) */
+#define MCFSIM_CSAR3           0xa4            /* CS 3 Address reg (r/w) */
 #define MCFSIM_CSMR3           0xa8            /* CS 3 Mask reg (r/w) */
 #define MCFSIM_CSCR3           0xae            /* CS 3 Control reg (r/w) */
 
index d3ce550f6ef4b078d50c2d14b38fdb318405c723..5886728409c07894522da014d95dd022958840e1 100644 (file)
 #define MCFSIM_CSMR7           0xda            /* CS 7 Mask reg (r/w) */
 #define MCFSIM_CSCR7           0xde            /* CS 7 Control reg (r/w) */
 #else
-#define MCFSIM_CSAR2           0x98            /* CS 2 Adress reg (r/w) */
+#define MCFSIM_CSAR2           0x98            /* CS 2 Address reg (r/w) */
 #define MCFSIM_CSMR2           0x9c            /* CS 2 Mask reg (r/w) */
 #define MCFSIM_CSCR2           0xa2            /* CS 2 Control reg (r/w) */
-#define MCFSIM_CSAR3           0xa4            /* CS 3 Adress reg (r/w) */
+#define MCFSIM_CSAR3           0xa4            /* CS 3 Address reg (r/w) */
 #define MCFSIM_CSMR3           0xa8            /* CS 3 Mask reg (r/w) */
 #define MCFSIM_CSCR3           0xae            /* CS 3 Control reg (r/w) */
-#define MCFSIM_CSAR4           0xb0            /* CS 4 Adress reg (r/w) */
+#define MCFSIM_CSAR4           0xb0            /* CS 4 Address reg (r/w) */
 #define MCFSIM_CSMR4           0xb4            /* CS 4 Mask reg (r/w) */
 #define MCFSIM_CSCR4           0xba            /* CS 4 Control reg (r/w) */
-#define MCFSIM_CSAR5           0xbc            /* CS 5 Adress reg (r/w) */
+#define MCFSIM_CSAR5           0xbc            /* CS 5 Address reg (r/w) */
 #define MCFSIM_CSMR5           0xc0            /* CS 5 Mask reg (r/w) */
 #define MCFSIM_CSCR5           0xc6            /* CS 5 Control reg (r/w) */
-#define MCFSIM_CSAR6           0xc8            /* CS 6 Adress reg (r/w) */
+#define MCFSIM_CSAR6           0xc8            /* CS 6 Address reg (r/w) */
 #define MCFSIM_CSMR6           0xcc            /* CS 6 Mask reg (r/w) */
 #define MCFSIM_CSCR6           0xd2            /* CS 6 Control reg (r/w) */
-#define MCFSIM_CSAR7           0xd4            /* CS 7 Adress reg (r/w) */
+#define MCFSIM_CSAR7           0xd4            /* CS 7 Address reg (r/w) */
 #define MCFSIM_CSMR7           0xd8            /* CS 7 Mask reg (r/w) */
 #define MCFSIM_CSCR7           0xde            /* CS 7 Control reg (r/w) */
 #endif /* CONFIG_OLDMASK */
index 75dcdacdb2980d90ca27398cee610c997b6bc74d..cc22c4a53005cc9a9e714889fd2869f3919a84e9 100644 (file)
 #define MCFSIM_CSMR1           0x90            /* CS 1 Mask reg (r/w) */
 #define MCFSIM_CSCR1           0x96            /* CS 1 Control reg (r/w) */
 
-#define MCFSIM_CSAR2           0x98            /* CS 2 Adress reg (r/w) */
+#define MCFSIM_CSAR2           0x98            /* CS 2 Address reg (r/w) */
 #define MCFSIM_CSMR2           0x9c            /* CS 2 Mask reg (r/w) */
 #define MCFSIM_CSCR2           0xa2            /* CS 2 Control reg (r/w) */
-#define MCFSIM_CSAR3           0xa4            /* CS 3 Adress reg (r/w) */
+#define MCFSIM_CSAR3           0xa4            /* CS 3 Address reg (r/w) */
 #define MCFSIM_CSMR3           0xa8            /* CS 3 Mask reg (r/w) */
 #define MCFSIM_CSCR3           0xae            /* CS 3 Control reg (r/w) */
-#define MCFSIM_CSAR4           0xb0            /* CS 4 Adress reg (r/w) */
+#define MCFSIM_CSAR4           0xb0            /* CS 4 Address reg (r/w) */
 #define MCFSIM_CSMR4           0xb4            /* CS 4 Mask reg (r/w) */
 #define MCFSIM_CSCR4           0xba            /* CS 4 Control reg (r/w) */
-#define MCFSIM_CSAR5           0xbc            /* CS 5 Adress reg (r/w) */
+#define MCFSIM_CSAR5           0xbc            /* CS 5 Address reg (r/w) */
 #define MCFSIM_CSMR5           0xc0            /* CS 5 Mask reg (r/w) */
 #define MCFSIM_CSCR5           0xc6            /* CS 5 Control reg (r/w) */
-#define MCFSIM_CSAR6           0xc8            /* CS 6 Adress reg (r/w) */
+#define MCFSIM_CSAR6           0xc8            /* CS 6 Address reg (r/w) */
 #define MCFSIM_CSMR6           0xcc            /* CS 6 Mask reg (r/w) */
 #define MCFSIM_CSCR6           0xd2            /* CS 6 Control reg (r/w) */
-#define MCFSIM_CSAR7           0xd4            /* CS 7 Adress reg (r/w) */
+#define MCFSIM_CSAR7           0xd4            /* CS 7 Address reg (r/w) */
 #define MCFSIM_CSMR7           0xd8            /* CS 7 Mask reg (r/w) */
 #define MCFSIM_CSCR7           0xde            /* CS 7 Control reg (r/w) */
 
index a3f8cc8a4a8403f79ce381945e05dad7f8bd2480..d57217ca4f27fe15c1dbe96d926ba3cd0989121c 100644 (file)
 #define CICR_SCC_SCC3           ((uint)0x00200000)      /* SCC3 @ SCCc */
 #define CICR_SCD_SCC4           ((uint)0x00c00000)      /* SCC4 @ SCCd */
 
-#define CICR_IRL_MASK           ((uint)0x0000e000)      /* Core interrrupt */
+#define CICR_IRL_MASK           ((uint)0x0000e000)      /* Core interrupt */
 #define CICR_HP_MASK            ((uint)0x00001f00)      /* Hi-pri int. */
 #define CICR_VBA_MASK           ((uint)0x000000e0)      /* Vector Base Address */
 #define CICR_SPS                ((uint)0x00000001)      /* SCC Spread */
index 1319a81814b15cb840f61987fc37842145b58668..8a7a67703ac3aaf6ac8c6884301750dc9bd8851f 100644 (file)
@@ -71,7 +71,7 @@ struct mcf_platform_uart {
 #define        MCFUART_UTB             0x0c            /* Transmit Buffer (w) */
 #define        MCFUART_UIPCR           0x10            /* Input Port Change (r) */
 #define        MCFUART_UACR            0x10            /* Auxiliary Control (w) */
-#define        MCFUART_UISR            0x14            /* Interrup Status (r) */
+#define        MCFUART_UISR            0x14            /* Interrupt Status (r) */
 #define        MCFUART_UIMR            0x14            /* Interrupt Mask (w) */
 #define        MCFUART_UBG1            0x18            /* Baud Rate MSB (r/w) */
 #define        MCFUART_UBG2            0x1c            /* Baud Rate LSB (r/w) */
index 568c76cdd9000aed94b2d7970bbfdb2f446d6973..ac5d541368e934a30ca17ac03e58bd990b9eb7ca 100644 (file)
@@ -128,7 +128,7 @@ typedef u32         compat_sigset_word;
  * A pointer passed in from user mode. This should not
  * be used for syscall parameters, just declare them
  * as pointers because the syscall entry code will have
- * appropriately comverted them already.
+ * appropriately converted them already.
  */
 typedef u32            compat_uptr_t;
 
index 38fcda703a0b197234fbb09577f1fb83b8285c00..0a1ef69bece76c54c356537506021da904c4611a 100644 (file)
@@ -3,7 +3,7 @@
 
 
 /**
- * Adress alignment of the individual FPGA bytes.
+ * Address alignment of the individual FPGA bytes.
  * The address arrangement of the individual bytes of the FPGA is two
  * byte aligned at the embedded MK2 platform.
  */
index 00d8bf6164a950f1664b3f81fa8d1cc607e5fe61..83746b84a5ec53c3c2d36a84e3780050fcff7ad2 100644 (file)
@@ -45,7 +45,7 @@
 #define GT_PCI_IO_SIZE 0x02000000UL
 
 /*
- * PCI interrupts will come in on either the INTA or INTD interrups lines,
+ * PCI interrupts will come in on either the INTA or INTD interrupt lines,
  * which are mapped to the #2 and #5 interrupt pins of the MIPS.  On our
  * boards, they all either come in on IntD or they all come in on IntA, they
  * aren't mixed. There can be numerous PCI interrupts, so we keep a list of the
index f4981c4f16bbfa999f49039dc76afa4a1a796973..c0501f91719b93a6a82db3fa082243eb500b9ffe 100644 (file)
@@ -15,7 +15,7 @@
 /*
  * These are the virtual IRQ numbers, we divide all IRQ's into
  * 'spaces', the 'space' determines where and how to enable/disable
- * that particular IRQ on an SGI machine. HPC DMA and MC DMA interrups
+ * that particular IRQ on an SGI machine. HPC DMA and MC DMA interrupts
  * are not supported this way. Driver is supposed to allocate HPC/MC
  * interrupt as shareable and then look to proper status bit (see
  * HAL2 driver). This will prevent many complications, trust me ;-)
index ef91b3363554ca8e1736112f3ab4a017b117e2cd..0187895e556c0f4a42bb4a83c544b16687551536 100644 (file)
@@ -338,7 +338,7 @@ typedef union io_perf_cnt {
 #define IIO_IFDR       0x400398        /* IOQ FIFO Depth */
 #define IIO_IIAP       0x4003a0        /* IIQ Arbitration Parameters */
 #define IIO_IMMR       IIO_IIAP
-#define IIO_ICMR       0x4003a8        /* CRB Managment Register */
+#define IIO_ICMR       0x4003a8        /* CRB Management Register */
 #define IIO_ICCR       0x4003b0        /* CRB Control Register */
 #define IIO_ICTO       0x4003b8        /* CRB Time Out Register */
 #define IIO_ICTP       0x4003c0        /* CRB Time Out Prescalar */
index 5a85d1b025c810de6e881931ce0ae3a38574216c..7f32611a7a5ebc1fe64e36716db7748df21c5070 100644 (file)
@@ -132,7 +132,7 @@ typedef u32         compat_sigset_word;
  * A pointer passed in from user mode. This should not
  * be used for syscall parameters, just declare them
  * as pointers because the syscall entry code will have
- * appropriately comverted them already.
+ * appropriately converted them already.
  */
 typedef        u32             compat_uptr_t;
 
index f628ac7de83dca17868b3737732b00c61354f62a..8e7946a141def9d1dfcd74ad6ffb5a73bd135554 100644 (file)
@@ -28,7 +28,7 @@
 #define EFA_PARISC_1_1             0x0210 /* PA-RISC 1.1 big-endian.  */
 #define EFA_PARISC_2_0             0x0214 /* PA-RISC 2.0 big-endian.  */
 
-/* Additional section indeces.  */
+/* Additional section indices.  */
 
 #define SHN_PARISC_ANSI_COMMON 0xff00     /* Section for tenatively declared
                                              symbols in ANSI C.  */
index ad8cd0d069eabd1a69fd6b802028950067b2e05e..0b19a7242d0c1237a1f0f9a079043149b0b8b7df 100644 (file)
@@ -8,7 +8,7 @@
 
 /*
  * In parisc assembly a semicolon marks a comment while a
- * exclamation mark is used to seperate independent lines.
+ * exclamation mark is used to separate independent lines.
  */
 #ifdef __ASSEMBLY__
 
index 154a84c843a749b459e05151079c2d431acda324..171399a88ca6aa175778c7bb3d727fd5c8cc7147 100644 (file)
@@ -3,4 +3,4 @@
 
 /* nothing */
 
-#endif __ASM_PARISC_VGA_H__
+#endif /* __ASM_PARISC_VGA_H__ */
index 64ab1ddbdf85c5d2cba8ca73750b873b43040a4d..d811a8cd7b58c9397200be83cf0ee333c313e037 100644 (file)
@@ -119,7 +119,7 @@ typedef u32         compat_sigset_word;
  * A pointer passed in from user mode. This should not
  * be used for syscall parameters, just declare them
  * as pointers because the syscall entry code will have
- * appropriately comverted them already.
+ * appropriately converted them already.
  */
 typedef        u32             compat_uptr_t;
 
index 7f4ad623f7d5d93a2f423cd76898c1df52883a51..de065b32381a36867eb7bf6bc58f2b0ba8ddeec2 100644 (file)
@@ -149,7 +149,7 @@ typedef u32         compat_sigset_word;
  * A pointer passed in from user mode. This should not
  * be used for syscall parameters, just declare them
  * as pointers because the syscall entry code will have
- * appropriately comverted them already.
+ * appropriately converted them already.
  */
 typedef        u32             compat_uptr_t;
 
index 01fe6682b4054237ee55d8d4418310aaf68947cd..f260b58f5ce9d34ac224d2781bf4e0ac277849d4 100644 (file)
@@ -152,7 +152,7 @@ typedef u32         compat_sigset_word;
  * A pointer passed in from user mode. This should not
  * be used for syscall parameters, just declare them
  * as pointers because the syscall entry code will have
- * appropriately comverted them already.
+ * appropriately converted them already.
  */
 typedef        u32             compat_uptr_t;
 
index b270ee04959ea7ce3fa73cf4935f39d9b7e0aa8b..d3e8f3e87ee8a876c413611fd2ae21fb0b6dbc63 100644 (file)
@@ -190,7 +190,7 @@ typedef struct user_regs_struct32 compat_elf_gregset_t;
  * A pointer passed in from user mode. This should not
  * be used for syscall parameters, just declare them
  * as pointers because the syscall entry code will have
- * appropriately comverted them already.
+ * appropriately converted them already.
  */
 typedef        u32             compat_uptr_t;
 
index bc2b5892630859f8c42441204d2beec90a2151dd..9e5a459fd15b2f13e5e1e266999a08ef49a3026e 100644 (file)
@@ -6,7 +6,6 @@
 
 /**
  * do_timer_interrupt_hook - hook into timer tick
- * @regs:     standard registers from interrupt
  *
  * Call the pit clock event handler. see asm/i8253.h
  **/
diff --git a/include/linux/aspm.h b/include/linux/aspm.h
deleted file mode 100644 (file)
index f41a698..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *     aspm.h
- *
- *     PCI Express ASPM defines and function prototypes
- *
- *     Copyright (C) 2007 Intel Corp.
- *             Zhang Yanmin (yanmin.zhang@intel.com)
- *             Shaohua Li (shaohua.li@intel.com)
- *
- *     For more information, please consult the following manuals (look at
- *     http://www.pcisig.com/ for how to get them):
- *
- *     PCI Express Specification
- */
-
-#ifndef LINUX_ASPM_H
-#define LINUX_ASPM_H
-
-#include <linux/pci.h>
-
-#define PCIE_LINK_STATE_L0S    1
-#define PCIE_LINK_STATE_L1     2
-#define PCIE_LINK_STATE_CLKPM  4
-
-#ifdef CONFIG_PCIEASPM
-extern void pcie_aspm_init_link_state(struct pci_dev *pdev);
-extern void pcie_aspm_exit_link_state(struct pci_dev *pdev);
-extern void pcie_aspm_pm_state_change(struct pci_dev *pdev);
-extern void pci_disable_link_state(struct pci_dev *pdev, int state);
-#else
-#define pcie_aspm_init_link_state(pdev)                do {} while (0)
-#define pcie_aspm_exit_link_state(pdev)                do {} while (0)
-#define pcie_aspm_pm_state_change(pdev)                do {} while (0)
-#define pci_disable_link_state(pdev, state)    do {} while (0)
-#endif
-
-#ifdef CONFIG_PCIEASPM_DEBUG /* this depends on CONFIG_PCIEASPM */
-extern void pcie_aspm_create_sysfs_dev_files(struct pci_dev *pdev);
-extern void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev);
-#else
-#define pcie_aspm_create_sysfs_dev_files(pdev) do {} while (0)
-#define pcie_aspm_remove_sysfs_dev_files(pdev) do {} while (0)
-#endif
-#endif /* LINUX_ASPM_H */
index a404c111c937a2da3dcddba17f7aba0a63e82cb4..519248d8b2b6529f3ec8833d09d0bf97710a5fac 100644 (file)
@@ -108,7 +108,7 @@ struct changer_element_status {
 
 /*
  * CHIOGELEM
- *    get more detailed status informtion for a single element
+ *    get more detailed status information for a single element
  */
 struct changer_get_element {
        int     cge_type;        /* type/unit */
index 8f3dcd30828fbb149ef7ee30c788ebf2e312e6e6..504cb2c3fa9a68fb77a0a4b3afb94a933c095f9c 100644 (file)
@@ -177,7 +177,7 @@ struct      CUSTOM_REG {
        __u32   fpga_version;           /* FPGA Version Number Register */
        __u32   cpu_start;              /* CPU start Register (write) */
        __u32   cpu_stop;               /* CPU stop Register (write) */
-       __u32   misc_reg;               /* Miscelaneous Register */
+       __u32   misc_reg;               /* Miscellaneous Register */
        __u32   idt_mode;               /* IDT mode Register */
        __u32   uart_irq_status;        /* UART IRQ status Register */
        __u32   clear_timer0_irq;       /* Clear timer interrupt Register */
index f7a9065834636c5824677d274beee1fc2d5f192d..362bf19d6cf194a8ae40f84632debc34aac218f0 100644 (file)
@@ -81,7 +81,7 @@ struct cycx_x25_cmd {
  *     @n2win - level 2 window (values: 1 thru 7)
  *     @n3win - level 3 window (values: 1 thru 7)
  *     @nvc - # of logical channels (values: 1 thru 64)
- *     @pktlen - level 3 packet lenght - log base 2 of size
+ *     @pktlen - level 3 packet length - log base 2 of size
  *     @locaddr - my address
  *     @remaddr - remote address
  *     @t1 - time, in seconds
index 484e45c7c89a832dd986c7fe927e545168e2ec77..aa0737019e37da6e759ea95e026088cbbfc6518d 100644 (file)
@@ -525,6 +525,7 @@ struct dccp_sock {
        __u64                           dccps_gsr;
        __u64                           dccps_gar;
        __be32                          dccps_service;
+       __u32                           dccps_mss_cache;
        struct dccp_service_list        *dccps_service_list;
        __u32                           dccps_timestamp_echo;
        __u32                           dccps_timestamp_time;
@@ -533,7 +534,6 @@ struct dccp_sock {
        __u16                           dccps_pcslen;
        __u16                           dccps_pcrlen;
        unsigned long                   dccps_ndp_count;
-       __u32                           dccps_mss_cache;
        unsigned long                   dccps_rate_last;
        struct dccp_minisock            dccps_minisock;
        struct dccp_ackvec              *dccps_hc_rx_ackvec;
index db375be333c708a2e556c5424c95a0aa91802836..479c0b31593c6e3b6e5225144af1a51ae86534e0 100644 (file)
@@ -534,11 +534,17 @@ extern struct device *device_create(struct class *cls, struct device *parent,
 extern void device_destroy(struct class *cls, dev_t devt);
 #ifdef CONFIG_PM_SLEEP
 extern void destroy_suspended_device(struct class *cls, dev_t devt);
+extern void device_pm_schedule_removal(struct device *);
 #else /* !CONFIG_PM_SLEEP */
 static inline void destroy_suspended_device(struct class *cls, dev_t devt)
 {
        device_destroy(cls, devt);
 }
+
+static inline void device_pm_schedule_removal(struct device *dev)
+{
+       device_unregister(dev);
+}
 #endif /* !CONFIG_PM_SLEEP */
 
 /*
index 101a2d4636befbd1248b7642c38a87ff77243f07..4470950892bed5e9b0f19c4576343baf28f3022e 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _ASM_LINUX_DMA_MAPPING_H
-#define _ASM_LINUX_DMA_MAPPING_H
+#ifndef _LINUX_DMA_MAPPING_H
+#define _LINUX_DMA_MAPPING_H
 
 #include <linux/device.h>
 #include <linux/err.h>
index 55c9a6952f447c6284a5b75b88ac9696ddc89214..5c84bf8975939d254f62595e9c4cc0795c8d3c96 100644 (file)
@@ -29,7 +29,7 @@
 #include <linux/dma-mapping.h>
 
 /**
- * enum dma_state - resource PNP/power managment state
+ * enum dma_state - resource PNP/power management state
  * @DMA_RESOURCE_SUSPEND: DMA device going into low power state
  * @DMA_RESOURCE_RESUME: DMA device returning to full power
  * @DMA_RESOURCE_AVAILABLE: DMA device available to the system
index 71d4ada6f31549342d75dbc50dd10045c43e3e17..fcbe8b640ffba57f04a35c986728bf850717bb6c 100644 (file)
@@ -309,7 +309,7 @@ int ethtool_op_set_flags(struct net_device *dev, u32 data);
  * get_ringparam: Report ring sizes
  * set_ringparam: Set ring sizes
  * get_pauseparam: Report pause parameters
- * set_pauseparam: Set pause paramters
+ * set_pauseparam: Set pause parameters
  * get_rx_csum: Report whether receive checksums are turned on or off
  * set_rx_csum: Turn receive checksum on or off
  * get_tx_csum: Report whether transmit checksums are turned on or off
index a516b6716870d01f2238929a463e83e698a396ac..56bd421c12088e1f294ea04db029eb513a0fc587 100644 (file)
@@ -872,6 +872,7 @@ struct file_lock {
        struct list_head fl_block;      /* circular list of blocked processes */
        fl_owner_t fl_owner;
        unsigned int fl_pid;
+       struct pid *fl_nspid;
        wait_queue_head_t fl_wait;
        struct file *fl_file;
        unsigned char fl_flags;
@@ -1307,7 +1308,7 @@ struct super_operations {
  *                     being set.  find_inode() uses this to prevent returning
  *                     nearly-dead inodes.
  * I_SYNC              Similar to I_LOCK, but limited in scope to writeback
- *                     of inode dirty data.  Having a seperate lock for this
+ *                     of inode dirty data.  Having a separate lock for this
  *                     purpose reduces latency and prevents some filesystem-
  *                     specific deadlocks.
  *
index 3882013d29eacb189700684af23c524ebd655934..e38e75967e74d765b518c4098cf61ee38e890d22 100644 (file)
@@ -364,7 +364,7 @@ typedef struct hd_drive_hob_hdr {
 #define SETFEATURES_EN_RLA     0xAA    /* Enable read look-ahead feature */
 #define SETFEATURES_PREFETCH   0xAB    /* Sets drive prefetch value */
 #define SETFEATURES_EN_REST    0xAC    /* ATA-1 */
-#define SETFEATURES_4B_RW_LONG 0xBB    /* Set Lenght of 4 bytes */
+#define SETFEATURES_4B_RW_LONG 0xBB    /* Set Length of 4 bytes */
 #define SETFEATURES_DIS_AAM    0xC2    /* Disable Automatic Acoustic Management */
 #define SETFEATURES_EN_RPOD    0xCC    /* Enable reverting to power on defaults */
 #define SETFEATURES_DIS_RI     0xDD    /* Disable release interrupt ATAPI */
index 49067f14fac190ea7bb492fceb1befdcf46aadce..f79dcba4b2c1861e4ab3148f0b9bcb2c5feb613b 100644 (file)
@@ -147,7 +147,6 @@ struct hrtimer_sleeper {
  * @get_time:          function to retrieve the current time of the clock
  * @get_softirq_time:  function to retrieve the current time from the softirq
  * @softirq_time:      the time when running the hrtimer queue in the softirq
- * @cb_pending:                list of timers where the callback is pending
  * @offset:            offset of this clock to the monotonic base
  * @reprogram:         function to reprogram the timer event
  */
index 5de6d911cdf7be1d8f7edf1b228fa70495e553e5..f577c8f1c66d999bda0a1338b2170058ed7c0956 100644 (file)
@@ -287,6 +287,12 @@ struct ieee80211_ht_addt_info {
 #define IEEE80211_HT_IE_NON_GF_STA_PRSNT       0x0004
 #define IEEE80211_HT_IE_NON_HT_STA_PRSNT       0x0010
 
+/* MIMO Power Save Modes */
+#define WLAN_HT_CAP_MIMO_PS_STATIC         0
+#define WLAN_HT_CAP_MIMO_PS_DYNAMIC        1
+#define WLAN_HT_CAP_MIMO_PS_INVALID        2
+#define WLAN_HT_CAP_MIMO_PS_DISABLED       3
+
 /* Authentication algorithms */
 #define WLAN_AUTH_OPEN 0
 #define WLAN_AUTH_SHARED_KEY 1
index 2efbda01674186d166671dbf2455063970c52bfa..90cdbbbbe0778f4d2d26e62d7171cc6e33da335c 100644 (file)
 #define __REF            .section       ".ref.text", "ax"
 #define __REFDATA        .section       ".ref.data", "aw"
 #define __REFCONST       .section       ".ref.rodata", "aw"
-/* backward compatibility */
-#define __INIT_REFOK     .section      __REF
-#define __INITDATA_REFOK .section      __REFDATA
 
 #ifndef __ASSEMBLY__
 /*
index 697104da91f11e159851c0698ff45dd0a1f5b618..589be3e1f3ac5a7859587ff4b662e0f6c3167314 100644 (file)
 struct lguest_device_desc {
        /* The device type: console, network, disk etc.  Type 0 terminates. */
        __u8 type;
-       /* The number of bytes of the config array. */
+       /* The number of virtqueues (first in config array) */
+       __u8 num_vq;
+       /* The number of bytes of feature bits.  Multiply by 2: one for host
+        * features and one for guest acknowledgements. */
+       __u8 feature_len;
+       /* The number of bytes of the config array after virtqueues. */
        __u8 config_len;
        /* A status byte, written by the Guest. */
        __u8 status;
@@ -31,7 +36,7 @@ struct lguest_device_desc {
 };
 
 /*D:135 This is how we expect the device configuration field for a virtqueue
- * (type VIRTIO_CONFIG_F_VIRTQUEUE) to be laid out: */
+ * to be laid out in config space. */
 struct lguest_vqconfig {
        /* The number of entries in the virtio_ring */
        __u16 num;
index 09f2e6d0e9ebdb491d8a31223acd8fcfdd49e512..7733585603f12894b95120b91bd7d9178919f1a7 100644 (file)
@@ -49,9 +49,9 @@ enum llc_sockopts {
 
 /* LLC SAP types. */
 #define LLC_SAP_NULL   0x00            /* NULL SAP.                    */
-#define LLC_SAP_LLC    0x02            /* LLC Sublayer Managment.      */
+#define LLC_SAP_LLC    0x02            /* LLC Sublayer Management.     */
 #define LLC_SAP_SNA    0x04            /* SNA Path Control.            */
-#define LLC_SAP_PNM    0x0E            /* Proway Network Managment.    */      
+#define LLC_SAP_PNM    0x0E            /* Proway Network Management.   */      
 #define LLC_SAP_IP     0x06            /* TCP/IP.                      */
 #define LLC_SAP_BSPAN  0x42            /* Bridge Spanning Tree Proto   */
 #define LLC_SAP_MMS    0x4E            /* Manufacturing Message Srv.   */
index 4f96f1d94ac4cf6c30d6660534c5b41a6f2fbee1..cee75c0ff6e7b8631b80c0edb0a428428c5d5f5d 100644 (file)
@@ -128,7 +128,6 @@ struct pci_cap_saved_state {
        u32 data[0];
 };
 
-struct pcie_link_state;
 /*
  * The pci_dev structure is used to describe PCI devices.
  */
@@ -164,10 +163,6 @@ struct pci_dev {
                                           this is D0-D3, D0 being fully functional,
                                           and D3 being off. */
 
-#ifdef CONFIG_PCIEASPM
-       struct pcie_link_state  *link_state;    /* ASPM link state. */
-#endif
-
        pci_channel_state_t error_state;        /* current connectivity state */
        struct  device  dev;            /* Generic device interface */
 
index c0c1223c91945111ca4ebbfe8d022de8461ab0ad..c1914a8b94a975fa5360722536b49a3746c29028 100644 (file)
 #define  PCI_EXP_DEVSTA_AUXPD  0x10    /* AUX Power Detected */
 #define  PCI_EXP_DEVSTA_TRPND  0x20    /* Transactions Pending */
 #define PCI_EXP_LNKCAP         12      /* Link Capabilities */
-#define  PCI_EXP_LNKCAP_ASPMS  0xc00   /* ASPM Support */
-#define  PCI_EXP_LNKCAP_L0SEL  0x7000  /* L0s Exit Latency */
-#define  PCI_EXP_LNKCAP_L1EL   0x38000 /* L1 Exit Latency */
-#define  PCI_EXP_LNKCAP_CLKPM  0x40000 /* L1 Clock Power Management */
 #define PCI_EXP_LNKCTL         16      /* Link Control */
-#define  PCI_EXP_LNKCTL_RL     0x20    /* Retrain Link */
-#define  PCI_EXP_LNKCTL_CCC    0x40    /* Common Clock COnfiguration */
 #define  PCI_EXP_LNKCTL_CLKREQ_EN 0x100        /* Enable clkreq */
 #define PCI_EXP_LNKSTA         18      /* Link Status */
-#define  PCI_EXP_LNKSTA_LT     0x800   /* Link Training */
-#define  PCI_EXP_LNKSTA_SLC    0x1000  /* Slot Clock Configuration */
 #define PCI_EXP_SLTCAP         20      /* Slot Capabilities */
 #define PCI_EXP_SLTCTL         24      /* Slot Control */
 #define PCI_EXP_SLTSTA         26      /* Slot Status */
index 554836edd915ef027011a9127b81b7188f3388ad..5e43ae7514122af688dc4679c04dd927856cb58b 100644 (file)
@@ -88,7 +88,7 @@ struct mii_bus {
 
        /* A lock to ensure that only one thing can read/write
         * the MDIO bus at a time */
-       spinlock_t mdio_lock;
+       struct mutex mdio_lock;
 
        struct device *dev;
 
@@ -284,10 +284,11 @@ struct phy_device {
 
        /* Interrupt and Polling infrastructure */
        struct work_struct phy_queue;
+       struct work_struct state_queue;
        struct timer_list phy_timer;
        atomic_t irq_disable;
 
-       spinlock_t lock;
+       struct mutex lock;
 
        struct net_device *attached_dev;
 
index b78e0295adf4342732b42d8ffd588a48771e2b79..eccf59ea2a77ba107359fd74288aa6043ff4140a 100644 (file)
@@ -95,7 +95,7 @@ struct pm_dev
 };
 
 /* Functions above this comment are list-based old-style power
- * managment. Please avoid using them.  */
+ * management. Please avoid using them.  */
 
 /*
  * Callbacks for platform drivers to implement.
index 2a6d62c7d2d1a5d8f58baad15d82e9a198eb4993..b9339d8b95bcbf68c0f0c4d304734748f40472e7 100644 (file)
@@ -126,7 +126,7 @@ struct pnp_resource_table {
 };
 
 /*
- * Device Managemnt
+ * Device Management
  */
 
 struct pnp_card {
index b6116b4445c760f01f0f133ad9530af71b6f09d0..b8ce2b444bb51b3f74130a0ad11acbf3d729069e 100644 (file)
@@ -91,7 +91,7 @@ do {                                                                  \
  *
  * For API usage, in general,
  * - any function _modifying_ the tree or tags (inserting or deleting
- *   items, setting or clearing tags must exclude other modifications, and
+ *   items, setting or clearing tags) must exclude other modifications, and
  *   exclude any functions reading the tree.
  * - any function _reading_ the tree or tags (looking up items or tags,
  *   gang lookups) must exclude modifications to the tree, but may occur
index 10fa0c832018c870a7bac82b428cdb976cb34449..db5ef9b83c3ff366be21465ffe2a86a5602032f4 100644 (file)
@@ -185,7 +185,7 @@ struct reiserfs_journal {
        unsigned long j_trans_id;
        unsigned long j_mount_id;
        unsigned long j_start;  /* start of current waiting commit (index into j_ap_blocks) */
-       unsigned long j_len;    /* lenght of current waiting commit */
+       unsigned long j_len;    /* length of current waiting commit */
        unsigned long j_len_alloc;      /* number of buffers requested by journal_begin() */
        atomic_t j_wcount;      /* count of writers for current commit */
        unsigned long j_bcount; /* batch count. allows turning X transactions into 1 */
index 86f9b1ef0e0934c9a354b44a67ab396be61ccbe4..ea037f28df91372d208a2e4301b24e21369596ca 100644 (file)
@@ -29,7 +29,7 @@ struct signalfd_siginfo {
 
        /*
         * Pad strcture to 128 bytes. Remember to update the
-        * pad size when you add new memebers. We use a fixed
+        * pad size when you add new members. We use a fixed
         * size structure to avoid compatibility problems with
         * future versions, and we leave extra space for additional
         * members. We use fixed size members because this strcture
index dfe975a9967ef16767be9040283ab8c34bb39e93..412672a79e8a9f237bd4dff87eb85df62fcf428c 100644 (file)
@@ -1810,5 +1810,6 @@ static inline void skb_forward_csum(struct sk_buff *skb)
                skb->ip_summed = CHECKSUM_NONE;
 }
 
+bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
 #endif /* __KERNEL__ */
 #endif /* _LINUX_SKBUFF_H */
index df7620dd8f3181133e6818a062cd85347c5e084d..64236b73c724e2bb4a8b357d8f8c50539377a9ca 100644 (file)
 /* USB slave/gadget data port base */
 #define SM501_USB_GADGET_DATA          (0x070000)
 
-/* Display contoller/video engine base */
+/* Display controller/video engine base */
 #define SM501_DC                       (0x080000)
 
 /* common defines for the SM501 address registers */
index 67faa044c5f5574042e72c28fa18f7f38e1fe51f..04e1d3164576eac1a5137b0620da7c1aa1959d89 100644 (file)
@@ -21,7 +21,7 @@
 /*
  * In the UP-nondebug case there's no real locking going on, so the
  * only thing we have to do is to keep the preempt counts and irq
- * flags straight, to supress compiler warnings of unused lock
+ * flags straight, to suppress compiler warnings of unused lock
  * variables, and to add the proper checker annotations:
  */
 #define __LOCK(lock) \
index 14e1379876d334f9bb99d04d43750c571c967528..260d1fcf29a4222c011ab39176b1e2e4d46a98a3 100644 (file)
 /**
  * virtqueue - a queue to register buffers for sending or receiving.
  * @callback: the function to call when buffers are consumed (can be NULL).
- *    If this returns false, callbacks are suppressed until vq_ops->restart
- *    is called.
  * @vdev: the virtio device this queue was created for.
  * @vq_ops: the operations for this virtqueue (see below).
  * @priv: a pointer for the virtqueue implementation to use.
  */
 struct virtqueue
 {
-       bool (*callback)(struct virtqueue *vq);
+       void (*callback)(struct virtqueue *vq);
        struct virtio_device *vdev;
        struct virtqueue_ops *vq_ops;
        void *priv;
@@ -41,13 +39,12 @@ struct virtqueue
  *     vq: the struct virtqueue we're talking about.
  *     len: the length written into the buffer
  *     Returns NULL or the "data" token handed to add_buf.
- * @restart: restart callbacks after callback returned false.
+ * @disable_cb: disable callbacks
+ *     vq: the struct virtqueue we're talking about.
+ * @enable_cb: restart callbacks after disable_cb.
  *     vq: the struct virtqueue we're talking about.
  *     This returns "false" (and doesn't re-enable) if there are pending
  *     buffers in the queue, to avoid a race.
- * @shutdown: "unadd" all buffers.
- *     vq: the struct virtqueue we're talking about.
- *     Remove everything from the queue.
  *
  * Locking rules are straightforward: the driver is responsible for
  * locking.  No two operations may be invoked simultaneously.
@@ -65,9 +62,8 @@ struct virtqueue_ops {
 
        void *(*get_buf)(struct virtqueue *vq, unsigned int *len);
 
-       bool (*restart)(struct virtqueue *vq);
-
-       void (*shutdown)(struct virtqueue *vq);
+       void (*disable_cb)(struct virtqueue *vq);
+       bool (*enable_cb)(struct virtqueue *vq);
 };
 
 /**
@@ -97,12 +93,15 @@ void unregister_virtio_device(struct virtio_device *dev);
  * @probe: the function to call when a device is found.  Returns a token for
  *    remove, or PTR_ERR().
  * @remove: the function when a device is removed.
+ * @config_changed: optional function to call when the device configuration
+ *    changes; may be called in interrupt context.
  */
 struct virtio_driver {
        struct device_driver driver;
        const struct virtio_device_id *id_table;
        int (*probe)(struct virtio_device *dev);
        void (*remove)(struct virtio_device *dev);
+       void (*config_changed)(struct virtio_device *dev);
 };
 
 int register_virtio_driver(struct virtio_driver *drv);
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h
new file mode 100644 (file)
index 0000000..979524e
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _LINUX_VIRTIO_BALLOON_H
+#define _LINUX_VIRTIO_BALLOON_H
+#include <linux/virtio_config.h>
+
+/* The ID for virtio_balloon */
+#define VIRTIO_ID_BALLOON      5
+
+/* The feature bitmap for virtio balloon */
+#define VIRTIO_BALLOON_F_MUST_TELL_HOST        0 /* Tell before reclaiming pages */
+
+struct virtio_balloon_config
+{
+       /* Number of pages host wants Guest to give up. */
+       __le32 num_pages;
+       /* Number of pages we've actually got in balloon. */
+       __le32 actual;
+};
+#endif /* _LINUX_VIRTIO_BALLOON_H */
index 7bd2bce0cfd964f2c4c5fe5bffa72977bc37fd2b..bca0b10d79470056cc6456101ef45454f813149f 100644 (file)
@@ -6,15 +6,19 @@
 #define VIRTIO_ID_BLOCK        2
 
 /* Feature bits */
-#define VIRTIO_CONFIG_BLK_F    0x40
-#define VIRTIO_BLK_F_BARRIER   1       /* Does host support barriers? */
+#define VIRTIO_BLK_F_BARRIER   0       /* Does host support barriers? */
+#define VIRTIO_BLK_F_SIZE_MAX  1       /* Indicates maximum segment size */
+#define VIRTIO_BLK_F_SEG_MAX   2       /* Indicates maximum # of segments */
 
-/* The capacity (in 512-byte sectors). */
-#define VIRTIO_CONFIG_BLK_F_CAPACITY   0x41
-/* The maximum segment size. */
-#define VIRTIO_CONFIG_BLK_F_SIZE_MAX   0x42
-/* The maximum number of segments. */
-#define VIRTIO_CONFIG_BLK_F_SEG_MAX    0x43
+struct virtio_blk_config
+{
+       /* The capacity (in 512-byte sectors). */
+       __le64 capacity;
+       /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */
+       __le32 size_max;
+       /* The maximum number of segments (if VIRTIO_BLK_F_SEG_MAX) */
+       __le32 seg_max;
+} __attribute__((packed));
 
 /* These two define direction. */
 #define VIRTIO_BLK_T_IN                0
@@ -35,8 +39,6 @@ struct virtio_blk_outhdr
        __u32 ioprio;
        /* Sector (ie. 512 byte offset) */
        __u64 sector;
-       /* Where to put reply. */
-       __u64 id;
 };
 
 #define VIRTIO_BLK_S_OK                0
index bcc01888df78d52e19592a92bd8861b0f1f5f9c9..d581b2914b342cbbe83744bc15762fb8718a81a3 100644 (file)
@@ -5,7 +5,7 @@
  * store and access that space differently. */
 #include <linux/types.h>
 
-/* Status byte for guest to report progress, and synchronize config. */
+/* Status byte for guest to report progress, and synchronize features. */
 /* We have seen device and processed generic fields (VIRTIO_CONFIG_F_VIRTIO) */
 #define VIRTIO_CONFIG_S_ACKNOWLEDGE    1
 /* We have found a driver for the device. */
 /* We've given up on this device. */
 #define VIRTIO_CONFIG_S_FAILED         0x80
 
-/* Feature byte (actually 7 bits availabe): */
-/* Requirements/features of the virtio implementation. */
-#define VIRTIO_CONFIG_F_VIRTIO 1
-/* Requirements/features of the virtqueue (may have more than one). */
-#define VIRTIO_CONFIG_F_VIRTQUEUE 2
-
 #ifdef __KERNEL__
 struct virtio_device;
 
 /**
  * virtio_config_ops - operations for configuring a virtio device
- * @find: search for the next configuration field of the given type.
+ * @feature: search for a feature in this config
  *     vdev: the virtio_device
- *     type: the feature type
- *     len: the (returned) length of the field if found.
- *     Returns a token if found, or NULL.  Never returnes the same field twice
- *     (ie. it's used up).
- * @get: read the value of a configuration field after find().
+ *     bit: the feature bit
+ *     Returns true if the feature is supported.  Acknowledges the feature
+ *     so the host can see it.
+ * @get: read the value of a configuration field
  *     vdev: the virtio_device
- *     token: the token returned from find().
+ *     offset: the offset of the configuration field
  *     buf: the buffer to write the field value into.
- *     len: the length of the buffer (given by find()).
+ *     len: the length of the buffer
  *     Note that contents are conventionally little-endian.
- * @set: write the value of a configuration field after find().
+ * @set: write the value of a configuration field
  *     vdev: the virtio_device
- *     token: the token returned from find().
+ *     offset: the offset of the configuration field
  *     buf: the buffer to read the field value from.
- *     len: the length of the buffer (given by find()).
+ *     len: the length of the buffer
  *     Note that contents are conventionally little-endian.
  * @get_status: read the status byte
  *     vdev: the virtio_device
@@ -50,62 +43,67 @@ struct virtio_device;
  * @set_status: write the status byte
  *     vdev: the virtio_device
  *     status: the new status byte
- * @find_vq: find the first VIRTIO_CONFIG_F_VIRTQUEUE and create a virtqueue.
+ * @reset: reset the device
+ *     vdev: the virtio device
+ *     After this, status and feature negotiation must be done again
+ * @find_vq: find a virtqueue and instantiate it.
  *     vdev: the virtio_device
+ *     index: the 0-based virtqueue number in case there's more than one.
  *     callback: the virqtueue callback
- *     Returns the new virtqueue or ERR_PTR().
+ *     Returns the new virtqueue or ERR_PTR() (eg. -ENOENT).
  * @del_vq: free a virtqueue found by find_vq().
  */
 struct virtio_config_ops
 {
-       void *(*find)(struct virtio_device *vdev, u8 type, unsigned *len);
-       void (*get)(struct virtio_device *vdev, void *token,
+       bool (*feature)(struct virtio_device *vdev, unsigned bit);
+       void (*get)(struct virtio_device *vdev, unsigned offset,
                    void *buf, unsigned len);
-       void (*set)(struct virtio_device *vdev, void *token,
+       void (*set)(struct virtio_device *vdev, unsigned offset,
                    const void *buf, unsigned len);
        u8 (*get_status)(struct virtio_device *vdev);
        void (*set_status)(struct virtio_device *vdev, u8 status);
+       void (*reset)(struct virtio_device *vdev);
        struct virtqueue *(*find_vq)(struct virtio_device *vdev,
-                                    bool (*callback)(struct virtqueue *));
+                                    unsigned index,
+                                    void (*callback)(struct virtqueue *));
        void (*del_vq)(struct virtqueue *vq);
 };
 
 /**
- * virtio_config_val - get a single virtio config and mark it used.
- * @config: the virtio config space
- * @type: the type to search for.
+ * virtio_config_val - look for a feature and get a single virtio config.
+ * @vdev: the virtio device
+ * @fbit: the feature bit
+ * @offset: the type to search for.
  * @val: a pointer to the value to fill in.
  *
- * Once used, the config type is marked with VIRTIO_CONFIG_F_USED so it can't
- * be found again.  This version does endian conversion. */
-#define virtio_config_val(vdev, type, v) ({                            \
-       int _err = __virtio_config_val((vdev),(type),(v),sizeof(*(v))); \
-                                                                       \
-       BUILD_BUG_ON(sizeof(*(v)) != 1 && sizeof(*(v)) != 2             \
-                    && sizeof(*(v)) != 4 && sizeof(*(v)) != 8);        \
-       if (!_err) {                                                    \
-               switch (sizeof(*(v))) {                                 \
-               case 2: le16_to_cpus((__u16 *) v); break;               \
-               case 4: le32_to_cpus((__u32 *) v); break;               \
-               case 8: le64_to_cpus((__u64 *) v); break;               \
-               }                                                       \
-       }                                                               \
+ * The return value is -ENOENT if the feature doesn't exist.  Otherwise
+ * the value is endian-corrected and returned in v. */
+#define virtio_config_val(vdev, fbit, offset, v) ({                    \
+       int _err;                                                       \
+       if ((vdev)->config->feature((vdev), (fbit))) {                  \
+               __virtio_config_val((vdev), (offset), (v));             \
+               _err = 0;                                               \
+       } else                                                          \
+               _err = -ENOENT;                                         \
        _err;                                                           \
 })
 
-int __virtio_config_val(struct virtio_device *dev,
-                       u8 type, void *val, size_t size);
-
 /**
- * virtio_use_bit - helper to use a feature bit in a bitfield value.
- * @dev: the virtio device
- * @token: the token as returned from vdev->config->find().
- * @len: the length of the field.
- * @bitnum: the bit to test.
+ * __virtio_config_val - get a single virtio config without feature check.
+ * @vdev: the virtio device
+ * @offset: the type to search for.
+ * @val: a pointer to the value to fill in.
  *
- * If handed a NULL token, it returns false, otherwise returns bit status.
- * If it's one, it sets the mirroring acknowledgement bit. */
-int virtio_use_bit(struct virtio_device *vdev,
-                  void *token, unsigned int len, unsigned int bitnum);
+ * The value is endian-corrected and returned in v. */
+#define __virtio_config_val(vdev, offset, v) do {                      \
+       BUILD_BUG_ON(sizeof(*(v)) != 1 && sizeof(*(v)) != 2             \
+                    && sizeof(*(v)) != 4 && sizeof(*(v)) != 8);        \
+       (vdev)->config->get((vdev), (offset), (v), sizeof(*(v)));       \
+       switch (sizeof(*(v))) {                                         \
+       case 2: le16_to_cpus((__u16 *) v); break;                       \
+       case 4: le32_to_cpus((__u32 *) v); break;                       \
+       case 8: le64_to_cpus((__u64 *) v); break;                       \
+       }                                                               \
+} while(0)
 #endif /* __KERNEL__ */
 #endif /* _LINUX_VIRTIO_CONFIG_H */
index ae469ae55d3662fe80c198fea895e68c6890e204..1ea3351df609474d097b67e4f0df31131257a34f 100644 (file)
@@ -5,32 +5,32 @@
 /* The ID for virtio_net */
 #define VIRTIO_ID_NET  1
 
-/* The bitmap of config for virtio net */
-#define VIRTIO_CONFIG_NET_F    0x40
-#define VIRTIO_NET_F_NO_CSUM   0
-#define VIRTIO_NET_F_TSO4      1
-#define VIRTIO_NET_F_UFO       2
-#define VIRTIO_NET_F_TSO4_ECN  3
-#define VIRTIO_NET_F_TSO6      4
+/* The feature bitmap for virtio net */
+#define VIRTIO_NET_F_CSUM      0       /* Can handle pkts w/ partial csum */
+#define VIRTIO_NET_F_MAC       5       /* Host has given MAC address. */
+#define VIRTIO_NET_F_GSO       6       /* Can handle pkts w/ any GSO type */
 
-/* The config defining mac address. */
-#define VIRTIO_CONFIG_NET_MAC_F        0x41
+struct virtio_net_config
+{
+       /* The config defining mac address (if VIRTIO_NET_F_MAC) */
+       __u8 mac[6];
+} __attribute__((packed));
 
 /* This is the first element of the scatter-gather list.  If you don't
  * specify GSO or CSUM features, you can simply ignore the header. */
 struct virtio_net_hdr
 {
 #define VIRTIO_NET_HDR_F_NEEDS_CSUM    1       // Use csum_start, csum_offset
-      __u8 flags;
+       __u8 flags;
 #define VIRTIO_NET_HDR_GSO_NONE                0       // Not a GSO frame
 #define VIRTIO_NET_HDR_GSO_TCPV4       1       // GSO frame, IPv4 TCP (TSO)
-/* FIXME: Do we need this?  If they said they can handle ECN, do they care? */
-#define VIRTIO_NET_HDR_GSO_TCPV4_ECN   2       // GSO frame, IPv4 TCP w/ ECN
 #define VIRTIO_NET_HDR_GSO_UDP         3       // GSO frame, IPv4 UDP (UFO)
 #define VIRTIO_NET_HDR_GSO_TCPV6       4       // GSO frame, IPv6 TCP
-      __u8 gso_type;
-      __u16 gso_size;
-      __u16 csum_start;
-      __u16 csum_offset;
+#define VIRTIO_NET_HDR_GSO_ECN         0x80    // TCP has ECN set
+       __u8 gso_type;
+       __u16 hdr_len;          /* Ethernet + IP + tcp/udp hdrs */
+       __u16 gso_size;         /* Bytes to append to gso_hdr_len per frame */
+       __u16 csum_start;       /* Position to start checksumming from */
+       __u16 csum_offset;      /* Offset after that to place checksum */
 };
 #endif /* _LINUX_VIRTIO_NET_H */
diff --git a/include/linux/virtio_pci.h b/include/linux/virtio_pci.h
new file mode 100644 (file)
index 0000000..b315165
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Virtio PCI driver
+ *
+ * This module allows virtio devices to be used over a virtual PCI device.
+ * This can be used with QEMU based VMMs like KVM or Xen.
+ *
+ * Copyright IBM Corp. 2007
+ *
+ * Authors:
+ *  Anthony Liguori  <aliguori@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef _LINUX_VIRTIO_PCI_H
+#define _LINUX_VIRTIO_PCI_H
+
+#include <linux/virtio_config.h>
+
+/* A 32-bit r/o bitmask of the features supported by the host */
+#define VIRTIO_PCI_HOST_FEATURES       0
+
+/* A 32-bit r/w bitmask of features activated by the guest */
+#define VIRTIO_PCI_GUEST_FEATURES      4
+
+/* A 32-bit r/w PFN for the currently selected queue */
+#define VIRTIO_PCI_QUEUE_PFN           8
+
+/* A 16-bit r/o queue size for the currently selected queue */
+#define VIRTIO_PCI_QUEUE_NUM           12
+
+/* A 16-bit r/w queue selector */
+#define VIRTIO_PCI_QUEUE_SEL           14
+
+/* A 16-bit r/w queue notifier */
+#define VIRTIO_PCI_QUEUE_NOTIFY                16
+
+/* An 8-bit device status register.  */
+#define VIRTIO_PCI_STATUS              18
+
+/* An 8-bit r/o interrupt status register.  Reading the value will return the
+ * current contents of the ISR and will also clear it.  This is effectively
+ * a read-and-acknowledge. */
+#define VIRTIO_PCI_ISR                 19
+
+/* The bit of the ISR which indicates a device configuration change. */
+#define VIRTIO_PCI_ISR_CONFIG          0x2
+
+/* The remaining space is defined by each driver as the per-driver
+ * configuration space */
+#define VIRTIO_PCI_CONFIG              20
+
+/* Virtio ABI version, this must match exactly */
+#define VIRTIO_PCI_ABI_VERSION         0
+#endif
index 1a4ed49f64780cc553a1ac3f6dcca0f2065972ff..abe481ed990e328bd6f5ec1f5212deeed07b9fea 100644 (file)
 /* This marks a buffer as write-only (otherwise read-only). */
 #define VRING_DESC_F_WRITE     2
 
-/* This means don't notify other side when buffer added. */
+/* The Host uses this in used->flags to advise the Guest: don't kick me when
+ * you add a buffer.  It's unreliable, so it's simply an optimization.  Guest
+ * will still kick if it's out of buffers. */
 #define VRING_USED_F_NO_NOTIFY 1
-/* This means don't interrupt guest when buffer consumed. */
+/* The Guest uses this in avail->flags to advise the Host: don't interrupt me
+ * when you consume a buffer.  It's unreliable, so it's simply an
+ * optimization.  */
 #define VRING_AVAIL_F_NO_INTERRUPT     1
 
 /* Virtio ring descriptors: 16 bytes.  These can chain together via "next". */
@@ -89,7 +93,7 @@ struct vring {
  * };
  */
 static inline void vring_init(struct vring *vr, unsigned int num, void *p,
-                             unsigned int pagesize)
+                             unsigned long pagesize)
 {
        vr->num = num;
        vr->desc = p;
@@ -98,7 +102,7 @@ static inline void vring_init(struct vring *vr, unsigned int num, void *p,
                            & ~(pagesize - 1));
 }
 
-static inline unsigned vring_size(unsigned int num, unsigned int pagesize)
+static inline unsigned vring_size(unsigned int num, unsigned long pagesize)
 {
        return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num)
                 + pagesize - 1) & ~(pagesize - 1))
@@ -114,7 +118,7 @@ struct virtqueue *vring_new_virtqueue(unsigned int num,
                                      struct virtio_device *vdev,
                                      void *pages,
                                      void (*notify)(struct virtqueue *vq),
-                                     bool (*callback)(struct virtqueue *vq));
+                                     void (*callback)(struct virtqueue *vq));
 void vring_del_virtqueue(struct virtqueue *vq);
 
 irqreturn_t vring_interrupt(int irq, void *_vq);
index 74e84caa1e208ba529729597bf8a66612d40061b..3160dfed73caf30a48cbfe64dd85a26315f446f9 100644 (file)
@@ -1079,7 +1079,7 @@ struct    iw_priv_args
  */
 struct iw_event
 {
-       __u16           len;                    /* Real lenght of this stuff */
+       __u16           len;                    /* Real length of this stuff */
        __u16           cmd;                    /* Wireless IOCTL */
        union iwreq_data        u;              /* IOCTL fixed payload */
 };
index 951c1ae0be7436b606274a63276407f8f8e60a00..a89426667618a42046a592b2f76e9c8262a1a19f 100644 (file)
@@ -4,7 +4,7 @@
     saa6588.c and every driver (e.g. bttv-driver.c) that wants
     to use the saa6588 module.
 
-    Instead of having a seperate rds.h, I'd prefer to include
+    Instead of having a separate rds.h, I'd prefer to include
     this stuff in one of the already existing files like tuner.h
 
     (c) 2005 by Hans J. Koch
index b24508abb8505bff87d1ba1f139f25db0f4a10e6..b2cfc4927257cd2307ed31b96ecd0dd5759f0618 100644 (file)
@@ -112,13 +112,13 @@ struct ifmcaddr6
        struct ip6_sf_list      *mca_sources;
        struct ip6_sf_list      *mca_tomb;
        unsigned int            mca_sfmode;
+       unsigned char           mca_crcount;
        unsigned long           mca_sfcount[2];
        struct timer_list       mca_timer;
        unsigned                mca_flags;
        int                     mca_users;
        atomic_t                mca_refcnt;
        spinlock_t              mca_lock;
-       unsigned char           mca_crcount;
        unsigned long           mca_cstamp;
        unsigned long           mca_tstamp;
 };
@@ -166,11 +166,11 @@ struct inet6_dev
        struct ifmcaddr6        *mc_list;
        struct ifmcaddr6        *mc_tomb;
        rwlock_t                mc_lock;
-       unsigned long           mc_v1_seen;
-       unsigned long           mc_maxdelay;
        unsigned char           mc_qrv;
        unsigned char           mc_gq_running;
        unsigned char           mc_ifc_count;
+       unsigned long           mc_v1_seen;
+       unsigned long           mc_maxdelay;
        struct timer_list       mc_gq_timer;    /* general query timer */
        struct timer_list       mc_ifc_timer;   /* interface change timer */
 
index fdff630708ce864470a3f422cd9a1f0deea3fabe..62a5b691858e0369df0e43ae749ef0aeafcf4871 100644 (file)
@@ -49,7 +49,7 @@ static inline int inet6_sk_ehashfn(const struct sock *sk)
        return inet6_ehashfn(laddr, lport, faddr, fport);
 }
 
-extern void __inet6_hash(struct inet_hashinfo *hashinfo, struct sock *sk);
+extern void __inet6_hash(struct sock *sk);
 
 /*
  * Sockets in TCP_CLOSE state are _always_ taken out of the hash, so
index 133cf30d2d7928047bb9eed5669bce71c45513ed..f00f0573627b0b36544e50af781ad64b03c67cdc 100644 (file)
@@ -29,7 +29,6 @@
 #undef INET_CSK_CLEAR_TIMERS
 
 struct inet_bind_bucket;
-struct inet_hashinfo;
 struct tcp_congestion_ops;
 
 /*
@@ -59,6 +58,8 @@ struct inet_connection_sock_af_ops {
                                int level, int optname,
                                char __user *optval, int __user *optlen);
        void        (*addr2sockaddr)(struct sock *sk, struct sockaddr *);
+       int         (*bind_conflict)(const struct sock *sk,
+                                    const struct inet_bind_bucket *tb);
 };
 
 /** inet_connection_sock - INET connection oriented sock
@@ -244,10 +245,7 @@ extern struct request_sock *inet_csk_search_req(const struct sock *sk,
                                                const __be32 laddr);
 extern int inet_csk_bind_conflict(const struct sock *sk,
                                  const struct inet_bind_bucket *tb);
-extern int inet_csk_get_port(struct inet_hashinfo *hashinfo,
-                            struct sock *sk, unsigned short snum,
-                            int (*bind_conflict)(const struct sock *sk,
-                                                 const struct inet_bind_bucket *tb));
+extern int inet_csk_get_port(struct sock *sk, unsigned short snum);
 
 extern struct dst_entry* inet_csk_route_req(struct sock *sk,
                                            const struct request_sock *req);
index c23c4ed30724f37e985aa65eb627bd841c5cd962..48ac620cb8463db035dd93b36d82ea34d2ad05ec 100644 (file)
@@ -221,9 +221,9 @@ static inline int inet_sk_listen_hashfn(const struct sock *sk)
 }
 
 /* Caller must disable local BH processing. */
-static inline void __inet_inherit_port(struct inet_hashinfo *table,
-                                      struct sock *sk, struct sock *child)
+static inline void __inet_inherit_port(struct sock *sk, struct sock *child)
 {
+       struct inet_hashinfo *table = sk->sk_prot->hashinfo;
        const int bhash = inet_bhashfn(inet_sk(child)->num, table->bhash_size);
        struct inet_bind_hashbucket *head = &table->bhash[bhash];
        struct inet_bind_bucket *tb;
@@ -235,15 +235,14 @@ static inline void __inet_inherit_port(struct inet_hashinfo *table,
        spin_unlock(&head->lock);
 }
 
-static inline void inet_inherit_port(struct inet_hashinfo *table,
-                                    struct sock *sk, struct sock *child)
+static inline void inet_inherit_port(struct sock *sk, struct sock *child)
 {
        local_bh_disable();
-       __inet_inherit_port(table, sk, child);
+       __inet_inherit_port(sk, child);
        local_bh_enable();
 }
 
-extern void inet_put_port(struct inet_hashinfo *table, struct sock *sk);
+extern void inet_put_port(struct sock *sk);
 
 extern void inet_listen_wlock(struct inet_hashinfo *hashinfo);
 
@@ -266,41 +265,9 @@ static inline void inet_listen_unlock(struct inet_hashinfo *hashinfo)
                wake_up(&hashinfo->lhash_wait);
 }
 
-extern void __inet_hash(struct inet_hashinfo *hashinfo, struct sock *sk);
-extern void __inet_hash_nolisten(struct inet_hashinfo *hinfo, struct sock *sk);
-
-static inline void inet_hash(struct inet_hashinfo *hashinfo, struct sock *sk)
-{
-       if (sk->sk_state != TCP_CLOSE) {
-               local_bh_disable();
-               __inet_hash(hashinfo, sk);
-               local_bh_enable();
-       }
-}
-
-static inline void inet_unhash(struct inet_hashinfo *hashinfo, struct sock *sk)
-{
-       rwlock_t *lock;
-
-       if (sk_unhashed(sk))
-               goto out;
-
-       if (sk->sk_state == TCP_LISTEN) {
-               local_bh_disable();
-               inet_listen_wlock(hashinfo);
-               lock = &hashinfo->lhash_lock;
-       } else {
-               lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
-               write_lock_bh(lock);
-       }
-
-       if (__sk_del_node_init(sk))
-               sock_prot_inuse_add(sk->sk_prot, -1);
-       write_unlock_bh(lock);
-out:
-       if (sk->sk_state == TCP_LISTEN)
-               wake_up(&hashinfo->lhash_wait);
-}
+extern void __inet_hash_nolisten(struct sock *sk);
+extern void inet_hash(struct sock *sk);
+extern void inet_unhash(struct sock *sk);
 
 extern struct sock *__inet_lookup_listener(struct net *net,
                                           struct inet_hashinfo *hashinfo,
@@ -425,7 +392,7 @@ extern int __inet_hash_connect(struct inet_timewait_death_row *death_row,
                struct sock *sk,
                int (*check_established)(struct inet_timewait_death_row *,
                        struct sock *, __u16, struct inet_timewait_sock **),
-               void (*hash)(struct inet_hashinfo *, struct sock *));
+                              void (*hash)(struct sock *sk));
 extern int inet_hash_connect(struct inet_timewait_death_row *death_row,
                             struct sock *sk);
 #endif /* _INET_HASHTABLES_H */
index 67e925065aaeee1245c8088a6ccead3a128f4fc2..296547bfb0b726610141c511504d358e518e4d94 100644 (file)
@@ -116,6 +116,7 @@ struct inet_timewait_sock {
 #define tw_hash                        __tw_common.skc_hash
 #define tw_prot                        __tw_common.skc_prot
 #define tw_net                 __tw_common.skc_net
+       int                     tw_timeout;
        volatile unsigned char  tw_substate;
        /* 3 bits hole, try to pack */
        unsigned char           tw_rcv_wscale;
@@ -130,7 +131,6 @@ struct inet_timewait_sock {
        __u8                    tw_ipv6only:1;
        /* 15 bits hole, try to pack */
        __u16                   tw_ipv6_offset;
-       int                     tw_timeout;
        unsigned long           tw_ttd;
        struct inet_bind_bucket *tw_tb;
        struct hlist_node       tw_death_node;
index e3fb4c047f4c99b1bdb73471010916243e733bbf..8a7889b35810ce9e6ee4c4799af4d79c7315c0a6 100644 (file)
@@ -496,6 +496,7 @@ extern int sk_wait_data(struct sock *sk, long *timeo);
 
 struct request_sock_ops;
 struct timewait_sock_ops;
+struct inet_hashinfo;
 
 /* Networking protocol blocks we attach to sockets.
  * socket layer -> transport layer interface
@@ -578,6 +579,8 @@ struct proto {
        struct request_sock_ops *rsk_prot;
        struct timewait_sock_ops *twsk_prot;
 
+       struct inet_hashinfo    *hashinfo;
+
        struct module           *owner;
 
        char                    name[32];
index e466d886e19283621c2e6af4f6087ce7eafa2d1e..4769efd4db24ec745cd4f5baff15fcfa76e12e5c 100644 (file)
@@ -176,7 +176,7 @@ struct class_device_attribute class_device_attr_vport_##_name =     \
  * ports has a unique presense on the SAN, and may be instantiated via
  * NPIV, Virtual Fabrics, or via additional ALPAs. As the vport is a
  * unique presense, each vport has it's own view of the fabric,
- * authentication priviledge, and priorities.
+ * authentication privilege, and priorities.
  *
  * A virtual port may support 1 or more FC4 roles. Typically it is a
  * FCP Initiator. It could be a FCP Target, or exist sole for an IP over FC
index dcc96a8c8c697451412d811a759b0a3683c265f8..b2acdeb2d312f4d7345f51df843ff52a2aab367d 100644 (file)
@@ -665,6 +665,20 @@ config SLOB
 
 endchoice
 
+config PROFILING
+       bool "Profiling support (EXPERIMENTAL)"
+       help
+         Say Y here to enable the extended profiling support mechanisms used
+         by profilers such as OProfile.
+
+config MARKERS
+       bool "Activate markers"
+       help
+         Place an empty function call at each marker site. Can be
+         dynamically changed for a probe function.
+
+source "arch/Kconfig"
+
 endmenu                # General setup
 
 config SLABINFO
diff --git a/kernel/Kconfig.instrumentation b/kernel/Kconfig.instrumentation
deleted file mode 100644 (file)
index 468f47a..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-menuconfig INSTRUMENTATION
-       bool "Instrumentation Support"
-       default y
-       ---help---
-         Say Y here to get to see options related to performance measurement,
-         system-wide debugging, and testing. This option alone does not add any
-         kernel code.
-
-         If you say N, all options in this submenu will be skipped and
-         disabled. If you're trying to debug the kernel itself, go see the
-         Kernel Hacking menu.
-
-if INSTRUMENTATION
-
-config PROFILING
-       bool "Profiling support (EXPERIMENTAL)"
-       help
-         Say Y here to enable the extended profiling support mechanisms used
-         by profilers such as OProfile.
-
-config OPROFILE
-       tristate "OProfile system profiling (EXPERIMENTAL)"
-       depends on PROFILING && !UML
-       depends on ARCH_SUPPORTS_OPROFILE || ALPHA || ARM || BLACKFIN || IA64 || M32R || PARISC || PPC || S390 || SUPERH || SPARC
-       help
-         OProfile is a profiling system capable of profiling the
-         whole system, include the kernel, kernel modules, libraries,
-         and applications.
-
-         If unsure, say N.
-
-config KPROBES
-       bool "Kprobes"
-       depends on KALLSYMS && MODULES && !UML
-       depends on X86_32 || IA64 || PPC || S390 || SPARC64 || X86_64 || AVR32
-       help
-         Kprobes allows you to trap at almost any kernel address and
-         execute a callback function.  register_kprobe() establishes
-         a probepoint and specifies the callback.  Kprobes is useful
-         for kernel debugging, non-intrusive instrumentation and testing.
-         If in doubt, say "N".
-
-config MARKERS
-       bool "Activate markers"
-       help
-         Place an empty function call at each marker site. Can be
-         dynamically changed for a probe function.
-
-endif # INSTRUMENTATION
index 8885627ea02138d58901d6c7d5d1cbda07883ccb..db9af707ff5bbf828174381cf64c65684978bf53 100644 (file)
@@ -9,7 +9,7 @@ obj-y     = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
            rcupdate.o extable.o params.o posix-timers.o \
            kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
            hrtimer.o rwsem.o latency.o nsproxy.o srcu.o \
-           utsname.o notifier.o
+           utsname.o notifier.o ksysfs.o
 
 obj-$(CONFIG_SYSCTL) += sysctl_check.o
 obj-$(CONFIG_STACKTRACE) += stacktrace.o
@@ -49,7 +49,6 @@ obj-$(CONFIG_AUDIT) += audit.o auditfilter.o
 obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
 obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
 obj-$(CONFIG_KPROBES) += kprobes.o
-obj-$(CONFIG_SYSFS) += ksysfs.o
 obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o
 obj-$(CONFIG_GENERIC_HARDIRQS) += irq/
 obj-$(CONFIG_SECCOMP) += seccomp.o
index bfb1c0e940e814f7e64a3c707c65a6f5608c0388..9e459fefda77191218466814a9355c85d4b09ea7 100644 (file)
@@ -50,8 +50,6 @@
 #include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 
-extern void sem_exit (void);
-
 static void exit_mm(struct task_struct * tsk);
 
 static void __unhash_process(struct task_struct *p)
index 35b4bbfc78ff6ee7d3f389baf0430231ed09af7b..36d563fd9e3b40d78f778f2bc46f339380daa6c3 100644 (file)
@@ -493,7 +493,7 @@ sys_timer_create(const clockid_t which_clock,
                goto retry;
        else if (error) {
                /*
-                * Wierd looking, but we return EAGAIN if the IDR is
+                * Weird looking, but we return EAGAIN if the IDR is
                 * full (proper POSIX return value for this)
                 */
                error = -EAGAIN;
index 61134eb7a0c8a9b2d2e0557b33ff4fbd7ff96f31..7c0373322f18892eea75e3773714554f59f46c1e 100644 (file)
@@ -92,6 +92,7 @@ static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma)
                return -EINVAL;
 
        vma->vm_ops = &relay_file_mmap_ops;
+       vma->vm_flags |= VM_DONTEXPAND;
        vma->vm_private_data = buf;
        buf->chan->cb->buf_mapped(buf, filp);
 
index 0d8a5a4a789d868100762420d0647f50f27c72fc..0d385be682db021dccc6482f385d8bb6f30fa75e 100644 (file)
@@ -81,7 +81,7 @@ config HEADERS_CHECK
 
 config DEBUG_SECTION_MISMATCH
        bool "Enable full Section mismatch analysis"
-       default n
+       depends on UNDEFINED
        help
          The section mismatch analysis checks if there are illegal
          references from one section to another section.
@@ -90,19 +90,19 @@ config DEBUG_SECTION_MISMATCH
          most likely result in an oops.
          In the code functions and variables are annotated with
          __init, __devinit etc. (see full list in include/linux/init.h)
-         which result in the code/data being placed in specific sections.
-         The section mismatch anaylsis are always done after a full
-         kernel build but enabling this options will in addition
+         which results in the code/data being placed in specific sections.
+         The section mismatch analysis is always done after a full
+         kernel build but enabling this option will in addition
          do the following:
          - Add the option -fno-inline-functions-called-once to gcc
            When inlining a function annotated __init in a non-init
-           function we would loose the section information and thus
+           function we would lose the section information and thus
            the analysis would not catch the illegal reference.
-           This options tell gcc to inline less but will also
+           This option tells gcc to inline less but will also
            result in a larger kernel.
          - Run the section mismatch analysis for each module/built-in.o
            When we run the section mismatch analysis on vmlinux.o we
-           looses valueable information about where the mismatch was
+           lose valueble information about where the mismatch was
            introduced.
            Running the analysis for each module/built-in.o file
            will tell where the mismatch happens much closer to the
index d2c2f257bedd348a0f81316fc02ef90226ecc0ac..49d1c9e3ce3820ccb8dd3d01cec5e11ac39cd7cc 100644 (file)
@@ -348,7 +348,7 @@ EXPORT_SYMBOL(crc32_be);
  * but again the multiple of the polynomial to subtract depends only on
  * the high bits, the high 8 bits in this case.  
  *
- * The multile we need in that case is the low 32 bits of a 40-bit
+ * The multiple we need in that case is the low 32 bits of a 40-bit
  * value whose high 8 bits are given, and which is a multiple of the
  * generator polynomial.  This is simply the CRC-32 of the given
  * one-byte message.
index 1d63ead1815e4f5cb8aae5ea2d86a1541eed23a2..d784daeb8571692e0fed288f17df60651a04366c 100644 (file)
@@ -637,7 +637,7 @@ struct kobject *kobject_create(void)
  * @name: the name for the kset
  * @parent: the parent kobject of this kobject, if any.
  *
- * This function creates a kset structure dynamically and registers it
+ * This function creates a kobject structure dynamically and registers it
  * with sysfs.  When you are finished with this structure, call
  * kobject_put() and the structure will be dynamically freed when
  * it is no longer being used.
index d9feaf638608a6de4d148f6fdce19e5a1fc59284..6b15a909ca3f0cfc163b4cdcd8a1613884643784 100644 (file)
@@ -164,7 +164,7 @@ typedef struct deflate_state {
     int nice_match; /* Stop searching when current match exceeds this */
 
                 /* used by trees.c: */
-    /* Didn't use ct_data typedef below to supress compiler warning */
+    /* Didn't use ct_data typedef below to suppress compiler warning */
     struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
     struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
     struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */
index d2b6d44962b7c7b28b89e20cdbf1af0b0c6ada31..8295577a83b2f03c76bac8223a589673045b2011 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -2216,7 +2216,7 @@ int install_special_mapping(struct mm_struct *mm,
        vma->vm_start = addr;
        vma->vm_end = addr + len;
 
-       vma->vm_flags = vm_flags | mm->def_flags;
+       vma->vm_flags = vm_flags | mm->def_flags | VM_DONTEXPAND;
        vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
 
        vma->vm_ops = &special_mapping_vmops;
index cadc15653ddeeaa311c80f794b6a564ae2f36fc8..c3123b08ff6dfcaf75224809e9f704fd552d81fd 100644 (file)
@@ -21,7 +21,7 @@
 
 
 /**
- * do_invalidatepage - invalidate part of all of a page
+ * do_invalidatepage - invalidate part or all of a page
  * @page: the page which is affected
  * @offset: the index of the truncation point
  *
index 40b71a29fc3faa11b8360ddab2d3fbcc6fe29276..42eea5fe262895587522ac689b1f06d2cf7ad7a1 100644 (file)
@@ -199,14 +199,12 @@ static void p9_virtio_close(struct p9_trans *trans)
        kfree(trans);
 }
 
-static bool p9_virtio_intr(struct virtqueue *q)
+static void p9_virtio_intr(struct virtqueue *q)
 {
        struct virtio_chan *chan = q->vdev->priv;
 
        P9_DPRINTK(P9_DEBUG_TRANS, "9p poll_wakeup: %p\n", &chan->wq);
        wake_up_interruptible(&chan->wq);
-
-       return true;
 }
 
 static int p9_virtio_probe(struct virtio_device *dev)
@@ -236,13 +234,13 @@ static int p9_virtio_probe(struct virtio_device *dev)
 
        /* Find the input queue. */
        dev->priv = chan;
-       chan->in_vq = dev->config->find_vq(dev, p9_virtio_intr);
+       chan->in_vq = dev->config->find_vq(dev, 0, p9_virtio_intr);
        if (IS_ERR(chan->in_vq)) {
                err = PTR_ERR(chan->in_vq);
                goto free;
        }
 
-       chan->out_vq = dev->config->find_vq(dev, NULL);
+       chan->out_vq = dev->config->find_vq(dev, 1, NULL);
        if (IS_ERR(chan->out_vq)) {
                err = PTR_ERR(chan->out_vq);
                goto free_in_vq;
index 26e941d912e8e68dd1e308e705fec2bbd92d37fc..7b660834a4c207a08b23ff6f63fa8ae719ca4fba 100644 (file)
@@ -287,7 +287,7 @@ EXPORT_SYMBOL_GPL(register_pernet_subsys);
  *     @ops: pernet operations structure to manipulate
  *
  *     Remove the pernet operations structure from the list to be
- *     used when network namespaces are created or destoryed.  In
+ *     used when network namespaces are created or destroyed.  In
  *     addition run the exit method for all existing network
  *     namespaces.
  */
@@ -335,7 +335,7 @@ EXPORT_SYMBOL_GPL(register_pernet_device);
  *     @ops: pernet operations structure to manipulate
  *
  *     Remove the pernet operations structure from the list to be
- *     used when network namespaces are created or destoryed.  In
+ *     used when network namespaces are created or destroyed.  In
  *     addition run the exit method for all existing network
  *     namespaces.
  */
index 98420f9c4b6d3cf8e77ec27856ff0abbec10ea46..4e354221ec2338fb646bd68b19eddd956b769506 100644 (file)
@@ -2461,6 +2461,34 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer)
        return elt;
 }
 
+/**
+ * skb_partial_csum_set - set up and verify partial csum values for packet
+ * @skb: the skb to set
+ * @start: the number of bytes after skb->data to start checksumming.
+ * @off: the offset from start to place the checksum.
+ *
+ * For untrusted partially-checksummed packets, we need to make sure the values
+ * for skb->csum_start and skb->csum_offset are valid so we don't oops.
+ *
+ * This function checks and sets those values and skb->ip_summed: if this
+ * returns false you should drop the packet.
+ */
+bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off)
+{
+       if (unlikely(start > skb->len - 2) ||
+           unlikely((int)start + off > skb->len - 2)) {
+               if (net_ratelimit())
+                       printk(KERN_WARNING
+                              "bad partial csum: csum=%u/%u len=%u\n",
+                              start, off, skb->len);
+               return false;
+       }
+       skb->ip_summed = CHECKSUM_PARTIAL;
+       skb->csum_start = skb_headroom(skb) + start;
+       skb->csum_offset = off;
+       return true;
+}
+
 EXPORT_SYMBOL(___pskb_trim);
 EXPORT_SYMBOL(__kfree_skb);
 EXPORT_SYMBOL(kfree_skb);
@@ -2497,3 +2525,4 @@ EXPORT_SYMBOL(skb_append_datato_frags);
 
 EXPORT_SYMBOL_GPL(skb_to_sgvec);
 EXPORT_SYMBOL_GPL(skb_cow_data);
+EXPORT_SYMBOL_GPL(skb_partial_csum_set);
index ebe59d98721a58a934b89ca1143c96b45d3dec9a..287a62bc2e0ffb40c741743026231f04b37ff176 100644 (file)
@@ -271,8 +271,6 @@ extern struct sk_buff       *dccp_make_response(struct sock *sk,
 
 extern int        dccp_connect(struct sock *sk);
 extern int        dccp_disconnect(struct sock *sk, int flags);
-extern void       dccp_hash(struct sock *sk);
-extern void       dccp_unhash(struct sock *sk);
 extern int        dccp_getsockopt(struct sock *sk, int level, int optname,
                                   char __user *optval, int __user *optlen);
 extern int        dccp_setsockopt(struct sock *sk, int level, int optname,
index c982ad88223dd6c5827116a7f362744c7e2ad3c0..474075adbde4d7c426fc960ef4079686cd185e2e 100644 (file)
  */
 static struct socket *dccp_v4_ctl_socket;
 
-static int dccp_v4_get_port(struct sock *sk, const unsigned short snum)
-{
-       return inet_csk_get_port(&dccp_hashinfo, sk, snum,
-                                inet_csk_bind_conflict);
-}
-
 int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
 {
        struct inet_sock *inet = inet_sk(sk);
@@ -408,8 +402,8 @@ struct sock *dccp_v4_request_recv_sock(struct sock *sk, struct sk_buff *skb,
 
        dccp_sync_mss(newsk, dst_mtu(dst));
 
-       __inet_hash_nolisten(&dccp_hashinfo, newsk);
-       __inet_inherit_port(&dccp_hashinfo, sk, newsk);
+       __inet_hash_nolisten(newsk);
+       __inet_inherit_port(sk, newsk);
 
        return newsk;
 
@@ -898,6 +892,7 @@ static struct inet_connection_sock_af_ops dccp_ipv4_af_ops = {
        .getsockopt        = ip_getsockopt,
        .addr2sockaddr     = inet_csk_addr2sockaddr,
        .sockaddr_len      = sizeof(struct sockaddr_in),
+       .bind_conflict     = inet_csk_bind_conflict,
 #ifdef CONFIG_COMPAT
        .compat_setsockopt = compat_ip_setsockopt,
        .compat_getsockopt = compat_ip_getsockopt,
@@ -937,10 +932,10 @@ static struct proto dccp_v4_prot = {
        .sendmsg                = dccp_sendmsg,
        .recvmsg                = dccp_recvmsg,
        .backlog_rcv            = dccp_v4_do_rcv,
-       .hash                   = dccp_hash,
-       .unhash                 = dccp_unhash,
+       .hash                   = inet_hash,
+       .unhash                 = inet_unhash,
        .accept                 = inet_csk_accept,
-       .get_port               = dccp_v4_get_port,
+       .get_port               = inet_csk_get_port,
        .shutdown               = dccp_shutdown,
        .destroy                = dccp_destroy_sock,
        .orphan_count           = &dccp_orphan_count,
@@ -948,6 +943,7 @@ static struct proto dccp_v4_prot = {
        .obj_size               = sizeof(struct dccp_sock),
        .rsk_prot               = &dccp_request_sock_ops,
        .twsk_prot              = &dccp_timewait_sock_ops,
+       .hashinfo               = &dccp_hashinfo,
 #ifdef CONFIG_COMPAT
        .compat_setsockopt      = compat_dccp_setsockopt,
        .compat_getsockopt      = compat_dccp_getsockopt,
index ed0a0053a797ffdf74d9e07b8f9fdfdabd04a62c..490333d47c7b04dda8a6660cab945988626a86ce 100644 (file)
@@ -39,21 +39,15 @@ static struct socket *dccp_v6_ctl_socket;
 static struct inet_connection_sock_af_ops dccp_ipv6_mapped;
 static struct inet_connection_sock_af_ops dccp_ipv6_af_ops;
 
-static int dccp_v6_get_port(struct sock *sk, unsigned short snum)
-{
-       return inet_csk_get_port(&dccp_hashinfo, sk, snum,
-                                inet6_csk_bind_conflict);
-}
-
 static void dccp_v6_hash(struct sock *sk)
 {
        if (sk->sk_state != DCCP_CLOSED) {
                if (inet_csk(sk)->icsk_af_ops == &dccp_ipv6_mapped) {
-                       dccp_hash(sk);
+                       inet_hash(sk);
                        return;
                }
                local_bh_disable();
-               __inet6_hash(&dccp_hashinfo, sk);
+               __inet6_hash(sk);
                local_bh_enable();
        }
 }
@@ -630,8 +624,8 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
 
        newinet->daddr = newinet->saddr = newinet->rcv_saddr = LOOPBACK4_IPV6;
 
-       __inet6_hash(&dccp_hashinfo, newsk);
-       inet_inherit_port(&dccp_hashinfo, sk, newsk);
+       __inet6_hash(newsk);
+       inet_inherit_port(sk, newsk);
 
        return newsk;
 
@@ -1054,6 +1048,7 @@ static struct inet_connection_sock_af_ops dccp_ipv6_af_ops = {
        .getsockopt        = ipv6_getsockopt,
        .addr2sockaddr     = inet6_csk_addr2sockaddr,
        .sockaddr_len      = sizeof(struct sockaddr_in6),
+       .bind_conflict     = inet6_csk_bind_conflict,
 #ifdef CONFIG_COMPAT
        .compat_setsockopt = compat_ipv6_setsockopt,
        .compat_getsockopt = compat_ipv6_getsockopt,
@@ -1123,9 +1118,9 @@ static struct proto dccp_v6_prot = {
        .recvmsg           = dccp_recvmsg,
        .backlog_rcv       = dccp_v6_do_rcv,
        .hash              = dccp_v6_hash,
-       .unhash            = dccp_unhash,
+       .unhash            = inet_unhash,
        .accept            = inet_csk_accept,
-       .get_port          = dccp_v6_get_port,
+       .get_port          = inet_csk_get_port,
        .shutdown          = dccp_shutdown,
        .destroy           = dccp_v6_destroy_sock,
        .orphan_count      = &dccp_orphan_count,
@@ -1133,6 +1128,7 @@ static struct proto dccp_v6_prot = {
        .obj_size          = sizeof(struct dccp6_sock),
        .rsk_prot          = &dccp6_request_sock_ops,
        .twsk_prot         = &dccp6_timewait_sock_ops,
+       .hashinfo          = &dccp_hashinfo,
 #ifdef CONFIG_COMPAT
        .compat_setsockopt = compat_dccp_setsockopt,
        .compat_getsockopt = compat_dccp_getsockopt,
index 0bed4a6095b7afd4f84ec179daefcf1285371a8c..e3f5d37b84be1817f2b69b0fe31c65e999ceb05d 100644 (file)
@@ -78,7 +78,7 @@ void dccp_set_state(struct sock *sk, const int state)
                sk->sk_prot->unhash(sk);
                if (inet_csk(sk)->icsk_bind_hash != NULL &&
                    !(sk->sk_userlocks & SOCK_BINDPORT_LOCK))
-                       inet_put_port(&dccp_hashinfo, sk);
+                       inet_put_port(sk);
                /* fall through */
        default:
                if (oldstate == DCCP_OPEN)
@@ -173,20 +173,6 @@ const char *dccp_state_name(const int state)
 
 EXPORT_SYMBOL_GPL(dccp_state_name);
 
-void dccp_hash(struct sock *sk)
-{
-       inet_hash(&dccp_hashinfo, sk);
-}
-
-EXPORT_SYMBOL_GPL(dccp_hash);
-
-void dccp_unhash(struct sock *sk)
-{
-       inet_unhash(&dccp_hashinfo, sk);
-}
-
-EXPORT_SYMBOL_GPL(dccp_unhash);
-
 int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized)
 {
        struct dccp_sock *dp = dccp_sk(sk);
@@ -268,7 +254,7 @@ int dccp_destroy_sock(struct sock *sk)
 
        /* Clean up a referenced DCCP bind bucket. */
        if (inet_csk(sk)->icsk_bind_hash != NULL)
-               inet_put_port(&dccp_hashinfo, sk);
+               inet_put_port(sk);
 
        kfree(dp->dccps_service_list);
        dp->dccps_service_list = NULL;
index de5a41de191a675e69701fd5416bda497da62aaf..b189278c7bc180a882b1ebb30ecd19ca19010199 100644 (file)
@@ -78,11 +78,9 @@ EXPORT_SYMBOL_GPL(inet_csk_bind_conflict);
 /* Obtain a reference to a local port for the given sock,
  * if snum is zero it means select any available local port.
  */
-int inet_csk_get_port(struct inet_hashinfo *hashinfo,
-                     struct sock *sk, unsigned short snum,
-                     int (*bind_conflict)(const struct sock *sk,
-                                          const struct inet_bind_bucket *tb))
+int inet_csk_get_port(struct sock *sk, unsigned short snum)
 {
+       struct inet_hashinfo *hashinfo = sk->sk_prot->hashinfo;
        struct inet_bind_hashbucket *head;
        struct hlist_node *node;
        struct inet_bind_bucket *tb;
@@ -142,7 +140,7 @@ tb_found:
                        goto success;
                } else {
                        ret = 1;
-                       if (bind_conflict(sk, tb))
+                       if (inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb))
                                goto fail_unlock;
                }
        }
index 48d45008f749664699856fa9d7ee8b465f4377c2..90f422c9447b71e0e1cd05defbc9fc81f59b521d 100644 (file)
@@ -66,8 +66,9 @@ void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
 /*
  * Get rid of any references to a local port held by the given sock.
  */
-static void __inet_put_port(struct inet_hashinfo *hashinfo, struct sock *sk)
+static void __inet_put_port(struct sock *sk)
 {
+       struct inet_hashinfo *hashinfo = sk->sk_prot->hashinfo;
        const int bhash = inet_bhashfn(inet_sk(sk)->num, hashinfo->bhash_size);
        struct inet_bind_hashbucket *head = &hashinfo->bhash[bhash];
        struct inet_bind_bucket *tb;
@@ -81,10 +82,10 @@ static void __inet_put_port(struct inet_hashinfo *hashinfo, struct sock *sk)
        spin_unlock(&head->lock);
 }
 
-void inet_put_port(struct inet_hashinfo *hashinfo, struct sock *sk)
+void inet_put_port(struct sock *sk)
 {
        local_bh_disable();
-       __inet_put_port(hashinfo, sk);
+       __inet_put_port(sk);
        local_bh_enable();
 }
 
@@ -317,8 +318,9 @@ static inline u32 inet_sk_port_offset(const struct sock *sk)
                                          inet->dport);
 }
 
-void __inet_hash_nolisten(struct inet_hashinfo *hashinfo, struct sock *sk)
+void __inet_hash_nolisten(struct sock *sk)
 {
+       struct inet_hashinfo *hashinfo = sk->sk_prot->hashinfo;
        struct hlist_head *list;
        rwlock_t *lock;
        struct inet_ehash_bucket *head;
@@ -337,13 +339,14 @@ void __inet_hash_nolisten(struct inet_hashinfo *hashinfo, struct sock *sk)
 }
 EXPORT_SYMBOL_GPL(__inet_hash_nolisten);
 
-void __inet_hash(struct inet_hashinfo *hashinfo, struct sock *sk)
+static void __inet_hash(struct sock *sk)
 {
+       struct inet_hashinfo *hashinfo = sk->sk_prot->hashinfo;
        struct hlist_head *list;
        rwlock_t *lock;
 
        if (sk->sk_state != TCP_LISTEN) {
-               __inet_hash_nolisten(hashinfo, sk);
+               __inet_hash_nolisten(sk);
                return;
        }
 
@@ -357,13 +360,48 @@ void __inet_hash(struct inet_hashinfo *hashinfo, struct sock *sk)
        write_unlock(lock);
        wake_up(&hashinfo->lhash_wait);
 }
-EXPORT_SYMBOL_GPL(__inet_hash);
+
+void inet_hash(struct sock *sk)
+{
+       if (sk->sk_state != TCP_CLOSE) {
+               local_bh_disable();
+               __inet_hash(sk);
+               local_bh_enable();
+       }
+}
+EXPORT_SYMBOL_GPL(inet_hash);
+
+void inet_unhash(struct sock *sk)
+{
+       rwlock_t *lock;
+       struct inet_hashinfo *hashinfo = sk->sk_prot->hashinfo;
+
+       if (sk_unhashed(sk))
+               goto out;
+
+       if (sk->sk_state == TCP_LISTEN) {
+               local_bh_disable();
+               inet_listen_wlock(hashinfo);
+               lock = &hashinfo->lhash_lock;
+       } else {
+               lock = inet_ehash_lockp(hashinfo, sk->sk_hash);
+               write_lock_bh(lock);
+       }
+
+       if (__sk_del_node_init(sk))
+               sock_prot_inuse_add(sk->sk_prot, -1);
+       write_unlock_bh(lock);
+out:
+       if (sk->sk_state == TCP_LISTEN)
+               wake_up(&hashinfo->lhash_wait);
+}
+EXPORT_SYMBOL_GPL(inet_unhash);
 
 int __inet_hash_connect(struct inet_timewait_death_row *death_row,
                struct sock *sk,
                int (*check_established)(struct inet_timewait_death_row *,
                        struct sock *, __u16, struct inet_timewait_sock **),
-               void (*hash)(struct inet_hashinfo *, struct sock *))
+               void (*hash)(struct sock *sk))
 {
        struct inet_hashinfo *hinfo = death_row->hashinfo;
        const unsigned short snum = inet_sk(sk)->num;
@@ -427,7 +465,7 @@ ok:
                inet_bind_hash(sk, tb, port);
                if (sk_unhashed(sk)) {
                        inet_sk(sk)->sport = htons(port);
-                       hash(hinfo, sk);
+                       hash(sk);
                }
                spin_unlock(&head->lock);
 
@@ -444,7 +482,7 @@ ok:
        tb  = inet_csk(sk)->icsk_bind_hash;
        spin_lock_bh(&head->lock);
        if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) {
-               hash(hinfo, sk);
+               hash(sk);
                spin_unlock_bh(&head->lock);
                return 0;
        } else {
index a0d373bd906588276f2f8eef8aaab93a31d1fb31..071e83a894ad9c02081f24b9ba243c77f7ea8d7c 100644 (file)
@@ -1669,7 +1669,7 @@ void tcp_set_state(struct sock *sk, int state)
                sk->sk_prot->unhash(sk);
                if (inet_csk(sk)->icsk_bind_hash &&
                    !(sk->sk_userlocks & SOCK_BINDPORT_LOCK))
-                       inet_put_port(&tcp_hashinfo, sk);
+                       inet_put_port(sk);
                /* fall through */
        default:
                if (oldstate==TCP_ESTABLISHED)
index 77c1939a2b0d50b2dee673fa450a410cd82bc9c9..63414ea427c578d9a9b1cb527cd87e4cc53ef5f3 100644 (file)
@@ -108,22 +108,6 @@ struct inet_hashinfo __cacheline_aligned tcp_hashinfo = {
        .lhash_wait  = __WAIT_QUEUE_HEAD_INITIALIZER(tcp_hashinfo.lhash_wait),
 };
 
-static int tcp_v4_get_port(struct sock *sk, unsigned short snum)
-{
-       return inet_csk_get_port(&tcp_hashinfo, sk, snum,
-                                inet_csk_bind_conflict);
-}
-
-static void tcp_v4_hash(struct sock *sk)
-{
-       inet_hash(&tcp_hashinfo, sk);
-}
-
-void tcp_unhash(struct sock *sk)
-{
-       inet_unhash(&tcp_hashinfo, sk);
-}
-
 static inline __u32 tcp_v4_init_sequence(struct sk_buff *skb)
 {
        return secure_tcp_sequence_number(ip_hdr(skb)->daddr,
@@ -1478,8 +1462,8 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
        }
 #endif
 
-       __inet_hash_nolisten(&tcp_hashinfo, newsk);
-       __inet_inherit_port(&tcp_hashinfo, sk, newsk);
+       __inet_hash_nolisten(newsk);
+       __inet_inherit_port(sk, newsk);
 
        return newsk;
 
@@ -1827,6 +1811,7 @@ struct inet_connection_sock_af_ops ipv4_specific = {
        .getsockopt        = ip_getsockopt,
        .addr2sockaddr     = inet_csk_addr2sockaddr,
        .sockaddr_len      = sizeof(struct sockaddr_in),
+       .bind_conflict     = inet_csk_bind_conflict,
 #ifdef CONFIG_COMPAT
        .compat_setsockopt = compat_ip_setsockopt,
        .compat_getsockopt = compat_ip_getsockopt,
@@ -1926,7 +1911,7 @@ int tcp_v4_destroy_sock(struct sock *sk)
 
        /* Clean up a referenced TCP bind bucket. */
        if (inet_csk(sk)->icsk_bind_hash)
-               inet_put_port(&tcp_hashinfo, sk);
+               inet_put_port(sk);
 
        /*
         * If sendmsg cached page exists, toss it.
@@ -2435,9 +2420,9 @@ struct proto tcp_prot = {
        .getsockopt             = tcp_getsockopt,
        .recvmsg                = tcp_recvmsg,
        .backlog_rcv            = tcp_v4_do_rcv,
-       .hash                   = tcp_v4_hash,
-       .unhash                 = tcp_unhash,
-       .get_port               = tcp_v4_get_port,
+       .hash                   = inet_hash,
+       .unhash                 = inet_unhash,
+       .get_port               = inet_csk_get_port,
        .enter_memory_pressure  = tcp_enter_memory_pressure,
        .sockets_allocated      = &tcp_sockets_allocated,
        .orphan_count           = &tcp_orphan_count,
@@ -2450,6 +2435,7 @@ struct proto tcp_prot = {
        .obj_size               = sizeof(struct tcp_sock),
        .twsk_prot              = &tcp_timewait_sock_ops,
        .rsk_prot               = &tcp_request_sock_ops,
+       .hashinfo               = &tcp_hashinfo,
 #ifdef CONFIG_COMPAT
        .compat_setsockopt      = compat_tcp_setsockopt,
        .compat_getsockopt      = compat_tcp_getsockopt,
@@ -2467,7 +2453,6 @@ void __init tcp_v4_init(struct net_proto_family *ops)
 EXPORT_SYMBOL(ipv4_specific);
 EXPORT_SYMBOL(tcp_hashinfo);
 EXPORT_SYMBOL(tcp_prot);
-EXPORT_SYMBOL(tcp_unhash);
 EXPORT_SYMBOL(tcp_v4_conn_request);
 EXPORT_SYMBOL(tcp_v4_connect);
 EXPORT_SYMBOL(tcp_v4_do_rcv);
index d325a995890911ec0f4418c2f00f0034231111e0..43f3993e1f304d009728a5d9100b1911d28c3543 100644 (file)
@@ -22,9 +22,9 @@
 #include <net/inet6_hashtables.h>
 #include <net/ip.h>
 
-void __inet6_hash(struct inet_hashinfo *hashinfo,
-                               struct sock *sk)
+void __inet6_hash(struct sock *sk)
 {
+       struct inet_hashinfo *hashinfo = sk->sk_prot->hashinfo;
        struct hlist_head *list;
        rwlock_t *lock;
 
index 59d0029e93a7b3f6123a0a7353eee918e1bd425b..12750f2b05ab02ff6846b64a1d880cfd9402322e 100644 (file)
@@ -86,12 +86,6 @@ static struct tcp_sock_af_ops tcp_sock_ipv6_specific;
 static struct tcp_sock_af_ops tcp_sock_ipv6_mapped_specific;
 #endif
 
-static int tcp_v6_get_port(struct sock *sk, unsigned short snum)
-{
-       return inet_csk_get_port(&tcp_hashinfo, sk, snum,
-                                inet6_csk_bind_conflict);
-}
-
 static void tcp_v6_hash(struct sock *sk)
 {
        if (sk->sk_state != TCP_CLOSE) {
@@ -100,7 +94,7 @@ static void tcp_v6_hash(struct sock *sk)
                        return;
                }
                local_bh_disable();
-               __inet6_hash(&tcp_hashinfo, sk);
+               __inet6_hash(sk);
                local_bh_enable();
        }
 }
@@ -1504,8 +1498,8 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
        }
 #endif
 
-       __inet6_hash(&tcp_hashinfo, newsk);
-       inet_inherit_port(&tcp_hashinfo, sk, newsk);
+       __inet6_hash(newsk);
+       inet_inherit_port(sk, newsk);
 
        return newsk;
 
@@ -1833,6 +1827,7 @@ static struct inet_connection_sock_af_ops ipv6_specific = {
        .getsockopt        = ipv6_getsockopt,
        .addr2sockaddr     = inet6_csk_addr2sockaddr,
        .sockaddr_len      = sizeof(struct sockaddr_in6),
+       .bind_conflict     = inet6_csk_bind_conflict,
 #ifdef CONFIG_COMPAT
        .compat_setsockopt = compat_ipv6_setsockopt,
        .compat_getsockopt = compat_ipv6_getsockopt,
@@ -1864,6 +1859,7 @@ static struct inet_connection_sock_af_ops ipv6_mapped = {
        .getsockopt        = ipv6_getsockopt,
        .addr2sockaddr     = inet6_csk_addr2sockaddr,
        .sockaddr_len      = sizeof(struct sockaddr_in6),
+       .bind_conflict     = inet6_csk_bind_conflict,
 #ifdef CONFIG_COMPAT
        .compat_setsockopt = compat_ipv6_setsockopt,
        .compat_getsockopt = compat_ipv6_getsockopt,
@@ -2127,8 +2123,8 @@ struct proto tcpv6_prot = {
        .recvmsg                = tcp_recvmsg,
        .backlog_rcv            = tcp_v6_do_rcv,
        .hash                   = tcp_v6_hash,
-       .unhash                 = tcp_unhash,
-       .get_port               = tcp_v6_get_port,
+       .unhash                 = inet_unhash,
+       .get_port               = inet_csk_get_port,
        .enter_memory_pressure  = tcp_enter_memory_pressure,
        .sockets_allocated      = &tcp_sockets_allocated,
        .memory_allocated       = &tcp_memory_allocated,
@@ -2141,6 +2137,7 @@ struct proto tcpv6_prot = {
        .obj_size               = sizeof(struct tcp6_sock),
        .twsk_prot              = &tcp6_timewait_sock_ops,
        .rsk_prot               = &tcp6_request_sock_ops,
+       .hashinfo               = &tcp_hashinfo,
 #ifdef CONFIG_COMPAT
        .compat_setsockopt      = compat_tcp_setsockopt,
        .compat_getsockopt      = compat_tcp_getsockopt,
index 09c255002e565dcba6606937d0c1a14409537212..e77592d050ce8a33a777ab12e6c384b84bc524b1 100644 (file)
@@ -98,6 +98,18 @@ config MAC80211_DEBUGFS
 
          Say N unless you know you need this.
 
+config MAC80211_DEBUG_PACKET_ALIGNMENT
+       bool "Enable packet alignment debugging"
+       depends on MAC80211
+       help
+         This option is recommended for driver authors and strongly
+         discouraged for everybody else, it will trigger a warning
+         when a driver hands mac80211 a buffer that is aligned in
+         a way that will cause problems with the IP stack on some
+         architectures.
+
+         Say N unless you're writing a mac80211 based driver.
+
 config MAC80211_DEBUG
        bool "Enable debugging output"
        depends on MAC80211
index 5dcc2d61551fe2260f5a39e6fe323669b705323b..67b7c75c430d337e0ddfdc5e8a33dac498b60472 100644 (file)
@@ -1344,17 +1344,17 @@ static int __init ieee80211_init(void)
 
        ret = rc80211_simple_init();
        if (ret)
-               goto fail;
+               goto out;
 
        ret = rc80211_pid_init();
        if (ret)
-               goto fail_simple;
+               goto out_cleanup_simple;
 
        ret = ieee80211_wme_register();
        if (ret) {
                printk(KERN_DEBUG "ieee80211_init: failed to "
                       "initialize WME (err=%d)\n", ret);
-               goto fail_pid;
+               goto out_cleanup_pid;
        }
 
        ieee80211_debugfs_netdev_init();
@@ -1362,11 +1362,11 @@ static int __init ieee80211_init(void)
 
        return 0;
 
- fail_pid:
-       rc80211_simple_exit();
- fail_simple:
+ out_cleanup_pid:
        rc80211_pid_exit();
- fail:
+ out_cleanup_simple:
+       rc80211_simple_exit();
+ out:
        return ret;
 }
 
index 554c4baed6fbd3d4bdb164eaeea024fcf919bcfb..c339571632b2f102fdc8a81a8416fb71826ccf98 100644 (file)
@@ -538,7 +538,7 @@ int __init rc80211_pid_init(void)
        return ieee80211_rate_control_register(&mac80211_rcpid);
 }
 
-void __exit rc80211_pid_exit(void)
+void rc80211_pid_exit(void)
 {
        ieee80211_rate_control_unregister(&mac80211_rcpid);
 }
index 934676d687d6f9b674c837181603b91e4aad2a6f..9a78b116acffbdca0b00ba2df579ce87ec6cd2f2 100644 (file)
@@ -389,7 +389,7 @@ int __init rc80211_simple_init(void)
        return ieee80211_rate_control_register(&mac80211_rcsimple);
 }
 
-void __exit rc80211_simple_exit(void)
+void rc80211_simple_exit(void)
 {
        ieee80211_rate_control_unregister(&mac80211_rcsimple);
 }
index d44c87269bcb782d697e0370ef21fcc3c2ea15e4..535407d07fa40890a4731648f85157a00fb39dc8 100644 (file)
@@ -340,11 +340,15 @@ static u32 ieee80211_rx_load_stats(struct ieee80211_local *local,
        return load;
 }
 
+#ifdef CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT
 static ieee80211_txrx_result
 ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx)
 {
        int hdrlen;
 
+       if (!WLAN_FC_DATA_PRESENT(rx->fc))
+               return TXRX_CONTINUE;
+
        /*
         * Drivers are required to align the payload data in a way that
         * guarantees that the contained IP header is aligned to a four-
@@ -371,11 +375,14 @@ ieee80211_rx_h_verify_ip_alignment(struct ieee80211_txrx_data *rx)
 
        return TXRX_CONTINUE;
 }
+#endif
 
 ieee80211_rx_handler ieee80211_rx_pre_handlers[] =
 {
        ieee80211_rx_h_parse_qos,
+#ifdef CONFIG_MAC80211_DEBUG_PACKET_ALIGNMENT
        ieee80211_rx_h_verify_ip_alignment,
+#endif
        NULL
 };
 
index 6562f868e82f07d7ce70169ef2920c41c07c1ae6..1a47f5d1be17c42814d83f705bd375de497c2b80 100644 (file)
@@ -340,7 +340,7 @@ EXPORT_SYMBOL(rfkill_allocate);
  * rfkill_free - Mark rfkill structure for deletion
  * @rfkill: rfkill structure to be destroyed
  *
- * Decrements reference count of rfkill structure so it is destoryed.
+ * Decrements reference count of rfkill structure so it is destroyed.
  * Note that rfkill_free() should _not_ be called after rfkill_unregister().
  */
 void rfkill_free(struct rfkill *rfkill)
index 61cbd5a8dd0c4954c212cacaf7f46f403ca1408b..5df0c4bd415b625918f51844470bca9a020760e4 100644 (file)
@@ -537,7 +537,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep,
                 *
                 * This means that if we only want to abort associations
                 * in an authenticated way (i.e AUTH+ABORT), then we
-                * can't destory this association just becuase the packet
+                * can't destroy this association just becuase the packet
                 * was malformed.
                 */
                if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
@@ -4130,7 +4130,7 @@ static sctp_disposition_t sctp_sf_abort_violation(
         *
         * This means that if we only want to abort associations
         * in an authenticated way (i.e AUTH+ABORT), then we
-        * can't destory this association just becuase the packet
+        * can't destroy this association just becuase the packet
         * was malformed.
         */
        if (sctp_auth_recv_cid(SCTP_CID_ABORT, asoc))
index 50e61c411bc0f89d8f9c5ec9d7c7ea6992a43371..734cf4f3131e69b36c26ee23ee36dfe0a59496ff 100644 (file)
@@ -821,6 +821,7 @@ static void conf_load(void)
                                return;
                        if (!conf_read(dialog_input_result)) {
                                set_config_filename(dialog_input_result);
+                               sym_set_change_count(1);
                                return;
                        }
                        show_textbox(NULL, _("File does not exist!"), 5, 38);
index fdad17367f612428d61ab78e8ebb0df864672454..606ceb9e746ec3b9649fd534c50f16e95f73f69f 100644 (file)
@@ -203,12 +203,9 @@ void sym_check_prop(struct symbol *sym)
                                prop_warn(prop,
                                    "config symbol '%s' uses select, but is "
                                    "not boolean or tristate", sym->name);
-                       else if (sym2->type == S_UNKNOWN)
-                               prop_warn(prop,
-                                   "'select' used by config symbol '%s' "
-                                   "refers to undefined symbol '%s'",
-                                   sym->name, sym2->name);
-                       else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE)
+                       else if (sym2->type != S_UNKNOWN &&
+                                sym2->type != S_BOOLEAN &&
+                                sym2->type != S_TRISTATE)
                                prop_warn(prop,
                                    "'%s' has wrong type. 'select' only "
                                    "accept arguments of boolean and "
index f8efc93eb7004c9ee0004c979acd617ca7d2e8f8..5d546466e6b1f8d2e700fa0ef846ebe6a14569cd 100644 (file)
@@ -870,7 +870,7 @@ const struct sectioncheck sectioncheck[] = {
 /* Do not export init/exit functions or data */
 {
        .fromsec = { "__ksymtab*", NULL },
-       .tosec   = { ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL },
+       .tosec   = { INIT_SECTIONS, EXIT_SECTIONS, NULL },
        .mismatch = EXPORT_TO_INIT_EXIT
 }
 };
@@ -1125,15 +1125,15 @@ static void report_sec_mismatch(const char *modname, enum mismatch mismatch,
        to = to_is_func ? "function" : "variable";
        to_p = to_is_func ? "()" : "";
 
+       sec_mismatch_count++;
+       if (!sec_mismatch_verbose)
+               return;
+
        fprintf(stderr, "WARNING: %s(%s+0x%llx): Section mismatch in"
                        " reference from the %s %s%s to the %s %s:%s%s\n",
                         modname, fromsec, fromaddr, from, fromsym, from_p,
                        to, tosec, tosym, to_p);
 
-       sec_mismatch_count++;
-       if (!sec_mismatch_verbose)
-               return;
-
        switch (mismatch) {
        case TEXT_TO_INIT:
                fprintf(stderr,
@@ -1939,10 +1939,9 @@ int main(int argc, char **argv)
                write_dump(dump_write);
        if (sec_mismatch_count && !sec_mismatch_verbose)
                fprintf(stderr, "modpost: Found %d section mismatch(es).\n"
-                       "To see additional details select \"Enable full "
-                       "Section mismatch analysis\"\n"
-                       "in the Kernel Hacking menu "
-                       "(CONFIG_SECTION_MISMATCH).\n", sec_mismatch_count);
+                       "To see full details build your kernel with:\n"
+                       "'make CONFIG_DEBUG_SECTION_MISMATCH=y'\n",
+                       sec_mismatch_count);
 
        return err;
 }
old mode 100644 (file)
new mode 100755 (executable)
index 52f032e..1c1bdaf
@@ -45,3 +45,19 @@ if hgid=`hg id 2>/dev/null`; then
        # All done with mercurial
        exit
 fi
+
+# Check for svn and a svn repo.
+if rev=`svn info 2>/dev/null | grep '^Revision'`; then
+       rev=`echo $rev | awk '{print $NF}'`
+       changes=`svn status 2>/dev/null | grep '^[AMD]' | wc -l`
+
+       # Are there uncommitted changes?
+       if [ $changes != 0 ]; then
+               printf -- '-svn%s%s%s' "$rev" -dirty "$changes"
+       else
+               printf -- '-svn%s' "$rev"
+       fi
+
+       # All done with svn
+       exit
+fi
index 5d3c0372df3289211223afe4968ff50eb4109cbb..f95aa0946758eddee10d995cc233d05005a8ae71 100644 (file)
@@ -2104,6 +2104,7 @@ static struct page * via_mm_nopage (struct vm_area_struct * vma,
 {
        struct via_info *card = vma->vm_private_data;
        struct via_channel *chan = &card->ch_out;
+       unsigned long max_bufs;
        struct page *dmapage;
        unsigned long pgoff;
        int rd, wr;
@@ -2127,14 +2128,11 @@ static struct page * via_mm_nopage (struct vm_area_struct * vma,
        rd = card->ch_in.is_mapped;
        wr = card->ch_out.is_mapped;
 
-#ifndef VIA_NDEBUG
-       {
-       unsigned long max_bufs = chan->frag_number;
-       if (rd && wr) max_bufs *= 2;
-       /* via_dsp_mmap() should ensure this */
-       assert (pgoff < max_bufs);
-       }
-#endif
+       max_bufs = chan->frag_number;
+       if (rd && wr)
+               max_bufs *= 2;
+       if (pgoff >= max_bufs)
+               return NOPAGE_SIGBUS;
 
        /* if full-duplex (read+write) and we have two sets of bufs,
         * then the playback buffers come first, sez soundcard.c */
index 6495534e5bf61ad11698764f6c592c67cfcbbd16..1558a5c4094faebb589c9822a37182c837867c39 100644 (file)
@@ -84,7 +84,7 @@ static int snd_us428ctls_mmap(struct snd_hwdep * hw, struct file *filp, struct v
                us428->us428ctls_sharedmem->CtlSnapShotLast = -2;
        }
        area->vm_ops = &us428ctls_vm_ops;
-       area->vm_flags |= VM_RESERVED;
+       area->vm_flags |= VM_RESERVED | VM_DONTEXPAND;
        area->vm_private_data = hw->private_data;
        return 0;
 }
index 800b5cecfc8054ce38026e954a17f67b481ebfc8..117946f2debb3a04891d87de9327c16d8f27f7fe 100644 (file)
@@ -722,7 +722,7 @@ static int snd_usX2Y_hwdep_pcm_mmap(struct snd_hwdep * hw, struct file *filp, st
                return -ENODEV;
        }
        area->vm_ops = &snd_usX2Y_hwdep_pcm_vm_ops;
-       area->vm_flags |= VM_RESERVED;
+       area->vm_flags |= VM_RESERVED | VM_DONTEXPAND;
        area->vm_private_data = hw->private_data;
        return 0;
 }