Merge git://oss.sgi.com:8090/xfs/xfs-2.6
authorLinus Torvalds <torvalds@g5.osdl.org>
Fri, 29 Sep 2006 16:36:55 +0000 (09:36 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 29 Sep 2006 16:36:55 +0000 (09:36 -0700)
* git://oss.sgi.com:8090/xfs/xfs-2.6: (49 commits)
  [XFS] Remove v1 dir trace macro - missed in a past commit.
  [XFS] 955947: Infinite loop in xfs_bulkstat() on formatter() error
  [XFS] pv 956241, author: nathans, rv: vapo - make ino validation checks
  [XFS] pv 956240, author: nathans, rv: vapo - Minor fixes in
  [XFS] Really fix use after free in xfs_iunpin.
  [XFS] Collapse sv_init and init_sv into just the one interface.
  [XFS] standardize on one sema init macro
  [XFS] Reduce endian flipping in alloc_btree, same as was done for
  [XFS] Minor cleanup from dio locking fix, remove an extra conditional.
  [XFS] Fix kmem_zalloc_greedy warnings on 64 bit platforms.
  [XFS] pv 955157, rv bnaujok - break the loop on EFAULT formatter() error
  [XFS] pv 955157, rv bnaujok - break the loop on formatter() error
  [XFS] Fixes the leak in reservation space because we weren't ungranting
  [XFS] Add lock annotations to xfs_trans_update_ail and
  [XFS] Fix a porting botch on the realtime subvol growfs code path.
  [XFS] Minor code rearranging and cleanup to prevent some coverity false
  [XFS] Remove a no-longer-correct debug assert from dio completion
  [XFS] Add a greedy allocation interface, allocating within a min/max size
  [XFS] Improve error handling for the zero-fsblock extent detection code.
  [XFS] Be more defensive with page flags (error/private) for metadata
  ...

550 files changed:
CREDITS
Documentation/CodingStyle
Documentation/DocBook/kernel-api.tmpl
Documentation/SubmitChecklist
Documentation/SubmittingDrivers
Documentation/SubmittingPatches
Documentation/cpusets.txt
Documentation/filesystems/proc.txt
Documentation/kernel-parameters.txt
Documentation/networking/pktgen.txt
Documentation/seclvl.txt [deleted file]
MAINTAINERS
arch/alpha/kernel/time.c
arch/alpha/mm/fault.c
arch/arm/kernel/time.c
arch/arm/mach-omap1/board-fsample.c
arch/arm/mach-omap1/board-h2.c
arch/arm/mach-omap1/board-h3.c
arch/arm/mach-omap1/board-innovator.c
arch/arm/mach-omap1/board-nokia770.c
arch/arm/mach-omap1/board-osk.c
arch/arm/mach-omap1/board-perseus2.c
arch/arm/mach-omap2/board-h4.c
arch/arm/mm/fault.c
arch/arm26/kernel/time.c
arch/arm26/mm/fault.c
arch/avr32/kernel/time.c
arch/cris/arch-v10/kernel/time.c
arch/cris/arch-v32/kernel/time.c
arch/frv/kernel/time.c
arch/h8300/kernel/time.c
arch/i386/kernel/apm.c
arch/i386/kernel/efi.c
arch/i386/kernel/smpboot.c
arch/i386/kernel/srat.c
arch/i386/lib/usercopy.c
arch/i386/mm/fault.c
arch/i386/oprofile/op_model_ppro.c
arch/ia64/hp/sim/simeth.c
arch/ia64/kernel/time.c
arch/ia64/mm/fault.c
arch/m32r/kernel/time.c
arch/m32r/mm/fault.c
arch/m68k/kernel/time.c
arch/m68k/mm/fault.c
arch/m68k/sun3/sun3ints.c
arch/m68knommu/kernel/time.c
arch/mips/au1000/common/time.c
arch/mips/gt64120/common/time.c
arch/mips/kernel/time.c
arch/mips/mm/fault.c
arch/mips/momentum/ocelot_g/gt-irq.c
arch/mips/sgi-ip27/ip27-timer.c
arch/parisc/kernel/module.c
arch/parisc/kernel/time.c
arch/powerpc/kernel/time.c
arch/powerpc/mm/fault.c
arch/powerpc/platforms/pseries/ras.c
arch/ppc/kernel/time.c
arch/ppc/kernel/traps.c
arch/ppc/mm/fault.c
arch/s390/appldata/appldata_base.c
arch/s390/kernel/time.c
arch/s390/mm/fault.c
arch/sh/kernel/time.c
arch/sh/mm/fault.c
arch/sh64/kernel/time.c
arch/sh64/mm/fault.c
arch/sparc/kernel/pcic.c
arch/sparc/kernel/time.c
arch/sparc64/kernel/time.c
arch/sparc64/solaris/misc.c
arch/um/drivers/mconsole_kern.c
arch/um/drivers/mconsole_user.c
arch/um/drivers/net_kern.c
arch/um/drivers/net_user.c
arch/um/drivers/null.c
arch/um/drivers/random.c
arch/um/drivers/stderr_console.c
arch/um/drivers/stdio_console.c
arch/um/drivers/ubd_kern.c
arch/um/include/net_kern.h
arch/um/include/net_user.h
arch/um/kernel/exitcode.c
arch/um/kernel/skas/mmu.c
arch/um/kernel/skas/process_kern.c [deleted file]
arch/um/kernel/time.c
arch/um/kernel/trap.c
arch/um/os-Linux/mem.c
arch/v850/kernel/time.c
arch/x86_64/kernel/pci-swiotlb.c
arch/x86_64/kernel/time.c
arch/x86_64/mm/fault.c
arch/xtensa/kernel/time.c
arch/xtensa/mm/fault.c
arch/xtensa/platform-iss/network.c
block/blktrace.c
block/genhd.c
block/ll_rw_blk.c
drivers/base/class.c
drivers/base/firmware_class.c
drivers/block/loop.c
drivers/bluetooth/bfusb.c
drivers/bluetooth/hci_ldisc.c
drivers/bluetooth/hci_usb.c
drivers/bluetooth/hci_vhci.c
drivers/char/Kconfig
drivers/char/Makefile
drivers/char/generic_serial.c
drivers/char/hw_random/intel-rng.c
drivers/char/istallion.c
drivers/char/lp.c
drivers/char/mem.c
drivers/char/pc8736x_gpio.c
drivers/char/raw.c
drivers/char/rtc.c
drivers/char/s3c2410-rtc.c [deleted file]
drivers/char/scx200_gpio.c
drivers/char/selection.c
drivers/char/specialix.c
drivers/char/sysrq.c
drivers/char/tty_io.c
drivers/char/tty_ioctl.c
drivers/char/vc_screen.c
drivers/char/vt.c
drivers/char/vt_ioctl.c
drivers/char/watchdog/Kconfig
drivers/char/watchdog/Makefile
drivers/char/watchdog/omap_wdt.c [new file with mode: 0644]
drivers/char/watchdog/omap_wdt.h [new file with mode: 0644]
drivers/firmware/dmi_scan.c
drivers/i2c/busses/i2c-sibyte.c
drivers/ide/pci/atiixp.c
drivers/infiniband/core/addr.c
drivers/input/keyboard/Kconfig
drivers/input/keyboard/Makefile
drivers/input/keyboard/omap-keypad.c [new file with mode: 0644]
drivers/isdn/i4l/isdn_net.c
drivers/leds/leds-net48xx.c
drivers/macintosh/via-pmu-backlight.c
drivers/macintosh/windfarm_smu_sat.c
drivers/mfd/ucb1x00-ts.c
drivers/net/8390.c
drivers/net/Kconfig
drivers/net/appletalk/ipddp.c
drivers/net/bonding/bond_main.c
drivers/net/fec_8xx/fec_main.c
drivers/net/fs_enet/fs_enet.h
drivers/net/irda/Kconfig
drivers/net/irda/nsc-ircc.c
drivers/net/irda/smsc-ircc2.c
drivers/net/irda/stir4200.c
drivers/net/irda/via-ircc.c
drivers/net/loopback.c
drivers/net/pppoe.c
drivers/net/smc91x.h
drivers/net/tg3.c
drivers/net/tg3.h
drivers/net/wan/hdlc_cisco.c
drivers/net/wan/syncppp.c
drivers/net/wireless/strip.c
drivers/parport/parport_serial.c
drivers/rtc/Kconfig
drivers/rtc/rtc-rs5c348.c
drivers/s390/net/qeth_main.c
drivers/serial/Kconfig
fs/9p/v9fs.c
fs/Kconfig
fs/Makefile
fs/afs/proc.c
fs/autofs4/root.c
fs/binfmt_aout.c
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/binfmt_misc.c
fs/block_dev.c
fs/char_dev.c
fs/cramfs/inode.c
fs/cramfs/uncompress.c
fs/dquot.c
fs/exec.c
fs/fat/file.c
fs/fat/inode.c
fs/file.c
fs/filesystems.c
fs/freevxfs/vxfs_super.c
fs/fuse/dev.c
fs/fuse/dir.c
fs/fuse/inode.c
fs/generic_acl.c [new file with mode: 0644]
fs/hugetlbfs/inode.c
fs/inode.c
fs/isofs/inode.c
fs/jbd/journal.c
fs/jbd/recovery.c
fs/libfs.c
fs/mbcache.c
fs/msdos/namei.c
fs/namei.c
fs/namespace.c
fs/open.c
fs/partitions/msdos.c
fs/proc/array.c
fs/proc/base.c
fs/proc/kcore.c
fs/reiserfs/Makefile
fs/reiserfs/file.c
fs/reiserfs/inode.c
fs/reiserfs/journal.c
fs/reiserfs/super.c
fs/select.c
fs/super.c
fs/udf/super.c
include/asm-arm/arch-clps711x/time.h
include/asm-arm/arch-l7200/time.h
include/asm-arm/arch-omap/keypad.h
include/asm-generic/bug.h
include/asm-i386/dma-mapping.h
include/asm-i386/mach-default/do_timer.h
include/asm-i386/mach-summit/mach_apic.h
include/asm-i386/mach-visws/do_timer.h
include/asm-i386/mach-voyager/do_timer.h
include/asm-i386/smp.h
include/asm-powerpc/bug.h
include/asm-s390/irq.h
include/asm-s390/pgtable.h
include/asm-um/pgtable.h
include/asm-x86_64/dma-mapping.h
include/linux/Kbuild
include/linux/atalk.h
include/linux/audit.h
include/linux/blkdev.h
include/linux/compiler.h
include/linux/cpuset.h
include/linux/cramfs_fs.h
include/linux/dma-mapping.h
include/linux/dmi.h
include/linux/errqueue.h
include/linux/file.h
include/linux/fs.h
include/linux/generic_acl.h [new file with mode: 0644]
include/linux/hrtimer.h
include/linux/icmp.h
include/linux/if.h
include/linux/if_arp.h
include/linux/if_link.h [new file with mode: 0644]
include/linux/igmp.h
include/linux/in.h
include/linux/in6.h
include/linux/inet_diag.h
include/linux/inetdevice.h
include/linux/interrupt.h
include/linux/ip.h
include/linux/ipv6.h
include/linux/jbd.h
include/linux/leds.h
include/linux/list.h
include/linux/lockdep.h
include/linux/loop.h
include/linux/module.h
include/linux/mroute.h
include/linux/msdos_fs.h
include/linux/namei.h
include/linux/netdevice.h
include/linux/netfilter_arp/arp_tables.h
include/linux/netfilter_ipv4/ip_conntrack.h
include/linux/netfilter_ipv4/ip_conntrack_h323.h
include/linux/netfilter_ipv4/ip_conntrack_tuple.h
include/linux/netfilter_ipv4/ip_nat.h
include/linux/netfilter_ipv4/ip_queue.h
include/linux/netfilter_ipv4/ipt_iprange.h
include/linux/nmi.h
include/linux/page-flags.h
include/linux/pci_ids.h
include/linux/percpu.h
include/linux/posix-timers.h
include/linux/ptrace.h
include/linux/reiserfs_acl.h
include/linux/reiserfs_fs_i.h
include/linux/reiserfs_xattr.h
include/linux/rtnetlink.h
include/linux/sched.h
include/linux/scx200_gpio.h
include/linux/security.h
include/linux/shmem_fs.h
include/linux/spinlock.h
include/linux/spinlock_api_smp.h
include/linux/sunrpc/auth.h
include/linux/sunrpc/msg_prot.h
include/linux/sunrpc/svc.h
include/linux/sunrpc/svcauth.h
include/linux/sunrpc/xdr.h
include/linux/sunrpc/xprt.h
include/linux/syscalls.h
include/linux/tcp.h
include/linux/trdevice.h
include/linux/tty.h
include/linux/udp.h
include/linux/vmstat.h
include/linux/vt_kern.h
include/linux/writeback.h
include/linux/xfrm.h
include/net/arp.h
include/net/bluetooth/hci.h
include/net/bluetooth/hci_core.h
include/net/cipso_ipv4.h
include/net/dst.h
include/net/flow.h
include/net/icmp.h
include/net/inet_connection_sock.h
include/net/inet_hashtables.h
include/net/inet_sock.h
include/net/inet_timewait_sock.h
include/net/inetpeer.h
include/net/ip.h
include/net/ip_fib.h
include/net/ip_mp_alg.h
include/net/ip_vs.h
include/net/ipv6.h
include/net/irda/irlan_common.h
include/net/irda/irlap_frame.h
include/net/irda/irlmp.h
include/net/netlabel.h
include/net/netlink.h
include/net/route.h
include/net/xfrm.h
kernel/acct.c
kernel/auditsc.c
kernel/capability.c
kernel/compat.c
kernel/cpuset.c
kernel/exit.c
kernel/fork.c
kernel/futex.c
kernel/hrtimer.c
kernel/irq/chip.c
kernel/kexec.c
kernel/kfifo.c
kernel/kmod.c
kernel/lockdep.c
kernel/module.c
kernel/params.c
kernel/posix-cpu-timers.c
kernel/posix-timers.c
kernel/ptrace.c
kernel/rcutorture.c
kernel/relay.c
kernel/rtmutex.c
kernel/sched.c
kernel/signal.c
kernel/softirq.c
kernel/softlockup.c
kernel/spinlock.c
kernel/stop_machine.c
kernel/sys.c
kernel/sysctl.c
kernel/timer.c
kernel/unwind.c
lib/Kconfig.debug
lib/Makefile
lib/list_debug.c [new file with mode: 0644]
lib/rwsem.c
lib/spinlock_debug.c
lib/ts_fsm.c
mm/Makefile
mm/filemap.c
mm/memory.c
mm/memory_hotplug.c
mm/oom_kill.c
mm/page-writeback.c
mm/shmem.c
mm/shmem_acl.c [new file with mode: 0644]
mm/slab.c
mm/swapfile.c
net/802/tr.c
net/Kconfig
net/appletalk/ddp.c
net/atm/mpc.c
net/atm/mpoa_caches.c
net/bluetooth/af_bluetooth.c
net/bluetooth/bnep/core.c
net/bluetooth/hci_conn.c
net/bluetooth/hci_core.c
net/bluetooth/hci_event.c
net/bluetooth/hci_sysfs.c
net/bluetooth/hidp/core.c
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/tty.c
net/bridge/netfilter/ebt_arpreply.c
net/core/dev.c
net/core/ethtool.c
net/core/neighbour.c
net/core/pktgen.c
net/core/rtnetlink.c
net/core/utils.c
net/dccp/ipv4.c
net/ethernet/eth.c
net/ipv4/af_inet.c
net/ipv4/arp.c
net/ipv4/cipso_ipv4.c
net/ipv4/datagram.c
net/ipv4/devinet.c
net/ipv4/fib_frontend.c
net/ipv4/fib_hash.c
net/ipv4/fib_lookup.h
net/ipv4/fib_rules.c
net/ipv4/fib_semantics.c
net/ipv4/fib_trie.c
net/ipv4/icmp.c
net/ipv4/igmp.c
net/ipv4/inet_connection_sock.c
net/ipv4/inet_diag.c
net/ipv4/inet_hashtables.c
net/ipv4/inetpeer.c
net/ipv4/ip_fragment.c
net/ipv4/ip_options.c
net/ipv4/ip_output.c
net/ipv4/ip_sockglue.c
net/ipv4/ipcomp.c
net/ipv4/ipmr.c
net/ipv4/ipvs/ip_vs_conn.c
net/ipv4/ipvs/ip_vs_core.c
net/ipv4/ipvs/ip_vs_ctl.c
net/ipv4/ipvs/ip_vs_dh.c
net/ipv4/ipvs/ip_vs_ftp.c
net/ipv4/ipvs/ip_vs_lblc.c
net/ipv4/ipvs/ip_vs_lblcr.c
net/ipv4/ipvs/ip_vs_proto.c
net/ipv4/ipvs/ip_vs_proto_tcp.c
net/ipv4/ipvs/ip_vs_proto_udp.c
net/ipv4/ipvs/ip_vs_sh.c
net/ipv4/ipvs/ip_vs_sync.c
net/ipv4/ipvs/ip_vs_xmit.c
net/ipv4/multipath_wrandom.c
net/ipv4/netfilter.c
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_conntrack_amanda.c
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_conntrack_ftp.c
net/ipv4/netfilter/ip_conntrack_helper_h323.c
net/ipv4/netfilter/ip_conntrack_helper_pptp.c
net/ipv4/netfilter/ip_conntrack_irc.c
net/ipv4/netfilter/ip_conntrack_netbios_ns.c
net/ipv4/netfilter/ip_conntrack_netlink.c
net/ipv4/netfilter/ip_conntrack_proto_icmp.c
net/ipv4/netfilter/ip_conntrack_proto_sctp.c
net/ipv4/netfilter/ip_conntrack_proto_tcp.c
net/ipv4/netfilter/ip_conntrack_sip.c
net/ipv4/netfilter/ip_conntrack_tftp.c
net/ipv4/netfilter/ip_nat_core.c
net/ipv4/netfilter/ip_nat_ftp.c
net/ipv4/netfilter/ip_nat_helper.c
net/ipv4/netfilter/ip_nat_helper_h323.c
net/ipv4/netfilter/ip_nat_helper_pptp.c
net/ipv4/netfilter/ip_nat_proto_icmp.c
net/ipv4/netfilter/ip_nat_proto_tcp.c
net/ipv4/netfilter/ip_nat_proto_udp.c
net/ipv4/netfilter/ip_nat_rule.c
net/ipv4/netfilter/ip_nat_sip.c
net/ipv4/netfilter/ip_nat_snmp_basic.c
net/ipv4/netfilter/ip_nat_standalone.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/ipv4/netfilter/ipt_ECN.c
net/ipv4/netfilter/ipt_MASQUERADE.c
net/ipv4/netfilter/ipt_NETMAP.c
net/ipv4/netfilter/ipt_REDIRECT.c
net/ipv4/netfilter/ipt_REJECT.c
net/ipv4/netfilter/ipt_SAME.c
net/ipv4/netfilter/ipt_TCPMSS.c
net/ipv4/netfilter/ipt_TOS.c
net/ipv4/netfilter/ipt_TTL.c
net/ipv4/netfilter/ipt_addrtype.c
net/ipv4/netfilter/ipt_hashlimit.c
net/ipv4/netfilter/ipt_recent.c
net/ipv4/netfilter/iptable_mangle.c
net/ipv4/raw.c
net/ipv4/route.c
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_lp.c
net/ipv4/tcp_output.c
net/ipv4/udp.c
net/ipv4/xfrm4_input.c
net/ipv4/xfrm4_policy.c
net/ipv4/xfrm4_state.c
net/ipv6/addrconf.c
net/ipv6/af_inet6.c
net/ipv6/inet6_hashtables.c
net/ipv6/ipcomp6.c
net/ipv6/ipv6_sockglue.c
net/ipv6/tcp_ipv6.c
net/ipv6/xfrm6_input.c
net/ipv6/xfrm6_state.c
net/ipv6/xfrm6_tunnel.c
net/irda/af_irda.c
net/irda/ircomm/ircomm_lmp.c
net/irda/iriap.c
net/irda/iriap_event.c
net/irda/irlan/irlan_common.c
net/irda/irlan/irlan_provider.c
net/irda/irlap_frame.c
net/irda/irlmp.c
net/irda/irttp.c
net/key/af_key.c
net/netlabel/netlabel_cipso_v4.c
net/netlabel/netlabel_domainhash.c
net/netlabel/netlabel_domainhash.h
net/netlabel/netlabel_mgmt.c
net/netlabel/netlabel_unlabeled.c
net/netlabel/netlabel_user.c
net/netlabel/netlabel_user.h
net/sched/cls_api.c
net/sched/cls_basic.c
net/sched/sch_api.c
net/sched/sch_generic.c
net/sched/sch_htb.c
net/sunrpc/auth.c
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/auth_gss/gss_krb5_seal.c
net/sunrpc/auth_gss/gss_krb5_wrap.c
net/sunrpc/auth_gss/svcauth_gss.c
net/sunrpc/auth_null.c
net/sunrpc/auth_unix.c
net/sunrpc/clnt.c
net/sunrpc/pmap_clnt.c
net/sunrpc/svc.c
net/sunrpc/svcauth.c
net/sunrpc/svcauth_unix.c
net/sunrpc/svcsock.c
net/sunrpc/xdr.c
net/sunrpc/xprt.c
net/sunrpc/xprtsock.c
net/xfrm/xfrm_hash.h
net/xfrm/xfrm_input.c
net/xfrm/xfrm_state.c
scripts/basic/docproc.c
security/Kconfig
security/Makefile
security/commoncap.c
security/seclvl.c [deleted file]
security/selinux/hooks.c
sound/Makefile
sound/mips/au1x00.c
sound/oss/COPYING [deleted file]
sound/oss/cs46xx.c
sound/oss/cs46xxpm-24.h [deleted file]
sound/oss/trident.c
sound/sound_core.c
sound/sound_firmware.c
sound/sparc/dbri.c

diff --git a/CREDITS b/CREDITS
index cc3453a55fb948f5173ff82715c304d18dc1212d..66e82466dde8af73c814354d8e4df82398e78e5c 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -1620,7 +1620,8 @@ D: fbdev hacking
 
 N: Jesper Juhl
 E: jesper.juhl@gmail.com
-D: Various fixes, cleanups and minor features.
+D: Various fixes, cleanups and minor features all over the tree.
+D: Wrote initial version of the hdaps driver (since passed on to others).
 S: Lemnosvej 1, 3.tv
 S: 2300 Copenhagen S.
 S: Denmark
@@ -2477,7 +2478,8 @@ S: Derbyshire DE4 3RL
 S: United Kingdom
 
 N: Ian S. Nelson
-E: ian.nelson@echostar.com
+E: nelsonis@earthlink.net
+P: 1024D/00D3D983 3EFD 7B86 B888 D7E2 29B6  9E97 576F 1B97 00D3 D983
 D: Minor mmap and ide hacks
 S: 1370 Atlantis Ave.
 S: Lafayette CO, 80026
index 6d2412ec91edb21ebab0c13e581951bbe352b610..29c18966b0502c3489e1058bd361db50a6c07686 100644 (file)
@@ -532,6 +532,40 @@ appears outweighs the potential value of the hint that tells gcc to do
 something it would have done anyway.
 
 
+               Chapter 16: Function return values and names
+
+Functions can return values of many different kinds, and one of the
+most common is a value indicating whether the function succeeded or
+failed.  Such a value can be represented as an error-code integer
+(-Exxx = failure, 0 = success) or a "succeeded" boolean (0 = failure,
+non-zero = success).
+
+Mixing up these two sorts of representations is a fertile source of
+difficult-to-find bugs.  If the C language included a strong distinction
+between integers and booleans then the compiler would find these mistakes
+for us... but it doesn't.  To help prevent such bugs, always follow this
+convention:
+
+       If the name of a function is an action or an imperative command,
+       the function should return an error-code integer.  If the name
+       is a predicate, the function should return a "succeeded" boolean.
+
+For example, "add work" is a command, and the add_work() function returns 0
+for success or -EBUSY for failure.  In the same way, "PCI device present" is
+a predicate, and the pci_dev_present() function returns 1 if it succeeds in
+finding a matching device or 0 if it doesn't.
+
+All EXPORTed functions must respect this convention, and so should all
+public functions.  Private (static) functions need not, but it is
+recommended that they do.
+
+Functions whose return value is the actual result of a computation, rather
+than an indication of whether the computation succeeded, are not subject to
+this rule.  Generally they indicate failure by returning some out-of-range
+result.  Typical examples would be functions that return pointers; they use
+NULL or the ERR_PTR mechanism to report failure.
+
+
 
                Appendix I: References
 
index f8fe882e33dccfc50f6e5add6ca89a53389d649f..6d4b1ef5b6f11a24a1705e1c0e73b17220feb35c 100644 (file)
@@ -181,27 +181,6 @@ X!Ilib/string.c
      </sect1>
   </chapter>
 
-  <chapter id="proc">
-     <title>The proc filesystem</title>
-     <sect1><title>sysctl interface</title>
-!Ekernel/sysctl.c
-     </sect1>
-
-     <sect1><title>proc filesystem interface</title>
-!Ifs/proc/base.c
-     </sect1>
-  </chapter>
-
-  <chapter id="debugfs">
-     <title>The debugfs filesystem</title>
-     <sect1><title>debugfs interface</title>
-!Efs/debugfs/inode.c
-!Efs/debugfs/file.c
-     </sect1>
-  </chapter>
-
   <chapter id="vfs">
      <title>The Linux VFS</title>
      <sect1><title>The Filesystem types</title>
@@ -234,6 +213,50 @@ X!Ilib/string.c
      </sect1>
   </chapter>
 
+  <chapter id="proc">
+     <title>The proc filesystem</title>
+     <sect1><title>sysctl interface</title>
+!Ekernel/sysctl.c
+     </sect1>
+
+     <sect1><title>proc filesystem interface</title>
+!Ifs/proc/base.c
+     </sect1>
+  </chapter>
+
+  <chapter id="sysfs">
+     <title>The Filesystem for Exporting Kernel Objects</title>
+!Efs/sysfs/file.c
+!Efs/sysfs/symlink.c
+!Efs/sysfs/bin.c
+  </chapter>
+
+  <chapter id="debugfs">
+     <title>The debugfs filesystem</title>
+     <sect1><title>debugfs interface</title>
+!Efs/debugfs/inode.c
+!Efs/debugfs/file.c
+     </sect1>
+  </chapter>
+
+  <chapter id="relayfs">
+     <title>relay interface support</title>
+
+     <para>
+       Relay interface support
+       is designed to provide an efficient mechanism for tools and
+       facilities to relay large amounts of data from kernel space to
+       user space.
+     </para>
+
+     <sect1><title>relay interface</title>
+!Ekernel/relay.c
+!Ikernel/relay.c
+     </sect1>
+  </chapter>
+
   <chapter id="netcore">
      <title>Linux Networking</title>
      <sect1><title>Networking Base Types</title>
@@ -349,13 +372,6 @@ X!Earch/i386/kernel/mca.c
      </sect1>
   </chapter>
 
-  <chapter id="sysfs">
-     <title>The Filesystem for Exporting Kernel Objects</title>
-!Efs/sysfs/file.c
-!Efs/sysfs/symlink.c
-!Efs/sysfs/bin.c
-  </chapter>
-
   <chapter id="security">
      <title>Security Framework</title>
 !Esecurity/security.c
@@ -386,6 +402,7 @@ X!Iinclude/linux/device.h
 -->
 !Edrivers/base/driver.c
 !Edrivers/base/core.c
+!Edrivers/base/class.c
 !Edrivers/base/firmware_class.c
 !Edrivers/base/transport_class.c
 !Edrivers/base/dmapool.c
@@ -437,6 +454,11 @@ X!Edrivers/pnp/system.c
 !Eblock/ll_rw_blk.c
   </chapter>
 
+  <chapter id="chrdev">
+       <title>Char devices</title>
+!Efs/char_dev.c
+  </chapter>
+
   <chapter id="miscdev">
      <title>Miscellaneous Devices</title>
 !Edrivers/char/misc.c
index a10bfb6ecd9fa4e55c9beecd2e588c9a0359ec71..a6cb6ffd293377bef9a19cd077299626fcb5bf47 100644 (file)
@@ -61,3 +61,6 @@ kernel patches.
     Documentation/kernel-parameters.txt.
 
 18: All new module parameters are documented with MODULE_PARM_DESC()
+
+19: All new userspace interfaces are documented in Documentation/ABI/.
+    See Documentation/ABI/README for more information.
index 6bd30fdd0786b9a7c64aa4c34f5a732b4c7096e0..58bead05eabb057fb777bdd5fe7a56b44f35b0e0 100644 (file)
@@ -59,11 +59,11 @@ Copyright:  The copyright owner must agree to use of GPL.
                are the same person/entity. If not, the name of
                the person/entity authorizing use of GPL should be
                listed in case it's necessary to verify the will of
-               the copright owner.
+               the copyright owner.
 
 Interfaces:    If your driver uses existing interfaces and behaves like
                other drivers in the same class it will be much more likely
-               to be accepted than if it invents gratuitous new ones. 
+               to be accepted than if it invents gratuitous new ones.
                If you need to implement a common API over Linux and NT
                drivers do it in userspace.
 
@@ -88,7 +88,7 @@ Clarity:      It helps if anyone can see how to fix the driver. It helps
                it will go in the bitbucket.
 
 Control:       In general if there is active maintainance of a driver by
-               the author then patches will be redirected to them unless 
+               the author then patches will be redirected to them unless
                they are totally obvious and without need of checking.
                If you want to be the contact and update point for the
                driver it is a good idea to state this in the comments,
@@ -100,7 +100,7 @@ What Criteria Do Not Determine Acceptance
 Vendor:                Being the hardware vendor and maintaining the driver is
                often a good thing. If there is a stable working driver from
                other people already in the tree don't expect 'we are the
-               vendor' to get your driver chosen. Ideally work with the 
+               vendor' to get your driver chosen. Ideally work with the
                existing driver author to build a single perfect driver.
 
 Author:                It doesn't matter if a large Linux company wrote the driver,
@@ -116,17 +116,13 @@ Linux kernel master tree:
        ftp.??.kernel.org:/pub/linux/kernel/...
        ?? == your country code, such as "us", "uk", "fr", etc.
 
-Linux kernel mailing list:             
+Linux kernel mailing list:
        linux-kernel@vger.kernel.org
        [mail majordomo@vger.kernel.org to subscribe]
 
 Linux Device Drivers, Third Edition (covers 2.6.10):
        http://lwn.net/Kernel/LDD3/  (free version)
 
-Kernel traffic:
-       Weekly summary of kernel list activity (much easier to read)
-       http://www.kerneltraffic.org/kernel-traffic/
-
 LWN.net:
        Weekly summary of kernel development activity - http://lwn.net/
        2.6 API changes:
@@ -145,11 +141,8 @@ KernelNewbies:
 Linux USB project:
        http://www.linux-usb.org/
 
-How to NOT write kernel driver by arjanv@redhat.com
-       http://people.redhat.com/arjanv/olspaper.pdf
+How to NOT write kernel driver by Arjan van de Ven:
+       http://www.fenrus.org/how-to-not-write-a-device-driver-paper.pdf
 
 Kernel Janitor:
        http://janitor.kernelnewbies.org/
-
---
-Last updated on 17 Nov 2005.
index d42ab4c9e893b787d0918cc9f5a540a785a11aee..302d148c2e18f0e0fe565bc9c9c1a2f4b232d346 100644 (file)
@@ -173,15 +173,15 @@ For small patches you may want to CC the Trivial Patch Monkey
 trivial@kernel.org managed by Adrian Bunk; which collects "trivial"
 patches. Trivial patches must qualify for one of the following rules:
  Spelling fixes in documentation
- Spelling fixes which could break grep(1).
+ Spelling fixes which could break grep(1)
  Warning fixes (cluttering with useless warnings is bad)
  Compilation fixes (only if they are actually correct)
  Runtime fixes (only if they actually fix things)
- Removing use of deprecated functions/macros (eg. check_region).
+ Removing use of deprecated functions/macros (eg. check_region)
  Contact detail and documentation fixes
  Non-portable code replaced by portable code (even in arch-specific,
  since people copy, as long as it's trivial)
- Any fix by the author/maintainer of the file. (ie. patch monkey
+ Any fix by the author/maintainer of the file (ie. patch monkey
  in re-transmission mode)
 URL: <http://www.kernel.org/pub/linux/kernel/people/bunk/trivial/>
 
@@ -209,6 +209,19 @@ 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);
+
+
 
 7) E-mail size.
 
@@ -245,13 +258,13 @@ updated change.
 It is quite common for Linus to "drop" your patch without comment.
 That's the nature of the system.  If he drops your patch, it could be
 due to
-* Your patch did not apply cleanly to the latest kernel version
+* Your patch did not apply cleanly to the latest kernel version.
 * Your patch was not sufficiently discussed on linux-kernel.
-* A style issue (see section 2),
-* An e-mail formatting issue (re-read this section)
-* A technical problem with your change
-* He gets tons of e-mail, and yours got lost in the shuffle
-* You are being annoying (See Figure 1)
+* A style issue (see section 2).
+* An e-mail formatting issue (re-read this section).
+* A technical problem with your change.
+* He gets tons of e-mail, and yours got lost in the shuffle.
+* You are being annoying.
 
 When in doubt, solicit comments on linux-kernel mailing list.
 
@@ -476,10 +489,10 @@ SECTION 3 - REFERENCES
 Andrew Morton, "The perfect patch" (tpp).
   <http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt>
 
-Jeff Garzik, "Linux kernel patch submission format."
+Jeff Garzik, "Linux kernel patch submission format".
   <http://linux.yyz.us/patch-format.html>
 
-Greg Kroah-Hartman "How to piss off a kernel subsystem maintainer".
+Greg Kroah-Hartman, "How to piss off a kernel subsystem maintainer".
   <http://www.kroah.com/log/2005/03/31/>
   <http://www.kroah.com/log/2005/07/08/>
   <http://www.kroah.com/log/2005/10/19/>
@@ -488,9 +501,9 @@ Greg Kroah-Hartman "How to piss off a kernel subsystem maintainer".
 NO!!!! No more huge patch bombs to linux-kernel@vger.kernel.org people!
   <http://marc.theaimsgroup.com/?l=linux-kernel&m=112112749912944&w=2>
 
-Kernel Documentation/CodingStyle
+Kernel Documentation/CodingStyle:
   <http://sosdg.org/~coywolf/lxr/source/Documentation/CodingStyle>
 
-Linus Torvald's mail on the canonical patch format:
+Linus Torvalds's mail on the canonical patch format:
   <http://lkml.org/lkml/2005/4/7/183>
 --
index 76b44290c1546c50a4e15527c18a19e626249f35..842f0d1ab2165781420fdd53b3875a16ba91adb6 100644 (file)
@@ -217,11 +217,11 @@ exclusive cpuset.  Also, the use of a Linux virtual file system (vfs)
 to represent the cpuset hierarchy provides for a familiar permission
 and name space for cpusets, with a minimum of additional kernel code.
 
-The cpus file in the root (top_cpuset) cpuset is read-only.
-It automatically tracks the value of cpu_online_map, using a CPU
-hotplug notifier.  If and when memory nodes can be hotplugged,
-we expect to make the mems file in the root cpuset read-only
-as well, and have it track the value of node_online_map.
+The cpus and mems files in the root (top_cpuset) cpuset are
+read-only.  The cpus file automatically tracks the value of
+cpu_online_map using a CPU hotplug notifier, and the mems file
+automatically tracks the value of node_online_map using the
+cpuset_track_online_nodes() hook.
 
 
 1.4 What are exclusive cpusets ?
index 7db71d6fba824bc92f08785578d7dc8fefb4c5aa..7240ee7515decf7b8d5205a18e43b891ddba2f9a 100644 (file)
@@ -39,6 +39,8 @@ Table of Contents
   2.9  Appletalk
   2.10 IPX
   2.11 /proc/sys/fs/mqueue - POSIX message queues filesystem
+  2.12 /proc/<pid>/oom_adj - Adjust the oom-killer score
+  2.13 /proc/<pid>/oom_score - Display current oom-killer score
 
 ------------------------------------------------------------------------------
 Preface
@@ -1962,6 +1964,22 @@ a queue must be less or equal then msg_max.
 maximum  message size value (it is every  message queue's attribute set during
 its creation).
 
+2.12 /proc/<pid>/oom_adj - Adjust the oom-killer score
+------------------------------------------------------
+
+This file can be used to adjust the score used to select which processes
+should be killed in an  out-of-memory  situation.  Giving it a high score will
+increase the likelihood of this process being killed by the oom-killer.  Valid
+values are in the range -16 to +15, plus the special value -17, which disables
+oom-killing altogether for this process.
+
+2.13 /proc/<pid>/oom_score - Display current oom-killer score
+-------------------------------------------------------------
+
+------------------------------------------------------------------------------
+This file can be used to check the current score used by the oom-killer is for
+any given <pid>. Use it together with /proc/<pid>/oom_adj to tune which
+process should be killed in an out-of-memory situation.
 
 ------------------------------------------------------------------------------
 Summary
index 54983246930d1aeb922c3691ac0b5a96028d97ef..137e993f4329aa9c6cc83a7835dcc9380312dbd6 100644 (file)
@@ -110,6 +110,13 @@ be entered as an environment variable, whereas its absence indicates that
 it will appear as a kernel argument readable via /proc/cmdline by programs
 running once the system is up.
 
+The number of kernel parameters is not limited, but the length of the
+complete command line (parameters including spaces etc.) is limited to
+a fixed number of characters. This limit depends on the architecture
+and is between 256 and 4096 characters. It is defined in the file
+./include/asm/setup.h as COMMAND_LINE_SIZE.
+
+
        53c7xx=         [HW,SCSI] Amiga SCSI controllers
                        See header of drivers/scsi/53c7xx.c.
                        See also Documentation/scsi/ncr53c7xx.txt.
@@ -1324,7 +1331,7 @@ running once the system is up.
        pt.             [PARIDE]
                        See Documentation/paride.txt.
 
-       quiet=          [KNL] Disable log messages
+       quiet           [KNL] Disable most log messages
 
        r128=           [HW,DRM]
 
index 44f2f769e8659dd2565c82a9ece8771150091a5f..18d385c068fc85b8a87deaef82caadd27e4204e6 100644 (file)
@@ -100,6 +100,7 @@ Examples:
                          are: IPSRC_RND #IP Source is random (between min/max),
                               IPDST_RND, UDPSRC_RND,
                               UDPDST_RND, MACSRC_RND, MACDST_RND 
+                              MPLS_RND, VID_RND, SVID_RND
 
  pgset "udp_src_min 9"   set UDP source port min, If < udp_src_max, then
                          cycle through the port range.
@@ -125,6 +126,21 @@ Examples:
 
  pgset "mpls 0"                  turn off mpls (or any invalid argument works too!)
 
+ pgset "vlan_id 77"       set VLAN ID 0-4095
+ pgset "vlan_p 3"         set priority bit 0-7 (default 0)
+ pgset "vlan_cfi 0"       set canonical format identifier 0-1 (default 0)
+
+ pgset "svlan_id 22"      set SVLAN ID 0-4095
+ pgset "svlan_p 3"        set priority bit 0-7 (default 0)
+ pgset "svlan_cfi 0"      set canonical format identifier 0-1 (default 0)
+
+ pgset "vlan_id 9999"     > 4095 remove vlan and svlan tags
+ pgset "svlan 9999"       > 4095 remove svlan tag
+
+
+ pgset "tos XX"           set former IPv4 TOS field (e.g. "tos 28" for AF11 no ECN, default 00)
+ pgset "traffic_class XX" set former IPv6 TRAFFIC CLASS (e.g. "traffic_class B8" for EF no ECN, default 00)
+
  pgset stop                      aborts injection. Also, ^C aborts generator.
 
 
diff --git a/Documentation/seclvl.txt b/Documentation/seclvl.txt
deleted file mode 100644 (file)
index 97274d1..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-BSD Secure Levels Linux Security Module
-Michael A. Halcrow <mike@halcrow.us>
-
-
-Introduction
-
-Under the BSD Secure Levels security model, sets of policies are
-associated with levels. Levels range from -1 to 2, with -1 being the
-weakest and 2 being the strongest. These security policies are
-enforced at the kernel level, so not even the superuser is able to
-disable or circumvent them. This hardens the machine against attackers
-who gain root access to the system.
-
-
-Levels and Policies
-
-Level -1 (Permanently Insecure):
- - Cannot increase the secure level
-
-Level 0 (Insecure):
- - Cannot ptrace the init process
-
-Level 1 (Default):
- - /dev/mem and /dev/kmem are read-only
- - IMMUTABLE and APPEND extended attributes, if set, may not be unset
- - Cannot load or unload kernel modules
- - Cannot write directly to a mounted block device
- - Cannot perform raw I/O operations
- - Cannot perform network administrative tasks
- - Cannot setuid any file
-
-Level 2 (Secure):
- - Cannot decrement the system time
- - Cannot write to any block device, whether mounted or not
- - Cannot unmount any mounted filesystems
-
-
-Compilation
-
-To compile the BSD Secure Levels LSM, seclvl.ko, enable the
-SECURITY_SECLVL configuration option.  This is found under Security
-options -> BSD Secure Levels in the kernel configuration menu.
-
-
-Basic Usage
-
-Once the machine is in a running state, with all the necessary modules
-loaded and all the filesystems mounted, you can load the seclvl.ko
-module:
-
-# insmod seclvl.ko
-
-The module defaults to secure level 1, except when compiled directly
-into the kernel, in which case it defaults to secure level 0. To raise
-the secure level to 2, the administrator writes ``2'' to the
-seclvl/seclvl file under the sysfs mount point (assumed to be /sys in
-these examples):
-
-# echo -n "2" > /sys/seclvl/seclvl
-
-Alternatively, you can initialize the module at secure level 2 with
-the initlvl module parameter:
-
-# insmod seclvl.ko initlvl=2
-
-At this point, it is impossible to remove the module or reduce the
-secure level.  If the administrator wishes to have the option of doing
-so, he must provide a module parameter, sha1_passwd, that specifies
-the SHA1 hash of the password that can be used to reduce the secure
-level to 0.
-
-To generate this SHA1 hash, the administrator can use OpenSSL:
-
-# echo -n "boogabooga" | openssl sha1
-abeda4e0f33defa51741217592bf595efb8d289c
-
-In order to use password-instigated secure level reduction, the SHA1
-crypto module must be loaded or compiled into the kernel:
-
-# insmod sha1.ko
-
-The administrator can then insmod the seclvl module, including the
-SHA1 hash of the password:
-
-# insmod seclvl.ko
-         sha1_passwd=abeda4e0f33defa51741217592bf595efb8d289c
-
-To reduce the secure level, write the password to seclvl/passwd under
-your sysfs mount point:
-
-# echo -n "boogabooga" > /sys/seclvl/passwd
-
-The September 2004 edition of Sys Admin Magazine has an article about
-the BSD Secure Levels LSM.  I encourage you to refer to that article
-for a more in-depth treatment of this security module:
-
-http://www.samag.com/documents/s=9304/sam0409a/0409a.htm
index 332b220f8a23462b3c8930098a53c1354b7dec63..2c752d18e24b677f865a1a9d5a81f7aa38972045 100644 (file)
@@ -851,7 +851,7 @@ P:  Doug Warzecha
 M:     Douglas_Warzecha@dell.com
 S:     Maintained
 
-DEVICE-MAPPER
+DEVICE-MAPPER  (LVM)
 P:     Alasdair Kergon
 L:     dm-devel@redhat.com
 W:     http://sources.redhat.com/dm
@@ -2062,7 +2062,7 @@ L:        linux-hams@vger.kernel.org
 W:     http://www.linux-ax25.org/
 S:     Maintained
 
-NETWORK BLOCK DEVICE
+NETWORK BLOCK DEVICE (NBD)
 P:     Paul Clements
 M:     Paul.Clements@steeleye.com
 S:     Maintained
@@ -2810,6 +2810,12 @@ M:       R.E.Wolff@BitWizard.nl
 L:     linux-kernel@vger.kernel.org ?
 S:     Supported
 
+SPIDERNET NETWORK DRIVER for CELL
+P:     Jim Lewis
+M:     jim@jklewis.com
+L:     netdev@vger.kernel.org
+S:     Supported
+
 SRM (Alpha) environment access
 P:     Jan-Benedict Glaw
 M:     jbglaw@lug-owl.de
@@ -2834,12 +2840,9 @@ S:       Maintained
 SUPERH (sh)
 P:     Paul Mundt
 M:     lethal@linux-sh.org
-P:     Kazumoto Kojima
-M:     kkojima@rr.iij4u.or.jp
-L:     linuxsh-dev@lists.sourceforge.net
+L:     linuxsh-dev@lists.sourceforge.net (subscribers-only)
 W:     http://www.linux-sh.org
 W:     http://www.m17n.org/linux-sh/
-W:     http://www.rr.iij4u.or.jp/~kkojima/linux-sh4.html
 S:     Maintained
 
 SUPERH64 (sh64)
index b191cc75973751d5bdfe6137596a051a1c821b13..7c1e44420a78ce8ffa5e63ac6ec1930e2d0c80f9 100644 (file)
@@ -132,7 +132,7 @@ irqreturn_t timer_interrupt(int irq, void *dev, struct pt_regs * regs)
        nticks = delta >> FIX_SHIFT;
 
        while (nticks > 0) {
-               do_timer(regs);
+               do_timer(1);
 #ifndef CONFIG_SMP
                update_process_times(user_mode(regs));
 #endif
index 622dabd846800b14fb13c623eff5c61da0ac9cf7..8871529a34e2026e4f2bd4eda531df7ec59808a4 100644 (file)
@@ -193,7 +193,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
        /* We ran out of memory, or some other thing happened to us that
           made us unable to handle the page fault gracefully.  */
  out_of_memory:
-       if (current->pid == 1) {
+       if (is_init(current)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index d4dceb5f06e94181b0300fbd3a1375f6a573194d..f7d5165796ef2e337ea6a8473c4db562535efb1c 100644 (file)
@@ -337,7 +337,7 @@ void timer_tick(struct pt_regs *regs)
        profile_tick(CPU_PROFILING, regs);
        do_leds();
        do_set_rtc();
-       do_timer(regs);
+       do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index c753a3c5aadd4f09d9e0e7e0cbde7de606410a0d..62e42c7a628e55ac1f86616064667ea2e0188534 100644 (file)
@@ -172,9 +172,11 @@ static struct resource kp_resources[] = {
 };
 
 static struct omap_kp_platform_data kp_data = {
-       .rows   = 8,
-       .cols   = 8,
-       .keymap = fsample_keymap,
+       .rows           = 8,
+       .cols           = 8,
+       .keymap         = fsample_keymap,
+       .keymapsize     = ARRAY_SIZE(fsample_keymap),
+       .delay          = 4,
 };
 
 static struct platform_device kp_device = {
index cd3a06dfc0a83d2e5f0d280c4ace0f49cef988c3..6e113078f7ab4fa3415f42d68901e3e0ecc0aaaf 100644 (file)
@@ -167,10 +167,13 @@ static struct resource h2_kp_resources[] = {
 };
 
 static struct omap_kp_platform_data h2_kp_data = {
-       .rows   = 8,
-       .cols   = 8,
-       .keymap = h2_keymap,
-       .rep    = 1,
+       .rows           = 8,
+       .cols           = 8,
+       .keymap         = h2_keymap,
+       .keymapsize     = ARRAY_SIZE(h2_keymap),
+       .rep            = 1,
+       .delay          = 9,
+       .dbounce        = 1,
 };
 
 static struct platform_device h2_kp_device = {
index 7b206116cd0391882f6d093325150bf9577acd80..f225a083dee1bb13073127a6cc05c6a21e199cfa 100644 (file)
@@ -247,10 +247,13 @@ static struct resource h3_kp_resources[] = {
 };
 
 static struct omap_kp_platform_data h3_kp_data = {
-       .rows   = 8,
-       .cols   = 8,
-       .keymap = h3_keymap,
-       .rep    = 1,
+       .rows           = 8,
+       .cols           = 8,
+       .keymap         = h3_keymap,
+       .keymapsize     = ARRAY_SIZE(h3_keymap),
+       .rep            = 1,
+       .delay          = 9,
+       .dbounce        = 1,
 };
 
 static struct platform_device h3_kp_device = {
index 4cbc62db5b5dd5cd6a72da1c4efbdf2ec56b8aa2..cb00530ad279392725581ae81b57c07a215eb1e6 100644 (file)
@@ -159,9 +159,11 @@ static struct resource innovator_kp_resources[] = {
 };
 
 static struct omap_kp_platform_data innovator_kp_data = {
-       .rows   = 8,
-       .cols   = 8,
-       .keymap = innovator_keymap,
+       .rows           = 8,
+       .cols           = 8,
+       .keymap         = innovator_keymap,
+       .keymapsize     = ARRAY_SIZE(innovator_keymap),
+       .delay          = 4,
 };
 
 static struct platform_device innovator_kp_device = {
index 02b980d77b12d2079e84d23a27eea010005707be..dbc555d209ff914eeff8b0b51d77d814212e430b 100644 (file)
@@ -71,9 +71,11 @@ static struct resource nokia770_kp_resources[] = {
 };
 
 static struct omap_kp_platform_data nokia770_kp_data = {
-       .rows   = 8,
-       .cols   = 8,
-       .keymap = nokia770_keymap
+       .rows           = 8,
+       .cols           = 8,
+       .keymap         = nokia770_keymap,
+       .keymapsize     = ARRAY_SIZE(nokia770_keymap)
+       .delay          = 4,
 };
 
 static struct platform_device nokia770_kp_device = {
index b742261c97ade63be4e744070d374ab66407bd4e..6b05647a6c01743504650c1021013b19dc367f51 100644 (file)
@@ -266,9 +266,11 @@ static const int osk_keymap[] = {
 };
 
 static struct omap_kp_platform_data osk_kp_data = {
-       .rows   = 8,
-       .cols   = 8,
-       .keymap = (int *) osk_keymap,
+       .rows           = 8,
+       .cols           = 8,
+       .keymap         = (int *) osk_keymap,
+       .keymapsize     = ARRAY_SIZE(osk_keymap),
+       .delay          = 9,
 };
 
 static struct resource osk5912_kp_resources[] = {
index 64b45d8ae357e9e7e3addb767707201672aa6031..fa4be962df67b454c09afc2ea956f11251904825 100644 (file)
@@ -171,9 +171,12 @@ static struct resource kp_resources[] = {
 };
 
 static struct omap_kp_platform_data kp_data = {
-       .rows   = 8,
-       .cols   = 8,
-       .keymap = p2_keymap,
+       .rows           = 8,
+       .cols           = 8,
+       .keymap         = p2_keymap,
+       .keymapsize     = ARRAY_SIZE(p2_keymap),
+       .delay          = 4,
+       .dbounce        = 1,
 };
 
 static struct platform_device kp_device = {
index 4933fce766c8269569b3e4f8bec8843e5c987916..996aeda1285d058e6abe2b39df36bfb5bbcf75b1 100644 (file)
@@ -245,6 +245,7 @@ static struct omap_kp_platform_data h4_kp_data = {
        .rows           = 6,
        .cols           = 7,
        .keymap         = h4_keymap,
+       .keymapsize     = ARRAY_SIZE(h4_keymap),
        .rep            = 1,
        .row_gpios      = row_gpios,
        .col_gpios      = col_gpios,
index f0943d160ffeccc8d02ece3f82d023bc7c68970a..5e658a8744984688ee171e16b67a44aee65c1331 100644 (file)
@@ -171,7 +171,7 @@ good_area:
        if (fsr & (1 << 11)) /* write? */
                mask = VM_WRITE;
        else
-               mask = VM_READ|VM_EXEC;
+               mask = VM_READ|VM_EXEC|VM_WRITE;
 
        fault = VM_FAULT_BADACCESS;
        if (!(vma->vm_flags & mask))
@@ -198,7 +198,7 @@ survive:
                return fault;
        }
 
-       if (tsk->pid != 1)
+       if (!is_init(tsk))
                goto out;
 
        /*
index db63d75d0715927bda8d6379a63dcdb8dd224822..80adbd005fc51812a8a0bc1701e37513c424f5b0 100644 (file)
@@ -194,7 +194,7 @@ EXPORT_SYMBOL(do_settimeofday);
 
 static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-        do_timer(regs);
+        do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index 761938b56679453d350adb663187b4d9b52399ac..a1f6d8a9cc32919084d14b5cf9181dbceb013ca6 100644 (file)
@@ -155,7 +155,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
         */
 good_area:
        if (READ_FAULT(fsr)) /* read? */
-               mask = VM_READ|VM_EXEC;
+               mask = VM_READ|VM_EXEC|VM_WRITE;
        else
                mask = VM_WRITE;
 
@@ -185,7 +185,7 @@ survive:
        }
 
        fault = -3; /* out of memory */
-       if (tsk->pid != 1)
+       if (!is_init(tsk))
                goto out;
 
        /*
index b0e6b5855a381d2096c9a9b581874be3fd5b634e..3e56b9f4358af4a3728c96ed2815eb033a0fc841 100644 (file)
@@ -148,7 +148,7 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
         * Call the generic timer interrupt handler
         */
        write_seqlock(&xtime_lock);
-       do_timer(regs);
+       do_timer(1);
        write_sequnlock(&xtime_lock);
 
        /*
index 9c22b76e129a32a18e49da042a675d23f8756ed2..ebacf1457d914cacae4069c21094639fbc906dd7 100644 (file)
@@ -227,7 +227,7 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        
        /* call the real timer interrupt handler */
 
-       do_timer(regs);
+       do_timer(1);
        
         cris_do_profile(regs); /* Save profiling information */
 
index 50f3f93293d64d33c8b1183a6971faf68eca0912..be0a01657d4fc88076e120b88264977acd25d2ed 100644 (file)
@@ -219,7 +219,7 @@ timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                return IRQ_HANDLED;
 
        /* call the real timer interrupt handler */
-       do_timer(regs);
+       do_timer(1);
 
        /*
         * If we have an externally synchronized Linux clock, then update
index 3d0284bccb940ba2d62c8c3e9e26f099065ff0b4..7e55884135ed8ee2cf460cd0c03c0f223853256d 100644 (file)
@@ -70,7 +70,7 @@ static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
         */
        write_seqlock(&xtime_lock);
 
-       do_timer(regs);
+       do_timer(1);
        update_process_times(user_mode(regs));
        profile_tick(CPU_PROFILING, regs);
 
index 688a5100604c943c614e5ffeb8fef25ba5c9b2fd..e569d17b4ae6b92b5ceccf554795d6cd83070945 100644 (file)
@@ -41,7 +41,7 @@ static void timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
        /* may need to kick the hardware timer */
        platform_timer_eoi();
 
-       do_timer(regs);
+       do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index ff9ce4b5eaa86489fec9dc55b272358ece1bf586..b42f2d914af3bb15eada724c854bc92581f47169 100644 (file)
 #include <linux/smp_lock.h>
 #include <linux/dmi.h>
 #include <linux/suspend.h>
+#include <linux/kthread.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -402,8 +403,6 @@ static int                  realmode_power_off = 1;
 #else
 static int                     realmode_power_off;
 #endif
-static int                     exit_kapmd __read_mostly;
-static int                     kapmd_running __read_mostly;
 #ifdef CONFIG_APM_ALLOW_INTS
 static int                     allow_ints = 1;
 #else
@@ -419,6 +418,8 @@ static const struct desc_struct     bad_bios_desc = { 0, 0x00409200 };
 
 static const char              driver_version[] = "1.16ac";    /* no spaces */
 
+static struct task_struct *kapmd_task;
+
 /*
  *     APM event names taken from the APM 1.2 specification. These are
  *     the message codes that the BIOS uses to tell us about events
@@ -1423,7 +1424,7 @@ static void apm_mainloop(void)
        set_current_state(TASK_INTERRUPTIBLE);
        for (;;) {
                schedule_timeout(APM_CHECK_TIMEOUT);
-               if (exit_kapmd)
+               if (kthread_should_stop())
                        break;
                /*
                 * Ok, check all events, check for idle (and mark us sleeping
@@ -1706,12 +1707,6 @@ static int apm(void *unused)
        char *          power_stat;
        char *          bat_stat;
 
-       kapmd_running = 1;
-
-       daemonize("kapmd");
-
-       current->flags |= PF_NOFREEZE;
-
 #ifdef CONFIG_SMP
        /* 2002/08/01 - WT
         * This is to avoid random crashes at boot time during initialization
@@ -1821,7 +1816,6 @@ static int apm(void *unused)
                console_blank_hook = NULL;
 #endif
        }
-       kapmd_running = 0;
 
        return 0;
 }
@@ -2220,7 +2214,7 @@ static int __init apm_init(void)
 {
        struct proc_dir_entry *apm_proc;
        struct desc_struct *gdt;
-       int ret;
+       int err;
 
        dmi_check_system(apm_dmi_table);
 
@@ -2329,12 +2323,17 @@ static int __init apm_init(void)
        if (apm_proc)
                apm_proc->owner = THIS_MODULE;
 
-       ret = kernel_thread(apm, NULL, CLONE_KERNEL | SIGCHLD);
-       if (ret < 0) {
-               printk(KERN_ERR "apm: disabled - Unable to start kernel thread.\n");
+       kapmd_task = kthread_create(apm, NULL, "kapmd");
+       if (IS_ERR(kapmd_task)) {
+               printk(KERN_ERR "apm: disabled - Unable to start kernel "
+                               "thread.\n");
+               err = PTR_ERR(kapmd_task);
+               kapmd_task = NULL;
                remove_proc_entry("apm", NULL);
-               return -ENOMEM;
+               return err;
        }
+       kapmd_task->flags |= PF_NOFREEZE;
+       wake_up_process(kapmd_task);
 
        if (num_online_cpus() > 1 && !smp ) {
                printk(KERN_NOTICE
@@ -2384,9 +2383,10 @@ static void __exit apm_exit(void)
        remove_proc_entry("apm", NULL);
        if (power_off)
                pm_power_off = NULL;
-       exit_kapmd = 1;
-       while (kapmd_running)
-               schedule();
+       if (kapmd_task) {
+               kthread_stop(kapmd_task);
+               kapmd_task = NULL;
+       }
 #ifdef CONFIG_PM_LEGACY
        pm_active = 0;
 #endif
index fe158042110bea08fd7774234dfdb3c7275712a0..f9436989473c23fa0f57ac4ddea21dc8a2f117f0 100644 (file)
@@ -65,7 +65,7 @@ static unsigned long efi_rt_eflags;
 static DEFINE_SPINLOCK(efi_rt_lock);
 static pgd_t efi_bak_pg_dir_pointer[2];
 
-static void efi_call_phys_prelog(void)
+static void efi_call_phys_prelog(void) __acquires(efi_rt_lock)
 {
        unsigned long cr4;
        unsigned long temp;
@@ -109,7 +109,7 @@ static void efi_call_phys_prelog(void)
        load_gdt(cpu_gdt_descr);
 }
 
-static void efi_call_phys_epilog(void)
+static void efi_call_phys_epilog(void) __releases(efi_rt_lock)
 {
        unsigned long cr4;
        struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, 0);
index 020d873b7d2130584e84906186703c8cd6079498..82b26d5ce476554bd3eb6158cda3d664a6974224 100644 (file)
@@ -102,6 +102,8 @@ u8 x86_cpu_to_apicid[NR_CPUS] __read_mostly =
                        { [0 ... NR_CPUS-1] = 0xff };
 EXPORT_SYMBOL(x86_cpu_to_apicid);
 
+u8 apicid_2_node[MAX_APICID];
+
 /*
  * Trampoline 80x86 program as an array.
  */
@@ -645,7 +647,7 @@ static void map_cpu_to_logical_apicid(void)
 {
        int cpu = smp_processor_id();
        int apicid = logical_smp_processor_id();
-       int node = apicid_to_node(apicid);
+       int node = apicid_to_node(hard_smp_processor_id());
 
        if (!node_online(node))
                node = first_online_node;
@@ -954,6 +956,7 @@ static int __devinit do_boot_cpu(int apicid, int cpu)
 
        irq_ctx_init(cpu);
 
+       x86_cpu_to_apicid[cpu] = apicid;
        /*
         * This grunge runs the startup process for
         * the targeted processor.
index 32413122c4c2650f1114db0f10bb1d8e12c116b8..f7e735c077c35df71c4ae0c2262113f3ea7a92e4 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/nodemask.h>
 #include <asm/srat.h>
 #include <asm/topology.h>
+#include <asm/smp.h>
 
 /*
  * proximity macros and definitions
@@ -54,6 +55,7 @@ struct node_memory_chunk_s {
 static struct node_memory_chunk_s node_memory_chunk[MAXCHUNKS];
 
 static int num_memory_chunks;          /* total number of memory chunks */
+static u8 __initdata apicid_to_pxm[MAX_APICID];
 
 extern void * boot_ioremap(unsigned long, unsigned long);
 
@@ -69,6 +71,8 @@ static void __init parse_cpu_affinity_structure(char *p)
        /* mark this node as "seen" in node bitmap */
        BMAP_SET(pxm_bitmap, cpu_affinity->proximity_domain);
 
+       apicid_to_pxm[cpu_affinity->apic_id] = cpu_affinity->proximity_domain;
+
        printk("CPU 0x%02X in proximity domain 0x%02X\n",
                cpu_affinity->apic_id, cpu_affinity->proximity_domain);
 }
@@ -235,6 +239,9 @@ static int __init acpi20_parse_srat(struct acpi_table_srat *sratp)
        printk("Number of logical nodes in system = %d\n", num_online_nodes());
        printk("Number of memory chunks in system = %d\n", num_memory_chunks);
 
+       for (i = 0; i < MAX_APICID; i++)
+               apicid_2_node[i] = pxm_to_node(apicid_to_pxm[i]);
+
        for (j = 0; j < num_memory_chunks; j++){
                struct node_memory_chunk_s * chunk = &node_memory_chunk[j];
                printk("chunk %d nid %d start_pfn %08lx end_pfn %08lx\n",
index efc7e7d5f4d0f518847b5232f38aad75ea9367f4..08502fc6d0cb8d0fc819682d26b499e5aab08efb 100644 (file)
@@ -739,7 +739,7 @@ survive:
                        retval = get_user_pages(current, current->mm,
                                        (unsigned long )to, 1, 1, 0, &pg, NULL);
 
-                       if (retval == -ENOMEM && current->pid == 1) {
+                       if (retval == -ENOMEM && is_init(current)) {
                                up_read(&current->mm->mmap_sem);
                                blk_congestion_wait(WRITE, HZ/50);
                                goto survive;
index 5e17a3f43b41ba89c15b17e7390f04dc730ada64..2581575786c135a0a0201cf63caf754a8654a755 100644 (file)
@@ -440,7 +440,7 @@ good_area:
                case 1:         /* read, present */
                        goto bad_area;
                case 0:         /* read, not present */
-                       if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
+                       if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
                                goto bad_area;
        }
 
@@ -589,7 +589,7 @@ no_context:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (tsk->pid == 1) {
+       if (is_init(tsk)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index f88e05ba8eb34acd2aac784da0e9c592dcb20ef4..ca2447e05e15d90a70012e4d2b725c8fa9a47e78 100644 (file)
@@ -138,11 +138,14 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
 static void ppro_start(struct op_msrs const * const msrs)
 {
        unsigned int low,high;
+       int i;
 
-       if (reset_value[0]) {
-               CTRL_READ(low, high, msrs, 0);
-               CTRL_SET_ACTIVE(low);
-               CTRL_WRITE(low, high, msrs, 0);
+       for (i = 0; i < NUM_COUNTERS; ++i) {
+               if (reset_value[i]) {
+                       CTRL_READ(low, high, msrs, i);
+                       CTRL_SET_ACTIVE(low);
+                       CTRL_WRITE(low, high, msrs, i);
+               }
        }
 }
 
@@ -150,11 +153,14 @@ static void ppro_start(struct op_msrs const * const msrs)
 static void ppro_stop(struct op_msrs const * const msrs)
 {
        unsigned int low,high;
+       int i;
 
-       if (reset_value[0]) {
-               CTRL_READ(low, high, msrs, 0);
+       for (i = 0; i < NUM_COUNTERS; ++i) {
+               if (!reset_value[i])
+                       continue;
+               CTRL_READ(low, high, msrs, i);
                CTRL_SET_INACTIVE(low);
-               CTRL_WRITE(low, high, msrs, 0);
+               CTRL_WRITE(low, high, msrs, i);
        }
 }
 
index b5195be6281895d3ea6fb42eca4cb4fb5b41308d..e1a1b11473e221a95e2988107f2d45a9572817e8 100644 (file)
@@ -320,7 +320,7 @@ simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
        }
 
        printk(KERN_INFO "simeth_device_event: %s ipaddr=0x%x\n",
-              dev->name, htonl(ifa->ifa_local));
+              dev->name, ntohl(ifa->ifa_local));
 
        /*
         * XXX Fix me
@@ -331,7 +331,7 @@ simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
        local = dev->priv;
        /* now do it for real */
        r = event == NETDEV_UP ?
-               netdev_attach(local->simfd, dev->irq, htonl(ifa->ifa_local)):
+               netdev_attach(local->simfd, dev->irq, ntohl(ifa->ifa_local)):
                netdev_detach(local->simfd);
 
        printk(KERN_INFO "simeth: netdev_attach/detach: event=%s ->%d\n",
index 6928ef0d64d852abc4a41b7ff5cfc2e1f14d5249..16262687a103a1be82d04f8b6acba09d2f7a2bd0 100644 (file)
@@ -78,7 +78,7 @@ timer_interrupt (int irq, void *dev_id, struct pt_regs *regs)
                         * xtime_lock.
                         */
                        write_seqlock(&xtime_lock);
-                       do_timer(regs);
+                       do_timer(1);
                        local_cpu_data->itm_next = new_itm;
                        write_sequnlock(&xtime_lock);
                } else
index 14ef7cceb208bbd45031036cecadfda5e5527487..59f3ab937615fb0fbe40ae08061b3aa47a32a775 100644 (file)
@@ -146,9 +146,11 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
 #              error File is out of sync with <linux/mm.h>.  Please update.
 #      endif
 
+       if (((isr >> IA64_ISR_R_BIT) & 1UL) && (!(vma->vm_flags & (VM_READ | VM_WRITE))))
+               goto bad_area;
+
        mask = (  (((isr >> IA64_ISR_X_BIT) & 1UL) << VM_EXEC_BIT)
-               | (((isr >> IA64_ISR_W_BIT) & 1UL) << VM_WRITE_BIT)
-               | (((isr >> IA64_ISR_R_BIT) & 1UL) << VM_READ_BIT));
+               | (((isr >> IA64_ISR_W_BIT) & 1UL) << VM_WRITE_BIT));
 
        if ((vma->vm_flags & mask) != mask)
                goto bad_area;
@@ -278,7 +280,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
 
   out_of_memory:
        up_read(&mm->mmap_sem);
-       if (current->pid == 1) {
+       if (is_init(current)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index ded0be07a476f62aca9f42ed17ea3f757f0453f0..7a896893cd284b80dbd4d2793dca650ec6032848 100644 (file)
@@ -202,7 +202,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 #ifndef CONFIG_SMP
        profile_tick(CPU_PROFILING, regs);
 #endif
-       do_timer(regs);
+       do_timer(1);
 
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
index dc18a33eefef36ccd10790525b2537e4cae89255..8d5f551b5754305e87474b617b8e437925b48f76 100644 (file)
@@ -299,7 +299,7 @@ no_context:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (tsk->pid == 1) {
+       if (is_init(tsk)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index 98e4b1adfa29f3836cf69ddd339f02017669bff5..1072e4946a4acab38173ba2246773c363782164c 100644 (file)
@@ -40,7 +40,7 @@ static inline int set_rtc_mmss(unsigned long nowtime)
  */
 static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
 {
-       do_timer(regs);
+       do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index aec15270d334b74795fbfdf7ec214434f35a923f..911f2ce3f53e11ec6d1e0deeba875735d5c2a13b 100644 (file)
@@ -144,7 +144,7 @@ good_area:
                case 1:         /* read, present */
                        goto acc_err;
                case 0:         /* read, not present */
-                       if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
+                       if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
                                goto acc_err;
        }
 
@@ -181,7 +181,7 @@ good_area:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (current->pid == 1) {
+       if (is_init(current)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index f18b9d3ef16df601915abadca0d7f9d1df2b2726..dc4ea7e074a620e21e500b66b75ab10c21a31965 100644 (file)
@@ -65,7 +65,7 @@ static irqreturn_t sun3_int5(int irq, void *dev_id, struct pt_regs *fp)
 #ifdef CONFIG_SUN3
        intersil_clear();
 #endif
-        do_timer(fp);
+        do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(fp));
 #endif
index 1db9872722200b91fc56dde75be3781dca13b567..db1e1ce0a34960392e44999cfc1e793e6e93532e 100644 (file)
@@ -51,7 +51,7 @@ static irqreturn_t timer_interrupt(int irq, void *dummy, struct pt_regs * regs)
 
        write_seqlock(&xtime_lock);
 
-       do_timer(regs);
+       do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index 7fbea1bf7b4824afb61d2bacc1c28ab40d1e9458..0a067f3113a54704a454501a14452996ec8b87c2 100644 (file)
@@ -96,7 +96,7 @@ void mips_timer_interrupt(struct pt_regs *regs)
                timerlo = count;
 
                kstat_this_cpu.irqs[irq]++;
-               do_timer(regs);
+               do_timer(1);
 #ifndef CONFIG_SMP
                update_process_times(user_mode(regs));
 #endif
@@ -137,7 +137,7 @@ irqreturn_t counter0_irq(int irq, void *dev_id, struct pt_regs *regs)
        }
 
        while (time_elapsed > 0) {
-               do_timer(regs);
+               do_timer(1);
 #ifndef CONFIG_SMP
                update_process_times(user_mode(regs));
 #endif
@@ -156,7 +156,7 @@ irqreturn_t counter0_irq(int irq, void *dev_id, struct pt_regs *regs)
 
        if (jiffie_drift >= 999) {
                jiffie_drift -= 999;
-               do_timer(regs); /* increment jiffies by one */
+               do_timer(1); /* increment jiffies by one */
 #ifndef CONFIG_SMP
                update_process_times(user_mode(regs));
 #endif
index d837b26fbe517e5602be5aec2ae5cb4d3b4ff244..7feca49350d18b4bc6ea2ed630c09bbfb3fd1937 100644 (file)
@@ -34,7 +34,7 @@ static void gt64120_irq(int irq, void *dev_id, struct pt_regs *regs)
        if (irq_src & 0x00000800) {     /* Check for timer interrupt */
                handled = 1;
                irq_src &= ~0x00000800;
-               do_timer(regs);
+               do_timer(1);
 #ifndef CONFIG_SMP
                update_process_times(user_mode(regs));
 #endif
index 170cb67f4ede504d67f38072a14735056daad8c2..6ab8d975a974213a3e7fe3c16014ebe4279d9c50 100644 (file)
@@ -434,7 +434,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        /*
         * call the generic timer interrupt handling
         */
-       do_timer(regs);
+       do_timer(1);
 
        /*
         * If we have an externally synchronized Linux clock, then update
index a4f8c45c4e8ede95a018f85da394317a88153ba4..8423d859077949520de140f5b03d7cfdecda92e1 100644 (file)
@@ -171,7 +171,7 @@ no_context:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (tsk->pid == 1) {
+       if (is_init(tsk)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index 9fb2493fff02494c0bb8789d4e273f5ac786c4c4..6cd87cf0195a1ca8ce2dea022502527054ff1aec 100644 (file)
@@ -133,7 +133,7 @@ static irqreturn_t gt64240_p0int_irq(int irq, void *dev, struct pt_regs *regs)
                MV_WRITE(TIMER_COUNTER_0_3_INTERRUPT_CAUSE, 0x0);
 
                /* handle the timer call */
-               do_timer(regs);
+               do_timer(1);
 #ifndef CONFIG_SMP
                update_process_times(user_mode(regs));
 #endif
index b029ba79c27af0f685079ba562c3d980122cc884..c62a3a9ef867fa6e3af03ecb773b8418e3ebed37 100644 (file)
@@ -111,7 +111,7 @@ again:
        kstat_this_cpu.irqs[irq]++;             /* kstat only for bootcpu? */
 
        if (cpu == 0)
-               do_timer(regs);
+               do_timer(1);
 
        update_process_times(user_mode(regs));
 
index aee311884f3fa114c2a4fa5f5f4b0dc4fbe2d5f3..f50b982b0834ce8b2598d1b66d1c06b5306ca29f 100644 (file)
@@ -27,7 +27,7 @@
  *    - SEGREL32 handling
  *      We are not doing SEGREL32 handling correctly. According to the ABI, we
  *      should do a value offset, like this:
- *                     if (is_init(me, (void *)val))
+ *                     if (in_init(me, (void *)val))
  *                             val -= (uint32_t)me->module_init;
  *                     else
  *                             val -= (uint32_t)me->module_core;
 
 /* three functions to determine where in the module core
  * or init pieces the location is */
-static inline int is_init(struct module *me, void *loc)
+static inline int in_init(struct module *me, void *loc)
 {
        return (loc >= me->module_init &&
                loc <= (me->module_init + me->init_size));
 }
 
-static inline int is_core(struct module *me, void *loc)
+static inline int in_core(struct module *me, void *loc)
 {
        return (loc >= me->module_core &&
                loc <= (me->module_core + me->core_size));
 }
 
-static inline int is_local(struct module *me, void *loc)
+static inline int in_local(struct module *me, void *loc)
 {
-       return is_init(me, loc) || is_core(me, loc);
+       return in_init(me, loc) || in_core(me, loc);
 }
 
-static inline int is_local_section(struct module *me, void *loc, void *dot)
+static inline int in_local_section(struct module *me, void *loc, void *dot)
 {
-       return (is_init(me, loc) && is_init(me, dot)) ||
-               (is_core(me, loc) && is_core(me, dot));
+       return (in_init(me, loc) && in_init(me, dot)) ||
+               (in_core(me, loc) && in_core(me, dot));
 }
 
 
@@ -566,14 +566,14 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
                        break;
                case R_PARISC_PCREL17F:
                        /* 17-bit PC relative address */
-                       val = get_stub(me, val, addend, ELF_STUB_GOT, is_init(me, loc));
+                       val = get_stub(me, val, addend, ELF_STUB_GOT, in_init(me, loc));
                        val = (val - dot - 8)/4;
                        CHECK_RELOC(val, 17)
                        *loc = (*loc & ~0x1f1ffd) | reassemble_17(val);
                        break;
                case R_PARISC_PCREL22F:
                        /* 22-bit PC relative address; only defined for pa20 */
-                       val = get_stub(me, val, addend, ELF_STUB_GOT, is_init(me, loc));
+                       val = get_stub(me, val, addend, ELF_STUB_GOT, in_init(me, loc));
                        DEBUGP("STUB FOR %s loc %lx+%lx at %lx\n", 
                               strtab + sym->st_name, (unsigned long)loc, addend, 
                               val)
@@ -670,9 +670,9 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
                               strtab + sym->st_name,
                               loc, val);
                        /* can we reach it locally? */
-                       if(!is_local_section(me, (void *)val, (void *)dot)) {
+                       if(!in_local_section(me, (void *)val, (void *)dot)) {
 
-                               if (is_local(me, (void *)val))
+                               if (in_local(me, (void *)val))
                                        /* this is the case where the
                                         * symbol is local to the
                                         * module, but in a different
@@ -680,14 +680,14 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
                                         * in case it's more than 22
                                         * bits away */
                                        val = get_stub(me, val, addend, ELF_STUB_DIRECT,
-                                                      is_init(me, loc));
+                                                      in_init(me, loc));
                                else if (strncmp(strtab + sym->st_name, "$$", 2)
                                    == 0)
                                        val = get_stub(me, val, addend, ELF_STUB_MILLI,
-                                                      is_init(me, loc));
+                                                      in_init(me, loc));
                                else
                                        val = get_stub(me, val, addend, ELF_STUB_GOT,
-                                                      is_init(me, loc));
+                                                      in_init(me, loc));
                        }
                        DEBUGP("STUB FOR %s loc %lx, val %lx+%lx at %lx\n", 
                               strtab + sym->st_name, loc, sym->st_value,
@@ -720,7 +720,7 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
                        break;
                case R_PARISC_FPTR64:
                        /* 64-bit function address */
-                       if(is_local(me, (void *)(val + addend))) {
+                       if(in_local(me, (void *)(val + addend))) {
                                *loc64 = get_fdesc(me, val+addend);
                                DEBUGP("FDESC for %s at %p points to %lx\n",
                                       strtab + sym->st_name, *loc64,
index 5facc9bff4ef68b584aa32fb263b99461e90eb77..700df10924dd8d671b9ae1d6f62b8763ad3f1c0a 100644 (file)
@@ -79,7 +79,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 #endif
                if (cpu == 0) {
                        write_seqlock(&xtime_lock);
-                       do_timer(regs);
+                       do_timer(1);
                        write_sequnlock(&xtime_lock);
                }
        }
index 7a3c3f791ade2aaac30bbadc0994da40ea12e80a..71f71da98e7deb6288a9acdeb6a0449e493787b6 100644 (file)
@@ -693,7 +693,7 @@ void timer_interrupt(struct pt_regs * regs)
                tb_next_jiffy = tb_last_jiffy + tb_ticks_per_jiffy;
                if (per_cpu(last_jiffy, cpu) >= tb_next_jiffy) {
                        tb_last_jiffy = tb_next_jiffy;
-                       do_timer(regs);
+                       do_timer(1);
                        timer_recalc_offset(tb_last_jiffy);
                        timer_check_rtc();
                }
index 78a0d59903ee69d2b8ac96de20e18c17fd5f9206..e8fa50624b70dae41c27ce669e10f472b18970a8 100644 (file)
@@ -333,7 +333,7 @@ good_area:
                /* protection fault */
                if (error_code & 0x08000000)
                        goto bad_area;
-               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
+               if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
                        goto bad_area;
        }
 
@@ -386,7 +386,7 @@ bad_area_nosemaphore:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (current->pid == 1) {
+       if (is_init(current)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index 903115d67fdcc5230b718abb6dfb25038881d5b8..311ed1993fc036de995f444bac92d1a327236c89 100644 (file)
@@ -337,7 +337,7 @@ static int recover_mce(struct pt_regs *regs, struct rtas_error_log * err)
                   err->disposition == RTAS_DISP_NOT_RECOVERED &&
                   err->target == RTAS_TARGET_MEMORY &&
                   err->type == RTAS_TYPE_ECC_UNCORR &&
-                  !(current->pid == 0 || current->pid == 1)) {
+                  !(current->pid == 0 || is_init(current))) {
                /* Kill off a user process with an ECC error */
                printk(KERN_ERR "MCE: uncorrectable ecc error for pid %d\n",
                       current->pid);
index 6ab8cc7226ab232b220d9d555f0ed66358c0f6c0..1e1f315547671503d0370a2e36bb31eb071b7167 100644 (file)
@@ -153,7 +153,7 @@ void timer_interrupt(struct pt_regs * regs)
                /* We are in an interrupt, no need to save/restore flags */
                write_seqlock(&xtime_lock);
                tb_last_stamp = jiffy_stamp;
-               do_timer(regs);
+               do_timer(1);
 
                /*
                 * update the rtc when needed, this should be performed on the
index d7a433049b4857b3acf2caa59e6f7c981d1c5f21..aafc8e8893d1ebc0ac969b097f77d9f976d616ee 100644 (file)
@@ -119,7 +119,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
         * generate the same exception over and over again and we get
         * nowhere.  Better to kill it and let the kernel panic.
         */
-       if (current->pid == 1) {
+       if (is_init(current)) {
                __sighandler_t handler;
 
                spin_lock_irq(&current->sighand->siglock);
index 5cdfb71fcb078ca50f56059a907e0104ab452194..465f451f3bc3a8a95908dcaa4d31757e04bc9f26 100644 (file)
@@ -239,7 +239,7 @@ good_area:
                /* protection fault */
                if (error_code & 0x08000000)
                        goto bad_area;
-               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
+               if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
                        goto bad_area;
        }
 
@@ -291,7 +291,7 @@ bad_area:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (current->pid == 1) {
+       if (is_init(current)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index 9a8f6ff216529be88bf8557d7bd787866056b3eb..2b1e6c9a6e0e539826a3a8d45181ec5a7c72e76c 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/errno.h>
 #include <linux/interrupt.h>
 #include <linux/proc_fs.h>
-#include <linux/page-flags.h>
+#include <linux/mm.h>
 #include <linux/swap.h>
 #include <linux/pagemap.h>
 #include <linux/sysctl.h>
index 1981c6199fa20c559aefaf671565b09a3d10a22b..abab42e9f5f8718cfcda91702803e8d797f70544 100644 (file)
@@ -166,7 +166,7 @@ EXPORT_SYMBOL(do_settimeofday);
 void account_ticks(struct pt_regs *regs)
 {
        __u64 tmp;
-       __u32 ticks, xticks;
+       __u32 ticks;
 
        /* Calculate how many ticks have passed. */
        if (S390_lowcore.int_clock < S390_lowcore.jiffy_timer) {
@@ -204,6 +204,7 @@ void account_ticks(struct pt_regs *regs)
         */
        write_seqlock(&xtime_lock);
        if (S390_lowcore.jiffy_timer > xtime_cc) {
+               __u32 xticks;
                tmp = S390_lowcore.jiffy_timer - xtime_cc;
                if (tmp >= 2*CLK_TICKS_PER_JIFFY) {
                        xticks = __div(tmp, CLK_TICKS_PER_JIFFY);
@@ -212,13 +213,11 @@ void account_ticks(struct pt_regs *regs)
                        xticks = 1;
                        xtime_cc += CLK_TICKS_PER_JIFFY;
                }
-               while (xticks--)
-                       do_timer(regs);
+               do_timer(xticks);
        }
        write_sequnlock(&xtime_lock);
 #else
-       for (xticks = ticks; xticks > 0; xticks--)
-               do_timer(regs);
+       do_timer(ticks);
 #endif
 
 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
index f2b9a84dc2bff3e424be20442a1835146c7f2924..9c3c19fe62fcd99dfb3893730d7f54b354b731f5 100644 (file)
@@ -353,7 +353,7 @@ no_context:
 */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (tsk->pid == 1) {
+       if (is_init(tsk)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index 149d9713eddf0432ff8321972cd31320652f4c30..f664a196c4f58dd635cd6ec960fd7808a8e8532f 100644 (file)
@@ -117,7 +117,7 @@ static long last_rtc_update;
  */
 void handle_timer_tick(struct pt_regs *regs)
 {
-       do_timer(regs);
+       do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index c69fd603226aa80a20ba084aebd545e65c5142c3..68663b8f99aec28619ea7cb92d16978c5a08be25 100644 (file)
@@ -69,7 +69,7 @@ good_area:
                if (!(vma->vm_flags & VM_WRITE))
                        goto bad_area;
        } else {
-               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
+               if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
                        goto bad_area;
        }
 
@@ -149,7 +149,7 @@ no_context:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (current->pid == 1) {
+       if (is_init(current)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index b8162e59030e447c6fcc1d12cdb0c59e15ce34e6..3b61e06f9d7258622d9aaa6123d433b66dd0f7d9 100644 (file)
@@ -298,7 +298,7 @@ static inline void do_timer_interrupt(int irq, struct pt_regs *regs)
        asm ("getcon cr62, %0" : "=r" (current_ctc));
        ctc_last_interrupt = (unsigned long) current_ctc;
 
-       do_timer(regs);
+       do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index f08d0eaf6497d34c716d8f0c5ee4baf2aa4eb27c..8e2f6c28b7390fc712a8d07f8e8e567fbd7b6853 100644 (file)
@@ -277,7 +277,7 @@ bad_area:
                        show_regs(regs);
 #endif
                }
-               if (tsk->pid == 1) {
+               if (is_init(tsk)) {
                        panic("INIT had user mode bad_area\n");
                }
                tsk->thread.address = address;
@@ -319,14 +319,14 @@ no_context:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-       if (current->pid == 1) {
+       if (is_init(current)) {
                panic("INIT out of memory\n");
                yield();
                goto survive;
        }
        printk("fault:Out of memory\n");
        up_read(&mm->mmap_sem);
-       if (current->pid == 1) {
+       if (is_init(current)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index bfd31aac2df3b2c7992f082fd08b9f5ba78da4c2..e19b1bad9bc56e0c1710c4c1d006b6867fdc5984 100644 (file)
@@ -712,7 +712,7 @@ static irqreturn_t pcic_timer_handler (int irq, void *h, struct pt_regs *regs)
 {
        write_seqlock(&xtime_lock);     /* Dummy, to show that we remember */
        pcic_clear_clock_irq();
-       do_timer(regs);
+       do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index 845081b0126760ac14e8b7c2735ad089bee991f2..6f84fa1b58e5e54b94c8ce42b05ee82c484c837b 100644 (file)
@@ -128,7 +128,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
 #endif
        clear_clock_irq();
 
-       do_timer(regs);
+       do_timer(1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index b0b4feeec09826f84a70e29d9ad8b77d6347ab7c..ca1193482f07d2df1cd292bd6cce62531bad3426 100644 (file)
@@ -465,7 +465,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
                profile_tick(CPU_PROFILING, regs);
                update_process_times(user_mode(regs));
 #endif
-               do_timer(regs);
+               do_timer(1);
 
                /* Guarantee that the following sequences execute
                 * uninterrupted.
@@ -496,7 +496,7 @@ void timer_tick_interrupt(struct pt_regs *regs)
 {
        write_seqlock(&xtime_lock);
 
-       do_timer(regs);
+       do_timer(1);
 
        timer_check_rtc();
 
index 642541769a179970c077dba52e23c2d1d90984a3..9c581328e76a191e3b4aa4903840276db2c3aab2 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/limits.h>
 #include <linux/mm.h>
 #include <linux/smp.h>
+#include <linux/tty.h>
 #include <linux/mman.h>
 #include <linux/file.h>
 #include <linux/timex.h>
@@ -422,7 +423,9 @@ asmlinkage int solaris_procids(int cmd, s32 pid, s32 pgid)
                           Solaris setpgrp and setsid? */
                        ret = sys_setpgid(0, 0);
                        if (ret) return ret;
+                       mutex_lock(&tty_mutex);
                        current->signal->tty = NULL;
+                       mutex_unlock(&tty_mutex);
                        return process_group(current);
                }
        case 2: /* getsid */
index 79610b5ce67ed5978aa5b74ee109411616c76e60..773a134e7fdb806fd6b63c80ceb3576ede57a370 100644 (file)
@@ -598,6 +598,11 @@ out:
        mconsole_reply(req, err_msg, err, 0);
 }
 
+struct mconsole_output {
+       struct list_head list;
+       struct mc_request *req;
+};
+
 static DEFINE_SPINLOCK(console_lock);
 static LIST_HEAD(clients);
 static char console_buf[MCONSOLE_MAX_DATA];
@@ -622,10 +627,10 @@ static void console_write(struct console *console, const char *string,
                        return;
 
                list_for_each(ele, &clients){
-                       struct mconsole_entry *entry;
+                       struct mconsole_output *entry;
 
-                       entry = list_entry(ele, struct mconsole_entry, list);
-                       mconsole_reply_len(&entry->request, console_buf,
+                       entry = list_entry(ele, struct mconsole_output, list);
+                       mconsole_reply_len(entry->req, console_buf,
                                           console_index, 0, 1);
                }
 
@@ -649,10 +654,10 @@ late_initcall(mc_add_console);
 static void with_console(struct mc_request *req, void (*proc)(void *),
                         void *arg)
 {
-       struct mconsole_entry entry;
+       struct mconsole_output entry;
        unsigned long flags;
 
-       entry.request = *req;
+       entry.req = req;
        list_add(&entry.list, &clients);
        spin_lock_irqsave(&console_lock, flags);
 
index 5b2f5fe9e426d3d45043bae9a49badb804a9426e..17068eb746c0bda5204a8ffd49ee0ab5de16c46a 100644 (file)
@@ -131,6 +131,10 @@ int mconsole_get_request(int fd, struct mc_request *req)
 int mconsole_reply_len(struct mc_request *req, const char *str, int total,
                       int err, int more)
 {
+       /* XXX This is a stack consumption problem.  It'd be nice to
+        * make it global and serialize access to it, but there are a
+        * ton of callers to this function.
+        */
        struct mconsole_reply reply;
        int len, n;
 
index 664c2e2fb8209de464e27a951407e7d9fb58ae56..16aa572325c9b4870c0fd2feacda2154a0a83119 100644 (file)
@@ -119,11 +119,6 @@ static int uml_net_open(struct net_device *dev)
                goto out;
        }
 
-       if(!lp->have_mac){
-               dev_ip_addr(dev, &lp->mac[2]);
-               set_ether_mac(dev, lp->mac);
-       }
-
        lp->fd = (*lp->open)(&lp->user);
        if(lp->fd < 0){
                err = lp->fd;
@@ -287,6 +282,37 @@ void uml_net_user_timer_expire(unsigned long _conn)
 #endif
 }
 
+static void setup_etheraddr(char *str, unsigned char *addr)
+{
+       char *end;
+       int i;
+
+       if(str == NULL)
+               goto random;
+
+       for(i=0;i<6;i++){
+               addr[i] = simple_strtoul(str, &end, 16);
+               if((end == str) ||
+                  ((*end != ':') && (*end != ',') && (*end != '\0'))){
+                       printk(KERN_ERR
+                              "setup_etheraddr: failed to parse '%s' "
+                              "as an ethernet address\n", str);
+                       goto random;
+               }
+               str = end + 1;
+       }
+       if(addr[0] & 1){
+               printk(KERN_ERR
+                      "Attempt to assign a broadcast ethernet address to a "
+                      "device disallowed\n");
+               goto random;
+       }
+       return;
+
+random:
+       random_ether_addr(addr)
+}
+
 static DEFINE_SPINLOCK(devices_lock);
 static LIST_HEAD(devices);
 
@@ -322,15 +348,13 @@ static int eth_configure(int n, void *init, char *mac,
        list_add(&device->list, &devices);
        spin_unlock(&devices_lock);
 
-       if (setup_etheraddr(mac, device->mac))
-               device->have_mac = 1;
+       setup_etheraddr(mac, device->mac);
 
        printk(KERN_INFO "Netdevice %d ", n);
-       if (device->have_mac)
-               printk("(%02x:%02x:%02x:%02x:%02x:%02x) ",
-                      device->mac[0], device->mac[1],
-                      device->mac[2], device->mac[3],
-                      device->mac[4], device->mac[5]);
+       printk("(%02x:%02x:%02x:%02x:%02x:%02x) ",
+              device->mac[0], device->mac[1],
+              device->mac[2], device->mac[3],
+              device->mac[4], device->mac[5]);
        printk(": ");
        dev = alloc_etherdev(size);
        if (dev == NULL) {
@@ -396,7 +420,6 @@ static int eth_configure(int n, void *init, char *mac,
                  .dev                  = dev,
                  .fd                   = -1,
                  .mac                  = { 0xfe, 0xfd, 0x0, 0x0, 0x0, 0x0},
-                 .have_mac             = device->have_mac,
                  .protocol             = transport->kern->protocol,
                  .open                 = transport->user->open,
                  .close                = transport->user->close,
@@ -411,14 +434,12 @@ static int eth_configure(int n, void *init, char *mac,
        init_timer(&lp->tl);
        spin_lock_init(&lp->lock);
        lp->tl.function = uml_net_user_timer_expire;
-       if (lp->have_mac)
-               memcpy(lp->mac, device->mac, sizeof(lp->mac));
+       memcpy(lp->mac, device->mac, sizeof(lp->mac));
 
        if (transport->user->init) 
                (*transport->user->init)(&lp->user, dev);
 
-       if (device->have_mac)
-               set_ether_mac(dev, device->mac);
+       set_ether_mac(dev, device->mac);
 
        return 0;
 }
@@ -747,47 +768,6 @@ static void close_devices(void)
 
 __uml_exitcall(close_devices);
 
-int setup_etheraddr(char *str, unsigned char *addr)
-{
-       char *end;
-       int i;
-
-       if(str == NULL)
-               return(0);
-       for(i=0;i<6;i++){
-               addr[i] = simple_strtoul(str, &end, 16);
-               if((end == str) ||
-                  ((*end != ':') && (*end != ',') && (*end != '\0'))){
-                       printk(KERN_ERR 
-                              "setup_etheraddr: failed to parse '%s' "
-                              "as an ethernet address\n", str);
-                       return(0);
-               }
-               str = end + 1;
-       }
-       if(addr[0] & 1){
-               printk(KERN_ERR 
-                      "Attempt to assign a broadcast ethernet address to a "
-                      "device disallowed\n");
-               return(0);
-       }
-       return(1);
-}
-
-void dev_ip_addr(void *d, unsigned char *bin_buf)
-{
-       struct net_device *dev = d;
-       struct in_device *ip = dev->ip_ptr;
-       struct in_ifaddr *in;
-
-       if((ip == NULL) || ((in = ip->ifa_list) == NULL)){
-               printk(KERN_WARNING "dev_ip_addr - device not assigned an "
-                      "IP address\n");
-               return;
-       }
-       memcpy(bin_buf, &in->ifa_address, sizeof(in->ifa_address));
-}
-
 struct sk_buff *ether_adjust_skb(struct sk_buff *skb, int extra)
 {
        if((skb != NULL) && (skb_tailroom(skb) < extra)){
@@ -825,7 +805,7 @@ int dev_netmask(void *d, void *m)
        struct net_device *dev = d;
        struct in_device *ip = dev->ip_ptr;
        struct in_ifaddr *in;
-       __u32 *mask_out = m;
+       __be32 *mask_out = m;
 
        if(ip == NULL) 
                return(1);
index 107c5e43fa00fec37d6fcf8c3b01851274a9b87e..f3a3f8a29c7af877d327692f2f30f89a7ef6f081 100644 (file)
@@ -12,6 +12,7 @@
 #include <string.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
+#include <sys/time.h>
 #include "user.h"
 #include "user_util.h"
 #include "kern_util.h"
index 3683ed44315d6e2da21707c9293bf82eb22e326b..9016c68beee8d3287761b1da07001c5915bde7c6 100644 (file)
@@ -8,6 +8,7 @@
 #include "chan_user.h"
 #include "os.h"
 
+/* This address is used only as a unique identifer */
 static int null_chan;
 
 static void *null_init(char *str, int device, const struct chan_opts *opts)
index ae9909415b9cdb372c1f1f0c1602a21a4c2e86b3..73b2bdd6d2d3b867165e116b7a1b430f34096c9b 100644 (file)
 
 #define RNG_MISCDEV_MINOR              183 /* official */
 
+/* Changed at init time, in the non-modular case, and at module load
+ * time, in the module case.  Presumably, the module subsystem
+ * protects against a module being loaded twice at the same time.
+ */
 static int random_fd = -1;
 
 static int rng_dev_open (struct inode *inode, struct file *filp)
index 6d2cf32a9e8f880eeaf7439e874ef4640f3ec7dc..911539293871d271ed306c36fd1b113f6acc9203 100644 (file)
@@ -9,6 +9,8 @@
 /*
  * Don't register by default -- as this registeres very early in the
  * boot process it becomes the default console.
+ *
+ * Initialized at init time.
  */
 static int use_stderr_console = 0;
 
index 5e44adb07051723333236caa67d9358e2cb7aabc..e4bfcfe8550ba91cc7515c3d3bd46bd7e39ba325 100644 (file)
@@ -108,6 +108,7 @@ static int con_open(struct tty_struct *tty, struct file *filp)
        return line_open(vts, tty);
 }
 
+/* Set in an initcall, checked in an exitcall */
 static int con_init_done = 0;
 
 static const struct tty_operations console_ops = {
index 34085315aa57e045232a20abeea45ec1111dda79..5fa4c8e258a4e4d76d9406b5e002589e6c042374 100644 (file)
@@ -668,18 +668,15 @@ static int ubd_add(int n)
        if(dev->file == NULL)
                goto out;
 
-       if (ubd_open_dev(dev))
-               goto out;
-
        err = ubd_file_size(dev, &dev->size);
        if(err < 0)
-               goto out_close;
+               goto out;
 
        dev->size = ROUND_BLOCK(dev->size);
 
        err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]);
        if(err)
-               goto out_close;
+               goto out;
 
        if(fake_major != MAJOR_NR)
                ubd_new_disk(fake_major, dev->size, n,
@@ -691,8 +688,6 @@ static int ubd_add(int n)
                make_ide_entries(ubd_gendisk[n]->disk_name);
 
        err = 0;
-out_close:
-       ubd_close(dev);
 out:
        return err;
 }
index 769fba43ee039a2bfb93fd33d32f23a49ba623cd..280459fb0b2619ded00ce874565a5d6c93ef6c49 100644 (file)
@@ -18,7 +18,6 @@ struct uml_net {
        struct platform_device pdev;
        int index;
        unsigned char mac[ETH_ALEN];
-       int have_mac;
 };
 
 struct uml_net_private {
@@ -29,7 +28,6 @@ struct uml_net_private {
        struct net_device_stats stats;
        int fd;
        unsigned char mac[ETH_ALEN];
-       int have_mac;
        unsigned short (*protocol)(struct sk_buff *);
        int (*open)(void *);
        void (*close)(int, void *);
@@ -62,7 +60,6 @@ struct transport {
 
 extern struct net_device *ether_init(int);
 extern unsigned short ether_protocol(struct sk_buff *);
-extern int setup_etheraddr(char *str, unsigned char *addr);
 extern struct sk_buff *ether_adjust_skb(struct sk_buff *skb, int extra);
 extern int tap_setup_common(char *str, char *type, char **dev_name, 
                            char **mac_out, char **gate_addr);
@@ -70,14 +67,3 @@ extern void register_transport(struct transport *new);
 extern unsigned short eth_protocol(struct sk_buff *skb);
 
 #endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
index 47ef7cb49a8e3f19619d7417ca856c7762907f3c..19f207cd70fe4b3bf6ed33dee917a58622055d9a 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
  * Licensed under the GPL
  */
@@ -25,9 +25,8 @@ struct net_user_info {
 };
 
 extern void ether_user_init(void *data, void *dev);
-extern void dev_ip_addr(void *d, unsigned char *bin_buf);
-extern void iter_addresses(void *d, void (*cb)(unsigned char *, 
-                                              unsigned char *, void *), 
+extern void iter_addresses(void *d, void (*cb)(unsigned char *,
+                                              unsigned char *, void *),
                           void *arg);
 
 extern void *get_output_buffer(int *len_out);
@@ -52,14 +51,3 @@ extern char *split_if_spec(char *str, ...);
 extern int dev_netmask(void *d, void *m);
 
 #endif
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only.  This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */
index d21ebad666b4246f45c99d2667dbcc82702b6f6c..8b7f2cdedf945148ffd96306ac04024dc9a0a7ee 100644 (file)
@@ -16,9 +16,13 @@ int uml_exitcode = 0;
 static int read_proc_exitcode(char *page, char **start, off_t off,
                              int count, int *eof, void *data)
 {
-       int len;
+       int len, val;
 
-       len = sprintf(page, "%d\n", uml_exitcode);
+       /* Save uml_exitcode in a local so that we don't need to guarantee
+        * that sprintf accesses it atomically.
+        */
+       val = uml_exitcode;
+       len = sprintf(page, "%d\n", val);
        len -= off;
        if(len <= off+count) *eof = 1;
        *start = page + off;
index 79c22707a6375c84cbda0f89df31abf0eda28836..4cd2ff546ef6f9d322b2f882ca182bf5315cf7c9 100644 (file)
@@ -61,8 +61,10 @@ static int init_stub_pte(struct mm_struct *mm, unsigned long proc,
 #endif
 
        *pte = mk_pte(virt_to_page(kernel), __pgprot(_PAGE_PRESENT));
-       *pte = pte_mkexec(*pte);
-       *pte = pte_wrprotect(*pte);
+       /* This is wrong for the code page, but it doesn't matter since the
+        * stub is mapped by hand with the correct permissions.
+        */
+       *pte = pte_mkwrite(*pte);
        return(0);
 
  out_pmd:
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c
deleted file mode 100644 (file)
index 0f3d5d0..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
- * Copyright 2003 PathScale, Inc.
- * Licensed under the GPL
- */
-
-#include "linux/config.h"
-#include "linux/kernel.h"
-#include "linux/sched.h"
-#include "linux/interrupt.h"
-#include "linux/string.h"
-#include "linux/mm.h"
-#include "linux/slab.h"
-#include "linux/utsname.h"
-#include "linux/fs.h"
-#include "linux/utime.h"
-#include "linux/smp_lock.h"
-#include "linux/module.h"
-#include "linux/init.h"
-#include "linux/capability.h"
-#include "linux/vmalloc.h"
-#include "linux/spinlock.h"
-#include "linux/proc_fs.h"
-#include "linux/ptrace.h"
-#include "linux/random.h"
-#include "linux/personality.h"
-#include "asm/unistd.h"
-#include "asm/mman.h"
-#include "asm/segment.h"
-#include "asm/stat.h"
-#include "asm/pgtable.h"
-#include "asm/processor.h"
-#include "asm/tlbflush.h"
-#include "asm/uaccess.h"
-#include "asm/user.h"
-#include "user_util.h"
-#include "kern_util.h"
-#include "kern.h"
-#include "signal_kern.h"
-#include "init.h"
-#include "irq_user.h"
-#include "mem_user.h"
-#include "tlb.h"
-#include "frame_kern.h"
-#include "sigcontext.h"
-#include "os.h"
-#include "mode.h"
-#include "mode_kern.h"
-#include "choose-mode.h"
-
-/* This is a per-cpu array.  A processor only modifies its entry and it only
- * cares about its entry, so it's OK if another processor is modifying its
- * entry.
- */
-struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } };
-
-int external_pid(void *t)
-{
-       struct task_struct *task = t ? t : current;
-
-       return(CHOOSE_MODE_PROC(external_pid_tt, external_pid_skas, task));
-}
-
-int pid_to_processor_id(int pid)
-{
-       int i;
-
-       for(i = 0; i < ncpus; i++){
-               if(cpu_tasks[i].pid == pid) return(i);
-       }
-       return(-1);
-}
-
-void free_stack(unsigned long stack, int order)
-{
-       free_pages(stack, order);
-}
-
-unsigned long alloc_stack(int order, int atomic)
-{
-       unsigned long page;
-       gfp_t flags = GFP_KERNEL;
-
-       if (atomic)
-               flags = GFP_ATOMIC;
-       page = __get_free_pages(flags, order);
-       if(page == 0)
-               return(0);
-       stack_protections(page);
-       return(page);
-}
-
-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
-{
-       int pid;
-
-       current->thread.request.u.thread.proc = fn;
-       current->thread.request.u.thread.arg = arg;
-       pid = do_fork(CLONE_VM | CLONE_UNTRACED | flags, 0,
-                     &current->thread.regs, 0, NULL, NULL);
-       if(pid < 0)
-               panic("do_fork failed in kernel_thread, errno = %d", pid);
-       return(pid);
-}
-
-void set_current(void *t)
-{
-       struct task_struct *task = t;
-
-       cpu_tasks[task_thread_info(task)->cpu] = ((struct cpu_task)
-               { external_pid(task), task });
-}
-
-void *_switch_to(void *prev, void *next, void *last)
-{
-        struct task_struct *from = prev;
-        struct task_struct *to= next;
-
-        to->thread.prev_sched = from;
-        set_current(to);
-
-       do {
-               current->thread.saved_task = NULL ;
-               CHOOSE_MODE_PROC(switch_to_tt, switch_to_skas, prev, next);
-               if(current->thread.saved_task)
-                       show_regs(&(current->thread.regs));
-               next= current->thread.saved_task;
-               prev= current;
-       } while(current->thread.saved_task);
-
-        return(current->thread.prev_sched);
-
-}
-
-void interrupt_end(void)
-{
-       if(need_resched()) schedule();
-       if(test_tsk_thread_flag(current, TIF_SIGPENDING)) do_signal();
-}
-
-void release_thread(struct task_struct *task)
-{
-       CHOOSE_MODE(release_thread_tt(task), release_thread_skas(task));
-}
-
-void exit_thread(void)
-{
-       unprotect_stack((unsigned long) current_thread);
-}
-
-void *get_current(void)
-{
-       return(current);
-}
-
-int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
-               unsigned long stack_top, struct task_struct * p,
-               struct pt_regs *regs)
-{
-       int ret;
-
-       p->thread = (struct thread_struct) INIT_THREAD;
-       ret = CHOOSE_MODE_PROC(copy_thread_tt, copy_thread_skas, nr,
-                               clone_flags, sp, stack_top, p, regs);
-
-       if (ret || !current->thread.forking)
-               goto out;
-
-       clear_flushed_tls(p);
-
-       /*
-        * Set a new TLS for the child thread?
-        */
-       if (clone_flags & CLONE_SETTLS)
-               ret = arch_copy_tls(p);
-
-out:
-       return ret;
-}
-
-void initial_thread_cb(void (*proc)(void *), void *arg)
-{
-       int save_kmalloc_ok = kmalloc_ok;
-
-       kmalloc_ok = 0;
-       CHOOSE_MODE_PROC(initial_thread_cb_tt, initial_thread_cb_skas, proc,
-                        arg);
-       kmalloc_ok = save_kmalloc_ok;
-}
-
-unsigned long stack_sp(unsigned long page)
-{
-       return(page + PAGE_SIZE - sizeof(void *));
-}
-
-int current_pid(void)
-{
-       return(current->pid);
-}
-
-void default_idle(void)
-{
-       CHOOSE_MODE(uml_idle_timer(), (void) 0);
-
-       while(1){
-               /* endless idle loop with no priority at all */
-
-               /*
-                * although we are an idle CPU, we do not want to
-                * get into the scheduler unnecessarily.
-                */
-               if(need_resched())
-                       schedule();
-
-               idle_sleep(10);
-       }
-}
-
-void cpu_idle(void)
-{
-       CHOOSE_MODE(init_idle_tt(), init_idle_skas());
-}
-
-int page_size(void)
-{
-       return(PAGE_SIZE);
-}
-
-void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
-                     pte_t *pte_out)
-{
-       pgd_t *pgd;
-       pud_t *pud;
-       pmd_t *pmd;
-       pte_t *pte;
-       pte_t ptent;
-
-       if(task->mm == NULL)
-               return(ERR_PTR(-EINVAL));
-       pgd = pgd_offset(task->mm, addr);
-       if(!pgd_present(*pgd))
-               return(ERR_PTR(-EINVAL));
-
-       pud = pud_offset(pgd, addr);
-       if(!pud_present(*pud))
-               return(ERR_PTR(-EINVAL));
-
-       pmd = pmd_offset(pud, addr);
-       if(!pmd_present(*pmd))
-               return(ERR_PTR(-EINVAL));
-
-       pte = pte_offset_kernel(pmd, addr);
-       ptent = *pte;
-       if(!pte_present(ptent))
-               return(ERR_PTR(-EINVAL));
-
-       if(pte_out != NULL)
-               *pte_out = ptent;
-       return((void *) (pte_val(ptent) & PAGE_MASK) + (addr & ~PAGE_MASK));
-}
-
-char *current_cmd(void)
-{
-#if defined(CONFIG_SMP) || defined(CONFIG_HIGHMEM)
-       return("(Unknown)");
-#else
-       void *addr = um_virt_to_phys(current, current->mm->arg_start, NULL);
-       return IS_ERR(addr) ? "(Unknown)": __va((unsigned long) addr);
-#endif
-}
-
-void force_sigbus(void)
-{
-       printk(KERN_ERR "Killing pid %d because of a lack of memory\n",
-              current->pid);
-       lock_kernel();
-       sigaddset(&current->pending.signal, SIGBUS);
-       recalc_sigpending();
-       current->flags |= PF_SIGNALED;
-       do_exit(SIGBUS | 0x80);
-}
-
-void dump_thread(struct pt_regs *regs, struct user *u)
-{
-}
-
-void enable_hlt(void)
-{
-       panic("enable_hlt");
-}
-
-EXPORT_SYMBOL(enable_hlt);
-
-void disable_hlt(void)
-{
-       panic("disable_hlt");
-}
-
-EXPORT_SYMBOL(disable_hlt);
-
-void *um_kmalloc(int size)
-{
-       return kmalloc(size, GFP_KERNEL);
-}
-
-void *um_kmalloc_atomic(int size)
-{
-       return kmalloc(size, GFP_ATOMIC);
-}
-
-void *um_vmalloc(int size)
-{
-       return vmalloc(size);
-}
-
-void *um_vmalloc_atomic(int size)
-{
-       return __vmalloc(size, GFP_ATOMIC | __GFP_HIGHMEM, PAGE_KERNEL);
-}
-
-int __cant_sleep(void) {
-       return in_atomic() || irqs_disabled() || in_interrupt();
-       /* Is in_interrupt() really needed? */
-}
-
-unsigned long get_fault_addr(void)
-{
-       return((unsigned long) current->thread.fault_addr);
-}
-
-EXPORT_SYMBOL(get_fault_addr);
-
-void not_implemented(void)
-{
-       printk(KERN_DEBUG "Something isn't implemented in here\n");
-}
-
-EXPORT_SYMBOL(not_implemented);
-
-int user_context(unsigned long sp)
-{
-       unsigned long stack;
-
-       stack = sp & (PAGE_MASK << CONFIG_KERNEL_STACK_ORDER);
-       return(stack != (unsigned long) current_thread);
-}
-
-extern exitcall_t __uml_exitcall_begin, __uml_exitcall_end;
-
-void do_uml_exitcalls(void)
-{
-       exitcall_t *call;
-
-       call = &__uml_exitcall_end;
-       while (--call >= &__uml_exitcall_begin)
-               (*call)();
-}
-
-char *uml_strdup(char *string)
-{
-       return kstrdup(string, GFP_KERNEL);
-}
-
-int copy_to_user_proc(void __user *to, void *from, int size)
-{
-       return(copy_to_user(to, from, size));
-}
-
-int copy_from_user_proc(void *to, void __user *from, int size)
-{
-       return(copy_from_user(to, from, size));
-}
-
-int clear_user_proc(void __user *buf, int size)
-{
-       return(clear_user(buf, size));
-}
-
-int strlen_user_proc(char __user *str)
-{
-       return(strlen_user(str));
-}
-
-int smp_sigio_handler(void)
-{
-#ifdef CONFIG_SMP
-       int cpu = current_thread->cpu;
-       IPI_handler(cpu);
-       if(cpu != 0)
-               return(1);
-#endif
-       return(0);
-}
-
-int cpu(void)
-{
-       return(current_thread->cpu);
-}
-
-static atomic_t using_sysemu = ATOMIC_INIT(0);
-int sysemu_supported;
-
-void set_using_sysemu(int value)
-{
-       if (value > sysemu_supported)
-               return;
-       atomic_set(&using_sysemu, value);
-}
-
-int get_using_sysemu(void)
-{
-       return atomic_read(&using_sysemu);
-}
-
-static int proc_read_sysemu(char *buf, char **start, off_t offset, int size,int *eof, void *data)
-{
-       if (snprintf(buf, size, "%d\n", get_using_sysemu()) < size) /*No overflow*/
-               *eof = 1;
-
-       return strlen(buf);
-}
-
-static int proc_write_sysemu(struct file *file,const char __user *buf, unsigned long count,void *data)
-{
-       char tmp[2];
-
-       if (copy_from_user(tmp, buf, 1))
-               return -EFAULT;
-
-       if (tmp[0] >= '0' && tmp[0] <= '2')
-               set_using_sysemu(tmp[0] - '0');
-       return count; /*We use the first char, but pretend to write everything*/
-}
-
-int __init make_proc_sysemu(void)
-{
-       struct proc_dir_entry *ent;
-       if (!sysemu_supported)
-               return 0;
-
-       ent = create_proc_entry("sysemu", 0600, &proc_root);
-
-       if (ent == NULL)
-       {
-               printk(KERN_WARNING "Failed to register /proc/sysemu\n");
-               return(0);
-       }
-
-       ent->read_proc  = proc_read_sysemu;
-       ent->write_proc = proc_write_sysemu;
-
-       return 0;
-}
-
-late_initcall(make_proc_sysemu);
-
-int singlestepping(void * t)
-{
-       struct task_struct *task = t ? t : current;
-
-       if ( ! (task->ptrace & PT_DTRACE) )
-               return(0);
-
-       if (task->thread.singlestep_syscall)
-               return(1);
-
-       return 2;
-}
-
-/*
- * Only x86 and x86_64 have an arch_align_stack().
- * All other arches have "#define arch_align_stack(x) (x)"
- * in their asm/system.h
- * As this is included in UML from asm-um/system-generic.h,
- * we can use it to behave as the subarch does.
- */
-#ifndef arch_align_stack
-unsigned long arch_align_stack(unsigned long sp)
-{
-       if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
-               sp -= get_random_int() % 8192;
-       return sp & ~0xf;
-}
-#endif
index 820affbf3e163cc4b99abc627fac7421786b8d57..a92965f8f9cdd57d600e229e136dee8fafa64d5a 100644 (file)
@@ -93,7 +93,7 @@ irqreturn_t um_timer(int irq, void *dev, struct pt_regs *regs)
 
        write_seqlock_irqsave(&xtime_lock, flags);
 
-       do_timer(regs);
+       do_timer(1);
 
        nsecs = get_time();
        xtime.tv_sec = nsecs / NSEC_PER_SEC;
index 61a23fff4395e822f1ee481a9ab589003201b1ba..c7b195c7e51fa3ddc3d46da245f2f0f5ce7fa6fe 100644 (file)
@@ -120,7 +120,7 @@ out_nosemaphore:
  * us unable to handle the page fault gracefully.
  */
 out_of_memory:
-       if (current->pid == 1) {
+       if (is_init(current)) {
                up_read(&mm->mmap_sem);
                yield();
                down_read(&mm->mmap_sem);
index b170b4704dc40aa25137f6ab29ece4b36eb03078..4203681e508d0a680635347c53a2168fdd3a68be 100644 (file)
@@ -132,6 +132,9 @@ err:
        else if(found < 0)
                printf("read returned errno %d\n", -found);
 
+out:
+       close(fd);
+
        return;
 
 found:
@@ -141,11 +144,12 @@ found:
 
        if(strncmp(buf, "tmpfs", strlen("tmpfs"))){
                printf("not tmpfs\n");
-               return;
+               goto out;
        }
 
        printf("OK\n");
        default_tmpdir = "/dev/shm";
+       goto out;
 }
 
 /*
index a0b46695f186f03921a7a09b66cde5af0bf5bfa8..f4d1a4d3cdc231696e55802039541e5b024b3c76 100644 (file)
@@ -51,7 +51,7 @@ static irqreturn_t timer_interrupt (int irq, void *dummy, struct pt_regs *regs)
        if (mach_tick)
          mach_tick ();
 
-       do_timer (regs);
+       do_timer (1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index 6a55f87ba97f917ed2814bc3c11c3f21a3ad096b..697f0aa794b960a663b15ee09e161f86890119ab 100644 (file)
@@ -3,7 +3,8 @@
 #include <linux/pci.h>
 #include <linux/cache.h>
 #include <linux/module.h>
-#include <asm/dma-mapping.h>
+#include <linux/dma-mapping.h>
+
 #include <asm/proto.h>
 #include <asm/swiotlb.h>
 #include <asm/dma.h>
index 1c255ee76e7c81870768f54adc9a5fe149dc0239..7ea3bf2a858c6299c1c686fc0530b1da14bbef63 100644 (file)
@@ -415,16 +415,16 @@ void main_timer_handler(struct pt_regs *regs)
                                (((long) offset << US_SCALE) / vxtime.tsc_quot) - 1;
        }
 
-       if (lost > 0) {
+       if (lost > 0)
                handle_lost_ticks(lost, regs);
-               jiffies += lost;
-       }
+       else
+               lost = 0;
 
 /*
  * Do the timer stuff.
  */
 
-       do_timer(regs);
+       do_timer(lost + 1);
 #ifndef CONFIG_SMP
        update_process_times(user_mode(regs));
 #endif
index 1a17b0733ab5d38ad81ccdf4263e2d58571d9e24..3751b4788e288748112c05df0121a1186aac5fab 100644 (file)
@@ -244,7 +244,7 @@ static int is_errata93(struct pt_regs *regs, unsigned long address)
 
 int unhandled_signal(struct task_struct *tsk, int sig)
 {
-       if (tsk->pid == 1)
+       if (is_init(tsk))
                return 1;
        if (tsk->ptrace & PT_PTRACED)
                return 0;
@@ -464,7 +464,7 @@ good_area:
                case PF_PROT:           /* read, present */
                        goto bad_area;
                case 0:                 /* read, not present */
-                       if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
+                       if (!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)))
                                goto bad_area;
        }
 
@@ -580,7 +580,7 @@ no_context:
  */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (current->pid == 1) { 
+       if (is_init(current)) {
                yield();
                goto again;
        }
index 412ab32de391788de830fe5786adffe2ac3ca854..241db201f40e59300bb97691bdcc4b2608c80c23 100644 (file)
@@ -175,7 +175,7 @@ again:
 
                last_ccount_stamp = next;
                next += CCOUNT_PER_JIFFY;
-               do_timer (regs); /* Linux handler in kernel/timer.c */
+               do_timer (1); /* Linux handler in kernel/timer.c */
 
                if (ntp_synced() &&
                    xtime.tv_sec - last_rtc_update >= 659 &&
index a945a33e85a129d0e268b1e20cf9a54710ec93c6..dd0dbec2e57e4f39b51ab7a73359a0117e638b48 100644 (file)
@@ -144,7 +144,7 @@ bad_area:
         */
 out_of_memory:
        up_read(&mm->mmap_sem);
-       if (current->pid == 1) {
+       if (is_init(current)) {
                yield();
                down_read(&mm->mmap_sem);
                goto survive;
index d96164e602fea496c7b33b35d4e685261eef7647..15d64414bd6018e2394d3485ec6070730614eb5a 100644 (file)
@@ -201,7 +201,7 @@ static void dev_ip_addr(void *d, char *buf, char *bin_buf)
        struct net_device *dev = d;
        struct in_device *ip = dev->ip_ptr;
        struct in_ifaddr *in;
-       u32 addr;
+       __be32 addr;
 
        if ((ip == NULL) || ((in = ip->ifa_list) == NULL)) {
                printk(KERN_WARNING "Device not assigned an IP address!\n");
index 2b4ef2b89b8d74b376a2011b5455039fd3730e20..8ff33441d8a214259bd2c718ddb4735874dd2fc5 100644 (file)
@@ -450,8 +450,10 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg)
  **/
 void blk_trace_shutdown(request_queue_t *q)
 {
-       blk_trace_startstop(q, 0);
-       blk_trace_remove(q);
+       if (q->blk_trace) {
+               blk_trace_startstop(q, 0);
+               blk_trace_remove(q);
+       }
 }
 
 /*
index 25d1f42568cc19714a2f8a5469ecd2842e9ea7e5..653919d50cd4d06aea68d8e027d15a473e5b4f5a 100644 (file)
@@ -295,10 +295,15 @@ static struct kobject *base_probe(dev_t dev, int *part, void *data)
 
 static int __init genhd_device_init(void)
 {
+       int err;
+
        bdev_map = kobj_map_init(base_probe, &block_subsys_lock);
        blk_dev_init();
-       subsystem_register(&block_subsys);
-       return 0;
+       err = subsystem_register(&block_subsys);
+       if (err < 0)
+               printk(KERN_WARNING "%s: subsystem_register error: %d\n",
+                       __FUNCTION__, err);
+       return err;
 }
 
 subsys_initcall(genhd_device_init);
index 9c3a06bcb7ba97b02d12de6638944ac79e33baa2..51dc0edf76e0281f52e53da15576e4ffa62b0eab 100644 (file)
@@ -1847,8 +1847,7 @@ static void blk_release_queue(struct kobject *kobj)
        if (q->queue_tags)
                __blk_queue_free_tags(q);
 
-       if (q->blk_trace)
-               blk_trace_shutdown(q);
+       blk_trace_shutdown(q);
 
        kmem_cache_free(requestq_cachep, q);
 }
index b06b0e2b9c62b536a321d12295988af5801012b3..b32b77ff2dcd7c1814c66318a477b74840b88e2f 100644 (file)
@@ -228,7 +228,7 @@ error:
 
 /**
  * class_destroy - destroys a struct class structure
- * @cs: pointer to the struct class that is to be destroyed
+ * @cls: pointer to the struct class that is to be destroyed
  *
  * Note, the pointer to be destroyed must have been created with a call
  * to class_create().
@@ -658,9 +658,9 @@ int class_device_register(struct class_device *class_dev)
 
 /**
  * class_device_create - creates a class device and registers it with sysfs
- * @cs: pointer to the struct class that this device should be registered to.
+ * @cls: pointer to the struct class that this device should be registered to.
  * @parent: pointer to the parent struct class_device of this new device, if any.
- * @dev: the dev_t for the char device to be added.
+ * @devt: the dev_t for the char device to be added.
  * @device: a pointer to a struct device that is assiociated with this class device.
  * @fmt: string for the class device's name
  *
@@ -766,7 +766,7 @@ void class_device_unregister(struct class_device *class_dev)
 /**
  * class_device_destroy - removes a class device that was created with class_device_create()
  * @cls: the pointer to the struct class that this device was registered * with.
- * @dev: the dev_t of the device that was previously registered.
+ * @devt: the dev_t of the device that was previously registered.
  *
  * This call unregisters and cleans up a class device that was created with a
  * call to class_device_create()
index 77bf8826e2f97b9d19cfaad6457df1371e660262..14615694ae9aa3e707435f2f04a1c6dde4586c5c 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/interrupt.h>
 #include <linux/bitops.h>
 #include <linux/mutex.h>
+#include <linux/kthread.h>
 
 #include <linux/firmware.h>
 #include "base.h"
@@ -511,7 +512,6 @@ request_firmware_work_func(void *arg)
                WARN_ON(1);
                return 0;
        }
-       daemonize("%s/%s", "firmware", fw_work->name);
        ret = _request_firmware(&fw, fw_work->name, fw_work->device,
                fw_work->uevent);
        if (ret < 0)
@@ -546,9 +546,9 @@ request_firmware_nowait(
        const char *name, struct device *device, void *context,
        void (*cont)(const struct firmware *fw, void *context))
 {
+       struct task_struct *task;
        struct firmware_work *fw_work = kmalloc(sizeof (struct firmware_work),
                                                GFP_ATOMIC);
-       int ret;
 
        if (!fw_work)
                return -ENOMEM;
@@ -566,14 +566,14 @@ request_firmware_nowait(
                .uevent = uevent,
        };
 
-       ret = kernel_thread(request_firmware_work_func, fw_work,
-                           CLONE_FS | CLONE_FILES);
+       task = kthread_run(request_firmware_work_func, fw_work,
+                           "firmware/%s", name);
 
-       if (ret < 0) {
+       if (IS_ERR(task)) {
                fw_work->cont(NULL, fw_work->context);
                module_put(fw_work->module);
                kfree(fw_work);
-               return ret;
+               return PTR_ERR(task);
        }
        return 0;
 }
index c774121684d7f8951ff8b0acafef0e74ce11e23d..68b0471ad5a64e52a2b53135ab58523507fb700d 100644 (file)
@@ -72,6 +72,7 @@
 #include <linux/completion.h>
 #include <linux/highmem.h>
 #include <linux/gfp.h>
+#include <linux/kthread.h>
 
 #include <asm/uaccess.h>
 
@@ -522,15 +523,12 @@ static int loop_make_request(request_queue_t *q, struct bio *old_bio)
                goto out;
        if (unlikely(rw == WRITE && (lo->lo_flags & LO_FLAGS_READ_ONLY)))
                goto out;
-       lo->lo_pending++;
        loop_add_bio(lo, old_bio);
+       wake_up(&lo->lo_event);
        spin_unlock_irq(&lo->lo_lock);
-       complete(&lo->lo_bh_done);
        return 0;
 
 out:
-       if (lo->lo_pending == 0)
-               complete(&lo->lo_bh_done);
        spin_unlock_irq(&lo->lo_lock);
        bio_io_error(old_bio, old_bio->bi_size);
        return 0;
@@ -570,14 +568,18 @@ static inline void loop_handle_bio(struct loop_device *lo, struct bio *bio)
  * to avoid blocking in our make_request_fn. it also does loop decrypting
  * on reads for block backed loop, as that is too heavy to do from
  * b_end_io context where irqs may be disabled.
+ *
+ * Loop explanation:  loop_clr_fd() sets lo_state to Lo_rundown before
+ * calling kthread_stop().  Therefore once kthread_should_stop() is
+ * true, make_request will not place any more requests.  Therefore
+ * once kthread_should_stop() is true and lo_bio is NULL, we are
+ * done with the loop.
  */
 static int loop_thread(void *data)
 {
        struct loop_device *lo = data;
        struct bio *bio;
 
-       daemonize("loop%d", lo->lo_number);
-
        /*
         * loop can be used in an encrypted device,
         * hence, it mustn't be stopped at all
@@ -587,47 +589,21 @@ static int loop_thread(void *data)
 
        set_user_nice(current, -20);
 
-       lo->lo_state = Lo_bound;
-       lo->lo_pending = 1;
+       while (!kthread_should_stop() || lo->lo_bio) {
 
-       /*
-        * complete it, we are running
-        */
-       complete(&lo->lo_done);
-
-       for (;;) {
-               int pending;
+               wait_event_interruptible(lo->lo_event,
+                               lo->lo_bio || kthread_should_stop());
 
-               if (wait_for_completion_interruptible(&lo->lo_bh_done))
+               if (!lo->lo_bio)
                        continue;
-
                spin_lock_irq(&lo->lo_lock);
-
-               /*
-                * could be completed because of tear-down, not pending work
-                */
-               if (unlikely(!lo->lo_pending)) {
-                       spin_unlock_irq(&lo->lo_lock);
-                       break;
-               }
-
                bio = loop_get_bio(lo);
-               lo->lo_pending--;
-               pending = lo->lo_pending;
                spin_unlock_irq(&lo->lo_lock);
 
                BUG_ON(!bio);
                loop_handle_bio(lo, bio);
-
-               /*
-                * upped both for pending work and tear-down, lo_pending
-                * will hit zero then
-                */
-               if (unlikely(!pending))
-                       break;
        }
 
-       complete(&lo->lo_done);
        return 0;
 }
 
@@ -840,12 +816,26 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
 
        set_blocksize(bdev, lo_blocksize);
 
-       error = kernel_thread(loop_thread, lo, CLONE_KERNEL);
-       if (error < 0)
-               goto out_putf;
-       wait_for_completion(&lo->lo_done);
+       lo->lo_thread = kthread_create(loop_thread, lo, "loop%d",
+                                               lo->lo_number);
+       if (IS_ERR(lo->lo_thread)) {
+               error = PTR_ERR(lo->lo_thread);
+               goto out_clr;
+       }
+       lo->lo_state = Lo_bound;
+       wake_up_process(lo->lo_thread);
        return 0;
 
+out_clr:
+       lo->lo_thread = NULL;
+       lo->lo_device = NULL;
+       lo->lo_backing_file = NULL;
+       lo->lo_flags = 0;
+       set_capacity(disks[lo->lo_number], 0);
+       invalidate_bdev(bdev, 0);
+       bd_set_size(bdev, 0);
+       mapping_set_gfp_mask(mapping, lo->old_gfp_mask);
+       lo->lo_state = Lo_unbound;
  out_putf:
        fput(file);
  out:
@@ -907,12 +897,9 @@ static int loop_clr_fd(struct loop_device *lo, struct block_device *bdev)
 
        spin_lock_irq(&lo->lo_lock);
        lo->lo_state = Lo_rundown;
-       lo->lo_pending--;
-       if (!lo->lo_pending)
-               complete(&lo->lo_bh_done);
        spin_unlock_irq(&lo->lo_lock);
 
-       wait_for_completion(&lo->lo_done);
+       kthread_stop(lo->lo_thread);
 
        lo->lo_backing_file = NULL;
 
@@ -925,6 +912,7 @@ static int loop_clr_fd(struct loop_device *lo, struct block_device *bdev)
        lo->lo_sizelimit = 0;
        lo->lo_encrypt_key_size = 0;
        lo->lo_flags = 0;
+       lo->lo_thread = NULL;
        memset(lo->lo_encrypt_key, 0, LO_KEY_SIZE);
        memset(lo->lo_crypt_name, 0, LO_NAME_SIZE);
        memset(lo->lo_file_name, 0, LO_NAME_SIZE);
@@ -1287,9 +1275,9 @@ static int __init loop_init(void)
                if (!lo->lo_queue)
                        goto out_mem4;
                mutex_init(&lo->lo_ctl_mutex);
-               init_completion(&lo->lo_done);
-               init_completion(&lo->lo_bh_done);
                lo->lo_number = i;
+               lo->lo_thread = NULL;
+               init_waitqueue_head(&lo->lo_event);
                spin_lock_init(&lo->lo_lock);
                disk->major = LOOP_MAJOR;
                disk->first_minor = i;
index 23f96213f4acad7e9c5f72b51e1e392e22a208c8..efcc28ec9d9a2a1b719fc8e5a5e87d527a71ab20 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  AVM BlueFRITZ! USB driver
  *
- *  Copyright (C) 2003  Marcel Holtmann <marcel@holtmann.org>
+ *  Copyright (C) 2003-2006  Marcel Holtmann <marcel@holtmann.org>
  *
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -59,7 +59,6 @@ static struct usb_device_id bfusb_table[] = {
 
 MODULE_DEVICE_TABLE(usb, bfusb_table);
 
-
 #define BFUSB_MAX_BLOCK_SIZE   256
 
 #define BFUSB_BLOCK_TIMEOUT    3000
@@ -70,7 +69,7 @@ MODULE_DEVICE_TABLE(usb, bfusb_table);
 #define BFUSB_MAX_BULK_TX      2
 #define BFUSB_MAX_BULK_RX      2
 
-struct bfusb {
+struct bfusb_data {
        struct hci_dev          *hdev;
 
        unsigned long           state;
@@ -92,137 +91,136 @@ struct bfusb {
        struct sk_buff_head     completed_q;
 };
 
-struct bfusb_scb {
+struct bfusb_data_scb {
        struct urb *urb;
 };
 
 static void bfusb_tx_complete(struct urb *urb, struct pt_regs *regs);
 static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs);
 
-static struct urb *bfusb_get_completed(struct bfusb *bfusb)
+static struct urb *bfusb_get_completed(struct bfusb_data *data)
 {
        struct sk_buff *skb;
        struct urb *urb = NULL;
 
-       BT_DBG("bfusb %p", bfusb);
+       BT_DBG("bfusb %p", data);
 
-       skb = skb_dequeue(&bfusb->completed_q);
+       skb = skb_dequeue(&data->completed_q);
        if (skb) {
-               urb = ((struct bfusb_scb *) skb->cb)->urb;
+               urb = ((struct bfusb_data_scb *) skb->cb)->urb;
                kfree_skb(skb);
        }
 
        return urb;
 }
 
-static void bfusb_unlink_urbs(struct bfusb *bfusb)
+static void bfusb_unlink_urbs(struct bfusb_data *data)
 {
        struct sk_buff *skb;
        struct urb *urb;
 
-       BT_DBG("bfusb %p", bfusb);
+       BT_DBG("bfusb %p", data);
 
-       while ((skb = skb_dequeue(&bfusb->pending_q))) {
-               urb = ((struct bfusb_scb *) skb->cb)->urb;
+       while ((skb = skb_dequeue(&data->pending_q))) {
+               urb = ((struct bfusb_data_scb *) skb->cb)->urb;
                usb_kill_urb(urb);
-               skb_queue_tail(&bfusb->completed_q, skb);
+               skb_queue_tail(&data->completed_q, skb);
        }
 
-       while ((urb = bfusb_get_completed(bfusb)))
+       while ((urb = bfusb_get_completed(data)))
                usb_free_urb(urb);
 }
 
-
-static int bfusb_send_bulk(struct bfusb *bfusb, struct sk_buff *skb)
+static int bfusb_send_bulk(struct bfusb_data *data, struct sk_buff *skb)
 {
-       struct bfusb_scb *scb = (void *) skb->cb;
-       struct urb *urb = bfusb_get_completed(bfusb);
+       struct bfusb_data_scb *scb = (void *) skb->cb;
+       struct urb *urb = bfusb_get_completed(data);
        int err, pipe;
 
-       BT_DBG("bfusb %p skb %p len %d", bfusb, skb, skb->len);
+       BT_DBG("bfusb %p skb %p len %d", data, skb, skb->len);
 
        if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC)))
                return -ENOMEM;
 
-       pipe = usb_sndbulkpipe(bfusb->udev, bfusb->bulk_out_ep);
+       pipe = usb_sndbulkpipe(data->udev, data->bulk_out_ep);
 
-       usb_fill_bulk_urb(urb, bfusb->udev, pipe, skb->data, skb->len,
+       usb_fill_bulk_urb(urb, data->udev, pipe, skb->data, skb->len,
                        bfusb_tx_complete, skb);
 
        scb->urb = urb;
 
-       skb_queue_tail(&bfusb->pending_q, skb);
+       skb_queue_tail(&data->pending_q, skb);
 
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err) {
                BT_ERR("%s bulk tx submit failed urb %p err %d", 
-                                       bfusb->hdev->name, urb, err);
-               skb_unlink(skb, &bfusb->pending_q);
+                                       data->hdev->name, urb, err);
+               skb_unlink(skb, &data->pending_q);
                usb_free_urb(urb);
        } else
-               atomic_inc(&bfusb->pending_tx);
+               atomic_inc(&data->pending_tx);
 
        return err;
 }
 
-static void bfusb_tx_wakeup(struct bfusb *bfusb)
+static void bfusb_tx_wakeup(struct bfusb_data *data)
 {
        struct sk_buff *skb;
 
-       BT_DBG("bfusb %p", bfusb);
+       BT_DBG("bfusb %p", data);
 
-       if (test_and_set_bit(BFUSB_TX_PROCESS, &bfusb->state)) {
-               set_bit(BFUSB_TX_WAKEUP, &bfusb->state);
+       if (test_and_set_bit(BFUSB_TX_PROCESS, &data->state)) {
+               set_bit(BFUSB_TX_WAKEUP, &data->state);
                return;
        }
 
        do {
-               clear_bit(BFUSB_TX_WAKEUP, &bfusb->state);
+               clear_bit(BFUSB_TX_WAKEUP, &data->state);
 
-               while ((atomic_read(&bfusb->pending_tx) < BFUSB_MAX_BULK_TX) &&
-                               (skb = skb_dequeue(&bfusb->transmit_q))) {
-                       if (bfusb_send_bulk(bfusb, skb) < 0) {
-                               skb_queue_head(&bfusb->transmit_q, skb);
+               while ((atomic_read(&data->pending_tx) < BFUSB_MAX_BULK_TX) &&
+                               (skb = skb_dequeue(&data->transmit_q))) {
+                       if (bfusb_send_bulk(data, skb) < 0) {
+                               skb_queue_head(&data->transmit_q, skb);
                                break;
                        }
                }
 
-       } while (test_bit(BFUSB_TX_WAKEUP, &bfusb->state));
+       } while (test_bit(BFUSB_TX_WAKEUP, &data->state));
 
-       clear_bit(BFUSB_TX_PROCESS, &bfusb->state);
+       clear_bit(BFUSB_TX_PROCESS, &data->state);
 }
 
 static void bfusb_tx_complete(struct urb *urb, struct pt_regs *regs)
 {
        struct sk_buff *skb = (struct sk_buff *) urb->context;
-       struct bfusb *bfusb = (struct bfusb *) skb->dev;
+       struct bfusb_data *data = (struct bfusb_data *) skb->dev;
 
-       BT_DBG("bfusb %p urb %p skb %p len %d", bfusb, urb, skb, skb->len);
+       BT_DBG("bfusb %p urb %p skb %p len %d", data, urb, skb, skb->len);
 
-       atomic_dec(&bfusb->pending_tx);
+       atomic_dec(&data->pending_tx);
 
-       if (!test_bit(HCI_RUNNING, &bfusb->hdev->flags))
+       if (!test_bit(HCI_RUNNING, &data->hdev->flags))
                return;
 
        if (!urb->status)
-               bfusb->hdev->stat.byte_tx += skb->len;
+               data->hdev->stat.byte_tx += skb->len;
        else
-               bfusb->hdev->stat.err_tx++;
+               data->hdev->stat.err_tx++;
 
-       read_lock(&bfusb->lock);
+       read_lock(&data->lock);
 
-       skb_unlink(skb, &bfusb->pending_q);
-       skb_queue_tail(&bfusb->completed_q, skb);
+       skb_unlink(skb, &data->pending_q);
+       skb_queue_tail(&data->completed_q, skb);
 
-       bfusb_tx_wakeup(bfusb);
+       bfusb_tx_wakeup(data);
 
-       read_unlock(&bfusb->lock);
+       read_unlock(&data->lock);
 }
 
 
-static int bfusb_rx_submit(struct bfusb *bfusb, struct urb *urb)
+static int bfusb_rx_submit(struct bfusb_data *data, struct urb *urb)
 {
-       struct bfusb_scb *scb;
+       struct bfusb_data_scb *scb;
        struct sk_buff *skb;
        int err, pipe, size = HCI_MAX_FRAME_SIZE + 32;
 
@@ -231,28 +229,29 @@ static int bfusb_rx_submit(struct bfusb *bfusb, struct urb *urb)
        if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC)))
                return -ENOMEM;
 
-       if (!(skb = bt_skb_alloc(size, GFP_ATOMIC))) {
+       skb = bt_skb_alloc(size, GFP_ATOMIC);
+       if (!skb) {
                usb_free_urb(urb);
                return -ENOMEM;
        }
 
-       skb->dev = (void *) bfusb;
+       skb->dev = (void *) data;
 
-       scb = (struct bfusb_scb *) skb->cb;
+       scb = (struct bfusb_data_scb *) skb->cb;
        scb->urb = urb;
 
-       pipe = usb_rcvbulkpipe(bfusb->udev, bfusb->bulk_in_ep);
+       pipe = usb_rcvbulkpipe(data->udev, data->bulk_in_ep);
 
-       usb_fill_bulk_urb(urb, bfusb->udev, pipe, skb->data, size,
+       usb_fill_bulk_urb(urb, data->udev, pipe, skb->data, size,
                        bfusb_rx_complete, skb);
 
-       skb_queue_tail(&bfusb->pending_q, skb);
+       skb_queue_tail(&data->pending_q, skb);
 
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err) {
                BT_ERR("%s bulk rx submit failed urb %p err %d",
-                                       bfusb->hdev->name, urb, err);
-               skb_unlink(skb, &bfusb->pending_q);
+                                       data->hdev->name, urb, err);
+               skb_unlink(skb, &data->pending_q);
                kfree_skb(skb);
                usb_free_urb(urb);
        }
@@ -260,15 +259,15 @@ static int bfusb_rx_submit(struct bfusb *bfusb, struct urb *urb)
        return err;
 }
 
-static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char *data, int len)
+static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned char *buf, int len)
 {
-       BT_DBG("bfusb %p hdr 0x%02x data %p len %d", bfusb, hdr, data, len);
+       BT_DBG("bfusb %p hdr 0x%02x data %p len %d", data, hdr, buf, len);
 
        if (hdr & 0x10) {
-               BT_ERR("%s error in block", bfusb->hdev->name);
-               if (bfusb->reassembly)
-                       kfree_skb(bfusb->reassembly);
-               bfusb->reassembly = NULL;
+               BT_ERR("%s error in block", data->hdev->name);
+               if (data->reassembly)
+                       kfree_skb(data->reassembly);
+               data->reassembly = NULL;
                return -EIO;
        }
 
@@ -277,46 +276,46 @@ static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char *
                unsigned char pkt_type;
                int pkt_len = 0;
 
-               if (bfusb->reassembly) {
-                       BT_ERR("%s unexpected start block", bfusb->hdev->name);
-                       kfree_skb(bfusb->reassembly);
-                       bfusb->reassembly = NULL;
+               if (data->reassembly) {
+                       BT_ERR("%s unexpected start block", data->hdev->name);
+                       kfree_skb(data->reassembly);
+                       data->reassembly = NULL;
                }
 
                if (len < 1) {
-                       BT_ERR("%s no packet type found", bfusb->hdev->name);
+                       BT_ERR("%s no packet type found", data->hdev->name);
                        return -EPROTO;
                }
 
-               pkt_type = *data++; len--;
+               pkt_type = *buf++; len--;
 
                switch (pkt_type) {
                case HCI_EVENT_PKT:
                        if (len >= HCI_EVENT_HDR_SIZE) {
-                               struct hci_event_hdr *hdr = (struct hci_event_hdr *) data;
+                               struct hci_event_hdr *hdr = (struct hci_event_hdr *) buf;
                                pkt_len = HCI_EVENT_HDR_SIZE + hdr->plen;
                        } else {
-                               BT_ERR("%s event block is too short", bfusb->hdev->name);
+                               BT_ERR("%s event block is too short", data->hdev->name);
                                return -EILSEQ;
                        }
                        break;
 
                case HCI_ACLDATA_PKT:
                        if (len >= HCI_ACL_HDR_SIZE) {
-                               struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) data;
+                               struct hci_acl_hdr *hdr = (struct hci_acl_hdr *) buf;
                                pkt_len = HCI_ACL_HDR_SIZE + __le16_to_cpu(hdr->dlen);
                        } else {
-                               BT_ERR("%s data block is too short", bfusb->hdev->name);
+                               BT_ERR("%s data block is too short", data->hdev->name);
                                return -EILSEQ;
                        }
                        break;
 
                case HCI_SCODATA_PKT:
                        if (len >= HCI_SCO_HDR_SIZE) {
-                               struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) data;
+                               struct hci_sco_hdr *hdr = (struct hci_sco_hdr *) buf;
                                pkt_len = HCI_SCO_HDR_SIZE + hdr->dlen;
                        } else {
-                               BT_ERR("%s audio block is too short", bfusb->hdev->name);
+                               BT_ERR("%s audio block is too short", data->hdev->name);
                                return -EILSEQ;
                        }
                        break;
@@ -324,27 +323,27 @@ static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char *
 
                skb = bt_skb_alloc(pkt_len, GFP_ATOMIC);
                if (!skb) {
-                       BT_ERR("%s no memory for the packet", bfusb->hdev->name);
+                       BT_ERR("%s no memory for the packet", data->hdev->name);
                        return -ENOMEM;
                }
 
-               skb->dev = (void *) bfusb->hdev;
+               skb->dev = (void *) data->hdev;
                bt_cb(skb)->pkt_type = pkt_type;
 
-               bfusb->reassembly = skb;
+               data->reassembly = skb;
        } else {
-               if (!bfusb->reassembly) {
-                       BT_ERR("%s unexpected continuation block", bfusb->hdev->name);
+               if (!data->reassembly) {
+                       BT_ERR("%s unexpected continuation block", data->hdev->name);
                        return -EIO;
                }
        }
 
        if (len > 0)
-               memcpy(skb_put(bfusb->reassembly, len), data, len);
+               memcpy(skb_put(data->reassembly, len), buf, len);
 
        if (hdr & 0x08) {
-               hci_recv_frame(bfusb->reassembly);
-               bfusb->reassembly = NULL;
+               hci_recv_frame(data->reassembly);
+               data->reassembly = NULL;
        }
 
        return 0;
@@ -353,22 +352,22 @@ static inline int bfusb_recv_block(struct bfusb *bfusb, int hdr, unsigned char *
 static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs)
 {
        struct sk_buff *skb = (struct sk_buff *) urb->context;
-       struct bfusb *bfusb = (struct bfusb *) skb->dev;
+       struct bfusb_data *data = (struct bfusb_data *) skb->dev;
        unsigned char *buf = urb->transfer_buffer;
        int count = urb->actual_length;
        int err, hdr, len;
 
        BT_DBG("bfusb %p urb %p skb %p len %d", bfusb, urb, skb, skb->len);
 
-       read_lock(&bfusb->lock);
+       read_lock(&data->lock);
 
-       if (!test_bit(HCI_RUNNING, &bfusb->hdev->flags))
+       if (!test_bit(HCI_RUNNING, &data->hdev->flags))
                goto unlock;
 
        if (urb->status || !count)
                goto resubmit;
 
-       bfusb->hdev->stat.byte_rx += count;
+       data->hdev->stat.byte_rx += count;
 
        skb_put(skb, count);
 
@@ -387,90 +386,89 @@ static void bfusb_rx_complete(struct urb *urb, struct pt_regs *regs)
 
                if (count < len) {
                        BT_ERR("%s block extends over URB buffer ranges",
-                                       bfusb->hdev->name);
+                                       data->hdev->name);
                }
 
                if ((hdr & 0xe1) == 0xc1)
-                       bfusb_recv_block(bfusb, hdr, buf, len);
+                       bfusb_recv_block(data, hdr, buf, len);
 
                count -= len;
                buf   += len;
        }
 
-       skb_unlink(skb, &bfusb->pending_q);
+       skb_unlink(skb, &data->pending_q);
        kfree_skb(skb);
 
-       bfusb_rx_submit(bfusb, urb);
+       bfusb_rx_submit(data, urb);
 
-       read_unlock(&bfusb->lock);
+       read_unlock(&data->lock);
 
        return;
 
 resubmit:
-       urb->dev = bfusb->udev;
+       urb->dev = data->udev;
 
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err) {
                BT_ERR("%s bulk resubmit failed urb %p err %d",
-                                       bfusb->hdev->name, urb, err);
+                                       data->hdev->name, urb, err);
        }
 
 unlock:
-       read_unlock(&bfusb->lock);
+       read_unlock(&data->lock);
 }
 
-
 static int bfusb_open(struct hci_dev *hdev)
 {
-       struct bfusb *bfusb = (struct bfusb *) hdev->driver_data;
+       struct bfusb_data *data = hdev->driver_data;
        unsigned long flags;
        int i, err;
 
-       BT_DBG("hdev %p bfusb %p", hdev, bfusb);
+       BT_DBG("hdev %p bfusb %p", hdev, data);
 
        if (test_and_set_bit(HCI_RUNNING, &hdev->flags))
                return 0;
 
-       write_lock_irqsave(&bfusb->lock, flags);
+       write_lock_irqsave(&data->lock, flags);
 
-       err = bfusb_rx_submit(bfusb, NULL);
+       err = bfusb_rx_submit(data, NULL);
        if (!err) {
                for (i = 1; i < BFUSB_MAX_BULK_RX; i++)
-                       bfusb_rx_submit(bfusb, NULL);
+                       bfusb_rx_submit(data, NULL);
        } else {
                clear_bit(HCI_RUNNING, &hdev->flags);
        }
 
-       write_unlock_irqrestore(&bfusb->lock, flags);
+       write_unlock_irqrestore(&data->lock, flags);
 
        return err;
 }
 
 static int bfusb_flush(struct hci_dev *hdev)
 {
-       struct bfusb *bfusb = (struct bfusb *) hdev->driver_data;
+       struct bfusb_data *data = hdev->driver_data;
 
-       BT_DBG("hdev %p bfusb %p", hdev, bfusb);
+       BT_DBG("hdev %p bfusb %p", hdev, data);
 
-       skb_queue_purge(&bfusb->transmit_q);
+       skb_queue_purge(&data->transmit_q);
 
        return 0;
 }
 
 static int bfusb_close(struct hci_dev *hdev)
 {
-       struct bfusb *bfusb = (struct bfusb *) hdev->driver_data;
+       struct bfusb_data *data = hdev->driver_data;
        unsigned long flags;
 
-       BT_DBG("hdev %p bfusb %p", hdev, bfusb);
+       BT_DBG("hdev %p bfusb %p", hdev, data);
 
        if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
                return 0;
 
-       write_lock_irqsave(&bfusb->lock, flags);
-       write_unlock_irqrestore(&bfusb->lock, flags);
+       write_lock_irqsave(&data->lock, flags);
+       write_unlock_irqrestore(&data->lock, flags);
 
-       bfusb_unlink_urbs(bfusb);
+       bfusb_unlink_urbs(data);
        bfusb_flush(hdev);
 
        return 0;
@@ -479,7 +477,7 @@ static int bfusb_close(struct hci_dev *hdev)
 static int bfusb_send_frame(struct sk_buff *skb)
 {
        struct hci_dev *hdev = (struct hci_dev *) skb->dev;
-       struct bfusb *bfusb;
+       struct bfusb_data *data;
        struct sk_buff *nskb;
        unsigned char buf[3];
        int sent = 0, size, count;
@@ -494,7 +492,7 @@ static int bfusb_send_frame(struct sk_buff *skb)
        if (!test_bit(HCI_RUNNING, &hdev->flags))
                return -EBUSY;
 
-       bfusb = (struct bfusb *) hdev->driver_data;
+       data = hdev->driver_data;
 
        switch (bt_cb(skb)->pkt_type) {
        case HCI_COMMAND_PKT:
@@ -514,12 +512,13 @@ static int bfusb_send_frame(struct sk_buff *skb)
        count = skb->len;
 
        /* Max HCI frame size seems to be 1511 + 1 */
-       if (!(nskb = bt_skb_alloc(count + 32, GFP_ATOMIC))) {
+       nskb = bt_skb_alloc(count + 32, GFP_ATOMIC);
+       if (!nskb) {
                BT_ERR("Can't allocate memory for new packet");
                return -ENOMEM;
        }
 
-       nskb->dev = (void *) bfusb;
+       nskb->dev = (void *) data;
 
        while (count) {
                size = min_t(uint, count, BFUSB_MAX_BLOCK_SIZE);
@@ -536,18 +535,18 @@ static int bfusb_send_frame(struct sk_buff *skb)
        }
 
        /* Don't send frame with multiple size of bulk max packet */
-       if ((nskb->len % bfusb->bulk_pkt_size) == 0) {
+       if ((nskb->len % data->bulk_pkt_size) == 0) {
                buf[0] = 0xdd;
                buf[1] = 0x00;
                memcpy(skb_put(nskb, 2), buf, 2);
        }
 
-       read_lock(&bfusb->lock);
+       read_lock(&data->lock);
 
-       skb_queue_tail(&bfusb->transmit_q, nskb);
-       bfusb_tx_wakeup(bfusb);
+       skb_queue_tail(&data->transmit_q, nskb);
+       bfusb_tx_wakeup(data);
 
-       read_unlock(&bfusb->lock);
+       read_unlock(&data->lock);
 
        kfree_skb(skb);
 
@@ -556,11 +555,11 @@ static int bfusb_send_frame(struct sk_buff *skb)
 
 static void bfusb_destruct(struct hci_dev *hdev)
 {
-       struct bfusb *bfusb = (struct bfusb *) hdev->driver_data;
+       struct bfusb_data *data = hdev->driver_data;
 
-       BT_DBG("hdev %p bfusb %p", hdev, bfusb);
+       BT_DBG("hdev %p bfusb %p", hdev, data);
 
-       kfree(bfusb);
+       kfree(data);
 }
 
 static int bfusb_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg)
@@ -568,25 +567,24 @@ static int bfusb_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long arg
        return -ENOIOCTLCMD;
 }
 
-
-static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int count)
+static int bfusb_load_firmware(struct bfusb_data *data, unsigned char *firmware, int count)
 {
        unsigned char *buf;
        int err, pipe, len, size, sent = 0;
 
-       BT_DBG("bfusb %p udev %p", bfusb, bfusb->udev);
+       BT_DBG("bfusb %p udev %p", data, data->udev);
 
        BT_INFO("BlueFRITZ! USB loading firmware");
 
-       pipe = usb_sndctrlpipe(bfusb->udev, 0);
+       pipe = usb_sndctrlpipe(data->udev, 0);
 
-       if (usb_control_msg(bfusb->udev, pipe, USB_REQ_SET_CONFIGURATION,
+       if (usb_control_msg(data->udev, pipe, USB_REQ_SET_CONFIGURATION,
                                0, 1, 0, NULL, 0, USB_CTRL_SET_TIMEOUT) < 0) {
                BT_ERR("Can't change to loading configuration");
                return -EBUSY;
        }
 
-       bfusb->udev->toggle[0] = bfusb->udev->toggle[1] = 0;
+       data->udev->toggle[0] = data->udev->toggle[1] = 0;
 
        buf = kmalloc(BFUSB_MAX_BLOCK_SIZE + 3, GFP_ATOMIC);
        if (!buf) {
@@ -594,14 +592,14 @@ static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int
                return -ENOMEM;
        }
 
-       pipe = usb_sndbulkpipe(bfusb->udev, bfusb->bulk_out_ep);
+       pipe = usb_sndbulkpipe(data->udev, data->bulk_out_ep);
 
        while (count) {
                size = min_t(uint, count, BFUSB_MAX_BLOCK_SIZE + 3);
 
                memcpy(buf, firmware + sent, size);
 
-               err = usb_bulk_msg(bfusb->udev, pipe, buf, size,
+               err = usb_bulk_msg(data->udev, pipe, buf, size,
                                        &len, BFUSB_BLOCK_TIMEOUT);
 
                if (err || (len != size)) {
@@ -613,21 +611,23 @@ static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int
                count -= size;
        }
 
-       if ((err = usb_bulk_msg(bfusb->udev, pipe, NULL, 0,
-                               &len, BFUSB_BLOCK_TIMEOUT)) < 0) {
+       err = usb_bulk_msg(data->udev, pipe, NULL, 0,
+                                       &len, BFUSB_BLOCK_TIMEOUT);
+       if (err < 0) {
                BT_ERR("Error in null packet request");
                goto error;
        }
 
-       pipe = usb_sndctrlpipe(bfusb->udev, 0);
+       pipe = usb_sndctrlpipe(data->udev, 0);
 
-        if ((err = usb_control_msg(bfusb->udev, pipe, USB_REQ_SET_CONFIGURATION,
-                               0, 2, 0, NULL, 0, USB_CTRL_SET_TIMEOUT)) < 0) {
+       err = usb_control_msg(data->udev, pipe, USB_REQ_SET_CONFIGURATION,
+                               0, 2, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
+       if (err < 0) {
                BT_ERR("Can't change to running configuration");
                goto error;
        }
 
-       bfusb->udev->toggle[0] = bfusb->udev->toggle[1] = 0;
+       data->udev->toggle[0] = data->udev->toggle[1] = 0;
 
        BT_INFO("BlueFRITZ! USB device ready");
 
@@ -637,9 +637,9 @@ static int bfusb_load_firmware(struct bfusb *bfusb, unsigned char *firmware, int
 error:
        kfree(buf);
 
-       pipe = usb_sndctrlpipe(bfusb->udev, 0);
+       pipe = usb_sndctrlpipe(data->udev, 0);
 
-       usb_control_msg(bfusb->udev, pipe, USB_REQ_SET_CONFIGURATION,
+       usb_control_msg(data->udev, pipe, USB_REQ_SET_CONFIGURATION,
                                0, 0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT);
 
        return err;
@@ -652,7 +652,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
        struct usb_host_endpoint *bulk_out_ep;
        struct usb_host_endpoint *bulk_in_ep;
        struct hci_dev *hdev;
-       struct bfusb *bfusb;
+       struct bfusb_data *data;
 
        BT_DBG("intf %p id %p", intf, id);
 
@@ -672,23 +672,24 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
        }
 
        /* Initialize control structure and load firmware */
-       if (!(bfusb = kzalloc(sizeof(struct bfusb), GFP_KERNEL))) {
+       data = kzalloc(sizeof(struct bfusb_data), GFP_KERNEL);
+       if (!data) {
                BT_ERR("Can't allocate memory for control structure");
                goto done;
        }
 
-       bfusb->udev = udev;
-       bfusb->bulk_in_ep    = bulk_in_ep->desc.bEndpointAddress;
-       bfusb->bulk_out_ep   = bulk_out_ep->desc.bEndpointAddress;
-       bfusb->bulk_pkt_size = le16_to_cpu(bulk_out_ep->desc.wMaxPacketSize);
+       data->udev = udev;
+       data->bulk_in_ep    = bulk_in_ep->desc.bEndpointAddress;
+       data->bulk_out_ep   = bulk_out_ep->desc.bEndpointAddress;
+       data->bulk_pkt_size = le16_to_cpu(bulk_out_ep->desc.wMaxPacketSize);
 
-       rwlock_init(&bfusb->lock);
+       rwlock_init(&data->lock);
 
-       bfusb->reassembly = NULL;
+       data->reassembly = NULL;
 
-       skb_queue_head_init(&bfusb->transmit_q);
-       skb_queue_head_init(&bfusb->pending_q);
-       skb_queue_head_init(&bfusb->completed_q);
+       skb_queue_head_init(&data->transmit_q);
+       skb_queue_head_init(&data->pending_q);
+       skb_queue_head_init(&data->completed_q);
 
        if (request_firmware(&firmware, "bfubase.frm", &udev->dev) < 0) {
                BT_ERR("Firmware request failed");
@@ -697,7 +698,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
 
        BT_DBG("firmware data %p size %d", firmware->data, firmware->size);
 
-       if (bfusb_load_firmware(bfusb, firmware->data, firmware->size) < 0) {
+       if (bfusb_load_firmware(data, firmware->data, firmware->size) < 0) {
                BT_ERR("Firmware loading failed");
                goto release;
        }
@@ -711,10 +712,10 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
                goto error;
        }
 
-       bfusb->hdev = hdev;
+       data->hdev = hdev;
 
        hdev->type = HCI_USB;
-       hdev->driver_data = bfusb;
+       hdev->driver_data = data;
        SET_HCIDEV_DEV(hdev, &intf->dev);
 
        hdev->open     = bfusb_open;
@@ -732,7 +733,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
                goto error;
        }
 
-       usb_set_intfdata(intf, bfusb);
+       usb_set_intfdata(intf, data);
 
        return 0;
 
@@ -740,7 +741,7 @@ release:
        release_firmware(firmware);
 
 error:
-       kfree(bfusb);
+       kfree(data);
 
 done:
        return -EIO;
@@ -748,8 +749,8 @@ done:
 
 static void bfusb_disconnect(struct usb_interface *intf)
 {
-       struct bfusb *bfusb = usb_get_intfdata(intf);
-       struct hci_dev *hdev = bfusb->hdev;
+       struct bfusb_data *data = usb_get_intfdata(intf);
+       struct hci_dev *hdev = data->hdev;
 
        BT_DBG("intf %p", intf);
 
@@ -779,7 +780,8 @@ static int __init bfusb_init(void)
 
        BT_INFO("BlueFRITZ! USB driver ver %s", VERSION);
 
-       if ((err = usb_register(&bfusb_driver)) < 0)
+       err = usb_register(&bfusb_driver);
+       if (err < 0)
                BT_ERR("Failed to register BlueFRITZ! USB driver");
 
        return err;
index 93ba25b7ea328303fad462372ddb575e69ea207e..420b645c4c9f0d20db0e5790e44a3c854890f6c8 100644 (file)
@@ -241,15 +241,11 @@ static int hci_uart_send_frame(struct sk_buff *skb)
 
 static void hci_uart_destruct(struct hci_dev *hdev)
 {
-       struct hci_uart *hu;
-
        if (!hdev)
                return;
 
        BT_DBG("%s", hdev->name);
-
-       hu = (struct hci_uart *) hdev->driver_data;
-       kfree(hu);
+       kfree(hdev->driver_data);
 }
 
 /* ------ LDISC part ------ */
@@ -272,7 +268,7 @@ static int hci_uart_tty_open(struct tty_struct *tty)
                return -EEXIST;
 
        if (!(hu = kzalloc(sizeof(struct hci_uart), GFP_KERNEL))) {
-               BT_ERR("Can't allocate controll structure");
+               BT_ERR("Can't allocate control structure");
                return -ENFILE;
        }
 
@@ -360,7 +356,7 @@ static void hci_uart_tty_wakeup(struct tty_struct *tty)
  *     
  * Return Value:    None
  */
-static void hci_uart_tty_receive(struct tty_struct *tty, const __u8 *data, char *flags, int count)
+static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, char *flags, int count)
 {
        struct hci_uart *hu = (void *)tty->disc_data;
 
@@ -375,7 +371,8 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const __u8 *data, char
        hu->hdev->stat.byte_rx += count;
        spin_unlock(&hu->rx_lock);
 
-       if (test_and_clear_bit(TTY_THROTTLED,&tty->flags) && tty->driver->unthrottle)
+       if (test_and_clear_bit(TTY_THROTTLED, &tty->flags) &&
+                                       tty->driver->unthrottle)
                tty->driver->unthrottle(tty);
 }
 
index e2d4beac74207c711bdafaf11399d0170d73d07b..0801af4ad2b9cab68ca22db8206e98031a090fb6 100644 (file)
@@ -96,6 +96,9 @@ static struct usb_device_id bluetooth_ids[] = {
        /* Ericsson with non-standard id */
        { USB_DEVICE(0x0bdb, 0x1002) },
 
+       /* Canyon CN-BTU1 with HID interfaces */
+       { USB_DEVICE(0x0c10, 0x0000), .driver_info = HCI_RESET },
+
        { }     /* Terminating entry */
 };
 
index aac67a3a6019958a5ad77347aa0dcc11c6609c99..a278d98a915126a2dac78c6d1865fc11d89181cf 100644 (file)
@@ -2,9 +2,9 @@
  *
  *  Bluetooth virtual HCI driver
  *
- *  Copyright (C) 2000-2001 Qualcomm Incorporated
- *  Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
- *  Copyright (C) 2004-2005 Marcel Holtmann <marcel@holtmann.org>
+ *  Copyright (C) 2000-2001  Qualcomm Incorporated
+ *  Copyright (C) 2002-2003  Maxim Krasnyansky <maxk@qualcomm.com>
+ *  Copyright (C) 2004-200 Marcel Holtmann <marcel@holtmann.org>
  *
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -72,21 +72,21 @@ static int vhci_open_dev(struct hci_dev *hdev)
 
 static int vhci_close_dev(struct hci_dev *hdev)
 {
-       struct vhci_data *vhci = hdev->driver_data;
+       struct vhci_data *data = hdev->driver_data;
 
        if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
                return 0;
 
-       skb_queue_purge(&vhci->readq);
+       skb_queue_purge(&data->readq);
 
        return 0;
 }
 
 static int vhci_flush(struct hci_dev *hdev)
 {
-       struct vhci_data *vhci = hdev->driver_data;
+       struct vhci_data *data = hdev->driver_data;
 
-       skb_queue_purge(&vhci->readq);
+       skb_queue_purge(&data->readq);
 
        return 0;
 }
@@ -94,7 +94,7 @@ static int vhci_flush(struct hci_dev *hdev)
 static int vhci_send_frame(struct sk_buff *skb)
 {
        struct hci_dev* hdev = (struct hci_dev *) skb->dev;
-       struct vhci_data *vhci;
+       struct vhci_data *data;
 
        if (!hdev) {
                BT_ERR("Frame for unknown HCI device (hdev=NULL)");
@@ -104,15 +104,15 @@ static int vhci_send_frame(struct sk_buff *skb)
        if (!test_bit(HCI_RUNNING, &hdev->flags))
                return -EBUSY;
 
-       vhci = hdev->driver_data;
+       data = hdev->driver_data;
 
        memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
-       skb_queue_tail(&vhci->readq, skb);
+       skb_queue_tail(&data->readq, skb);
 
-       if (vhci->flags & VHCI_FASYNC)
-               kill_fasync(&vhci->fasync, SIGIO, POLL_IN);
+       if (data->flags & VHCI_FASYNC)
+               kill_fasync(&data->fasync, SIGIO, POLL_IN);
 
-       wake_up_interruptible(&vhci->read_wait);
+       wake_up_interruptible(&data->read_wait);
 
        return 0;
 }
@@ -122,7 +122,7 @@ static void vhci_destruct(struct hci_dev *hdev)
        kfree(hdev->driver_data);
 }
 
-static inline ssize_t vhci_get_user(struct vhci_data *vhci,
+static inline ssize_t vhci_get_user(struct vhci_data *data,
                                        const char __user *buf, size_t count)
 {
        struct sk_buff *skb;
@@ -139,7 +139,7 @@ static inline ssize_t vhci_get_user(struct vhci_data *vhci,
                return -EFAULT;
        }
 
-       skb->dev = (void *) vhci->hdev;
+       skb->dev = (void *) data->hdev;
        bt_cb(skb)->pkt_type = *((__u8 *) skb->data);
        skb_pull(skb, 1);
 
@@ -148,7 +148,7 @@ static inline ssize_t vhci_get_user(struct vhci_data *vhci,
        return count;
 }
 
-static inline ssize_t vhci_put_user(struct vhci_data *vhci,
+static inline ssize_t vhci_put_user(struct vhci_data *data,
                        struct sk_buff *skb, char __user *buf, int count)
 {
        char __user *ptr = buf;
@@ -161,42 +161,43 @@ static inline ssize_t vhci_put_user(struct vhci_data *vhci,
 
        total += len;
 
-       vhci->hdev->stat.byte_tx += len;
+       data->hdev->stat.byte_tx += len;
 
        switch (bt_cb(skb)->pkt_type) {
        case HCI_COMMAND_PKT:
-               vhci->hdev->stat.cmd_tx++;
+               data->hdev->stat.cmd_tx++;
                break;
 
        case HCI_ACLDATA_PKT:
-               vhci->hdev->stat.acl_tx++;
+    &nbs