http://linux.bkbits.net/linux-2.5 torvalds@ppc970.osdl.org|ChangeSet|20050128171434|45338 torvalds # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/28 09:14:34-08:00 torvalds@ppc970.osdl.org # Merge bk://linux-scsi.bkbits.net/scsi-for-linus-2.6 # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # drivers/scsi/sr.c # 2005/01/28 09:14:30-08:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/sg.c # 2005/01/28 09:14:30-08:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/sd.c # 2005/01/28 09:14:30-08:00 torvalds@ppc970.osdl.org +0 -1 # Auto merged # # drivers/scsi/scsi_debug.c # 2005/01/28 09:14:30-08:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/osst.c # 2005/01/28 09:14:29-08:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/dpt_i2o.c # 2005/01/28 09:14:29-08:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # drivers/scsi/Kconfig # 2005/01/28 09:14:29-08:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2005/01/27 17:10:18-08:00 torvalds@ppc970.osdl.org # Fix permissions on drivers/scsi/a100u2w.c # # drivers/scsi/a100u2w.c # 2005/01/27 17:09:36-08:00 torvalds@ppc970.osdl.org +0 -0 # Change mode to -rw-r--r-- # # ChangeSet # 2005/01/28 00:08:57+00:00 dvrabel@com.rmk.(none) # [ARM PATCH] 2437/1: ixp4xx: cosmetic change to arch_reset() # # Patch from David Vrabel # # Use some #define'd constants in the ixp4xx's arch_reset(). # # Signed-off-by: David Vrabel # Signed-off-by: Russell King # # include/asm-arm/arch-ixp4xx/system.h # 2005/01/27 15:49:14+00:00 dvrabel@com.rmk.(none) +3 -4 # [PATCH] 2437/1: ixp4xx: cosmetic change to arch_reset() # # ChangeSet # 2005/01/27 17:13:18-05:00 shemminger@osdl.org # [PATCH] (2/2) skfddi: netdev_priv and cast cleanup # # Use netdev_priv() and get rid of the PRIV() macro by using the correct # data element. Also eliminate casts, where type is correct. # # Signed-off-by: Stephen Hemminger # Signed-off-by: Jeff Garzik # # drivers/net/skfp/skfddi.c # 2004/12/14 14:07:42-05:00 shemminger@osdl.org +30 -28 # (2/2) skfddi: netdev_priv and cast cleanup # # ChangeSet # 2005/01/27 17:12:59-05:00 shemminger@osdl.org # [PATCH] (1/2) skfddi: initialization # # When the skfddi driver was converted to the new PCI netdevice interface, # it never got tested with real hardware. The initialization got broken, this # should fix it. # # Signed-off-by: Stephen Hemminger # Signed-off-by: Jeff Garzik # # drivers/net/skfp/skfddi.c # 2004/12/14 14:08:07-05:00 shemminger@osdl.org +20 -38 # (1/2) skfddi: initialization # # ChangeSet # 2005/01/27 17:08:40-05:00 galak@freescale.com # [PATCH] netdrv gianfar: Fix usage of gfar_read in debug code # # Fixes instances where gfar_read() was invoked in debug codewith a value, # rather than a pointer. # # Signed-of-by: Andy Fleming # Signed-of-by: Kumar Gala # Signed-off-by: Jeff Garzik # # drivers/net/gianfar.c # 2005/01/25 19:14:13-05:00 galak@freescale.com +4 -4 # netdrv gianfar: Fix usage of gfar_read in debug code # # ChangeSet # 2005/01/27 16:57:11-05:00 akpm@osdl.org # [PATCH] e100 locking up netconsole. # # From: Steven Rostedt # # If the transmit buffer of the e100 overflowed, then the system would hang. # This was caused because the e100 driver would stop the queue, and # netpoll_send_pkt in netpoll.c would then loop forever. This is because the # e100 net_poll would never start the queue again after the transmits have # completed. # # For those that use the e100 and netconsole, all you need to do is a sysreq # 't' to lock up the system. # # Acked-by: Ingo Molnar # Signed-off-by: Andrew Morton # Signed-off-by: Jeff Garzik # # drivers/net/e100.c # 2005/01/24 21:55:48-05:00 akpm@osdl.org +1 -0 # e100 locking up netconsole. # # ChangeSet # 2005/01/27 16:52:54-05:00 jason.d.gaston@intel.com # [PATCH] SATA AHCI support for Intel ICH7R # # This patch adds the Intel ICH7R DID's to the ahci.c SATA AHCI driver # for ICH7R SATA support. # # Signed-off-by:  Jason Gaston # Signed-off-by: Jeff Garzik # # drivers/scsi/ahci.c # 2005/01/21 10:48:59-05:00 jason.d.gaston@intel.com +4 -0 # SATA AHCI support for Intel ICH7R - 2.6.11-rc1 # # ChangeSet # 2005/01/27 16:13:14-05:00 viro@parcelfarce.linux.theplanet.co.uk # [PATCH] de2104x: Fixes breakage in getting MAC address # # Fixes breakage in getting MAC address on built-in tulip in # alphastation 200 - without delay we are skipping bytes. # # Signed-off-by: Al Viro # Signed-off-by: Jeff Garzik # # drivers/net/tulip/de2104x.c # 2005/01/25 22:28:28-05:00 viro@parcelfarce.linux.theplanet.co.uk +1 -0 # de2104x # # ChangeSet # 2005/01/27 15:37:39-05:00 haroldo.gamal@infolink.com.br # [libata sata_sil] add another Seagate driver to blacklist # # drivers/scsi/sata_sil.c # 2005/01/27 15:37:33-05:00 haroldo.gamal@infolink.com.br +1 -0 # [libata sata_sil] add another Seagate driver to blacklist # # ChangeSet # 2005/01/27 19:31:47+00:00 rmk@flint.arm.linux.org.uk # [ARM] Replace duplicate sets of vector code with assembler macro. # # Signed-off-by: Russell King # # arch/arm/kernel/entry-armv.S # 2005/01/27 19:27:00+00:00 rmk@flint.arm.linux.org.uk +103 -158 # Replace 4 almost duplicate sets of vector code with an assembler # macro. # # ChangeSet # 2005/01/27 19:13:38+00:00 rmk@flint.arm.linux.org.uk # [ARM] Make vector labels consistent with naming scheme # # Signed-off-by: Russell King # # arch/arm/kernel/entry-armv.S # 2005/01/27 19:09:17+00:00 rmk@flint.arm.linux.org.uk +11 -11 # Rename some private labels to be consistent with the naming scheme # elsewhere in entry-armv.S # # ChangeSet # 2005/01/27 09:37:23-08:00 torvalds@ppc970.osdl.org # Merge bk://kernel.bkbits.net/vojtech/for-linus # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # Documentation/kernel-parameters.txt # 2005/01/27 09:37:19-08:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2005/01/27 14:58:43+01:00 vojtech@silver.ucw.cz # input: Add missing input_sync() calls to atkbd.c. # # Signed-off-by: Vojtech Pavlik # # drivers/input/keyboard/atkbd.c # 2005/01/27 14:58:31+01:00 vojtech@silver.ucw.cz +2 -0 # input: Add missing input_sync() calls to atkbd.c. # # ChangeSet # 2005/01/27 14:48:48+01:00 vojtech@silver.ucw.cz # input: Enable scancode event generation in the HID driver. This should allow # changing HID->event mappings (via EVIOCS*) in the future and make # debugging easier now. # # Signed-off-by: Vojtech Pavlik # # drivers/usb/input/hid-input.c # 2005/01/27 14:48:37+01:00 vojtech@silver.ucw.cz +7 -3 # input: Enable scancode event generation in the HID driver. This should allow # changing HID->event mappings (via EVIOCS*) in the future. # # ChangeSet # 2005/01/27 13:47:19+01:00 vojtech@silver.ucw.cz # input: Always bring the i8042 multiplexer out of multiplexing mode before # rebooting. # # Signed-off-by: Vojtech Pavlik # # drivers/input/serio/i8042.c # 2005/01/27 13:47:08+01:00 vojtech@silver.ucw.cz +22 -14 # input: Always bring the i8042 multiplexer out of multiplexing mode before # rebooting. # # ChangeSet # 2005/01/27 01:18:50-05:00 dtor_core@ameritech.net # Input: ACK/NAK processing rules in libps2 were too strict - while it is a # good idea to discard any character other than ACK/NAK during probe # it causes missing releases and keys getting "stuck" when a command # issued on enabled device. The effect is easily demonstrated with # the following command: # while true; do xset led 3; xset -led 3; done # # With this change extra characters will be discarded only if device # has not been marked as "enabled" yet. # # Signed-off-by: Dmitry Torokhov # # drivers/input/serio/libps2.c # 2005/01/27 01:18:38-05:00 dtor_core@ameritech.net +13 -3 # Do not claim to have processed ACK/NAK when received other character. # # ChangeSet # 2005/01/26 10:43:01-08:00 herbert@13thfloor.at # [PATCH] fix ext3 quota allocation bug on error path ... # # looking at ext3_xattr_block_set() [fs/ext3/xattr.c] ... # I see that # # error = -EDQUOT; # if (DQUOT_ALLOC_BLOCK(inode, 1)) # goto cleanup; # # allocates a quota block, but right after that several # error echecks happen ... # # if (error) # goto cleanup; # # and I don't see any DQUOT_FREE_BLOCK() in the errorpath # # cleanup: # if (ce) # mb_cache_entry_release(ce); # brelse(new_bh); # if (!(bs->bh && s->base == bs->bh->b_data)) # kfree(s->base); # # return error; # # I'd suggest the attached fix. # # Acked-by: Jan Kara # Acked-by: Andreas Gruenbacher # Signed-off-by: Linus Torvalds # # fs/ext3/xattr.c # 2005/01/22 07:45:09-08:00 herbert@13thfloor.at +6 -2 # fix ext3 quota allocation bug on error path ... # # ChangeSet # 2005/01/26 08:47:14-08:00 torvalds@ppc970.osdl.org # Merge bk://kernel.bkbits.net/davem/net-2.6 # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # MAINTAINERS # 2005/01/26 08:47:09-08:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2005/01/25 22:06:30-08:00 tgraf@suug.ch # [NET]: Set NLM_F_MULTI for neighbour rtnetlink messages to userspace. # # Signed-off-by: Thomas Graf # Signed-off-by: David S. Miller # # net/core/neighbour.c # 2005/01/25 22:06:06-08:00 tgraf@suug.ch +1 -0 # [NET]: Set NLM_F_MULTI for neighbour rtnetlink messages to userspace. # # Signed-off-by: Thomas Graf # Signed-off-by: David S. Miller # # ChangeSet # 2005/01/25 22:00:23-08:00 James.Bottomley@SteelEye.com # [PATCH] fix broken cross compiles # # The change to kbuild to use -isystem `gcc -print-file-name=include` # broke our parisc crosscompile (and presumably everyone else's). # # The reason is that you have a := in the NOSTDINC_FLAGS rule, which is # evaluated in situ (i.e. before we've had a chance to set CROSSCOMPILE # on CC) so the gcc include path is actually the native one not the # crosscompiler one. On parisc this causes us to be unable to handle # _builtin_va functions, but I bet there are a heap of other problems. # # Acked-by: Sam Ravnborg # Signed-off-by: Linus Torvalds # # Makefile # 2005/01/25 15:13:51-08:00 James.Bottomley@SteelEye.com +1 -1 # fix broken cross compiles # # ChangeSet # 2005/01/25 21:53:42-08:00 herbert@gondor.apana.org.au # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/xfrm/xfrm_user.c # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +2 -4 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/xfrm/xfrm_algo.c # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +29 -38 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/key/af_key.c # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +3 -3 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/ipv6/ipcomp6.c # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +1 -1 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/ipv6/esp6.c # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +1 -1 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/ipv6/ah6.c # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +1 -1 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/ipv4/ipcomp.c # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +1 -1 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/ipv4/esp4.c # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +1 -1 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # net/ipv4/ah4.c # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +1 -1 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # include/net/xfrm.h # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +3 -3 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # include/linux/crypto.h # 2005/01/25 21:53:19-08:00 herbert@gondor.apana.org.au +8 -0 # [XFRM]: Probe selected algorithm only. # # This patch removes an annoying problem in xfrm_user. As it is every # time an SA is added it probes every known algorithm in the universe. # Now if they all existed it would be OK. However, for the ones which # don't actually exist this causes multiple /sbin/modprobe processes to # be spawned which slows the system down when you're adding hundreds of # SAs. # # Since we know the type of algorithm required when we're adding a new # SA, we can get away with only probing the selected algorithms. This # is what the following patch does for xfrm_user. # # Signed-off-by: Herbert Xu # Signed-off-by: James Morris # Signed-off-by: David S. Miller # # ChangeSet # 2005/01/25 21:34:49-08:00 akpm@osdl.org # [TUN/TAP]: Add missing trans_start and last_rx setting. # # But as stated in bonding.txt, the ARP monitor requires the underlying # driver to update dev->trans_start and dev->last_rx. # # The patch below adds the required functionality to the TUN/TAP driver. # Please test if this helps in your case. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # drivers/net/tun.c # 2005/01/25 21:34:26-08:00 akpm@osdl.org +2 -0 # [TUN/TAP]: Add missing trans_start and last_rx setting. # # But as stated in bonding.txt, the ARP monitor requires the underlying # driver to update dev->trans_start and dev->last_rx. # # The patch below adds the required functionality to the TUN/TAP driver. # Please test if this helps in your case. # # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2005/01/25 21:33:24-08:00 akpm@osdl.org # [NET]: netpoll: Fix NAPI polling race on SMP # # From: Matt Mackall # # This avoids a nasty NAPI race by checking that work was actually scheduled # for the CPU netpoll is running on and pulls the NAPI-specific code out into # a separate function. # # Original idea from Jeff Moyer # Tested by Andrew Tridgell # # Signed-off-by: Matt Mackall # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # net/core/netpoll.c # 2005/01/25 21:32:56-08:00 akpm@osdl.org +25 -16 # [NET]: netpoll: Fix NAPI polling race on SMP # # From: Matt Mackall # # This avoids a nasty NAPI race by checking that work was actually scheduled # for the CPU netpoll is running on and pulls the NAPI-specific code out into # a separate function. # # Original idea from Jeff Moyer # Tested by Andrew Tridgell # # Signed-off-by: Matt Mackall # Signed-off-by: Andrew Morton # Signed-off-by: David S. Miller # # ChangeSet # 2005/01/25 21:31:12-08:00 mostrows@watson.ibm.com # [MAINTAINERS]: Fix my email address in PPPOE entry. # # Signed-off-by: David S. Miller # # MAINTAINERS # 2005/01/25 21:30:49-08:00 mostrows@watson.ibm.com +1 -1 # [MAINTAINERS]: Fix my email address in PPPOE entry. # # Signed-off-by: David S. Miller # # ChangeSet # 2005/01/25 21:19:37-08:00 rusty@rustcorp.com.au # [NETFILTER]: Avoid breaking userspace due to tuple change # # Andreas Schwab points out that the ipt_conntrack # match exposes struct # # include/linux/netfilter_ipv4/ipt_conntrack.h # 2005/01/25 21:18:55-08:00 rusty@rustcorp.com.au +22 -1 # [NETFILTER]: Avoid breaking userspace due to tuple change # # Andreas Schwab points out that the ipt_conntrack # match exposes struct # # ChangeSet # 2005/01/25 21:18:13-08:00 rusty@rustcorp.com.au # [NETFILTER]: IRC Zero Port Fix # # Ian Kumlien reported that new NAT code started sending out DCC # requests with 0 as the IP address. That prompted me to write a simple # IRC test case, which both illustrated the bug, and found another one # in that the wrong expectation was being set up when NAT occurred. # # Signed-off-by: Rusty Russell # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ip_nat_irc.c # 2005/01/25 21:17:27-08:00 rusty@rustcorp.com.au +4 -1 # [NETFILTER]: IRC Zero Port Fix # # Ian Kumlien reported that new NAT code started sending out DCC # requests with 0 as the IP address. That prompted me to write a simple # IRC test case, which both illustrated the bug, and found another one # in that the wrong expectation was being set up when NAT occurred. # # Signed-off-by: Rusty Russell # Signed-off-by: David S. Miller # # net/ipv4/netfilter/ip_conntrack_irc.c # 2005/01/25 21:17:27-08:00 rusty@rustcorp.com.au +6 -1 # [NETFILTER]: IRC Zero Port Fix # # Ian Kumlien reported that new NAT code started sending out DCC # requests with 0 as the IP address. That prompted me to write a simple # IRC test case, which both illustrated the bug, and found another one # in that the wrong expectation was being set up when NAT occurred. # # Signed-off-by: Rusty Russell # Signed-off-by: David S. Miller # # ChangeSet # 2005/01/25 21:16:24-08:00 rddunlap@osdl.org # [VLAN]: Eliminate gcc warnings with PROC_FS=n # # Signed-off-by: Randy Dunlap # Signed-off-by: David S. Miller # # net/8021q/vlanproc.h # 2005/01/25 21:15:43-08:00 rddunlap@osdl.org +2 -2 # [VLAN]: Eliminate gcc warnings with PROC_FS=n # # Signed-off-by: Randy Dunlap # Signed-off-by: David S. Miller # # ChangeSet # 2005/01/25 21:15:28-08:00 nathanl@austin.ibm.com # [PATCH] ppc64: fix use kref for device_node refcounting (fix) # # The recent ppc64 patch to use kref for device_node refcounting # introduced an unbalanced get/put in of_add_node which would cause # newly-added device nodes to be prematurely freed. Sorry for the # screwup, a more rigorously tested fix follows. # # Signed-off-by: Nathan Lynch # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/prom.c # 2005/01/25 20:58:33-08:00 nathanl@austin.ibm.com +1 -0 # ppc64: fix use kref for device_node refcounting (fix) # # ChangeSet # 2005/01/25 20:56:30-08:00 olh@suse.de # [PATCH] fix architecture names in hugetlbpage.txt # # Anton fixed the code recently, but forgot to fix the documentation. There # is no "ia32" thing, its i386. The other thing is named 'ia64' in arch/ # # Signed-off-by: Olaf Hering # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # Documentation/vm/hugetlbpage.txt # 2005/01/25 13:50:28-08:00 olh@suse.de +10 -10 # fix architecture names in hugetlbpage.txt # # ChangeSet # 2005/01/25 20:56:12-08:00 rusty@rustcorp.com.au # [PATCH] Include type information as module info where possible # # Module parameters no longer have a type in general, as we use a callback # system (module_param_call()). However, it's useful to include type # information in the commonly-used wrappers: module_param, # module_param_string and module_param_array. # # Signed-off-by: Rusty Russell # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/moduleparam.h # 2005/01/25 13:50:28-08:00 rusty@rustcorp.com.au +6 -3 # Include type information as module info where possible # # ChangeSet # 2005/01/25 20:55:59-08:00 adaplas@hotpop.com # [PATCH] matroxfb: FB_MATROX_G Kconfig changes # # The current Kconfig entries for the Matrox G cards are quite confusing: # # config FB_MATROX_G450 # bool "G100/G200/G400/G450/G550 support" # depends on FB_MATROX # # config FB_MATROX_G100A # bool "G100/G200/G400 support" # depends on FB_MATROX && !FB_MATROX_G450 # # The patch below contains: # - remove FB_MATROX_G100{,A} and rename FB_MATROX_G to FB_MATROX_G450 # (FB_MATROX_G450 included support from the G100 to the G550, so # I don't see any non-historic reason why to call it G450) # - small update for the FB_MATROX_G Kconfig text # # The disadvantage of this patch is, that you can no longer select support # only for the G100-G400 without supporting the G450 and G550. But # compared with the current confusing Kconfig setup, I don't think that's # a big issue. # # Signed-off-by: Adrian Bunk # Signed-off-by: Antonino Daplas # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/matrox/matroxfb_g450.h # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +1 -1 # matroxfb: FB_MATROX_G Kconfig changes # # drivers/video/matrox/matroxfb_base.h # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +1 -1 # matroxfb: FB_MATROX_G Kconfig changes # # drivers/video/matrox/matroxfb_base.c # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +3 -3 # matroxfb: FB_MATROX_G Kconfig changes # # drivers/video/matrox/matroxfb_DAC1064.h # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +1 -1 # matroxfb: FB_MATROX_G Kconfig changes # # drivers/video/matrox/matroxfb_DAC1064.c # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +10 -15 # matroxfb: FB_MATROX_G Kconfig changes # # drivers/video/matrox/Makefile # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +1 -2 # matroxfb: FB_MATROX_G Kconfig changes # # drivers/video/Kconfig # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +6 -26 # matroxfb: FB_MATROX_G Kconfig changes # # ChangeSet # 2005/01/25 20:55:42-08:00 adaplas@hotpop.com # [PATCH] backlight: Fix compile error if CONFIG_FB is unset # # With Andrew Zabolotny # # LD init/built-in.o # LD .tmp_vmlinux1 # drivers/built-in.o(.text+0x9bfa): In function `lcd_device_register': # : undefined reference to `fb_register_client' # drivers/built-in.o(.text+0x9ce3): In function `lcd_device_unregister': # : undefined reference to `fb_unregister_client' # drivers/built-in.o(.text+0xa16a): In function `backlight_device_register': # : undefined reference to `fb_register_client' # drivers/built-in.o(.text+0xa253): In function `backlight_device_unregister': # : undefined reference to `fb_unregister_client' # make: *** [.tmp_vmlinux1] Error 1 # # Signed-off-by: Antonino Daplas # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/backlight/Kconfig # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +2 -0 # backlight: Fix compile error if CONFIG_FB is unset # # drivers/video/Kconfig # 2005/01/25 14:29:26-08:00 adaplas@hotpop.com +1 -1 # backlight: Fix compile error if CONFIG_FB is unset # # ChangeSet # 2005/01/25 20:55:28-08:00 adaplas@hotpop.com # [PATCH] fbcon: Save blank state last # # Save blank state after do_blank|unblank_screen() since this flag is checked in # fbcon_blank(). # # Signed-off-by: Antonino Daplas # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/console/fbcon.c # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +1 -2 # fbcon: Save blank state last # # ChangeSet # 2005/01/25 20:55:14-08:00 adaplas@hotpop.com # [PATCH] intelfb: Workaround for 830M # # This is a work around for the 830M with intelfb. Relative to 2.6.10. Without # this patch, updates to the DSPACNTR register will be ignored. # # On the 830M, the display plane needs to be enabled before writing to any of # the other bits in the DSPACNTR register. # # This patch detects the specific case, temporarily enables the plane, updates # the register, and then disables the plane. It also appears to require some # settling time, but not an entire frame's time. # # Without this change, the pixel format fields in DSPACNTR won't get written on # the 830M. # # Signed-off-by: Andrew Pfiffer # Signed-off-by: Antonino Daplas # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/intelfb/intelfbhw.c # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +16 -0 # intelfb: Workaround for 830M # # ChangeSet # 2005/01/25 20:54:57-08:00 adaplas@hotpop.com # [PATCH] vesafb: Change return error id # # With # # I'm getting a message in dmesg: "localhost kernel: vesafb: probe of vesafb0 # failed with error -6" # # I searched the web, and found that a lot of people are getting this, but I # couldn't find an answer, so I looked into it. # # This appears to be because "vesafb" returns -ENXIO ("No such device or # address") when its probe function fails. However, driverse/base/bus.c spews # an error message during device_attach() if a matching driver's probe function # returns anything but -ENODEV ("No such device"). # # Signed-off-by: Antonino Daplas # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/vesafb.c # 2005/01/25 13:50:28-08:00 adaplas@hotpop.com +2 -2 # vesafb: Change return error id # # ChangeSet # 2005/01/25 20:54:43-08:00 adaplas@hotpop.com # [PATCH] radeonfb: Set accelerator id # # Set accelerator id for radeonfb. This id is checked by some user apps such as # DirectFB. # # Signed-off-by: Antonino Daplas # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/video/aty/radeon_base.c # 2005/01/25 13:50:27-08:00 adaplas@hotpop.com +1 -0 # radeonfb: Set accelerator id # # ChangeSet # 2005/01/25 20:54:24-08:00 kraxel@bytesex.org # [PATCH] add i2c adapter id for the cx88 driver. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/i2c-id.h # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +1 -0 # add i2c adapter id for the cx88 driver. # # drivers/media/video/cx88/cx88-i2c.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +1 -1 # add i2c adapter id for the cx88 driver. # # ChangeSet # 2005/01/25 20:54:10-08:00 kraxel@bytesex.org # [PATCH] v4l-saa7134-module fix # # New version, this time using a #define, which should kill the reference # to need_* as well ... # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/saa7134/saa7134-core.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +9 -0 # v4l-saa7134-module fix # # ChangeSet # 2005/01/25 20:53:56-08:00 kraxel@bytesex.org # [PATCH] v4l: saa7134 module # # - fix saa7134 module loading issues. # # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/saa7134/saa7134-core.c # 2005/01/25 14:29:28-08:00 kraxel@bytesex.org +45 -2 # v4l: saa7134 module # # ChangeSet # 2005/01/25 20:53:37-08:00 kraxel@bytesex.org # [PATCH] v4l: bttv update # # - some cleanups merged. # - use new tveeprom module to configure Hauppauge cards. # - add new tv cards. # # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/bttvp.h # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +2 -6 # v4l: bttv update # # drivers/media/video/bttv.h # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +3 -2 # v4l: bttv update # # drivers/media/video/bttv-vbi.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +3 -2 # v4l: bttv update # # drivers/media/video/bttv-risc.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +1 -1 # v4l: bttv update # # drivers/media/video/bttv-if.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +12 -2 # v4l: bttv update # # drivers/media/video/bttv-i2c.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +3 -20 # v4l: bttv update # # drivers/media/video/bttv-driver.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +12 -5 # v4l: bttv update # # drivers/media/video/bttv-cards.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +106 -97 # v4l: bttv update # # drivers/media/video/btcx-risc.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +2 -1 # v4l: bttv update # # drivers/media/video/Kconfig # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +1 -0 # v4l: bttv update # # ChangeSet # 2005/01/25 20:53:22-08:00 kraxel@bytesex.org # [PATCH] v4l: bttv IR input driver update # # This patch enables IR support for one AverMedia card and drops a obsolete # function. # # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/ir-kbd-i2c.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +2 -2 # v4l: bttv IR input driver update # # drivers/media/video/ir-kbd-gpio.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +2 -2 # v4l: bttv IR input driver update # # drivers/media/common/ir-common.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +2 -1 # v4l: bttv IR input driver update # # ChangeSet # 2005/01/25 20:53:05-08:00 kraxel@bytesex.org # [PATCH] v4l: tvaudio update # # - minor msp3400 updates. # - add tea6320 support. # # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/tvmixer.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +1 -0 # v4l: tvaudio update # # drivers/media/video/tvaudio.h # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +1 -1 # v4l: tvaudio update # # drivers/media/video/tvaudio.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +59 -2 # v4l: tvaudio update # # drivers/media/video/msp3400.c # 2005/01/25 13:50:27-08:00 kraxel@bytesex.org +9 -2 # v4l: tvaudio update # # ChangeSet # 2005/01/25 20:52:50-08:00 kraxel@bytesex.org # [PATCH] v4l: add tveeprom module. # # Add a module which can parse config informations out of TV card eeproms. Will # be used by bttv, cx88 and ivtv. # # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/media/tveeprom.h # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +23 -0 # v4l: add tveeprom module. # # include/media/tveeprom.h # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/include/media/tveeprom.h # # drivers/media/video/tveeprom.c # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +577 -0 # v4l: add tveeprom module. # # drivers/media/video/Makefile # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +1 -0 # v4l: add tveeprom module. # # drivers/media/Kconfig # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +3 -0 # v4l: add tveeprom module. # # drivers/media/video/tveeprom.c # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/video/tveeprom.c # # ChangeSet # 2005/01/25 20:52:33-08:00 kraxel@bytesex.org # [PATCH] v4l: tuner update # # - add new tuner types. # - add support for digital tv tuning. # - make tda9887 output ports more configurable. # # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/media/tuner.h # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +6 -2 # v4l: tuner update # # drivers/media/video/tuner.c # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +35 -25 # v4l: tuner update # # drivers/media/video/tda9887.c # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +28 -10 # v4l: tuner update # # ChangeSet # 2005/01/25 20:52:17-08:00 kraxel@bytesex.org # [PATCH] v4l2 tuner api update # # Add new tuner type to the v4l2 API. # # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/videodev2.h # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +1 -0 # v4l2 tuner api update # # ChangeSet # 2005/01/25 20:52:00-08:00 kraxel@bytesex.org # [PATCH] v4l: video-buf update # # - Fix a memory leak in video-buf.c # - Small update for the video-buf-dvb.c module. # # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/media/video-buf-dvb.h # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +3 -1 # v4l: video-buf update # # drivers/media/video/video-buf.c # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +3 -1 # v4l: video-buf update # # drivers/media/video/video-buf-dvb.c # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +7 -4 # v4l: video-buf update # # ChangeSet # 2005/01/25 20:51:45-08:00 kraxel@bytesex.org # [PATCH] video/zr36120: remove casts # # Remove unneeded casts of (void *) pointers. # # Signed-off-by: Domen Puncer # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/zr36120.c # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +8 -8 # video/zr36120: remove casts # # ChangeSet # 2005/01/25 20:51:29-08:00 kraxel@bytesex.org # [PATCH] video/w9966: remove casts # # Remove unneeded casts of (void *) pointers. # # Signed-off-by: Domen Puncer # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/w9966.c # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +3 -3 # video/w9966: remove casts # # ChangeSet # 2005/01/25 20:51:15-08:00 kraxel@bytesex.org # [PATCH] video/arv: remove casts # # Remove unneeded casts of (void *) pointers. # # Signed-off-by: Domen Puncer # Signed-off-by: Gerd Knorr - # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/video/arv.c # 2005/01/25 13:50:26-08:00 kraxel@bytesex.org +1 -1 # video/arv: remove casts # # ChangeSet # 2005/01/25 20:50:58-08:00 kraxel@bytesex.org # [PATCH] videotext: ioctls changed to use _IO macros # # From: Michael Geng # # This patch switches the videotext drivers over to use the _IO macros for # ioctls. video_usercopy() works correctly then. The drivers will also map the # old to the new ioctl numbers to make sure old apps don't break. # # The patch also updates Documentation/ioctl.h to reflect that change. and # deletes a unused struct in include/linux/videotext.h. # # Signed-off-by: Gerd Knorr # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/videotext.h # 2005/01/25 13:50:25-08:00 kraxel@bytesex.org +33 -52 # videotext: ioctls changed to use _IO macros # # drivers/media/video/saa5249.c # 2005/01/25 13:50:25-08:00 kraxel@bytesex.org +53 -1 # videotext: ioctls changed to use _IO macros # # drivers/media/video/saa5246a.h # 2005/01/25 13:50:25-08:00 kraxel@bytesex.org +1 -1 # videotext: ioctls changed to use _IO macros # # drivers/media/video/saa5246a.c # 2005/01/25 13:50:25-08:00 kraxel@bytesex.org +49 -0 # videotext: ioctls changed to use _IO macros # # Documentation/ioctl-number.txt # 2005/01/25 13:50:25-08:00 kraxel@bytesex.org +2 -1 # videotext: ioctls changed to use _IO macros # # ChangeSet # 2005/01/25 20:50:44-08:00 linux@dominikbrodowski.de # [PATCH] pcmcia: use unsigned long for IO port address # # With Randy Dunlap # # PCMCIA: convert internal I/O port addresses to unsigned long (kio_addr_t). # # Dominik pointed out that some ioaddr_t data are exposed to userspace, so don't # touch those structures. # # Linus said: # But the right thing is definitely to make an IO port pointer be # "unsigned int" or even "unsigned long". # URL: http://lkml.org/lkml/2005/1/11/168 # # Signed-off-by: Randy Dunlap # Signed-off-by: Dominik Brodowski # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/pcmcia/ss.h # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +4 -4 # pcmcia: use unsigned long for IO port address # # include/pcmcia/cs_types.h # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +2 -0 # pcmcia: use unsigned long for IO port address # # drivers/serial/serial_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +3 -3 # pcmcia: use unsigned long for IO port address # # drivers/pcmcia/tcic.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +8 -8 # pcmcia: use unsigned long for IO port address # # drivers/pcmcia/rsrc_nonstatic.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +8 -6 # pcmcia: use unsigned long for IO port address # # drivers/pcmcia/m32r_pcc.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +4 -4 # pcmcia: use unsigned long for IO port address # # drivers/pcmcia/m32r_cfc.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +5 -5 # pcmcia: use unsigned long for IO port address # # drivers/pcmcia/i82365.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +14 -14 # pcmcia: use unsigned long for IO port address # # drivers/pcmcia/i82092.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +1 -1 # pcmcia: use unsigned long for IO port address # # drivers/pcmcia/hd64465_ss.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +1 -1 # pcmcia: use unsigned long for IO port address # # drivers/pcmcia/cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +3 -3 # pcmcia: use unsigned long for IO port address # # drivers/pcmcia/au1000_generic.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +2 -2 # pcmcia: use unsigned long for IO port address # # drivers/net/wireless/wavelan_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +28 -28 # pcmcia: use unsigned long for IO port address # # drivers/net/wireless/netwave_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +12 -12 # pcmcia: use unsigned long for IO port address # # drivers/net/pcmcia/xirc2ps_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +25 -25 # pcmcia: use unsigned long for IO port address # # drivers/net/pcmcia/smc91c92_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +31 -31 # pcmcia: use unsigned long for IO port address # # drivers/net/pcmcia/pcnet_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +19 -19 # pcmcia: use unsigned long for IO port address # # drivers/net/pcmcia/nmclan_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +12 -12 # pcmcia: use unsigned long for IO port address # # drivers/net/pcmcia/fmvj18x_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +11 -11 # pcmcia: use unsigned long for IO port address # # drivers/net/pcmcia/axnet_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +13 -13 # pcmcia: use unsigned long for IO port address # # drivers/net/pcmcia/3c589_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +16 -15 # pcmcia: use unsigned long for IO port address # # drivers/net/pcmcia/3c574_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +26 -24 # pcmcia: use unsigned long for IO port address # # drivers/bluetooth/btuart_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +1 -1 # pcmcia: use unsigned long for IO port address # # drivers/bluetooth/bt3c_cs.c # 2005/01/25 13:50:25-08:00 linux@dominikbrodowski.de +1 -1 # pcmcia: use unsigned long for IO port address # # ChangeSet # 2005/01/25 20:50:25-08:00 linux@dominikbrodowski.de # [PATCH] pcmcia: socket->{a,c}region are unused # # From: Christoph Hellwig # # socket->{a,c}_region aren't ever touched elsewhere, so let's kill this. # # Signed-off-by: Christoph Hellwig # Signed-off-by: Dominik Brodowski # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/pcmcia/ss.h # 2005/01/25 14:29:31-08:00 linux@dominikbrodowski.de +0 -2 # pcmcia: socket->{a,c}region are unused # # drivers/pcmcia/cs.c # 2005/01/25 14:29:31-08:00 linux@dominikbrodowski.de +4 -18 # pcmcia: socket->{a,c}region are unused # # ChangeSet # 2005/01/25 20:50:11-08:00 linux@dominikbrodowski.de # [PATCH] pcmcia: i82092: fix checking of return value from request_region # # From: Randy Dunlap # # i82092: check return value from request_region() correctly; # apparently unused for awhile now; # # Signed-off-by: Randy Dunlap # Signed-off-by: Dominik Brodowski # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/pcmcia/i82092.c # 2005/01/25 14:29:31-08:00 linux@dominikbrodowski.de +1 -1 # pcmcia: i82092: fix checking of return value from request_region # # ChangeSet # 2005/01/25 20:49:54-08:00 linux@dominikbrodowski.de # [PATCH] pcmcia: i82365: use CONFIG_PNP instead of __ISAPNP__ # # From: Randy Dunlap # # Use CONFIG_PNP consistenly, for allocating and freeing # resources, drop __ISAPNP__. # # Signed-off-by: Randy Dunlap # Signed-off-by: Dominik Brodowski # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/pcmcia/i82365.c # 2005/01/25 14:29:31-08:00 linux@dominikbrodowski.de +1 -1 # pcmcia: i82365: use CONFIG_PNP instead of __ISAPNP__ # # ChangeSet # 2005/01/25 20:49:39-08:00 linux@dominikbrodowski.de # [PATCH] pcmcia: tcic: eleminate deprecated check_region() # # From: Randy Dunlap # # tcic: eliminate deprecated check_region(); # # Signed-off-by: Randy Dunlap # Signed-off-by: Dominik Brodowski # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/pcmcia/tcic.c # 2005/01/25 14:29:31-08:00 linux@dominikbrodowski.de +8 -4 # pcmcia: tcic: eleminate deprecated check_region() # # ChangeSet # 2005/01/25 20:49:23-08:00 roland@topspin.com # [PATCH] InfiniBand/mthca: initialize mutex earlier # # The cap_mask_mutex needs to be initialized before ib_register_device(), # because device registration will call client init functions that may try to # modify the capability mask. # # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/hw/mthca/mthca_provider.c # 2005/01/25 13:50:24-08:00 roland@topspin.com +2 -2 # InfiniBand/mthca: initialize mutex earlier # # ChangeSet # 2005/01/25 20:49:05-08:00 roland@topspin.com # [PATCH] InfiniBand/mthca: remove x86 SSE pessimization # # Get rid of the x86 SSE code for atomic 64-bit writes to doorbell registers. # Saving/setting CR0 plus a clts instruction are too expensive for it to ever be # a win, and the config option was just confusing. # # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/hw/mthca/mthca_main.c # 2005/01/25 13:50:24-08:00 roland@topspin.com +0 -20 # InfiniBand/mthca: remove x86 SSE pessimization # # drivers/infiniband/hw/mthca/mthca_doorbell.h # 2005/01/25 13:50:24-08:00 roland@topspin.com +6 -46 # InfiniBand/mthca: remove x86 SSE pessimization # # drivers/infiniband/hw/mthca/Kconfig # 2005/01/25 13:50:24-08:00 roland@topspin.com +0 -10 # InfiniBand/mthca: remove x86 SSE pessimization # # ChangeSet # 2005/01/25 20:48:48-08:00 roland@topspin.com # [PATCH] InfiniBand/mthca: clean up ioremap()/request_region() usage # # From: "Michael S. Tsirkin" # # Here are misc fixes for mthca mapping: # # 1. Thinkably, MSI tables or another region could fall between HCR # and ECR tables. # Thus its arguably wrong to map both tables in one region. # So, do it separately. # I think its also more readable to have ecr_base and access ecr there, # not access ecr with hcr pointer. # # 2. mthca_request_regions error handling was borken # (wrong order of cleanups). For example on all errors # pci_release_region was called which is wrong if the region # was not yet mapped. And other such cleanups. # # 3. Fixed some error messages too. # # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/hw/mthca/mthca_main.c # 2005/01/25 14:29:32-08:00 roland@topspin.com +62 -22 # InfiniBand/mthca: clean up ioremap()/request_region() usage # # drivers/infiniband/hw/mthca/mthca_eq.c # 2005/01/25 13:50:24-08:00 roland@topspin.com +3 -2 # InfiniBand/mthca: clean up ioremap()/request_region() usage # # drivers/infiniband/hw/mthca/mthca_dev.h # 2005/01/25 13:50:24-08:00 roland@topspin.com +1 -0 # InfiniBand/mthca: clean up ioremap()/request_region() usage # # drivers/infiniband/hw/mthca/mthca_config_reg.h # 2005/01/25 13:50:24-08:00 roland@topspin.com +1 -6 # InfiniBand/mthca: clean up ioremap()/request_region() usage # # ChangeSet # 2005/01/25 20:48:33-08:00 roland@topspin.com # [PATCH] InfiniBand/core: add IsSM userspace support # # Implement setting/clearing IsSM port capability bit from userspace via "issm" # special files (set IsSM bit on open, clear on close). # # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/core/user_mad.c # 2005/01/25 13:50:24-08:00 roland@topspin.com +171 -59 # InfiniBand/core: add IsSM userspace support # # Documentation/infiniband/user_mad.txt # 2005/01/25 13:50:24-08:00 roland@topspin.com +23 -5 # InfiniBand/core: add IsSM userspace support # # ChangeSet # 2005/01/25 20:48:17-08:00 roland@topspin.com # [PATCH] InfiniBand/ipoib: remove uses of yield() # # Replace uses of yield() with msleep(1) as suggested by kernel janitors. # # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/ulp/ipoib/ipoib_ib.c # 2005/01/25 13:50:23-08:00 roland@topspin.com +2 -2 # InfiniBand/ipoib: remove uses of yield() # # ChangeSet # 2005/01/25 20:48:02-08:00 roland@topspin.com # [PATCH] InfiniBand/mthca: test IRQ routing during initialization # # When we switch to interrupt-driven command mode, test interrupt generation # with a NOP firmware command. Broken MSI/MSI-X and interrupt line routing # problems seem to be very common, and this makes the error message much clearer # -- before this change we would mysteriously fail when initializing the QP # table. # # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/hw/mthca/mthca_main.c # 2005/01/25 14:29:32-08:00 roland@topspin.com +13 -0 # InfiniBand/mthca: test IRQ routing during initialization # # drivers/infiniband/hw/mthca/mthca_cmd.h # 2005/01/25 13:50:23-08:00 roland@topspin.com +1 -0 # InfiniBand/mthca: test IRQ routing during initialization # # drivers/infiniband/hw/mthca/mthca_cmd.c # 2005/01/25 13:50:23-08:00 roland@topspin.com +5 -0 # InfiniBand/mthca: test IRQ routing during initialization # # ChangeSet # 2005/01/25 20:47:46-08:00 roland@topspin.com # [PATCH] InfiniBand/mthca: optimize event queue handling # # From: "Michael S. Tsirkin" # # Event queue handling performance improvements: # - Only calculate EQ entry address once, and don't truncate the # consumer index until we really need to. # - Only read ECR once. If a new event occurs while we're in the # interrupt handler, we'll get another interrupt anyway, since we # only clear events once. # # Signed-off-by: Michael S. Tsirkin # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/hw/mthca/mthca_provider.h # 2005/01/25 13:50:23-08:00 roland@topspin.com +1 -1 # InfiniBand/mthca: optimize event queue handling # # drivers/infiniband/hw/mthca/mthca_eq.c # 2005/01/25 14:29:32-08:00 roland@topspin.com +24 -20 # InfiniBand/mthca: optimize event queue handling # # ChangeSet # 2005/01/25 20:47:32-08:00 roland@topspin.com # [PATCH] InfiniBand/mthca: pass full process_mad info to firmware # # From: "Michael S. Tsirkin" # # Pass full extended MAD information to firmware when a work completion is # supplied to the MAD_IFC command. This allows B_Key checking/trap generation. # # Signed-off-by: Michael S. Tsirkin # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/hw/mthca/mthca_provider.c # 2005/01/25 14:29:32-08:00 roland@topspin.com +10 -10 # InfiniBand/mthca: pass full process_mad info to firmware # # drivers/infiniband/hw/mthca/mthca_mad.c # 2005/01/25 13:50:23-08:00 roland@topspin.com +3 -2 # InfiniBand/mthca: pass full process_mad info to firmware # # drivers/infiniband/hw/mthca/mthca_cmd.h # 2005/01/25 14:29:33-08:00 roland@topspin.com +2 -1 # InfiniBand/mthca: pass full process_mad info to firmware # # drivers/infiniband/hw/mthca/mthca_cmd.c # 2005/01/25 14:29:33-08:00 roland@topspin.com +52 -5 # InfiniBand/mthca: pass full process_mad info to firmware # # ChangeSet # 2005/01/25 20:47:14-08:00 roland@topspin.com # [PATCH] InfiniBand/mthca: don't write ECR in MSI-X mode # # From: "Michael S. Tsirkin" # # We don't need to write to the ECR to clear events when using MSI-X, since we # never read the ECR anyway. # # Signed-off-by: Michael S. Tsirkin # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/hw/mthca/mthca_eq.c # 2005/01/25 14:29:34-08:00 roland@topspin.com +0 -1 # InfiniBand/mthca: don't write ECR in MSI-X mode # # ChangeSet # 2005/01/25 20:47:00-08:00 roland@topspin.com # [PATCH] InfiniBand/core: fix port capability enums bit order # # Correct defines of port capability mask enum values (bits were ordered # backwards) and add new capability bits from IBA spec version 1.2. # # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/include/ib_verbs.h # 2005/01/25 13:50:23-08:00 roland@topspin.com +22 -19 # InfiniBand/core: fix port capability enums bit order # # ChangeSet # 2005/01/25 20:46:43-08:00 roland@topspin.com # [PATCH] InfiniBand/mthca: implement modifying port attributes # # Implement the port_modify() device method for mthca using the SET_IB firmware # command. In particular this allows changing the port capability mask. # # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/hw/mthca/mthca_provider.c # 2005/01/25 14:29:34-08:00 roland@topspin.com +31 -1 # InfiniBand/mthca: implement modifying port attributes # # drivers/infiniband/hw/mthca/mthca_dev.h # 2005/01/25 14:29:32-08:00 roland@topspin.com +1 -0 # InfiniBand/mthca: implement modifying port attributes # # drivers/infiniband/hw/mthca/mthca_cmd.h # 2005/01/25 14:29:34-08:00 roland@topspin.com +9 -0 # InfiniBand/mthca: implement modifying port attributes # # drivers/infiniband/hw/mthca/mthca_cmd.c # 2005/01/25 14:29:34-08:00 roland@topspin.com +35 -0 # InfiniBand/mthca: implement modifying port attributes # # ChangeSet # 2005/01/25 20:46:29-08:00 roland@topspin.com # [PATCH] InfiniBand/mthca: more Arbel Mem-Free support # # Continue development of Arbel Mem-Free support: we now compute a valid # profile, allocate context memory, map sufficient aux memory for HCA page # tables, map sufficient context memory to cover all reserved firmware resources # and successfully call the INIT_HCA and QUERY_ADAPTER firmware commands. Fix a # few error gotos that unwound the wrong things. # # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/hw/mthca/mthca_profile.h # 2005/01/25 13:50:22-08:00 roland@topspin.com +2 -2 # InfiniBand/mthca: more Arbel Mem-Free support # # drivers/infiniband/hw/mthca/mthca_profile.c # 2005/01/25 13:50:22-08:00 roland@topspin.com +9 -3 # InfiniBand/mthca: more Arbel Mem-Free support # # drivers/infiniband/hw/mthca/mthca_memfree.h # 2005/01/25 13:50:22-08:00 roland@topspin.com +17 -2 # InfiniBand/mthca: more Arbel Mem-Free support # # drivers/infiniband/hw/mthca/mthca_memfree.c # 2005/01/25 13:50:22-08:00 roland@topspin.com +79 -6 # InfiniBand/mthca: more Arbel Mem-Free support # # drivers/infiniband/hw/mthca/mthca_main.c # 2005/01/25 14:29:33-08:00 roland@topspin.com +279 -81 # InfiniBand/mthca: more Arbel Mem-Free support # # drivers/infiniband/hw/mthca/mthca_eq.c # 2005/01/25 14:29:34-08:00 roland@topspin.com +44 -0 # InfiniBand/mthca: more Arbel Mem-Free support # # drivers/infiniband/hw/mthca/mthca_dev.h # 2005/01/25 14:29:35-08:00 roland@topspin.com +27 -15 # InfiniBand/mthca: more Arbel Mem-Free support # # drivers/infiniband/hw/mthca/mthca_cmd.h # 2005/01/25 14:29:35-08:00 roland@topspin.com +18 -8 # InfiniBand/mthca: more Arbel Mem-Free support # # drivers/infiniband/hw/mthca/mthca_cmd.c # 2005/01/25 14:29:35-08:00 roland@topspin.com +113 -12 # InfiniBand/mthca: more Arbel Mem-Free support # # ChangeSet # 2005/01/25 20:46:12-08:00 roland@topspin.com # [PATCH] InfiniBand/core: compat_ioctl conversion minor fixes # # Slightly tidy up Andi Kleen's compat_ioctl conversion for the InfiniBand MAD # driver by removing the no-longer-needed include of ioctl32.h, killing # unreachable code and doing some really anal whitespace fixing. # # Signed-off-by: Roland Dreier # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/infiniband/core/user_mad.c # 2005/01/25 14:29:33-08:00 roland@topspin.com +7 -10 # InfiniBand/core: compat_ioctl conversion minor fixes # # ChangeSet # 2005/01/25 20:45:58-08:00 anton@samba.org # [PATCH] genhd: rename device_init # # Rename device_init to make it more unique. Useful when looking through # debug initcall bootlogs. While I'm in the area, also make it static. # # Signed-off-by: Anton Blanchard # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/block/genhd.c # 2005/01/25 13:50:22-08:00 anton@samba.org +2 -2 # genhd: rename device_init # # ChangeSet # 2005/01/25 20:45:45-08:00 anton@samba.org # [PATCH] Problems disabling SYSCTL # # Create a cond_syscall for sys32_sysctl and make all architectures use it. # Also fix the architectures that dont wrap their 32bit compat sysctl code. # # Signed-off-by: Anton Blanchard # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/sys_ni.c # 2005/01/25 13:50:22-08:00 anton@samba.org +1 -0 # Problems disabling SYSCTL # # arch/x86_64/ia32/sys_ia32.c # 2005/01/25 13:50:22-08:00 anton@samba.org +2 -4 # Problems disabling SYSCTL # # arch/s390/kernel/compat_linux.c # 2005/01/25 13:50:22-08:00 anton@samba.org +2 -0 # Problems disabling SYSCTL # # arch/ppc64/kernel/sys_ppc32.c # 2005/01/25 13:50:22-08:00 anton@samba.org +2 -0 # Problems disabling SYSCTL # # arch/parisc/kernel/sys_parisc32.c # 2005/01/25 13:50:22-08:00 anton@samba.org +0 -6 # Problems disabling SYSCTL # # arch/mips/kernel/linux32.c # 2005/01/25 13:50:22-08:00 anton@samba.org +0 -7 # Problems disabling SYSCTL # # arch/ia64/ia32/sys_ia32.c # 2005/01/25 13:50:22-08:00 anton@samba.org +2 -4 # Problems disabling SYSCTL # # ChangeSet # 2005/01/25 20:45:28-08:00 james4765@cwazy.co.uk # [PATCH] arm26: new maintainer of Archimedes floppy and hard disk drivers # # After getting in touch with the listed maintainer of the ARM26 floppy and # hard drive maintainer, I found out that he had passed it on to Ian Molton. # # Signed-off-by: James Nelson # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # MAINTAINERS # 2005/01/25 13:50:21-08:00 james4765@cwazy.co.uk +2 -2 # arm26: new maintainer of Archimedes floppy and hard disk drivers # # ChangeSet # 2005/01/25 20:45:13-08:00 kevcorry@us.ibm.com # [PATCH] device-mapper: fix TB stripe data corruption # # In stripe_map(), change chunk to 64-bit and use do_div to divide and mod by # the number of stripes. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-stripe.c # 2005/01/25 13:50:21-08:00 kevcorry@us.ibm.com +3 -4 # device-mapper: fix TB stripe data corruption # # ChangeSet # 2005/01/25 20:44:57-08:00 agk@redhat.com # [PATCH] device-mapper: optionally bypass a bdget # # Improve performance by optionally bypassing some code that uses bdget. # # Signed-Off-By: Alasdair G Kergon # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/dm-ioctl.h # 2005/01/25 13:50:21-08:00 agk@redhat.com +8 -3 # device-mapper: optionally bypass a bdget # # drivers/md/dm-ioctl.c # 2005/01/25 13:50:21-08:00 agk@redhat.com +15 -12 # device-mapper: optionally bypass a bdget # # ChangeSet # 2005/01/25 20:44:38-08:00 agk@redhat.com # [PATCH] device-mapper: Add presuspend hook # # Add optional callback before each device gets suspended (called 'presuspend'). # Rename existing callback used by dm-mirror from 'suspend' to 'postsuspend'. # # dm-multipath will use the new callback. # # (Any kernel module using device-mapper must be recompiled after this patch.) # # Signed-Off-By: Alasdair G Kergon # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/device-mapper.h # 2005/01/25 13:50:21-08:00 agk@redhat.com +4 -2 # device-mapper: Add presuspend hook # # drivers/md/dm.h # 2005/01/25 13:50:21-08:00 agk@redhat.com +2 -1 # device-mapper: Add presuspend hook # # drivers/md/dm.c # 2005/01/25 13:50:21-08:00 agk@redhat.com +9 -4 # device-mapper: Add presuspend hook # # drivers/md/dm-table.c # 2005/01/25 13:50:21-08:00 agk@redhat.com +20 -6 # device-mapper: Add presuspend hook # # drivers/md/dm-raid1.c # 2005/01/25 13:50:21-08:00 agk@redhat.com +3 -2 # device-mapper: Add presuspend hook # # ChangeSet # 2005/01/25 20:44:22-08:00 agk@redhat.com # [PATCH] device-mapper: remove unused bs_bio_init() # # Remove unused bs_bio_init(). # # Signed-Off-By: Alasdair G Kergon # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-io.c # 2005/01/25 13:50:21-08:00 agk@redhat.com +0 -16 # device-mapper: remove unused bs_bio_init() # # ChangeSet # 2005/01/25 20:44:09-08:00 agk@redhat.com # [PATCH] device-mapper: fix mirror log type module ref count # # Fix module reference counting for mirror log type. # # Signed-Off-By: Alasdair G Kergon # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/md/dm-log.c # 2005/01/25 13:50:21-08:00 agk@redhat.com +7 -7 # device-mapper: fix mirror log type module ref count # # ChangeSet # 2005/01/25 20:43:55-08:00 agruen@suse.de # [PATCH] fs/mbcache.c: Remove an unused wait queue variable # # This one slipped me. The "real" wait queue is defined some lines further # down inside the loop. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/mbcache.c # 2005/01/25 13:50:21-08:00 agruen@suse.de +0 -2 # fs/mbcache.c: Remove an unused wait queue variable # # ChangeSet # 2005/01/25 20:43:39-08:00 dsd@gentoo.org # [PATCH] Configurable delay before mounting root device # # Adds a boot parameter which can be used to specify a delay (in seconds) # before the root device is decoded/discovered/mounted. # # Example usage for 10 second delay: # # rootdelay=10 # # Useful for usb-storage devices which no longer make their partitions # immediately available, and for other storage devices which require some # "spin-up" time. # # Signed-off-by: Daniel Drake # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # init/do_mounts.c # 2005/01/25 13:50:20-08:00 dsd@gentoo.org +15 -0 # Configurable delay before mounting root device # # Documentation/kernel-parameters.txt # 2005/01/25 13:50:20-08:00 dsd@gentoo.org +3 -0 # Configurable delay before mounting root device # # ChangeSet # 2005/01/25 20:43:20-08:00 linville@tuxdriver.com # [PATCH] i810_audio: offset LVI from CIV to avoid stalled start # # This fixes a "no sound" problem with Wolfenstein Enemy Territory and # (apparently) other games using the Quake3 engine. It probably affects some # other OSS applications as well. # # This recreates some code that had been removed from the i810_audio driver # around 5/2004. (This is the 2.6-based version of this patch.) # # Acked-by: Herbert Xu # Acked-by: Thomas Voegtle # Signed-off-by: John W. Linville # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # sound/oss/i810_audio.c # 2005/01/25 13:50:20-08:00 linville@tuxdriver.com +10 -0 # i810_audio: offset LVI from CIV to avoid stalled start # # ChangeSet # 2005/01/25 20:43:03-08:00 matthew@wil.cx # [PATCH] Minor ext2 speedup # # Port Andreas Dilger's and Jan Kara's patch for ext3 to ext2. Also some # whitespace changes to get ext2/ext3 closer in sync. # # Signed-off-by: Matthew Wilcox # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ext2/balloc.c # 2005/01/25 13:50:20-08:00 matthew@wil.cx +19 -20 # Minor ext2 speedup # # ChangeSet # 2005/01/25 20:42:49-08:00 agruen@suse.de # [PATCH] ext2/ext3 ACLs: remove the number of acl entries limit # # This patch removes the arbitrary limit of 32 acl entries on ext[23] when # writing acls. A patch that removes the same check when reding acls is in # BK since 12 March 2004, so all kernels since then are already able to read # large acls. I think that ten+ months are enough so that we can now also # remove the write limit. # # This is the read-limit patch: # http://linux.bkbits.net:8080/linux-2.6/cset%404051e2863UsuQEgAQShmimgBooAXkg?nav=index.html # # Even without this patch the xattr block could already contain less space # than needed for the acl, because other attributes might already use up # almost all space. So this patch does not introduce additional error # conditions. We have been shipping with this patch the last year (almost). # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ext3/acl.h # 2005/01/25 13:50:20-08:00 agruen@suse.de +0 -1 # ext2/ext3 ACLs: remove the number of acl entries limit # # fs/ext3/acl.c # 2005/01/25 13:50:20-08:00 agruen@suse.de +0 -2 # ext2/ext3 ACLs: remove the number of acl entries limit # # fs/ext2/acl.h # 2005/01/25 13:50:20-08:00 agruen@suse.de +0 -1 # ext2/ext3 ACLs: remove the number of acl entries limit # # fs/ext2/acl.c # 2005/01/25 13:50:20-08:00 agruen@suse.de +0 -2 # ext2/ext3 ACLs: remove the number of acl entries limit # # ChangeSet # 2005/01/25 20:42:31-08:00 agruen@suse.de # [PATCH] ext3: fix ea-in-inode default ACL creation # # When a new inode is created, ext3_new_inode sets the EXT3_STATE_NEW flag, # which tells ext3_do_update_inode to zero out the inode before filling in # the inode's data. When a file is created in a directory with a default # acl, the new inode inherits the directory's default acl; this generates # attributes. The attributes are created before ext3_do_update_inode is # called to write out the inode. In case of in-inode attributes, the new # inode's attributes are written, and then zeroed out again by # ext3_do_update_inode. Bad thing. # # Fix this by recognizing the EXT3_STATE_NEW case in ext3_xattr_set_handle, # and zeroing out the inode there already when necessary. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ext3/xattr.c # 2005/01/25 13:50:20-08:00 agruen@suse.de +7 -0 # ext3: fix ea-in-inode default ACL creation # # ChangeSet # 2005/01/25 20:42:18-08:00 agruen@suse.de # [PATCH] ext3/ea: disallow in-inode attributes for reserved inodes # # When creating a filesystem with inodes bigger than 128 bytes, mke2fs fails # to clear out bytes beyond EXT3_GOOD_OLD_INODE_SIZE in all inodes it creates # (the journal, the filesystem root, and lost+found). We would require a # zeroed-out i_extra_isize field but we don't get it, so disallow in-inode # attributes for those inodes. # # Add an i_extra_isize sanity check. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ext3/inode.c # 2005/01/25 13:50:20-08:00 agruen@suse.de +24 -9 # ext3/ea: disallow in-inode attributes for reserved inodes # # ChangeSet # 2005/01/25 20:42:01-08:00 agruen@suse.de # [PATCH] ext3/ea: ix i_extra_isize check # # We are checking for (EXT3_SB(inode->i_sb)->s_inode_size <= # EXT3_GOOD_OLD_INODE_SIZE) to find out if we can set in-inode attributes; # the test fails for inodes that have been created before the ea-in-inode # patch. Those inodes have (i_extra_isize == 0), so we end up with the # attributes overlapping the i_extra_isize field. Checking for # (i_extra_isize == 0) instead fixes this case. # # The EXT3_STATE_XATTR flag is only set if (i_extra_isize > 0) and the inodes # has in-inode attributes, so that is enough in the first two tests. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ext3/xattr.c # 2005/01/25 14:29:38-08:00 agruen@suse.de +4 -6 # ext3/ea: ix i_extra_isize check # # ChangeSet # 2005/01/25 20:41:47-08:00 agruen@suse.de # [PATCH] ext3/ea: documentation fix # # In-inode xattr entry descriptors are unsorted. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ext3/xattr.c # 2005/01/25 14:29:39-08:00 agruen@suse.de +3 -3 # ext3/ea: documentation fix # # ChangeSet # 2005/01/25 20:41:31-08:00 agruen@suse.de # [PATCH] ext3/ea: set the EXT3_FEATURE_COMPAT_EXT_ATTR for in-inode xattrs # # The xattr feature was only set when creating an xattr block. Also set it # when creating in-inode xattrs. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ext3/xattr.c # 2005/01/25 14:29:39-08:00 agruen@suse.de +1 -1 # ext3/ea: set the EXT3_FEATURE_COMPAT_EXT_ATTR for in-inode xattrs # # ChangeSet # 2005/01/25 20:41:18-08:00 agruen@suse.de # [PATCH] ext3/ea: no lock needed when freeing inode # # ext3_xattr_delete_inode is called from ext3_free_inode which always has # exclusive access to the inode, so there is no need to take the xattr # semaphore. # # Signed-off-by: Andreas Gruenbacher # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ext3/xattr.c # 2005/01/25 14:29:39-08:00 agruen@suse.de +0 -2 # ext3/ea: no lock needed when freeing inode # # ChangeSet # 2005/01/25 20:41:05-08:00 stone_wang@sohu.com # [PATCH] ext2/ext3: block allocator startup fix # # We found strange blocks layout in our mail server, after careful study, we # got the reason and tried to fix it. # # On the very fist attempt to allocate a block to the newly-initialised inode, # if we are trying to add a block at logical file offset "1" then # ext2_find_goal() will incorrectly assume that this was a next_alloc_block # cache hit (because we think the previously-allocated block was at offset # zero). # # Net result: why trying to extend a freshly-opened one-block file we end up # deciding to place the second file block at disk block "1", rather than going # off and calling ext2_find_near(). # # Fix it by checking that we actually do have something valid cached in # next_alloc_goal. # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/ext3/inode.c # 2005/01/25 14:29:39-08:00 stone_wang@sohu.com +1 -1 # ext2/ext3: block allocator startup fix # # fs/ext2/inode.c # 2005/01/25 13:50:19-08:00 stone_wang@sohu.com +1 -1 # ext2/ext3: block allocator startup fix # # ChangeSet # 2005/01/25 20:40:51-08:00 klassert@mathematik.tu-chemnitz.de # [PATCH] 3c59x ethtool: provide NIC-specific stats # # With this patch get_ethtool_stats() provides the NIC-specific extra stats. # # Signed-off-by: Steffen Klassert # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/net/3c59x.c # 2005/01/25 13:50:19-08:00 klassert@mathematik.tu-chemnitz.de +23 -26 # 3c59x ethtool: provide NIC-specific stats # # ChangeSet # 2005/01/25 20:40:34-08:00 bgerst@didntduck.org # [PATCH] clean up UTS_RELEASE usage # # This patch cleans up usage of UTS_RELEASE, by replacing many references # with system_utsname.release, and deleting others. This eliminates a # dependency on version.h for these files, so they don't get rebuilt if # EXTRAVERSION or localversion change. # # Signed-off-by: Brian Gerst # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # fs/cifs/connect.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +12 -13 # clean up UTS_RELEASE usage # # drivers/usb/gadget/zero.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +3 -4 # clean up UTS_RELEASE usage # # drivers/usb/gadget/serial.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +4 -4 # clean up UTS_RELEASE usage # # drivers/usb/gadget/file_storage.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +3 -4 # clean up UTS_RELEASE usage # # drivers/usb/gadget/ether.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +3 -4 # clean up UTS_RELEASE usage # # drivers/usb/core/hcd.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +3 -3 # clean up UTS_RELEASE usage # # drivers/scsi/aic7xxx_old.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +1 -3 # clean up UTS_RELEASE usage # # drivers/parisc/led.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +5 -2 # clean up UTS_RELEASE usage # # drivers/char/ftape/zftape/zftape-init.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +2 -5 # clean up UTS_RELEASE usage # # drivers/char/ftape/lowlevel/ftape-init.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +1 -3 # clean up UTS_RELEASE usage # # drivers/char/ftape/compressor/zftape-compress.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +1 -3 # clean up UTS_RELEASE usage # # drivers/cdrom/mcdx.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +0 -5 # clean up UTS_RELEASE usage # # drivers/cdrom/aztcd.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +2 -3 # clean up UTS_RELEASE usage # # arch/x86_64/kernel/process.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +2 -2 # clean up UTS_RELEASE usage # # arch/um/sys-x86_64/sysrq.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +2 -2 # clean up UTS_RELEASE usage # # arch/ppc64/kernel/process.c # 2005/01/25 13:50:18-08:00 bgerst@didntduck.org +2 -2 # clean up UTS_RELEASE usage # # ChangeSet # 2005/01/25 20:40:18-08:00 hch@lst.de # [PATCH] kill softirq_pending() # # With Steffen Klassert # # no more users left, time to kill the various implementations # # Signed-off-by: Steffen Klassert # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # net/core/pktgen.c # 2005/01/25 13:50:18-08:00 hch@lst.de +1 -1 # kill softirq_pending() # # include/linux/irq_cpustat.h # 2005/01/25 13:50:18-08:00 hch@lst.de +2 -2 # kill softirq_pending() # # include/asm-s390/hardirq.h # 2005/01/25 13:50:18-08:00 hch@lst.de +0 -9 # kill softirq_pending() # # include/asm-ia64/hardirq.h # 2005/01/25 13:50:18-08:00 hch@lst.de +0 -1 # kill softirq_pending() # # ChangeSet # 2005/01/25 20:40:02-08:00 pavel@ucw.cz # [PATCH] Enable swsusp on SMP machines # # This enables swsusp on SMP machines. It should be working in 2.6.10, # already (but you may need noapic in 2.6.10). # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/power/main.c # 2005/01/25 13:50:18-08:00 pavel@ucw.cz +5 -5 # Enable swsusp on SMP machines # # ChangeSet # 2005/01/25 20:39:48-08:00 pavel@suse.cz # [PATCH] swsusp: fix buggy comment # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/suspend_asm.S # 2005/01/25 13:50:18-08:00 pavel@suse.cz +5 -2 # swsusp: fix buggy comment # # ChangeSet # 2005/01/25 20:39:34-08:00 ysato@users.sourceforge.jp # [PATCH] h8300: makefile update # # Fix build error when .config does not exist # # Signed-off-by: Yoshinori Sato # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/h8300/Makefile # 2005/01/25 13:50:18-08:00 ysato@users.sourceforge.jp +4 -5 # h8300: makefile update # # ChangeSet # 2005/01/25 20:39:17-08:00 ysato@users.sourceforge.jp # [PATCH] h8300: fix warning # # update argument type # # Signed-off-by: Yoshinori Sato # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-h8300/bitops.h # 2005/01/25 13:50:18-08:00 ysato@users.sourceforge.jp +1 -1 # h8300: fix warning # # ChangeSet # 2005/01/25 20:39:03-08:00 ak@suse.de # [PATCH] x86_64: Speed up suspend # # The following patch speeds up the restoring of swsusp images on x86-64 # and makes the assembly code more readable (tested and works on AMD64). # # Signed-off-by: Rafael J. Wysocki # # Changed by AK to not hardcode any C values and get them from offset.h instead # and not flushing CR3 needlessly (according to Pavel it was just an old # debugging measure that is not needed anymore) # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/suspend_asm.S # 2005/01/25 14:29:41-08:00 ak@suse.de +20 -34 # x86_64: Speed up suspend # # arch/x86_64/kernel/asm-offsets.c # 2005/01/25 13:50:18-08:00 ak@suse.de +4 -1 # x86_64: Speed up suspend # # ChangeSet # 2005/01/25 20:38:49-08:00 ak@suse.de # [PATCH] x86_64: Remove earlyprintk help # # Remove invisible earlyprintk help. # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/Kconfig # 2005/01/25 13:50:17-08:00 ak@suse.de +0 -9 # x86_64: Remove earlyprintk help # # ChangeSet # 2005/01/25 20:38:31-08:00 ak@suse.de # [PATCH] x86_64: Enlarge northbridge numa scan mask # # Enlarge max nodes mask in k8 northbridge scan code. # # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/mm/k8topology.c # 2005/01/25 13:50:17-08:00 ak@suse.de +1 -1 # x86_64: Enlarge northbridge numa scan mask # # ChangeSet # 2005/01/25 20:38:18-08:00 ak@suse.de # [PATCH] x86_64: remove duplicated includes # # There's usually no reason for including the same header file twice. # # The patch below removes such duplicate includes in x86_64 specific files. # # Signed-off-by: Adrian Bunk # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-x86_64/pci.h # 2005/01/25 13:50:17-08:00 ak@suse.de +0 -1 # x86_64: remove duplicated includes # # arch/x86_64/kernel/x8664_ksyms.c # 2005/01/25 13:50:17-08:00 ak@suse.de +0 -1 # x86_64: remove duplicated includes # # arch/x86_64/kernel/time.c # 2005/01/25 13:50:17-08:00 ak@suse.de +0 -1 # x86_64: remove duplicated includes # # arch/x86_64/kernel/setup.c # 2005/01/25 13:50:17-08:00 ak@suse.de +0 -1 # x86_64: remove duplicated includes # # arch/x86_64/kernel/module.c # 2005/01/25 13:50:17-08:00 ak@suse.de +0 -1 # x86_64: remove duplicated includes # # arch/x86_64/kernel/entry.S # 2005/01/25 13:50:17-08:00 ak@suse.de +0 -1 # x86_64: remove duplicated includes # # ChangeSet # 2005/01/25 20:38:01-08:00 ak@suse.de # [PATCH] x86_64: remove centaur mtrr support # # Drop unused centaur mtrr support code. # # Signed-off-by: Adrian Bunk # Signed-off-by: Andi Kleen # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-x86_64/mtrr.h # 2005/01/25 13:50:17-08:00 ak@suse.de +0 -3 # x86_64: remove centaur mtrr support # # ChangeSet # 2005/01/25 20:37:47-08:00 ak@suse.de # [PATCH] x86: Remove unused function # # Remove unused get_cr2 function (from i386) # # Signed-off-by: Adrian Bunk # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/traps.c # 2005/01/25 13:50:17-08:00 ak@suse.de +0 -9 # x86: Remove unused function # # ChangeSet # 2005/01/25 20:37:31-08:00 rusty@rustcorp.com.au # [PATCH] x86: no interrupts from secondary CPUs until officially online # # Andi Kleen reported a problem where a very slow boot caused the timer # interrupt on a secondary CPU to go off before the CPU was actually brought # up by the core code, so the CPU_PREPARE notifier hadn't been called, so the # per-cpu timer code wasn't set up. # # This was caused by enabling interrupts around calibrate_delay() on # secondary CPUs, which is not actually neccessary (interrupts on CPU 0 # increments jiffies, which is all that is required). So delay enabling # interrupts until the actual __cpu_up() call for that CPU. # # Signed-off-by: Rusty Russell # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/i386/kernel/smpboot.c # 2005/01/25 13:50:17-08:00 rusty@rustcorp.com.au +5 -3 # x86: no interrupts from secondary CPUs until officially online # # arch/i386/kernel/apic.c # 2005/01/25 13:50:17-08:00 rusty@rustcorp.com.au +0 -2 # x86: no interrupts from secondary CPUs until officially online # # ChangeSet # 2005/01/25 20:37:16-08:00 benh@kernel.crashing.org # [PATCH] ppc64: Missing call to ioremap in pci_iomap() # # This patch adds the missing ioremap call to pci_iomap on ppc64. # # Signed-off-by: Benjamin Herrenschmidt # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/iomap.c # 2005/01/25 13:50:17-08:00 benh@kernel.crashing.org +1 -1 # ppc64: Missing call to ioremap in pci_iomap() # # ChangeSet # 2005/01/25 20:37:00-08:00 anton@samba.org # [PATCH] ppc64: enable virtual ethernet and virtual scsi # # Enable the virtual ethernet and virtual scsi drivers in the pseries config. # Since our root device may be on either we need them compiled in (unless we # play initrd tricks). # # Signed-off-by: Anton Blanchard # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/configs/pSeries_defconfig # 2005/01/25 13:50:16-08:00 anton@samba.org +2 -2 # ppc64: enable virtual ethernet and virtual scsi # # ChangeSet # 2005/01/25 20:36:45-08:00 anton@samba.org # [PATCH] ppc64: problem disabling SYSVIPC # # The kernel wouldnt link when SYSVIPC was disabled. x86-64 was already # defining a cond_syscall, instead of duplicating it in the ppc64 port move it # into the arch specific portion of kernel/sys_ni.c # # Signed-off-by: Anton Blanchard # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # kernel/sys_ni.c # 2005/01/25 14:29:36-08:00 anton@samba.org +1 -1 # ppc64: problem disabling SYSVIPC # # arch/x86_64/ia32/sys_ia32.c # 2005/01/25 14:29:36-08:00 anton@samba.org +0 -2 # ppc64: problem disabling SYSVIPC # # arch/ppc64/kernel/sys_ppc32.c # 2005/01/25 14:29:36-08:00 anton@samba.org +2 -0 # ppc64: problem disabling SYSVIPC # # ChangeSet # 2005/01/25 20:36:29-08:00 anton@samba.org # [PATCH] ppc64: disable some boot wrapper debug # # The debug information in the boot wrapper can be quite verbose (it prints an # entry for every address it attempts to claim). Disable it. # # Signed-off-by: Anton Blanchard # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/boot/main.c # 2005/01/25 13:50:16-08:00 anton@samba.org +1 -1 # ppc64: disable some boot wrapper debug # # ChangeSet # 2005/01/25 20:36:14-08:00 anton@samba.org # [PATCH] ppc64: allow EEH to be disabled # # Allow EEH to be disabled for pSeries targets, but only if the EMBEDDED option # is enabled. This version incorporates some suggestions from Arnd Bergmann and # Linas Vepstas. # # Signed-off-by: Anton Blanchard # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc64/eeh.h # 2005/01/25 13:50:16-08:00 anton@samba.org +23 -13 # ppc64: allow EEH to be disabled # # arch/ppc64/kernel/pSeries_setup.c # 2005/01/25 13:50:16-08:00 anton@samba.org +3 -10 # ppc64: allow EEH to be disabled # # arch/ppc64/kernel/eeh.c # 2005/01/25 13:50:16-08:00 anton@samba.org +0 -2 # ppc64: allow EEH to be disabled # # arch/ppc64/kernel/Makefile # 2005/01/25 13:50:16-08:00 anton@samba.org +2 -1 # ppc64: allow EEH to be disabled # # arch/ppc64/Kconfig # 2005/01/25 13:50:16-08:00 anton@samba.org +5 -0 # ppc64: allow EEH to be disabled # # ChangeSet # 2005/01/25 20:35:57-08:00 paulus@samba.org # [PATCH] ppc64: use kref for device_node refcounting # # This patch is from Nathan Lynch . # # This changes struct device_node and associated code to use the kref api for # object refcounting and freeing. I've given it some testing on pSeries with # cpu add/remove and verified that the release function works. The change is # somewhat cosmetic but it does make the code easier to understand... at least # I think so =) # # The only real change is that the refcount on all device_nodes is initialized # at 1, and the device node is freed when the refcount reaches 0 (of_remove_node # has the extra "put" to ensure that this happens). This lets us get rid of the # OF_STALE flag and macros in prom.h. # # Signed-off-by: Nathan Lynch # Signed-off-by: Paul Mackerras # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc64/prom.h # 2005/01/25 13:50:16-08:00 paulus@samba.org +1 -4 # ppc64: use kref for device_node refcounting # # arch/ppc64/kernel/prom.c # 2005/01/25 13:50:16-08:00 paulus@samba.org +24 -26 # ppc64: use kref for device_node refcounting # # ChangeSet # 2005/01/25 20:35:44-08:00 paulus@samba.org # [PATCH] ppc64: sparse fixes for cpu feature constants # # This patch is originally from Nathan Lynch . # # Sparse gives a warning "constant ... is so big it is long" for every # expression where we check bits in the cur_cpu_spec->cpu_features value. This # patch removes the warnings by using the ASM_CONST macro. # # Signed-off-by: Nathan Lynch # Signed-off-by: Paul Mackerras # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc64/mmu_context.h # 2005/01/25 13:50:16-08:00 paulus@samba.org +5 -8 # ppc64: sparse fixes for cpu feature constants # # include/asm-ppc64/cputable.h # 2005/01/25 13:50:16-08:00 paulus@samba.org +29 -28 # ppc64: sparse fixes for cpu feature constants # # include/asm-ppc64/cacheflush.h # 2005/01/25 13:50:16-08:00 paulus@samba.org +1 -1 # ppc64: sparse fixes for cpu feature constants # # ChangeSet # 2005/01/25 20:35:29-08:00 paulus@samba.org # [PATCH] ppc64: trivial cleanup: EEH_REGION # # This patch is originally from Linas Vepstas . # # This is a dumb, dorky cleanup patch: Per last round of emails, the concept of # EEH_REGION is gone, but a few stubs remained. This patch removes them. # # Signed-off-by: Linas Vepstas # Signed-off-by: Paul Mackerras # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc64/page.h # 2005/01/25 13:50:15-08:00 paulus@samba.org +0 -2 # ppc64: trivial cleanup: EEH_REGION # # arch/ppc64/mm/slb.c # 2005/01/25 13:50:15-08:00 paulus@samba.org +3 -6 # ppc64: trivial cleanup: EEH_REGION # # arch/ppc64/mm/hash_utils.c # 2005/01/25 13:50:15-08:00 paulus@samba.org +0 -6 # ppc64: trivial cleanup: EEH_REGION # # ChangeSet # 2005/01/25 20:35:13-08:00 paulus@samba.org # [PATCH] ppc64: replace schedule_timeout in die # # This patch is from Nishanth Aravamudan . # # Replace schedule_timeout() with ssleep to simplify the code and to express the # delay in seconds instead of HZ. # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Paul Mackerras # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/traps.c # 2005/01/25 13:50:15-08:00 paulus@samba.org +2 -2 # ppc64: replace schedule_timeout in die # # ChangeSet # 2005/01/25 20:34:59-08:00 paulus@samba.org # [PATCH] ppc64: replace schedule_timeout in __cpu_up # # This patch is from Nishanth Aravamudan . # # Replace schedule_timeout() with msleep to simplify the code and to express the # delay in milliseconds instead of HZ. # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Paul Mackerras # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/smp.c # 2005/01/25 13:50:15-08:00 paulus@samba.org +1 -2 # ppc64: replace schedule_timeout in __cpu_up # # ChangeSet # 2005/01/25 20:34:42-08:00 paulus@samba.org # [PATCH] ppc64: replace schedule_timeout in pSeries_cpu_die # # This patch is from Nishanth Aravamudan . # # Replace schedule_timeout() with msleep to simplify the code and to express the # delay in milliseconds instead of HZ. # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Paul Mackerras # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/pSeries_smp.c # 2005/01/25 13:50:15-08:00 paulus@samba.org +1 -2 # ppc64: replace schedule_timeout in pSeries_cpu_die # # ChangeSet # 2005/01/25 20:34:27-08:00 paulus@samba.org # [PATCH] ppc64: replace schedule_timeout in iSeries_pci_reset # # This patch is from Nishanth Aravamudan . # # Replace schedule_timeout() with msleep to simplify the code and to express the # delay in milliseconds instead of HZ. # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Paul Mackerras # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/iSeries_pci_reset.c # 2005/01/25 13:50:15-08:00 paulus@samba.org +8 -9 # ppc64: replace schedule_timeout in iSeries_pci_reset # # ChangeSet # 2005/01/25 20:34:11-08:00 paulus@samba.org # [PATCH] ppc64: clear MSR_RI earlier in syscall exit path # # This patch is from Craig Chaney . # # This patch moves the restoring of the stack pointer in the system call exit # path to after the point where we clear the RI (recoverable interrupt) bit in # the MSR. Normally, loading the stack pointer before clearing RI doesn't cause # any problem because there is no trap that can normally occur in between. But # if we are tracing the code using a tool that single-steps instructions, this # can cause a problem. In this case, clearing RI serves as an indication that # the following code can't be safely single-stepped. # # Signed-off-by: Craig Chaney # Signed-off-by: Paul Mackerras # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/entry.S # 2005/01/25 13:50:15-08:00 paulus@samba.org +1 -1 # ppc64: clear MSR_RI earlier in syscall exit path # # ChangeSet # 2005/01/25 20:33:57-08:00 paulus@samba.org # [PATCH] ppc64: fix in_be64 definition # # This patch is from Jake Moilanen . # # The instruction syntax for the in_be64 inline asm was incorrect for the "m" # constraint for the address parameter. This patch fixes the instruction in the # inline asm. # # Signed-off-by: Jake Moilanen # Signed-off-by: Paul Mackerras # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc64/io.h # 2005/01/25 13:50:15-08:00 paulus@samba.org +1 -1 # ppc64: fix in_be64 definition # # ChangeSet # 2005/01/25 20:33:40-08:00 paulus@samba.org # [PATCH] ppc64: xmon data breakpoints on partitioned systems # # This patch is originally from Jake Moilanen , # substantially modified by me. # # On PPC64 systems with a hypervisor, we can't set the Data Address Breakpoint # Register (DABR) directly, we have to do it through a hypervisor call. # # Signed-off-by: Jake Moilanen # Signed-off-by: Paul Mackerras # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/xmon/xmon.c # 2005/01/25 13:50:14-08:00 paulus@samba.org +15 -4 # ppc64: xmon data breakpoints on partitioned systems # # ChangeSet # 2005/01/25 20:33:26-08:00 anton@samba.org # [PATCH] ppc64: limit segment tables on UP kernels # # We were allocating 48 segment tables on UP kernels. Remove them and save # 192kB of kernel memory on UP builds. # # Signed-off-by: Anton Blanchard # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/head.S # 2005/01/25 13:50:14-08:00 anton@samba.org +2 -0 # ppc64: limit segment tables on UP kernels # # ChangeSet # 2005/01/25 20:33:08-08:00 benh@kernel.crashing.org # [PATCH] ppc32: Add support for Pegasos machines # # This patch, mostly from Sven Luther and reworked by me, adds support for # Pegasos machines to the ppc32 arch. The patch contains all of the arch # code. I'll send separately a few driver changes as well. # # Signed-off-by: Benjamin Herrenschmidt # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/asm-ppc/processor.h # 2005/01/25 13:50:14-08:00 benh@kernel.crashing.org +2 -0 # ppc32: Add support for Pegasos machines # # arch/ppc/syslib/prom_init.c # 2005/01/25 13:50:14-08:00 benh@kernel.crashing.org +17 -5 # ppc32: Add support for Pegasos machines # # arch/ppc/platforms/chrp_time.c # 2005/01/25 13:50:14-08:00 benh@kernel.crashing.org +2 -0 # ppc32: Add support for Pegasos machines # # arch/ppc/platforms/chrp_setup.c # 2005/01/25 13:50:14-08:00 benh@kernel.crashing.org +65 -11 # ppc32: Add support for Pegasos machines # # arch/ppc/platforms/chrp_pci.c # 2005/01/25 13:50:14-08:00 benh@kernel.crashing.org +34 -4 # ppc32: Add support for Pegasos machines # # ChangeSet # 2005/01/25 20:32:53-08:00 galak@freescale.com # [PATCH] ppc32: fix PCI2 IO space mapping on CDS # # The ppc pci bus and resource fixups will automatically adjust the IO space # mappings by (hose->io_base_virt - isa_io_base). Since we map all of PCI IO # space (PCI1 & PCI2) with a single mapping so it is continguious in virtual, # physical, and PCI IO space the offset will equal MPC85XX_PCI1_IO_SIZE. # There for we needed to reduce the setting by that amount for everything to # work properly on CDS. # # Signed-off-by: Kumar Gala # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc/platforms/85xx/mpc85xx_cds_common.h # 2005/01/25 13:50:14-08:00 galak@freescale.com +4 -2 # ppc32: fix PCI2 IO space mapping on CDS # # ChangeSet # 2005/01/25 20:32:37-08:00 rvinson@mvista.com # [PATCH] ppc32: missing call to ioremap in pci_iomap() # # The PPC version of pci_iomap seems to be missing a call to ioremap. This # patch corrects that oversight and has been tested on a IBM PPC750FX Eval # board. # # Signed-off-by: Randy Vinson # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc/kernel/pci.c # 2005/01/25 13:50:14-08:00 rvinson@mvista.com +5 -1 # ppc32: missing call to ioremap in pci_iomap() # # ChangeSet # 2005/01/25 20:32:23-08:00 galak@freescale.com # [PATCH] ppc32: allow usage of gen550 on platforms that do not define SERIAL_PORT_DFNS # # Allows a platform to initialize serial_state completely from gen550_init # and no longer requires it to define SERIAL_PORT_DFNS. # # Signed-off-by: Kumar Gala # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc/syslib/gen550_dbg.c # 2005/01/25 13:50:14-08:00 galak@freescale.com +6 -0 # ppc32: allow usage of gen550 on platforms that do not define SERIAL_PORT_DFNS # # ChangeSet # 2005/01/25 20:32:06-08:00 galak@freescale.com # [PATCH] ppc32: Add defconfigs for 85xx boards -- updated # # Adds default config files the MPC8540 ADS, MPC8560 ADS, and MPC8555 CDS # reference boards. Hopefully people will stop asking me for mine :) # # Signed-off-by: Kumar Gala # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/ppc/configs/mpc8560_ads_defconfig # 2005/01/25 13:50:14-08:00 galak@freescale.com +719 -0 # ppc32: Add defconfigs for 85xx boards -- updated # # arch/ppc/configs/mpc8555_cds_defconfig # 2005/01/25 13:50:14-08:00 galak@freescale.com +718 -0 # ppc32: Add defconfigs for 85xx boards -- updated # # arch/ppc/configs/mpc8540_ads_defconfig # 2005/01/25 13:50:14-08:00 galak@freescale.com +707 -0 # ppc32: Add defconfigs for 85xx boards -- updated # # arch/ppc/configs/mpc8560_ads_defconfig # 2005/01/25 13:50:14-08:00 galak@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/configs/mpc8560_ads_defconfig # # arch/ppc/configs/mpc8555_cds_defconfig # 2005/01/25 13:50:14-08:00 galak@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/configs/mpc8555_cds_defconfig # # arch/ppc/configs/mpc8540_ads_defconfig # 2005/01/25 13:50:14-08:00 galak@freescale.com +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/arch/ppc/configs/mpc8540_ads_defconfig # # ChangeSet # 2005/01/25 20:31:51-08:00 andrea@suse.de # [PATCH] mm: truncate SMP race fix # # Fix up an smp race introduced in 2.6.11-rc1 # # Signed-off-by: Andrea Arcangeli # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/memory.c # 2005/01/25 13:50:14-08:00 andrea@suse.de +17 -0 # mm: truncate SMP race fix # # ChangeSet # 2005/01/25 20:31:34-08:00 andrea@suse.de # [PATCH] mm: adjust dirty threshold for lowmem-only mappings # # With Rik van Riel # # Simply running "dd if=/dev/zero of=/dev/hd" can cause # excessive amounts of dirty lowmem pagecache, due to the blockdev's # non-highmem page allocation strategy. # # This patch effectively lowers the dirty limit for mappings which cannot be # cached in highmem, counting the dirty limit as a percentage of lowmem # instead. This should prevent heavy block device writers from pushing the # VM over the edge and triggering OOM kills. # # Signed-off-by: Rik van Riel # Acked-by: Andrea Arcangeli # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # mm/page-writeback.c # 2005/01/25 13:50:13-08:00 andrea@suse.de +19 -6 # mm: adjust dirty threshold for lowmem-only mappings # # ChangeSet # 2005/01/25 20:31:20-08:00 chrisw@osdl.org # [PATCH] compat ioctl security hook fixup # # Fix a bug spotted by "Michael S. Tsirkin" # # Introduce a simple helper, vfs_ioctl(), so that both sys_ioctl() and # compat_sys_ioctl() call the security hook in all cases and without # duplication. # # Signed-off-by: Chris Wright # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/fs.h # 2005/01/25 13:43:48-08:00 chrisw@osdl.org +2 -0 # compat ioctl security hook fixup # # fs/ioctl.c # 2005/01/25 13:43:48-08:00 chrisw@osdl.org +23 -13 # compat ioctl security hook fixup # # fs/compat.c # 2005/01/25 13:43:48-08:00 chrisw@osdl.org +6 -6 # compat ioctl security hook fixup # # ChangeSet # 2005/01/25 20:31:01-08:00 amgta@yacht.ocn.ne.jp # [PATCH] oprofile: falling back on timer interrupt mode # # When some hardware setups or architectures do not allow OProfile to use # performance counters, OProfile operates in timer mode. # # But, from 2.6.11-rc1, we need to specify the module parameter "timer=1" to # work on timer interrupt mode. Change things so that we detect the absence of # the high-resolution timer and fall back to timer-based profiling # automatically. # # Furthermore we can easily get oops by reading /dev/oprofile/cpu_type. # # Signed-off-by: Akinobu Mita # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # include/linux/oprofile.h # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +1 -1 # oprofile: falling back on timer interrupt mode # # drivers/oprofile/oprof.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +3 -3 # oprofile: falling back on timer interrupt mode # # arch/sparc64/oprofile/init.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +2 -1 # oprofile: falling back on timer interrupt mode # # arch/sh/oprofile/op_model_null.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +2 -1 # oprofile: falling back on timer interrupt mode # # arch/s390/oprofile/init.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +2 -1 # oprofile: falling back on timer interrupt mode # # arch/ppc64/oprofile/common.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +4 -2 # oprofile: falling back on timer interrupt mode # # arch/parisc/oprofile/init.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +2 -1 # oprofile: falling back on timer interrupt mode # # arch/m32r/oprofile/init.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +2 -1 # oprofile: falling back on timer interrupt mode # # arch/ia64/oprofile/init.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +6 -2 # oprofile: falling back on timer interrupt mode # # arch/i386/oprofile/init.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +3 -1 # oprofile: falling back on timer interrupt mode # # arch/arm/oprofile/init.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +6 -2 # oprofile: falling back on timer interrupt mode # # arch/arm/oprofile/common.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +5 -2 # oprofile: falling back on timer interrupt mode # # arch/alpha/oprofile/common.c # 2005/01/25 13:43:48-08:00 amgta@yacht.ocn.ne.jp +4 -2 # oprofile: falling back on timer interrupt mode # # ChangeSet # 2005/01/25 20:30:47-08:00 yuasa@hh.iij4u.or.jp # [PATCH] mips: fixed conflicting types # # arch/mips/lib/csum_partial_copy.c:21: error: conflicting types for `csum_partial_copy_nocheck' # include/asm/checksum.h:65: error: previous declaration of `csum_partial_copy_nocheck' # arch/mips/lib/csum_partial_copy.c:38: error: conflicting types for `csum_partial_copy_from_user' # include/asm/checksum.h:38: error: previous declaration of `csum_partial_copy_from_user' # make[1]: *** [arch/mips/lib/csum_partial_copy.o] Error 1 # make: *** [arch/mips/lib] Error 2 # # Signed-off-by: Yoichi Yuasa # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # arch/mips/lib/csum_partial_copy.c # 2005/01/25 13:43:47-08:00 yuasa@hh.iij4u.or.jp +2 -2 # mips: fixed conflicting types # # ChangeSet # 2005/01/25 20:30:29-08:00 js@linuxtv.org # [PATCH] DVB linkage fix # # We have two global variables called "debug". # # The attached patch cleans up various aspects of dibusb module argument # handling, so it's a bit larger than just renaming "debug". # # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/dvb/dibusb/dvb-dibusb.h # 2005/01/25 13:33:10-08:00 js@linuxtv.org +9 -11 # DVB linkage fix # # drivers/media/dvb/dibusb/dvb-dibusb-usb.c # 2005/01/25 13:33:10-08:00 js@linuxtv.org +9 -5 # DVB linkage fix # # drivers/media/dvb/dibusb/dvb-dibusb-remote.c # 2005/01/25 13:33:10-08:00 js@linuxtv.org +5 -5 # DVB linkage fix # # drivers/media/dvb/dibusb/dvb-dibusb-core.c # 2005/01/25 13:43:25-08:00 js@linuxtv.org +14 -5 # DVB linkage fix # # ChangeSet # 2005/01/25 20:30:15-08:00 akpm@osdl.org # [PATCH] dib3000mc build fix # # - Build fix for older gcc's # # - Don't typecast when assigning between void*'s and other pointers. # # cc: # Signed-off-by: Andrew Morton # Signed-off-by: Linus Torvalds # # drivers/media/dvb/frontends/dib3000mc.c # 2005/01/25 13:33:10-08:00 akpm@osdl.org +3 -1 # dib3000mc build fix # # ChangeSet # 2005/01/25 20:29:47-08:00 torvalds@ppc970.osdl.org # Add 'f_maxcount' to allow filesystems to set a per-file maximum IO size. # # include/linux/fs.h # 2005/01/25 20:29:40-08:00 torvalds@ppc970.osdl.org +1 -0 # Add 'f_maxcount' to allow filesystems to set a per-file maximum IO size. # # fs/read_write.c # 2005/01/25 20:29:40-08:00 torvalds@ppc970.osdl.org +5 -1 # Add 'f_maxcount' to allow filesystems to set a per-file maximum IO size. # # fs/file_table.c # 2005/01/25 20:29:40-08:00 torvalds@ppc970.osdl.org +1 -0 # Add 'f_maxcount' to allow filesystems to set a per-file maximum IO size. # # ChangeSet # 2005/01/25 15:00:33-08:00 torvalds@ppc970.osdl.org # Rename "locks_verify_area()" to "rw_verify_area()" and clean up the # arguments. # # And make it non-inlined. # # include/linux/fs.h # 2005/01/25 15:00:26-08:00 torvalds@ppc970.osdl.org +1 -8 # Rename "locks_verify_area()" to "rw_verify_area()" and clean up the # arguments. # # And make it non-inlined. # # fs/read_write.c # 2005/01/25 15:00:25-08:00 torvalds@ppc970.osdl.org +15 -12 # Rename "locks_verify_area()" to "rw_verify_area()" and clean up the # arguments. # # And make it non-inlined. # # fs/locks.c # 2005/01/25 15:00:25-08:00 torvalds@ppc970.osdl.org +1 -1 # Rename "locks_verify_area()" to "rw_verify_area()" and clean up the # arguments. # # And make it non-inlined. # # fs/compat.c # 2005/01/25 15:00:25-08:00 torvalds@ppc970.osdl.org +1 -6 # Rename "locks_verify_area()" to "rw_verify_area()" and clean up the # arguments. # # And make it non-inlined. # # arch/mips/kernel/linux32.c # 2005/01/25 15:00:25-08:00 torvalds@ppc970.osdl.org +2 -4 # Rename "locks_verify_area()" to "rw_verify_area()" and clean up the # arguments. # # And make it non-inlined. # # ChangeSet # 2005/01/25 22:51:34+00:00 nico@org.rmk.(none) # [ARM PATCH] 2435/1: platform data for audio on Mainstone # # Patch from Nicolas Pitre # # This enables audio on Mainstone with the ALSA PXA2xx AC97 driver. # # Signed-off-by: Nicolas Pitre # Signed-off-by: Russell King # # arch/arm/mach-pxa/mainstone.c # 2005/01/25 00:00:00+00:00 nico@org.rmk.(none) +46 -0 # [PATCH] 2435/1: platform data for audio on Mainstone # # include/asm-arm/arch-pxa/audio.h # 2005/01/25 00:00:00+00:00 nico@org.rmk.(none) +16 -0 # [PATCH] 2435/1: platform data for audio on Mainstone # # include/asm-arm/arch-pxa/audio.h # 2005/01/25 00:00:00+00:00 nico@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-pxa/audio.h # # ChangeSet # 2005/01/25 22:43:59+00:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2433/1: debug-macro.S split - fix header filename # # Patch from Ben Dooks # # All the headers refer to debug-armv.S, when they where split from # debug.S # # Signed-off-by: Ben Dooks # Signed-off-by: Russell King # # include/asm-arm/arch-versatile/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-shark/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-sa1100/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-s3c2410/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-rpc/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-pxa/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-omap/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-lh7a40x/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-l7200/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-ixp4xx/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-ixp2000/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-iop3xx/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-integrator/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-imx/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-h720x/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-epxa10db/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-ebsa285/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-ebsa110/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-clps711x/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # include/asm-arm/arch-cl7500/debug-macro.S # 2005/01/25 00:07:07+00:00 ben-linux@org.rmk.(none) +1 -1 # [PATCH] 2433/1: debug-macro.S split - fix header filename # # ChangeSet # 2005/01/25 22:36:39+00:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2432/1: include/asm-arm/bitops.h - missing const from find # # Patch from Ben Dooks # # the calls _find_first_zero_bit_be() and _find_next_zero_bit_be() # are missing const from the pointer argument passed in, causing # several build warnings when building an ARM kernel in big-endian # mode. # # Signed-off-by: Ben Dooks # Signed-off-by: Russell King # # include/asm-arm/bitops.h # 2005/01/23 23:32:10+00:00 ben-linux@org.rmk.(none) +2 -2 # [PATCH] 2432/1: include/asm-arm/bitops.h - missing const from find # # ChangeSet # 2005/01/25 12:49:07-08:00 greg@kroah.com # [PATCH] Modules: Allow sysfs module parameters to be written to. # # This fixes a bug in the current tree preventing the sysfs module # parameters from being able to be changed at all from userspace. It's as # if someone just forgot to write this function... # # Signed-off-by: Greg Kroah-Hartman # Signed-off-by: Linus Torvalds # # kernel/params.c # 2005/01/24 21:07:40-08:00 greg@kroah.com +25 -1 # Modules: Allow sysfs module parameters to be written to. # # ChangeSet # 2005/01/25 08:03:42-08:00 geert@linux-m68k.org # [PATCH] m68k csum_partial_copy_* gcc4 warning fixes # # The gcc4 signedness warning fix forgot to update the declarations in # include/asm-m68k/checksum.h. # # include/asm-m68k/checksum.h # 2005/01/24 05:58:28-08:00 geert@linux-m68k.org +7 -4 # m68k csum_partial_copy_* gcc4 warning fixes # # ChangeSet # 2005/01/25 08:01:03-08:00 ecashin@coraid.com # [PATCH] AOE: fix up the block device registration so that it actually works # # Remove __exit from aoeblk_exit (to allow it to be called from __init code). # # Remove register_blkdev into aoe_init (it's done in aoemain.c). # # Signed-off-by: Ed L. Cashin # Signed-off-by: Linus Torvalds # # drivers/block/aoe/aoeblk.c # 2005/01/19 12:21:53-08:00 ecashin@coraid.com +1 -8 # AOE: fix up the block device registration so that it actually works # # ChangeSet # 2005/01/25 10:10:51+00:00 aia21@cantab.net # NTFS: Add printk rate limiting for ntfs_warning() and ntfs_error() when # compiled without debug. This avoids a possible denial of service # attack. Thanks to Carl-Daniel Hailfinger from SuSE for pointing this # out. # # fs/ntfs/debug.c # 2005/01/25 10:10:42+00:00 aia21@cantab.net +8 -0 # Add printk rate limiting for ntfs_warning() and ntfs_error() when # compiled without debug. This avoids a possible denial of service # attack. Thanks to Carl-Daniel Hailfinger from SuSE for pointing this out. # # fs/ntfs/ChangeLog # 2005/01/25 10:10:42+00:00 aia21@cantab.net +7 -0 # Update # # ChangeSet # 2005/01/25 04:31:49+01:00 kernel@linuxace.com # [NETFILTER]: Add inversion to multiport match # # Should add this to rev1 of multiport before 2.6.11 comes out. # # Signed-off-by: Phil Oester # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ipt_multiport.c # 2005/01/25 04:31:40+01:00 kernel@linuxace.com +8 -7 # [NETFILTER]: Add inversion to multiport match # # Should add this to rev1 of multiport before 2.6.11 comes out. # # Signed-off-by: Phil Oester # Signed-off-by: Patrick McHardy # # include/linux/netfilter_ipv4/ipt_multiport.h # 2005/01/25 04:31:40+01:00 kernel@linuxace.com +1 -0 # [NETFILTER]: Add inversion to multiport match # # Should add this to rev1 of multiport before 2.6.11 comes out. # # Signed-off-by: Phil Oester # Signed-off-by: Patrick McHardy # # ChangeSet # 2005/01/25 04:12:44+01:00 gandalf@wlug.westbo.se # [NETFILTER]: Fix compile with NAT but without modules # # Here's another patch to fix compile-errors, this time with NAT but # without modules. There's a missing 'extern' in ip_conntrack_tftp.h # # Signed-off-by: Martin Josefsson # Signed-off-by: Patrick McHardy # # include/linux/netfilter_ipv4/ip_conntrack_tftp.h # 2005/01/25 04:12:37+01:00 gandalf@wlug.westbo.se +1 -1 # [NETFILTER]: Fix compile with NAT but without modules # # Here's another patch to fix compile-errors, this time with NAT but # without modules. There's a missing 'extern' in ip_conntrack_tftp.h # # Signed-off-by: Martin Josefsson # Signed-off-by: Patrick McHardy # # ChangeSet # 2005/01/25 04:10:59+01:00 gandalf@wlug.westbo.se # [NETFILTER]: Fix compile errors without NAT # # This patch fixes some compile errors with NAT that has appeared # after all the recent patches. # # Move struct ip_conntrack_expect after the definition of struct # ip_conntrack. Add #ifdef CONFIG_IP_NF_NAT_NEEDED around # ip_nat_initialized() Add lockhelp.h to ipt_CLUSTERIP.c # # Signed-off-by: Martin Josefsson # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ipt_CLUSTERIP.c # 2005/01/25 04:10:50+01:00 gandalf@wlug.westbo.se +1 -0 # [NETFILTER]: Fix compile errors without NAT # # This patch fixes some compile errors with NAT that has appeared # after all the recent patches. # # Move struct ip_conntrack_expect after the definition of struct # ip_conntrack. Add #ifdef CONFIG_IP_NF_NAT_NEEDED around # ip_nat_initialized() Add lockhelp.h to ipt_CLUSTERIP.c # # Signed-off-by: Martin Josefsson # Signed-off-by: Patrick McHardy # # include/linux/netfilter_ipv4/ip_conntrack.h # 2005/01/25 04:10:50+01:00 gandalf@wlug.westbo.se +30 -27 # [NETFILTER]: Fix compile errors without NAT # # This patch fixes some compile errors with NAT that has appeared # after all the recent patches. # # Move struct ip_conntrack_expect after the definition of struct # ip_conntrack. Add #ifdef CONFIG_IP_NF_NAT_NEEDED around # ip_nat_initialized() Add lockhelp.h to ipt_CLUSTERIP.c # # Signed-off-by: Martin Josefsson # Signed-off-by: Patrick McHardy # # ChangeSet # 2005/01/25 03:56:48+01:00 gandalf@wlug.westbo.se # [NETFILTER]: Fix SNAT/DNAT target size checks # # This patch fixes two size checks in the checkentry() for SNAT and DNAT # targets. The patch to remove support for multiple ranges forgot to use # IPT_ALIGN(). This isn't a problem on x86 but other archs like parisc # are affected and thus can't add any SNAT/DNAT rules. # # Signed-off-by: Martin Josefsson # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_nat_rule.c # 2005/01/25 03:56:39+01:00 gandalf@wlug.westbo.se +2 -2 # [NETFILTER]: Fix SNAT/DNAT target size checks # # This patch fixes two size checks in the checkentry() for SNAT and DNAT # targets. The patch to remove support for multiple ranges forgot to use # IPT_ALIGN(). This isn't a problem on x86 but other archs like parisc # are affected and thus can't add any SNAT/DNAT rules. # # Signed-off-by: Martin Josefsson # Signed-off-by: Patrick McHardy # # ChangeSet # 2005/01/24 17:41:45-08:00 davem@nuts.davemloft.net # [TG3]: Update driver version and reldate. # # Signed-off-by: David S. Miller # # drivers/net/tg3.c # 2005/01/24 17:41:14-08:00 davem@nuts.davemloft.net +2 -2 # [TG3]: Update driver version and reldate. # # ChangeSet # 2005/01/24 17:39:51-08:00 mchan@broadcom.com # [TG3]: Fix TSO for 5750 # # - Fix TSO for 5750 chips by setting tcp checksum field to 0 for TSO packets # - Add TG3_FLG2_HW_TSO flag for 5750 and newer chips that use the same TSO # scheme # # Signed-off-by: Michael Chan # Signed-off-by: David S. Miller # # drivers/net/tg3.h # 2005/01/24 17:39:28-08:00 mchan@broadcom.com +1 -0 # [TG3]: Fix TSO for 5750 # # - Fix TSO for 5750 chips by setting tcp checksum field to 0 for TSO packets # - Add TG3_FLG2_HW_TSO flag for 5750 and newer chips that use the same TSO # scheme # # Signed-off-by: Michael Chan # Signed-off-by: David S. Miller # # drivers/net/tg3.c # 2005/01/24 17:39:28-08:00 mchan@broadcom.com +24 -11 # [TG3]: Fix TSO for 5750 # # - Fix TSO for 5750 chips by setting tcp checksum field to 0 for TSO packets # - Add TG3_FLG2_HW_TSO flag for 5750 and newer chips that use the same TSO # scheme # # Signed-off-by: Michael Chan # Signed-off-by: David S. Miller # # ChangeSet # 2005/01/24 16:40:33-08:00 herbert@gondor.apana.org.au # [IPV4/IPV6]: In ip_fragment(), reset ip_summed field on SKB sub-frags. # # If we forward a fragmented packet, we can have ip_summed # set to CHECKSUM_HW or similar. This is fine for local # protocol processing, but once if we are forwarding this # packet we want to reset ip_summed to CHECKSUM_NONE. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv6/ip6_output.c # 2005/01/24 16:40:10-08:00 herbert@gondor.apana.org.au +1 -0 # [IPV4/IPV6]: In ip_fragment(), reset ip_summed field on SKB sub-frags. # # If we forward a fragmented packet, we can have ip_summed # set to CHECKSUM_HW or similar. This is fine for local # protocol processing, but once if we are forwarding this # packet we want to reset ip_summed to CHECKSUM_NONE. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv4/ip_output.c # 2005/01/24 16:40:10-08:00 herbert@gondor.apana.org.au +1 -0 # [IPV4/IPV6]: In ip_fragment(), reset ip_summed field on SKB sub-frags. # # If we forward a fragmented packet, we can have ip_summed # set to CHECKSUM_HW or similar. This is fine for local # protocol processing, but once if we are forwarding this # packet we want to reset ip_summed to CHECKSUM_NONE. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # ChangeSet # 2005/01/24 15:57:20-08:00 arjan@infradead.org # [PATCH] removing bcopy... because it's half broken # # Nothing in the kernel is using bcopy right know, and that is a good thing. # Why? Because a lot of the architectures implement a broken bcopy().... # the userspace standard bcopy() is basically a memmove() with a weird # parameter order, however a bunch of architectures implement a memcpy() not a # memmove(). # # Instead of fixing this inconsistency, I decided to remove it entirely, # explicit memcpy() and memmove() are prefered anyway (welcome to the 1990's) # and nothing in the kernel is using these functions, so this saves code size # as well for everyone. # # Signed-off-by: Arjan van de Ven # Signed-off-by: Adrian Bunk # # [ Side note: the only reason for bcopy appears to be totally ancient # gcc versions for OSF/1, used to originally cross-compile Linux on # alpha. Possibly some other similar cases. Time to move on ;-] # # Signed-off-by: Linus Torvalds # # lib/string.c # 2005/01/09 11:09:38-08:00 arjan@infradead.org +0 -24 # removing bcopy... because it's half broken # # include/asm-v850/string.h # 2005/01/09 11:15:35-08:00 arjan@infradead.org +0 -2 # removing bcopy... because it's half broken # # include/asm-sparc/string.h # 2005/01/09 11:16:25-08:00 arjan@infradead.org +0 -1 # removing bcopy... because it's half broken # # include/asm-sh/string.h # 2005/01/09 11:15:28-08:00 arjan@infradead.org +0 -3 # removing bcopy... because it's half broken # # include/asm-s390/string.h # 2005/01/09 11:16:21-08:00 arjan@infradead.org +0 -1 # removing bcopy... because it's half broken # # include/asm-ppc64/string.h # 2005/01/09 11:16:17-08:00 arjan@infradead.org +0 -1 # removing bcopy... because it's half broken # # include/asm-ppc/string.h # 2005/01/09 11:16:43-08:00 arjan@infradead.org +0 -1 # removing bcopy... because it's half broken # # include/asm-parisc/string.h # 2005/01/09 11:15:19-08:00 arjan@infradead.org +0 -3 # removing bcopy... because it's half broken # # include/asm-mips/string.h # 2005/01/09 11:16:13-08:00 arjan@infradead.org +0 -3 # removing bcopy... because it's half broken # # include/asm-ia64/string.h # 2005/01/09 11:16:04-08:00 arjan@infradead.org +0 -1 # removing bcopy... because it's half broken # # include/asm-arm/string.h # 2005/01/09 11:15:58-08:00 arjan@infradead.org +0 -2 # removing bcopy... because it's half broken # # include/asm-alpha/string.h # 2005/01/09 11:15:54-08:00 arjan@infradead.org +0 -1 # removing bcopy... because it's half broken # # arch/v850/lib/memcpy.c # 2005/01/09 11:12:33-08:00 arjan@infradead.org +0 -5 # removing bcopy... because it's half broken # # arch/sparc/lib/memcpy.S # 2005/01/09 11:13:33-08:00 arjan@infradead.org +2 -9 # removing bcopy... because it's half broken # # arch/sparc/kernel/sparc_ksyms.c # 2005/01/09 11:13:51-08:00 arjan@infradead.org +0 -2 # removing bcopy... because it's half broken # # arch/s390/lib/string.c # 2005/01/09 11:14:30-08:00 arjan@infradead.org +0 -15 # removing bcopy... because it's half broken # # arch/ppc64/boot/string.S # 2005/01/09 11:14:09-08:00 arjan@infradead.org +0 -7 # removing bcopy... because it's half broken # # arch/ppc/lib/string.S # 2005/01/09 11:11:50-08:00 arjan@infradead.org +0 -6 # removing bcopy... because it's half broken # # arch/ppc/boot/common/misc-common.c # 2005/01/09 11:12:20-08:00 arjan@infradead.org +0 -1 # removing bcopy... because it's half broken # # arch/parisc/lib/memcpy.c # 2005/01/09 11:11:30-08:00 arjan@infradead.org +0 -8 # removing bcopy... because it's half broken # # arch/ia64/lib/memcpy_mck.S # 2005/01/09 11:10:53-08:00 arjan@infradead.org +0 -9 # removing bcopy... because it's half broken # # arch/ia64/lib/memcpy.S # 2005/01/09 11:10:35-08:00 arjan@infradead.org +0 -16 # removing bcopy... because it's half broken # # arch/alpha/lib/memmove.S # 2005/01/09 11:10:08-08:00 arjan@infradead.org +0 -12 # removing bcopy... because it's half broken # # ChangeSet # 2005/01/24 14:37:53-08:00 torvalds@ppc970.osdl.org # Merge bk://linux-voyager.bkbits.net/voyager-2.6 # into ppc970.osdl.org:/home/torvalds/v2.6/linux # # arch/i386/mach-voyager/voyager_smp.c # 2005/01/24 14:37:49-08:00 torvalds@ppc970.osdl.org +0 -0 # Auto merged # # ChangeSet # 2005/01/24 14:36:59-08:00 torvalds@ppc970.osdl.org # Free temporary pipe page after freeing the main buffers. # # Duh. Freeing the main buffers can _cause_ the temporary # page to be created. # # fs/pipe.c # 2005/01/24 14:36:51-08:00 torvalds@ppc970.osdl.org +2 -2 # Free temporary pipe page after freeing the main buffers. # # Duh. Freeing the main buffers can _cause_ the temporary # page to be created. # # ChangeSet # 2005/01/23 17:44:52-06:00 hch@lst.de # [PATCH] osst: don't use obsolete SCSI APIs # # this patch gets rid of the need for scsi.h, similar to the recent patch # to the st driver. (applies ontop of Willem's patches) # # Signed-off-by: James Bottomley # Signed-off-by: Willem Riede # # drivers/scsi/osst.h # 2005/01/02 14:44:29-06:00 hch@lst.de +2 -2 # osst: don't use obsolete SCSI APIs # # drivers/scsi/osst.c # 2005/01/02 14:49:05-06:00 hch@lst.de +101 -97 # osst: don't use obsolete SCSI APIs # # ChangeSet # 2005/01/23 11:09:59-08:00 torvalds@ppc970.osdl.org # x86-64: don't crash and loop when the user passes an unknown earlyprintk= option. # # Signed-off-by: Andi Kleen # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/early_printk.c # 2005/01/23 11:09:52-08:00 torvalds@ppc970.osdl.org +0 -3 # x86-64: don't crash and loop when the user passes an unknown earlyprintk= option. # # ChangeSet # 2005/01/23 20:01:39+01:00 marcel@holtmann.org # [Bluetooth] Add RFCOMM service level security # # This patch adds the support for RFCOMM service level security. It # allows to request authentication and encryption before a RFCOMM # connection is finally established. # # Signed-off-by: Marcel Holtmann # # net/bluetooth/rfcomm/core.c # 2005/01/23 19:59:56+01:00 marcel@holtmann.org +138 -19 # Add RFCOMM service level security # # include/net/bluetooth/rfcomm.h # 2005/01/23 19:59:42+01:00 marcel@holtmann.org +7 -2 # Add RFCOMM service level security # # ChangeSet # 2005/01/23 19:55:30+01:00 marcel@holtmann.org # [Bluetooth] Fix rfcomm_sock_destruct() deadlock # # The fix for socket unlink race introduced a deadlock in the RFCOMM # code. The state change function is always called under the DLC lock # and if rfcomm_sock_kill() is called the rfcomm_sock_destruct() will # dead lock. So the DLC lock must be dropped first and claimed again # afterwards. # # Signed-off-by: Marcel Holtmann # # net/bluetooth/rfcomm/sock.c # 2005/01/23 19:48:51+01:00 marcel@holtmann.org +7 -2 # Fix rfcomm_sock_destruct() deadlock # # ChangeSet # 2005/01/23 10:29:42-08:00 kaos@ocs.com.au # [PATCH] fix module kallsym lookup breakage # # Anton Blanchard wrote: # >Your recent patch looks to break module kallsyms lookups.... # >It looks like if CONFIG_KALLSYMS_ALL is set then we never look up module # >addresses. # # Separate lookups for kernel and modules when CONFIG_KALLSYMS_ALL=y. # # Signed-off-by: Keith Owens # Acked-by: Chris Wedgwood # Signed-off-by: Linus Torvalds # # kernel/kallsyms.c # 2005/01/10 05:42:42-08:00 kaos@ocs.com.au +9 -1 # fix module kallsym lookup breakage # # ChangeSet # 2005/01/23 10:29:27-08:00 ak@suse.de # [PATCH] x86-64: Fix UP build warning # # Fix warning: # # In file included from include/asm/numa.h:5, # from arch/x86_64/kernel/setup64.c:27: # include/asm/numnodes.h:6:1: warning: "NODES_SHIFT" redefined # In file included from include/linux/mmzone.h:13, # from include/linux/gfp.h:4, # from include/linux/slab.h:15, # from include/linux/percpu.h:4, # from include/linux/sched.h:33, # from arch/x86_64/kernel/setup64.c:11: # include/linux/numa.h:11:1: warning: this is the location of the previous definition # # in UP builds. # # Signed-off-by: Andi Kleen # Signed-off-by: Linus Torvalds # # include/asm-x86_64/numnodes.h # 2005/01/23 10:29:19-08:00 ak@suse.de +4 -0 # x86-64: Fix UP build warning # # ChangeSet # 2005/01/23 10:29:11-08:00 ak@suse.de # [PATCH] i386/x86-64: Fix ioremap off by one # # From Terence Ripperda # # When doing iounmap don't try to change_page_attr back the guard # page that ioremap added. # # Since the last round of change_page_attr changes this would # trigger an BUG because the reference count on the changed pages # wouldn't match up. # # The problem would be only visible on machines with >3GB of memory, # because only then the PCI memory hole is below end_pfn and # change_page_attr is used. # # Fixed for both i386 and x86-64. # # This was actually discovered&fixed by Andrea earlier, but I goofed up # while doing the last ioremap fixes merge and this change got lost. # Poor Terence had to debug it again. Sorry about that. # # cc: andrea@suse.de # Signed-off-by: Andi Kleen # Signed-off-by: Linus Torvalds # # arch/x86_64/mm/ioremap.c # 2005/01/23 10:29:03-08:00 ak@suse.de +2 -1 # i386/x86-64: Fix ioremap off by one # # arch/i386/mm/ioremap.c # 2005/01/23 10:29:03-08:00 ak@suse.de +2 -1 # i386/x86-64: Fix ioremap off by one # # ChangeSet # 2005/01/23 10:28:57-08:00 ak@suse.de # [PATCH] x86_64: Fix int3 trap # # Undo bogus change that was introduced with kprobes. It's not # really needed and it breaks some user applications because # it changes the signal for int 3 from SIGTRAP to SIGSEGV. # # Cc: # Signed-off-by: Andi Kleen # Signed-off-by: Linus Torvalds # # arch/x86_64/kernel/traps.c # 2005/01/23 10:28:47-08:00 ak@suse.de +1 -1 # x86_64: Fix int3 trap # # ChangeSet # 2005/01/23 18:50:26+01:00 marcel@holtmann.org # [Bluetooth] Fix too many keys pressed error # # This patch fixes the problem of keys repeating when too many keys # are pressed at the same time (e.g. when typing quickly). This # often results in "mount" becoming "mouount". # # It seems that Bluetooth keyboards send a HID report with the keys # all set to 0x01 if too many keys were pressed at the same time. # This confuses the previous report handling logic and now these # reports are ignored. # # Signed-off-by: Juha Yrjölä # Signed-off-by: Marcel Holtmann # # ChangeSet # 2005/01/23 17:47:02+00:00 ben-linux@org.rmk.(none) # [ARM PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # Patch from Ben Dooks # # This patch moves all the machine/arch specific bits out of # arch/arm/kernel/debug.S and places them into the include # directories for those given architectures. The debug macros # are placed into include/asm-arm/arch-*/debug-macro.S. # The aim is to clean-up the debug.S code and make it easier to # modify a single-architecture without affecting the entire # debug.S file. # The patch also removes CONFIG_ARCH_FTVPCI, which no longer # exists anywhere else in the kernel. # All new include files have the original copyright notice # from arch/arm/kernel/debug.S. # Note, not all architectures modified here have been built # and/or tested due to lack of available machines, or # problems building for them (no defconfig available, or # problems with kernel build). # # Signed-off-by: Ben Dooks # Signed-off-by: Russell King # # net/bluetooth/hidp/core.c # 2005/01/23 18:46:26+01:00 marcel@holtmann.org +7 -0 # Fix too many keys pressed error # # include/asm-arm/arch-versatile/debug-macro.S # 2005/01/23 12:13:09+00:00 ben-linux@org.rmk.(none) +39 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-shark/debug-macro.S # 2005/01/23 12:12:54+00:00 ben-linux@org.rmk.(none) +31 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-sa1100/debug-macro.S # 2005/01/23 12:12:35+00:00 ben-linux@org.rmk.(none) +57 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-s3c2410/debug-macro.S # 2005/01/23 12:11:54+00:00 ben-linux@org.rmk.(none) +97 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-rpc/debug-macro.S # 2005/01/23 12:11:22+00:00 ben-linux@org.rmk.(none) +35 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-pxa/debug-macro.S # 2005/01/23 12:11:00+00:00 ben-linux@org.rmk.(none) +36 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-omap/debug-macro.S # 2005/01/23 12:10:41+00:00 ben-linux@org.rmk.(none) +45 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-lh7a40x/debug-macro.S # 2005/01/23 12:10:13+00:00 ben-linux@org.rmk.(none) +39 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-l7200/debug-macro.S # 2005/01/23 12:09:57+00:00 ben-linux@org.rmk.(none) +40 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # arch/arm/kernel/debug.S # 2005/01/23 12:03:37+00:00 ben-linux@org.rmk.(none) +5 -663 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-versatile/debug-macro.S # 2005/01/23 12:13:09+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-versatile/debug-macro.S # # include/asm-arm/arch-shark/debug-macro.S # 2005/01/23 12:12:54+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-shark/debug-macro.S # # include/asm-arm/arch-sa1100/debug-macro.S # 2005/01/23 12:12:35+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-sa1100/debug-macro.S # # include/asm-arm/arch-s3c2410/debug-macro.S # 2005/01/23 12:11:54+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-s3c2410/debug-macro.S # # include/asm-arm/arch-rpc/debug-macro.S # 2005/01/23 12:11:22+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-rpc/debug-macro.S # # include/asm-arm/arch-pxa/debug-macro.S # 2005/01/23 12:11:00+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-pxa/debug-macro.S # # include/asm-arm/arch-omap/debug-macro.S # 2005/01/23 12:10:41+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-omap/debug-macro.S # # include/asm-arm/arch-lh7a40x/debug-macro.S # 2005/01/23 12:10:13+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-lh7a40x/debug-macro.S # # include/asm-arm/arch-l7200/debug-macro.S # 2005/01/23 12:09:57+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-l7200/debug-macro.S # # include/asm-arm/arch-ixp4xx/debug-macro.S # 2005/01/23 12:09:29+00:00 ben-linux@org.rmk.(none) +34 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-ixp2000/debug-macro.S # 2005/01/23 12:08:50+00:00 ben-linux@org.rmk.(none) +40 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-iop3xx/debug-macro.S # 2005/01/23 12:08:26+00:00 ben-linux@org.rmk.(none) +48 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-integrator/debug-macro.S # 2005/01/23 12:08:04+00:00 ben-linux@org.rmk.(none) +38 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-imx/debug-macro.S # 2005/01/23 12:07:39+00:00 ben-linux@org.rmk.(none) +34 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-h720x/debug-macro.S # 2005/01/23 12:07:24+00:00 ben-linux@org.rmk.(none) +40 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-epxa10db/debug-macro.S # 2005/01/23 12:07:07+00:00 ben-linux@org.rmk.(none) +41 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-ebsa285/debug-macro.S # 2005/01/23 12:06:37+00:00 ben-linux@org.rmk.(none) +66 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-ebsa110/debug-macro.S # 2005/01/23 12:05:48+00:00 ben-linux@org.rmk.(none) +34 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-clps711x/debug-macro.S # 2005/01/23 12:05:31+00:00 ben-linux@org.rmk.(none) +46 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-ixp4xx/debug-macro.S # 2005/01/23 12:09:29+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-ixp4xx/debug-macro.S # # include/asm-arm/arch-ixp2000/debug-macro.S # 2005/01/23 12:08:50+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-ixp2000/debug-macro.S # # include/asm-arm/arch-iop3xx/debug-macro.S # 2005/01/23 12:08:26+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-iop3xx/debug-macro.S # # include/asm-arm/arch-integrator/debug-macro.S # 2005/01/23 12:08:04+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-integrator/debug-macro.S # # include/asm-arm/arch-imx/debug-macro.S # 2005/01/23 12:07:39+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-imx/debug-macro.S # # include/asm-arm/arch-h720x/debug-macro.S # 2005/01/23 12:07:24+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-h720x/debug-macro.S # # include/asm-arm/arch-epxa10db/debug-macro.S # 2005/01/23 12:07:07+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-epxa10db/debug-macro.S # # include/asm-arm/arch-ebsa285/debug-macro.S # 2005/01/23 12:06:37+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-ebsa285/debug-macro.S # # include/asm-arm/arch-ebsa110/debug-macro.S # 2005/01/23 12:05:48+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-ebsa110/debug-macro.S # # include/asm-arm/arch-clps711x/debug-macro.S # 2005/01/23 12:05:31+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-clps711x/debug-macro.S # # include/asm-arm/arch-cl7500/debug-macro.S # 2005/01/23 12:05:02+00:00 ben-linux@org.rmk.(none) +31 -0 # [PATCH] 2431/1: Split arch specifics out of arch/arm/kernel/debug.S # # include/asm-arm/arch-cl7500/debug-macro.S # 2005/01/23 12:05:02+00:00 ben-linux@org.rmk.(none) +0 -0 # BitKeeper file /usr/src/bk/linux-2.6-rmk/include/asm-arm/arch-cl7500/debug-macro.S # # ChangeSet # 2005/01/23 18:40:28+01:00 marcel@holtmann.org # [Bluetooth] Use wait_event_timeout() # # Use wait_event_timeout() instead of custom wait queue code. The # current code uses TASK_INTERRUPTIBLE but only cares about timing # out and the wait queue event taking place (does not actively do # anything in response to signals), so wait_event_timeout() should # be enough. # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Marcel Holtmann # # net/bluetooth/hidp/core.c # 2005/01/23 18:38:32+01:00 marcel@holtmann.org +4 -20 # Use wait_event_timeout() # # ChangeSet # 2005/01/23 18:36:35+01:00 marcel@holtmann.org # [Bluetooth] Use wait_event_interruptible_timeout() # # Use wait_event_interruptible_timeout() instead of custom wait # queue code. # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Marcel Holtmann # # net/bluetooth/cmtp/capi.c # 2005/01/23 18:35:21+01:00 marcel@holtmann.org +8 -35 # Use wait_event_interruptible_timeout() # # ChangeSet # 2005/01/23 09:26:01-06:00 jejb@mulgrave.(none) # sd descriptor sense support # # From: Douglas Gilbert # # - make all sd driver sense data handling able to use # both fixed and descriptor format # - permit 64 bit lbas associated with medium (or # hardware) errors to be conveyed back to the block # layer # # Signed-off-by: James Bottomley # # drivers/scsi/sd.c # 2005/01/23 09:25:07-06:00 jejb@mulgrave.(none) +69 -43 # sd descriptor sense support # # ChangeSet # 2005/01/23 09:20:23-06:00 bunk@stusta.de # [PATCH] SCSI NCR_Q720.c: make some code static # # This patch makes two needlessly global structs static. # # Signed-off-by: Adrian Bunk # Signed-off-by: James Bottomley # # drivers/scsi/NCR_Q720.c # 2004/11/13 09:34:32-06:00 bunk@stusta.de +2 -2 # SCSI NCR_Q720.c: make some code static # # ChangeSet # 2005/01/23 09:12:43-06:00 markh@osdl.org # [PATCH] aacraid 2.6: add scsi synchronize cache support. # # This is an update from the Adaptec driver that adds support for the scsi # synchronize cache command. It essentially blocks further commands until # data has been flushed to the disks. # # Signed-off-by: Mark Haverkamp # Signed-off-by: James Bottomley # # drivers/scsi/aacraid/aacraid.h # 2005/01/19 12:48:23-06:00 markh@osdl.org +24 -0 # aacraid 2.6: add scsi synchronize cache support. # # drivers/scsi/aacraid/aachba.c # 2005/01/20 10:51:37-06:00 markh@osdl.org +113 -0 # aacraid 2.6: add scsi synchronize cache support. # # ChangeSet # 2005/01/23 08:51:23-06:00 jejb@mulgrave.(none) # SCSI: Fix style nitpicks # # Noticed by: Christoph Hellwig # # Signed-off-by: James Bottomley # # drivers/scsi/sd.c # 2005/01/23 08:49:12-06:00 jejb@mulgrave.(none) +1 -1 # SCSI: Fix style nitpicks # # drivers/scsi/scsi_lib.c # 2005/01/23 08:49:11-06:00 jejb@mulgrave.(none) +1 -1 # SCSI: Fix style nitpicks # # ChangeSet # 2005/01/23 08:41:37-06:00 dougg@torque.net # [PATCH] streamline block SG_IO error processing in sd # # - sd_init_command(): use retry count of 1 for block # SG_IO; minor cleanup # - sd_rw_init(): bypass sd level error processing for # block SG_IO # # Signed-off-by: Douglas Gilbert # Signed-off-by: James Bottomley # # drivers/scsi/sd.c # 2005/01/14 03:50:15-06:00 dougg@torque.net +31 -24 # streamline block SG_IO error processing # # ChangeSet # 2005/01/23 08:36:14-06:00 dougg@torque.net # [PATCH] streamline block SG_IO error processing # # - cleanup scsi_end_request() documentation # - shorten path for block SG_IO through scsi_io_completion() # - for non-SG_IO sense processing in scsi_io_completion(): # - ignore deferred errors (report + retry should suffice) # - consolidate into a cleaner switch statement # # Signed-off-by: Douglas Gilbert # Signed-off-by: James Bottomley # # drivers/scsi/scsi_lib.c # 2005/01/14 19:34:03-06:00 dougg@torque.net +54 -54 # streamline block SG_IO error processing # # ChangeSet # 2005/01/23 13:45:48+00:00 rmk@flint.arm.linux.org.uk # [ARM] Add warning about building fiq.c with gcc >= 3.4 # # Unfortunately, some changes to GCC prevents fiq.c expressing the # constraints for the assembly setting the FIQ register set. Warn # people with later gcc toolchains that they can expect failure to # occur. # # Signed-off-by: Russell King # # arch/arm/kernel/fiq.c # 2005/01/23 13:41:53+00:00 rmk@flint.arm.linux.org.uk +6 -0 # Add a warning about building fiq.c with gcc >= 3.4 # # ChangeSet # 2005/01/23 13:33:19+00:00 rmk@flint.arm.linux.org.uk # [ARM] msr can take immediate constants. # # Signed-off-by: Russell King # # arch/arm/kernel/fiq.c # 2005/01/23 13:29:07+00:00 rmk@flint.arm.linux.org.uk +8 -10 # msr can take immediate constants # # ChangeSet # 2005/01/22 19:46:13-08:00 davem@nuts.davemloft.net # [SPARC64]: Minor memmove refinements. # # - If dst/src are equal, memcpy can be used. # - Eliminate register writes which were unused # # Signed-off-by: David S. Miller # # arch/sparc64/lib/memmove.S # 2005/01/22 19:45:36-08:00 davem@nuts.davemloft.net +5 -7 # [SPARC64]: Minor memmove refinements. # # ChangeSet # 2005/01/22 19:42:06-08:00 davem@nuts.davemloft.net # [TG3]: Update driver version and reldate. # # Signed-off-by: David S. Miller # # drivers/net/tg3.c # 2005/01/22 19:41:32-08:00 davem@nuts.davemloft.net +2 -2 # [TG3]: Update driver version and reldate. # # ChangeSet # 2005/01/22 16:01:24-08:00 tony.luck@intel.com # [IA64] clean up loose ends from addition of efi_range_is_wc() # # Signed-off-by: Tony Luck # # drivers/char/drm/drm_vm.c # 2005/01/22 15:59:58-08:00 tony.luck@intel.com +3 -0 # need linux/efi.h to get efi_range_is_wc() # # arch/ia64/kernel/efi.c # 2005/01/22 15:59:24-08:00 tony.luck@intel.com +1 -0 # export efi_mem_attributes so users of efi_range_is_wc() can see it # # ChangeSet # 2005/01/22 15:56:39-08:00 tony.luck@intel.com # [IA64] irq handling cleanup # # Patch from Christoph Hellwig to: # - irq_desc and irq_to_vector machvecs. SN2 has it's own versions, # but they're the same as the generic ones # - kill do do_IRQ and use __do_IRQ directly everywhere # - kill dead X86 ifdefs # - move some variable declarations around in irq.c to recuce # of ifdefs # # Signed-off-by: Tony Luck # # include/asm-ia64/machvec_sn2.h # 2005/01/22 15:54:56-08:00 tony.luck@intel.com +0 -4 # ia64: irq handling cleanup # # include/asm-ia64/machvec_init.h # 2005/01/22 15:54:55-08:00 tony.luck@intel.com +0 -2 # ia64: irq handling cleanup # # include/asm-ia64/machvec.h # 2005/01/22 15:54:53-08:00 tony.luck@intel.com +0 -15 # ia64: irq handling cleanup # # include/asm-ia64/hw_irq.h # 2005/01/22 15:54:52-08:00 tony.luck@intel.com +2 -14 # ia64: irq handling cleanup # # arch/ia64/sn/kernel/irq.c # 2005/01/22 15:54:50-08:00 tony.luck@intel.com +0 -10 # ia64: irq handling cleanup # # arch/ia64/kernel/irq_ia64.c # 2005/01/22 15:54:49-08:00 tony.luck@intel.com +2 -4 # ia64: irq handling cleanup # # arch/ia64/kernel/irq.c # 2005/01/22 15:54:25-08:00 tony.luck@intel.com +7 -43 # ia64: irq handling cleanup # # ChangeSet # 2005/01/22 15:00:59-08:00 jbarnes@sgi.com # [IA64] remove superfluous layer from sn2 DMA API # # When I converted the sn2 code over to the new DMA API, I left the old routines # in place and added wrappers to call them from the generic DMA API functions. # This added an unnecessary level of obfuscation since the generic ia64 code # calls those functions when any of the old style PCI DMA API functions are # called. This patch rectifies the problem making the code much easier to # understand and hopefully a little more efficient (though I'm sure gcc was # already inlining things pretty well, there were a bunch of unnecessary checks # that I took this opportunity to remove). It also shrinks the size of the sn2 # pci_dma.c quite a bit. # # pci_dma.c | 480 +++++++++++++++++++----------------------------------------- # 1 files changed, 151 insertions(+), 329 deletions(-) # # Signed-off-by: Jesse Barnes # Signed-off-by: Tony Luck # # arch/ia64/sn/pci/pci_dma.c # 2005/01/22 14:59:35-08:00 jbarnes@sgi.com +151 -329 # remove superfluous layer from sn2 DMA API # # ChangeSet # 2005/01/22 14:58:21-08:00 jbarnes@sgi.com # [IA64] fix early SAL init for sn2 # # sn2 does early initialization of the SAL so it can use it for early console # support. Unfortunately, the loop to find the SAL entry point was buggy so # when we tried out new EFI and SAL system table layouts, the loop didn't # terminate. Here's the fix (doh!, use two different loop counters instead of # one and just return if we find the SAL entry point). # # Signed-off-by: Jesse Barnes # Signed-off-by: Tony Luck # # include/asm-ia64/sal.h # 2005/01/22 14:57:26-08:00 jbarnes@sgi.com +2 -0 # fix early SAL init for sn2 # # arch/ia64/sn/kernel/setup.c # 2005/01/22 14:57:15-08:00 jbarnes@sgi.com +5 -4 # fix early SAL init for sn2 # # ChangeSet # 2005/01/22 14:45:15-08:00 jbarnes@sgi.com # [IA64] new api efi_range_is_wc() # # Ok, here you go Tony. This one fixes the loop and also fixes drm_vm.c. All # of the bits aside from the efi.h bit are ia64 specific (either under # arch/ia64 or __ia64__), so your tree is probably the right place for all of # it. # # This patch adds efi_range_is_wc() to efi.h. It's used to determine whether an # address range can be mapped with the write coalescing attribute. It also # fixes up some ia64 specific callers to use the new routine instead of # unconditionally calling pgprot_writecombined, which can be dangerous if used # on ranges that don't support it. # # Signed-off-by: Jesse Barnes # Signed-off-by: Tony Luck # # include/linux/efi.h # 2005/01/22 14:43:57-08:00 jbarnes@sgi.com +21 -0 # new api efi_range_is_wc() # # drivers/video/fbmem.c # 2005/01/22 14:43:51-08:00 jbarnes@sgi.com +7 -2 # Use new efi_range_is_wc() api (inside #if ia64 code) # # drivers/char/drm/drm_vm.c # 2005/01/22 14:43:24-08:00 jbarnes@sgi.com +7 -2 # Use new efi_range_is_wc() api (inside #if ia64 code) # # arch/ia64/pci/pci.c # 2005/01/22 14:42:51-08:00 jbarnes@sgi.com +2 -1 # Use new efi_range_is_wc() api. # # ChangeSet # 2005/01/22 14:39:46-08:00 jes@trained-monkey.org # [IA64] fix PAL_PREFETCH_VISIBILITY call # # The following patch fixes the ia64_pal_prefetch_visibility function to # take a transaction type argument for either virtual or physical memory # as specified in the System Architechture Manual page 2:358. # # Signed-Off-By: Jes Sorensen # Signed-Off-By: Tony Luck # # include/asm-ia64/pal.h # 2005/01/22 14:38:52-08:00 jes@trained-monkey.org +17 -3 # fix PAL_PREFETCH_VISIBILITY call # # ChangeSet # 2005/01/22 14:35:36-08:00 eranian@hpl.hp.com # [IA64] entry.S: perfmon psr.pp fix # # Problem: # There exists a case where we stop monitoring, i.e. clear # psr.pp/dcr.pp, via IPI. This is when the stop is triggered # by a close(), either explicit in the application or implicit # via exit_files(). The IPI is necessary because at the time the # thread (controlling the context) issues a close() it may not run # on the CPU the context is bound to. Yet the call must succeed, # hence we need to propagate the call to the right CPU. # But what is the problem then? # Under IPI, we invoke a perfmon routine which clear the kernel # (live) kernel psr.pp bit and also dcr.pp. Then we return from # the function and execute the kernel exit path which restores # the interrupted state. Unfortunately, this restores the kernel # psr from ipsr which now contains a stale value. Therefore # monitoring in the kernel will be active even though we stopped it. # You cannot modify the "global" psr in an interrupt routine because # it will be systematically restored on the way back. # # Solution: # We need to patch ipsr.pp in the kernel exit path to reflect the # kernel value of the kernel psr.pp bit. This must be done only when # returning to kernel. # # The proposed patch does patch ipsr.pp such that it is identical # to psr.pp. The patch is subtle because the exit path does not have # a lot of free registers and also because we need to schedule for # a psr read. I had to shuffle things around a little bit. # # The patch is important because there will be another situation where # this problem can occur once we incorporate the support for event set # and multiplexing. In this configuration, you may be in the middle of # the idle loop and on a timer interrupt, you may stop monitoring. # Slightly different condition, yet same problem with ipsr.pp vs. psr.pp. # # # Changelog: # - update kernel exit path when returning to kernel to copy # psr.pp to ipsr.pp. This is necesary to ensure that if psr.pp # was modified during the kernel entry, the change is propagated # the the psr.pp of the of the interrupted thread. Psr.pp can # be modified as a consequence of an IPI under certain conditions, # such as when a system-wide context is closed from a remote CPU. # # Special thanks to David for reworking the patch to fit # into the enhanced exit path. # # signed-off-by: stephane eranian # Signed-off-by: Tony Luck # # arch/ia64/kernel/entry.S # 2005/01/22 14:32:20-08:00 eranian@hpl.hp.com +9 -5 # perfmon psr.pp fix # # ChangeSet # 2005/01/22 14:21:34-08:00 tony.luck@intel.com # [IA64] clean up ptrace corner cases # # Patch from yanmin.zhang@intel.com to fix up some corner cases # in ptrace. Many thanks to davidm for reviewing and improving. # # Signed-off-by: Tony Luck # # include/asm-ia64/unistd.h # 2005/01/22 14:19:22-08:00 tony.luck@intel.com +1 -1 # clean up ptrace corner cases # # arch/ia64/kernel/process.c # 2005/01/22 14:19:21-08:00 tony.luck@intel.com +1 -1 # clean up ptrace corner cases # # arch/ia64/kernel/ivt.S # 2005/01/22 14:19:19-08:00 tony.luck@intel.com +20 -5 # clean up ptrace corner cases # # arch/ia64/kernel/gate.S # 2005/01/22 14:19:18-08:00 tony.luck@intel.com +3 -1 # clean up ptrace corner cases # # arch/ia64/kernel/fsys.S # 2005/01/22 14:19:11-08:00 tony.luck@intel.com +3 -2 # clean up ptrace corner cases # # arch/ia64/kernel/entry.S # 2005/01/22 14:18:28-08:00 tony.luck@intel.com +19 -7 # clean up ptrace corner cases # # ChangeSet # 2005/01/22 13:50:44-08:00 tony.luck@intel.com # [IA64] mca.c: delete unused "return_to_sal" label # # Label is unused, and so the compiler generates a warning. # # Signed-off-by: Tony Luck # # arch/ia64/kernel/mca.c # 2005/01/22 13:48:51-08:00 tony.luck@intel.com +0 -2 # delete unused "return_to_sal" label # # ChangeSet # 2005/01/22 13:35:36-08:00 davidm@hpl.hp.com # [IA64] entry.S update the copyright year & fix a comment # # Signed-off-by: David Mosberger-Tang # Signed-off-by: Tony Luck # # arch/ia64/kernel/entry.S # 2005/01/22 13:34:06-08:00 davidm@hpl.hp.com +2 -2 # update the copyright year & fix a comment # # ChangeSet # 2005/01/22 13:33:33-08:00 davidm@hpl.hp.com # [IA64] Use srlz.d instead of srlz.i in ia64_leave_syscall # # Use srlz.d instead of srlz.i. Safe because we don't care whether # the VHPT walker sees the clearing of PSR.ic (if it does, that's fine # if it doesn't, it's OK too since the kernel-text is pinned anyhow). # Good for another 11+ cycles in (normal) getpid(). # # Signed-off-by: David Mosberger-Tang # Signed-off-by: Tony Luck # # arch/ia64/kernel/entry.S # 2005/01/22 13:31:53-08:00 davidm@hpl.hp.com +1 -1 # (ia64_leave_syscall): Use srlz.d instead of srlz.i # # ChangeSet # 2005/01/22 13:31:05-08:00 davidm@hpl.hp.com # [IA64] Improve ia64_leave_syscall() for McKinley-type cores. # # Optimize ia64_leave_syscall() a bit better for McKinley-type cores. # The patch looks big, but that's mostly due to renaming r16/r17 to r2/r3. # Good for a 13 cycle improvement. # # Signed-off-by: David Mosberger-Tang # Signed-off-by: Tony Luck # # arch/ia64/kernel/entry.S # 2005/01/22 13:29:44-08:00 davidm@hpl.hp.com +51 -48 # Improve ia64_leave_syscall() for McKinley-type cores. # # ChangeSet # 2005/01/22 13:29:13-08:00 davidm@hpl.hp.com # [IA64] Resched skip_rbs_switch to run 4 cycles faster on McKinley-type cores # # Signed-off-by: David Mosberger-Tang # Signed-off-by: Tony Luck # # arch/ia64/kernel/entry.S # 2005/01/22 13:28:01-08:00 davidm@hpl.hp.com +26 -16 # Resched skip_rbs_switch to run 4 cycles faster on McKinley-type cores # # ChangeSet # 2005/01/22 13:27:29-08:00 davidm@hpl.hp.com # [IA64] entry.S: Align rse_clear_invalid to double-bundle boundary. # # Trivial patch: align rse_clear_invalid to 32-byte boundary. Good for # a 9 cycle speed up. # # Signed-off-by: David Mosberger-Tang # Signed-off-by: Tony Luck # # arch/ia64/kernel/entry.S # 2005/01/22 13:26:04-08:00 davidm@hpl.hp.com +1 -0 # Align rse_clear_invalid to double-bundle boundary. # # ChangeSet # 2005/01/22 13:25:31-08:00 davidm@hpl.hp.com # [IA64] Don't forget to initialize PKStk for kernel-threads # # Kernel-threads had both pUStk and pKStk set to FALSE, which was # unintentional. I don't think the bug has shown any ill effects, but # it's clearly wrong and could come around to bite us later, so let's # fix it now. Depends on the previous patch to clean up C usage of the # global/root-function predicates. # # Signed-off-by: Tony Luck # # arch/ia64/kernel/process.c # 2005/01/22 13:23:44-08:00 davidm@hpl.hp.com +3 -1 # Don't forget to initialize PKStk for kernel-threads # # ChangeSet # 2005/01/22 13:22:55-08:00 davidm@hpl.hp.com # [IA64] cleanup C uage of global/root-function predicates # # The patch below is purely a cleanup but it's a prerequisite for the # next bug fix patch. # # Signed-off-by: David Mosberger-Tang # Signed-off-by: Tony Luck # # arch/ia64/kernel/unwind.c # 2005/01/22 13:20:30-08:00 davidm@hpl.hp.com +1 -3 # cleanup in preparation for speedup # # arch/ia64/kernel/ptrace.c # 2005/01/22 13:20:22-08:00 davidm@hpl.hp.com +2 -5 # cleanup in preparation for speedup # # arch/ia64/kernel/entry.h # 2005/01/22 13:19:53-08:00 davidm@hpl.hp.com +18 -7 # cleanup in preparation for speedup # # ChangeSet # 2005/01/22 13:16:18-08:00 nacc@us.ibm.com # [IA64] smpboot.c: use msleep(100) instead of inlined equivalent # # Use msleep() instead of schedule_timeout() to guarantee the task # delays as expected. # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Tony Luck # # arch/ia64/kernel/smpboot.c # 2005/01/22 13:13:47-08:00 nacc@us.ibm.com +1 -2 # use msleep(100) instead of inlined equivalent # # ChangeSet # 2005/01/22 13:09:59-08:00 rja@sgi.com # [IA64] increase limit on #pages to isolate for MCA errors # # The fixed sized array of pages that are isolated because of 2xECC # memory errors can run out. Increasing the size of the array is a # band-aid measure, the real fix will require changes to generic code # to add some bits to page_flags so that pages with errors can be # marked so as to prevent them ever being examined. # # Signed-off-by: Russ Anderson # Signed-off-by: Tony Luck # # arch/ia64/kernel/mca_drv.c # 2005/01/22 13:05:41-08:00 rja@sgi.com +1 -1 # increase limit on #pages to isolate for MCA errors # # ChangeSet # 2005/01/22 13:03:24-08:00 davidm@hpl.hp.com # [IA64] sys_ia32.c: add missing __user annotation for sparse # # Signed-off-by: David Mosberger-Tang # Signed-off-by: Tony Luck # # arch/ia64/ia32/sys_ia32.c # 2005/01/22 13:01:53-08:00 davidm@hpl.hp.com +1 -1 # add missing __user annotation for sparse # # ChangeSet # 2005/01/22 12:59:23-08:00 kaos@sgi.com # [IA64] Sanity check unw_unwind_to_user # # Signed-off-by: Keith Owens # Signed-off-by: Tony Luck # # arch/ia64/kernel/unwind.c # 2005/01/22 12:57:36-08:00 kaos@sgi.com +4 -1 # Sanity check unw_unwind_to_user # # ChangeSet # 2005/01/22 12:51:34-08:00 davidm@hpl.hp.com # [IA64] domain.c: eliminate warning when compiling CONFIG_NUMA=n # # When compiling for non-NUMA variable "node" ended up not being used, # which solicits a warning from GCC. Fix is to evluate cpu_to_node(i) # in place. This has the effect of doing cpu_to_node(i) twice on NUMA, # but this is init code, so performance is not an issue (and even if # it were, you can just declare cpu_to_node() as being a pure function, # so the compiler can eliminate the second call). # # Signed-off-by: David Mosberger-Tang # Signed-off-by: Tony Luck # # arch/ia64/kernel/domain.c # 2005/01/22 12:48:48-08:00 davidm@hpl.hp.com +2 -3 # eliminate warning when compiling CONFIG_NUMA=n # # ChangeSet # 2005/01/22 12:46:27-08:00 davidm@hpl.hp.com # [IA64] uaccess.h: add missing __user annotation for sparse # # I was getting a lot of spurious warnings with "make C=1", due to a # missing "__user" attribute. I'm not sure whether this got lost or # whether earlier versions of sparse failed to warn about it, but it's # clearly needed (and the i386 version of uaccess.h does the same). # # Signed-off-by: David Mosberger-Tang # Signed-off-by: Tony Luck # # include/asm-ia64/uaccess.h # 2005/01/22 12:44:45-08:00 davidm@hpl.hp.com +1 -1 # add missing __user annotation for sparse # # ChangeSet # 2005/01/22 12:18:41-08:00 tony.luck@intel.com # [IA64] binfmt_elf32.c: BUG if insert_vm_struct fails # # It seems that in ia64_elf32_init, instead of calling return, if we insert # an overlapping vma, we should instead BUG(). We should never get into this # code path, because the vma's are set above PAGE_OFFSET, and thus a # Xmalicious user can not trigger this code path. This change is being # suggested mainly for clarity. Thanks to Stephen Tweedie for pointing out # that returning early in ia64_elf32_init could have unpredictable results. # # Signed-off-by: Tony Luck # # arch/ia64/ia32/binfmt_elf32.c # 2005/01/22 12:16:29-08:00 tony.luck@intel.com +3 -3 # BUG if insert_vm_struct fails # # ChangeSet # 2005/01/22 12:08:41-08:00 markgw@sgi.com # [IA64] fix SN2 hwperf error handling # # Fix the error handling for the SN2 hardware perf ioctl interface. # # Signed-off-by: Mark Goodwin # Signed-off-by: Tony Luck # # arch/ia64/sn/kernel/sn2/sn_hwperf.c # 2005/01/22 12:07:37-08:00 markgw@sgi.com +45 -1 # fix SN2 hwperf error handling # # ChangeSet # 2005/01/22 12:03:07-08:00 steiner@sgi.com # [IA64] Delete: arch/ia64/sn/include/shub.h # # Signed-off-by: Jack Steiner # Signed-off-by: Tony Luck # # BitKeeper/deleted/.del-shub.h~31fa7a1f3da74fcf # 2005/01/22 12:02:00-08:00 steiner@sgi.com +0 -0 # Delete: arch/ia64/sn/include/shub.h # # ChangeSet # 2005/01/22 11:57:39-08:00 steiner@sgi.com # [IA64] Delete duplicate SN2 definition of cpu_logical_id for UP build # # Signed-off-by: Jack Steiner # Signed-off-by: Tony Luck # # include/asm-ia64/sn/sn_cpuid.h # 2005/01/22 11:56:17-08:00 steiner@sgi.com +0 -1 # Delete duplicate SN2 definition of cpu_logical_id for UP build # # ChangeSet # 2005/01/22 11:50:47-08:00 bob.picco@hp.com # [IA64] fix declaration of __find_next_zero_bit, first arg is "const" # # Signed-off-by: Bob Picco # Signed-off-by: Tony Luck # # include/asm-ia64/bitops.h # 2005/01/22 11:49:20-08:00 bob.picco@hp.com +1 -1 # fix declaration of __find_next_zero_bit, first arg is "const" # # arch/ia64/lib/bitop.c # 2005/01/22 11:48:41-08:00 bob.picco@hp.com +1 -1 # fix definition of __find_next_zero_bit, first arg is "const" # # ChangeSet # 2005/01/22 11:37:01-08:00 js@linuxtv.org # [PATCH] dvb: dvb-ttpci: fix SMP race, budget: fixe init race, misc fixes # # - [DVB] dvb-ttpci: re-added support for Fujitsu-Siemens DVB-S rev 1.6 0x13c2:0x0006 # - [DVB] dvb-ttpci: finally clean up debi irq/tasklet handling to make it work on SMP # - [DVB] dvb-ttpci: misc. changes to av7110_send_fw_cmd() error handling done along the way # - [DVB] dvb-ttpci: budgetpatch integrated into dvb-ttpci: enables full ts option running # in parallel with all previous functions of dvb-ttpci # - [DVB] dvb-ttpci: fix Oops provoked by insmod/rmmod test loop, patch by Emard # - [DVB] budget: Fixed start_ts_capture(): saa7146 will not issue a VPE interrupt # if VPE bit is set in PSR and VPE interrupts are enabled afterwards. # - [DVB] budget: enable satelco support. code was commented out, but actually it works, patch by Emard # - [DVB] budget: Budget patch improved driver, fixed slight packet loss by using different trigger mode # # Signed-off-by: Michael Hunold # Signed-off-by: Johannes Stezenbach # Signed-off-by: Linus Torvalds # # drivers/media/dvb/ttpci/budget.c # 2005/01/20 10:56:39-08:00 js@linuxtv.org +3 -3 # dvb: dvb-ttpci: fix SMP race, budget: fixe init race, misc fixes # # drivers/media/dvb/ttpci/budget-patch.c # 2005/01/20 10:56:39-08:00 js@linuxtv.org +311 -35 # dvb: dvb-ttpci: fix SMP race, budget: fixe init race, misc fixes # # drivers/media/dvb/ttpci/budget-core.c # 2005/01/20 10:56:39-08:00 js@linuxtv.org +13 -4 # dvb: dvb-ttpci: fix SMP race, budget: fixe init race, misc fixes # # drivers/media/dvb/ttpci/av7110_v4l.c # 2005/01/20 10:56:39-08:00 js@linuxtv.org +2 -2 # dvb: dvb-ttpci: fix SMP race, budget: fixe init race, misc fixes # # drivers/media/dvb/ttpci/av7110_hw.c # 2005/01/20 10:56:39-08:00 js@linuxtv.org +62 -30 # dvb: dvb-ttpci: fix SMP race, budget: fixe init race, misc fixes # # drivers/media/dvb/ttpci/av7110.h # 2005/01/20 10:56:38-08:00 js@linuxtv.org +13 -1 # dvb: dvb-ttpci: fix SMP race, budget: fixe init race, misc fixes # # drivers/media/dvb/ttpci/av7110.c # 2005/01/20 10:56:38-08:00 js@linuxtv.org +507 -85 # dvb: dvb-ttpci: fix SMP race, budget: fixe init race, misc fixes # # ChangeSet # 2005/01/22 11:36:47-08:00 js@linuxtv.org # [PATCH] dvb: nxt2002: add ATSC support, misc fixes # # - [DVB] mt352: exported a mt352_read_reg-function, implemented a single byte # write_register function (needed for dibusb) # - [DVB] nxt2002: patch by Taylor Jacob to add support for ATSC/VSB frontends # and the B2C2/BBTI Air2PC-ATSC card # - [DVB] stv0297: fix tuning problems and compile time warnings, patch by Markus Breitenberger # - [DVB] fix spelling errors in various frontend drivers # # Signed-off-by: Michael Hunold # Signed-off-by: Johannes Stezenbach # Signed-off-by: Linus Torvalds # # drivers/media/dvb/frontends/nxt2002.h # 2004/12/16 07:45:54-08:00 js@linuxtv.org +23 -0 # dvb: nxt2002: add ATSC support, misc fixes # # drivers/media/dvb/frontends/tda80xx.c # 2004/11/18 06:58:34-08:00 js@linuxtv.org +1 -1 # dvb: nxt2002: add ATSC support, misc fixes # # drivers/media/dvb/frontends/tda10021.h # 2005/01/20 10:56:38-08:00 js@linuxtv.org +1 -1 # dvb: nxt2002: add ATSC support, misc fixes # # drivers/media/dvb/frontends/tda10021.c # 2005/01/20 10:56:38-08:00 js@linuxtv.org +1 -1 # dvb: nxt2002: add ATSC support, misc fixes # # drivers/media/dvb/frontends/stv0297.h # 2004/12/17 13:00:18-08:00 js@linuxtv.org +3 -0 # dvb: nxt2002: add ATSC support, misc fixes # # drivers/media/dvb/frontends/stv0297.c # 2005/01/20 10:56:38-08:00 js@linuxtv.org +63 -31 # dvb: nxt2002: add ATSC support, misc fixes # # drivers/media/dvb/frontends/nxt2002.h # 2004/12/16 07:45:54-08:00 js@linuxtv.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/dvb/frontends/nxt2002.h # # drivers/media/dvb/frontends/nxt2002.c # 2004/12/16 07:45:54-08:00 js@linuxtv.org +670 -0 # dvb: nxt2002: add ATSC support, misc fixes # # drivers/media/dvb/frontends/mt352.h # 2005/01/20 10:56:38-08:00 js@linuxtv.org +1 -0 # dvb: nxt2002: add ATSC support, misc fixes # # drivers/media/dvb/frontends/mt352.c # 2005/01/20 10:56:38-08:00 js@linuxtv.org +18 -6 # dvb: nxt2002: add ATSC support, misc fixes # # drivers/media/dvb/frontends/nxt2002.c # 2004/12/16 07:45:54-08:00 js@linuxtv.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/dvb/frontends/nxt2002.c # # ChangeSet # 2005/01/22 11:36:33-08:00 js@linuxtv.org # [PATCH] dvb: dib3000 refactoring # # - [DVB] dib3000: driver refactoring, makes it easier to support device clones # # Signed-off-by: Michael Hunold # Signed-off-by: Johannes Stezenbach # Signed-off-by: Linus Torvalds # # drivers/media/dvb/frontends/dib3000mc_priv.h # 2005/01/20 10:56:38-08:00 js@linuxtv.org +23 -34 # dvb: dib3000 refactoring # # drivers/media/dvb/frontends/dib3000mc.c # 2005/01/20 10:56:38-08:00 js@linuxtv.org +300 -229 # dvb: dib3000 refactoring # # drivers/media/dvb/frontends/dib3000mb.c # 2005/01/20 10:56:37-08:00 js@linuxtv.org +27 -25 # dvb: dib3000 refactoring # # drivers/media/dvb/frontends/dib3000.h # 2005/01/20 10:56:37-08:00 js@linuxtv.org +10 -11 # dvb: dib3000 refactoring # # drivers/media/dvb/frontends/dib3000-common.h # 2005/01/20 10:56:37-08:00 js@linuxtv.org +11 -27 # dvb: dib3000 refactoring # # drivers/media/dvb/frontends/dib3000-common.c # 2005/01/20 10:56:37-08:00 js@linuxtv.org +1 -63 # dvb: dib3000 refactoring # # ChangeSet # 2005/01/22 11:36:18-08:00 js@linuxtv.org # [PATCH] dvb: add ATSC support, misc fixes # # - [DVB] dvb-core: vfree() checking cleanups, patch by Domen Puncer # - [DVB] dvb-core: fix handling of discontinuity indicator in section filter, # bug reported by Frank Rosengart # - [DVB] dvb-core: handle PUSI in section filter correctly, patch by Emard, # bug reported by Patrick Valsecchi # - [DVB] dvb-core: add support for ATSC/VSB frontends, patch by Taylor Jacob # - [DVB] dvb-core: removed semi-colon from a very wrong place; FE_ENABLE_HIGH_LNB_VOLTAGE # kernel oops; thanks to Christophe Massiot # - [DVB] dvb-core: Fixed slow tuning problems, remove frequeny bending support from # frontend code, code simplification # # Signed-off-by: Michael Hunold # Signed-off-by: Johannes Stezenbach # Signed-off-by: Linus Torvalds # # include/linux/dvb/version.h # 2004/12/17 13:00:18-08:00 js@linuxtv.org +1 -0 # dvb: add ATSC support, misc fixes # # include/linux/dvb/frontend.h # 2004/12/17 13:00:18-08:00 js@linuxtv.org +8 -3 # dvb: add ATSC support, misc fixes # # drivers/media/dvb/ttusb-dec/ttusb_dec.c # 2005/01/20 10:56:40-08:00 js@linuxtv.org +3 -3 # dvb: add ATSC support, misc fixes # # drivers/media/dvb/dvb-core/dvb_net.c # 2005/01/20 10:56:37-08:00 js@linuxtv.org +10 -4 # dvb: add ATSC support, misc fixes # # drivers/media/dvb/dvb-core/dvb_frontend.h # 2005/01/20 10:56:37-08:00 js@linuxtv.org +1 -22 # dvb: add ATSC support, misc fixes # # drivers/media/dvb/dvb-core/dvb_frontend.c # 2005/01/20 10:56:37-08:00 js@linuxtv.org +198 -147 # dvb: add ATSC support, misc fixes # # drivers/media/dvb/dvb-core/dvb_demux.h # 2005/01/20 10:56:37-08:00 js@linuxtv.org +1 -0 # dvb: add ATSC support, misc fixes # # drivers/media/dvb/dvb-core/dvb_demux.c # 2005/01/20 10:56:37-08:00 js@linuxtv.org +40 -18 # dvb: add ATSC support, misc fixes # # ChangeSet # 2005/01/22 11:36:05-08:00 js@linuxtv.org # [PATCH] dvb: support nxt2002 frontend, misc skystar2 fixes # # - [DVB] nxt2002: add support for nxt2002 frontend (firmware extraction, Kconfig, driver) # - [DVB] skystar2: misc cleanup, remove unneeded casts, remove unreachable # code, patches by Francois Romieu # - [DVB] skystar2: fix mt352 clock setting for VHF (6 and 7 MHz bw channels), # patch by Thomas Martin and Dieter Zander: # - [DVB] b2c2-usb-core: fix file permissions to be octal, ISO C90 compile fix, # temporally repaired the request_types # - [DVB] remove remains of dibusb driver after splitup # # Signed-off-by: Michael Hunold # Signed-off-by: Johannes Stezenbach # Signed-off-by: Linus Torvalds # # drivers/media/dvb/frontends/Makefile # 2004/12/17 13:00:17-08:00 js@linuxtv.org +2 -0 # dvb: support nxt2002 frontend, misc skystar2 fixes # # drivers/media/dvb/frontends/Kconfig # 2005/01/20 10:56:37-08:00 js@linuxtv.org +12 -0 # dvb: support nxt2002 frontend, misc skystar2 fixes # # drivers/media/dvb/b2c2/skystar2.c # 2005/01/20 10:56:37-08:00 js@linuxtv.org +195 -161 # dvb: support nxt2002 frontend, misc skystar2 fixes # # drivers/media/dvb/b2c2/b2c2-usb-core.c # 2005/01/20 10:56:37-08:00 js@linuxtv.org +12 -2 # dvb: support nxt2002 frontend, misc skystar2 fixes # # drivers/media/dvb/b2c2/Kconfig # 2004/12/17 13:00:17-08:00 js@linuxtv.org +4 -2 # dvb: support nxt2002 frontend, misc skystar2 fixes # # Documentation/dvb/get_dvb_firmware # 2004/12/17 13:00:17-08:00 js@linuxtv.org +19 -1 # dvb: support nxt2002 frontend, misc skystar2 fixes # # BitKeeper/deleted/.del-dvb-dibusb.c~44bff9a054ce6c32 # 2005/01/22 11:35:58-08:00 js@linuxtv.org +0 -0 # Delete: drivers/media/dvb/dibusb/dvb-dibusb.c # # ChangeSet # 2005/01/22 11:35:52-08:00 js@linuxtv.org # [PATCH] dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # - [DVB] dvb-dibusb: refactoring of the dibusb driver, support for device clones # from Yakumo/HAMA/Typhoon/HanfTek, update the documentation # # Signed-off-by: Michael Hunold # Signed-off-by: Johannes Stezenbach # Signed-off-by: Linus Torvalds # # drivers/media/dvb/dibusb/dvb-dibusb-usb.c # 2005/01/13 05:24:13-08:00 js@linuxtv.org +259 -0 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # drivers/media/dvb/dibusb/dvb-dibusb-remote.c # 2005/01/09 07:50:44-08:00 js@linuxtv.org +197 -0 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # drivers/media/dvb/dibusb/dvb-dibusb-pid.c # 2005/01/13 05:24:13-08:00 js@linuxtv.org +80 -0 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # drivers/media/dvb/dibusb/dvb-dibusb-firmware.c # 2005/01/07 03:49:57-08:00 js@linuxtv.org +85 -0 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c # 2005/01/13 05:24:12-08:00 js@linuxtv.org +598 -0 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # drivers/media/dvb/dibusb/dvb-dibusb-dvb.c # 2005/01/13 05:24:12-08:00 js@linuxtv.org +205 -0 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # drivers/media/dvb/dibusb/dvb-dibusb.h # 2005/01/20 10:56:37-08:00 js@linuxtv.org +228 -258 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # drivers/media/dvb/dibusb/dvb-dibusb-usb.c # 2005/01/13 05:24:13-08:00 js@linuxtv.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c # # drivers/media/dvb/dibusb/dvb-dibusb-remote.c # 2005/01/09 07:50:44-08:00 js@linuxtv.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/dvb/dibusb/dvb-dibusb-remote.c # # drivers/media/dvb/dibusb/dvb-dibusb-pid.c # 2005/01/13 05:24:13-08:00 js@linuxtv.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c # # drivers/media/dvb/dibusb/dvb-dibusb-firmware.c # 2005/01/07 03:49:57-08:00 js@linuxtv.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c # # drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c # 2005/01/13 05:24:12-08:00 js@linuxtv.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c # # drivers/media/dvb/dibusb/dvb-dibusb-dvb.c # 2005/01/13 05:24:12-08:00 js@linuxtv.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c # # drivers/media/dvb/dibusb/dvb-dibusb-core.c # 2005/01/13 05:24:12-08:00 js@linuxtv.org +471 -0 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # drivers/media/dvb/dibusb/Makefile # 2005/01/20 10:56:37-08:00 js@linuxtv.org +8 -0 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # drivers/media/dvb/dibusb/Kconfig # 2005/01/20 10:56:37-08:00 js@linuxtv.org +9 -5 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # Documentation/dvb/README.dibusb # 2005/01/20 10:56:37-08:00 js@linuxtv.org +44 -16 # dvb: dibusb refactoring, support Yakumo/HAMA/Typhoon/HanfTek clones # # drivers/media/dvb/dibusb/dvb-dibusb-core.c # 2005/01/13 05:24:12-08:00 js@linuxtv.org +0 -0 # BitKeeper file /home/torvalds/v2.6/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c # # ChangeSet # 2005/01/22 11:35:38-08:00 js@linuxtv.org # [PATCH] dvb: support pinnacle pctv-sat, clean-ups # # - [DVB] dvb-bt8xx: add support for pinnacle pctv-sat, patch by Peter Hettkamp and Adam Szalkowski # - [DVB] dvb-bt8xx: minor code cleanups, patch by Arne Ahrend # - [DVB] dvb-bt8xx: make sure to compile all necessary frontend modules, remove misleading comment # # Signed-off-by: Michael Hunold # Signed-off-by: Johannes Stezenbach # Signed-off-by: Linus Torvalds # # drivers/media/dvb/bt8xx/dvb-bt8xx.h # 2005/01/20 10:56:37-08:00 js@linuxtv.org +6 -0 # dvb: support pinnacle pctv-sat, clean-ups # # drivers/media/dvb/bt8xx/dvb-bt8xx.c # 2005/01/20 10:56:37-08:00 js@linuxtv.org +80 -2 # dvb: support pinnacle pctv-sat, clean-ups # # drivers/media/dvb/bt8xx/Kconfig # 2005/01/20 10:56:37-08:00 js@linuxtv.org +2 -3 # dvb: support pinnacle pctv-sat, clean-ups # # ChangeSet # 2005/01/22 11:35:24-08:00 js@linuxtv.org # [PATCH] dvb: fix RPS init race # # - [DVB] saa7146: explicitely disable RPS tasks in saa7146_init_one() # # Signed-off-by: Michael Hunold # Signed-off-by: Johannes Stezenbach # Signed-off-by: Linus Torvalds # # drivers/media/common/saa7146_core.c # 2005/01/20 10:56:37-08:00 js@linuxtv.org +2 -2 # dvb: fix RPS init race # # ChangeSet # 2005/01/22 11:32:44-08:00 tony.luck@intel.com # [IA64] tiger_defconfig: updated for 2.6.11-rc2 # # Signed-off-by: Tony Luck # # arch/ia64/configs/tiger_defconfig # 2005/01/22 11:31:45-08:00 tony.luck@intel.com +48 -11 # updated for 2.6.11-rc2 # # ChangeSet # 2005/01/22 11:02:00-08:00 roland@redhat.com # [PATCH] PPC64: fix stack alignment for signal handlers # # The PPC64 ABI specifies that the stack should be kept aligned to 16 # bytes. However, signal handlers on PPC64 are getting run with the stack # misaligned (sp % 16 == 8). This patch fixes that by ensuring that the # signal frame allocated is a multiple of 16 bytes. # # In addition to the PPC64 signal frame itself being of misaligned size, # the explicit alignment of the starting stack pointer is also to 8 # instead of 16. I've corrected this as well, so signal frames are # aligned even if the interrupted registers contained a misaligned stack # pointer. # # Signed-off-by: Roland McGrath # # [ Paul Mackerras acked the original patch (which # also did it for the 32-bit cases), and pointed out that the 32-bit # cases all already did the alignment elsewhere and didn't need this. # Patch edited down accordingly. ] # # Signed-off-by: Linus Torvalds # # arch/ppc64/kernel/signal.c # 2005/01/21 16:00:00-08:00 roland@redhat.com +2 -2 # PPC64: fix stack alignment for signal handlers # # ChangeSet # 2005/01/22 10:31:39-08:00 nanhai.zou@intel.com # [PATCH] Fix an error in copy_page_range # # There is a bug in copy_page_range with 4 level page table change. # copy_page_range do a continue without adding pgds and addr when # pgd_none(*src_pgd) or pgd_bad(*src_pgd). # # Signed-off-by: Zou Nan hai # Acked-by: Nick Piggin # Signed-off-by: Linus Torvalds # # mm/memory.c # 2005/01/20 12:49:13-08:00 nanhai.zou@intel.com +3 -2 # Fix an error in copy_page_range # # ChangeSet # 2005/01/22 11:19:29+01:00 vojtech@silver.ucw.cz # Merge silver.ucw.cz:/home/vojtech/bk/linus # into silver.ucw.cz:/home/vojtech/bk/input # # drivers/usb/input/hid-core.c # 2005/01/22 11:19:23+01:00 vojtech@silver.ucw.cz +0 -0 # Auto merged # # ChangeSet # 2005/01/21 20:04:07-08:00 davem@nuts.davemloft.net # [SPARC64]: Update defconfig. # # Signed-off-by: David S. Miller # # arch/sparc64/defconfig # 2005/01/21 20:03:35-08:00 davem@nuts.davemloft.net +12 -5 # [SPARC64]: Update defconfig. # # ChangeSet # 2005/01/21 16:19:30-08:00 hch@lst.de # [PATCH] cosmetic jazz_esp updates # # small changes from Linux/MIPS CVS and typedef removal from me # # Signed-off-by: James Bottomley # # drivers/scsi/jazz_esp.c # 2005/01/19 03:33:09-08:00 hch@lst.de +25 -24 # cosmetic jazz_esp updates # # ChangeSet # 2005/01/21 16:12:34-08:00 hch@lst.de # [PATCH] update dec_esp with changes from mips CVS # # Changes are from Maciej W. Rozycki and not nicely splitup because it's # the changes to make it work with 2.6 again. Cosmetic changes by me # to avoid obsolete typedefs. # # Signed-off-by: James Bottomley # # drivers/scsi/dec_esp.c # 2005/01/16 02:49:14-08:00 hch@lst.de +205 -191 # update dec_esp with changes from mips CVS # # ChangeSet # 2005/01/21 16:07:11-08:00 hch@lst.de # [PATCH] update mips driver Kconfig bits # # Signed-off-by: James Bottomley # # drivers/scsi/Kconfig # 2005/01/16 02:44:56-08:00 hch@lst.de +2 -2 # update mips driver Kconfig bits # # ChangeSet # 2005/01/21 14:02:07-08:00 roland@topspin.com # [SPARC]: Hook up drivers/infiniband/Kconfig to sparc32. # # Signed-off-by: Roland Dreier # Signed-off-by: David S. Miller # # arch/sparc/Kconfig # 2005/01/21 14:01:27-08:00 roland@topspin.com +2 -0 # [SPARC]: Hook up drivers/infiniband/Kconfig to sparc32. # # ChangeSet # 2005/01/21 13:54:21-08:00 krzysztof.h1@wp.pl # [SPARC]: Fix asm constraints in muldiv.c # # Signed-off-by: David S. Miller # # arch/sparc/kernel/muldiv.c # 2005/01/21 13:53:45-08:00 krzysztof.h1@wp.pl +7 -4 # [SPARC]: Fix asm constraints in muldiv.c # # ChangeSet # 2005/01/21 13:42:18-08:00 davem@nuts.davemloft.net # Merge nuts.davemloft.net:/disk1/BK/sparcwork-2.6 # into nuts.davemloft.net:/disk1/BK/sparc-2.6 # # fs/binfmt_elf.c # 2005/01/21 13:42:06-08:00 davem@nuts.davemloft.net +0 -0 # Auto merged # # ChangeSet # 2005/01/21 12:26:19-08:00 pablo@eurodev.net # [NETLINK]: Move nl_nonroot into netlink_table. # # Signed-off-by: David S. Miller # # net/netlink/af_netlink.c # 2005/01/21 12:25:32-08:00 pablo@eurodev.net +3 -3 # [NETLINK]: Move nl_nonroot into netlink_table. # # ChangeSet # 2005/01/20 16:28:10-08:00 mchan@broadcom.com # [TG3]: add tg3_set_eeprom() # # - Add nvram size detection # - Add appropriate byte swapping to tg3_get_eeprom so that the same byte # stream is read in all systems # - Fix tg3_get_eeprom to read both eeprom and flash # - Add tg3_set_eeprom to write eeprom and flash # - Change tg3_nvram_init to detect all supported nvram devices # - Change tg3_nvram_read to properly detect Atmel flash that requires # address translation # - Increase nvram polling delay to account for slower eeprom devices # - Remove some of the flushing read that is not required for the # production 5750 devices # # Signed-off-by: Michael Chan # Signed-off-by: David S. Miller # # drivers/net/tg3.h # 2005/01/20 16:27:12-08:00 mchan@broadcom.com +46 -3 # [TG3]: add tg3_set_eeprom() # # drivers/net/tg3.c # 2005/01/20 16:27:12-08:00 mchan@broadcom.com +469 -45 # [TG3]: add tg3_set_eeprom() # # ChangeSet # 2005/01/20 13:24:38-08:00 davem@nuts.davemloft.net # Cset exclude: davem@nuts.davemloft.net|ChangeSet|20050120063740|10274 # # net/sched/sch_teql.c # 2005/01/20 13:24:32-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # net/sched/sch_generic.c # 2005/01/20 13:24:32-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # net/core/dev_mcast.c # 2005/01/20 13:24:32-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # net/core/dev.c # 2005/01/20 13:24:32-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # net/atm/clip.c # 2005/01/20 13:24:32-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # include/linux/netdevice.h # 2005/01/20 13:24:32-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # drivers/infiniband/ulp/ipoib/ipoib_main.c # 2005/01/20 13:24:32-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # Documentation/networking/netdevices.txt # 2005/01/20 13:24:32-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # net/core/pktgen.c # 2005/01/20 13:24:31-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # net/core/netpoll.c # 2005/01/20 13:24:31-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # drivers/net/tg3.h # 2005/01/20 13:24:31-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # drivers/net/tg3.c # 2005/01/20 13:24:31-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # drivers/net/sungem.h # 2005/01/20 13:24:31-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # drivers/net/sungem.c # 2005/01/20 13:24:31-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # drivers/net/e1000/e1000_main.c # 2005/01/20 13:24:31-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # drivers/net/e1000/e1000.h # 2005/01/20 13:24:31-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # drivers/infiniband/ulp/ipoib/ipoib_ib.c # 2005/01/20 13:24:31-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # drivers/infiniband/ulp/ipoib/ipoib.h # 2005/01/20 13:24:31-08:00 davem@nuts.davemloft.net +0 -0 # Exclude # # ChangeSet # 2005/01/19 17:18:08-08:00 tony.luck@intel.com # [IA64] two trivial build fixes for generic uniprocessor # # Patches supplied by Dann Frazier. # # Signed-off-by: Tony Luck # # arch/ia64/sn/kernel/irq.c # 2005/01/19 17:15:31-08:00 tony.luck@intel.com +2 -0 # set_irq_affinity_info() is only defined for SMP # # arch/ia64/sn/kernel/bte_error.c # 2005/01/19 17:15:06-08:00 tony.luck@intel.com +1 -0 # Need HZ defined for UP build. # # ChangeSet # 2005/01/19 10:54:12-08:00 ak@muc.de # [PATCH] Add compat_ioctl to scsi host structure # # Add compat_ioctl vector to scsi_host. # # Signed-off-by: Andi Kleen # Signed-off-by: James Bottomley # # include/scsi/scsi_host.h # 2005/01/19 08:01:21-08:00 ak@muc.de +12 -1 # Add compat_ioctl to scsi host structure # # ChangeSet # 2005/01/19 10:34:55-08:00 dougg@torque.net # [PATCH] sense data helpers lk 2.6.11-rc1-bk1 # # - add sense data helper functions: # - scsi_sense_desc_find() to find a given # sense descriptor (e.g. type 0 -> information) # - scsi_get_sense_info_fld() to get the information # field from fixed or descriptor sense data # # Kai Makisara proposed the "find" function. For # example, it will help the st driver find the Filemark, # EOM and ILI flags which have been placed in the # "stream commands" sense data descriptor. # # Signed-off-by: Douglas Gilbert # Signed-off-by: James Bottomley # # include/scsi/scsi_eh.h # 2005/01/17 22:49:08-08:00 dougg@torque.net +6 -0 # sense data helpers lk 2.6.11-rc1-bk1 # # drivers/scsi/scsi_error.c # 2005/01/17 22:54:45-08:00 dougg@torque.net +93 -0 # sense data helpers lk 2.6.11-rc1-bk1 # # ChangeSet # 2005/01/19 09:06:54-08:00 geert@linux-m68k.org # [PATCH] SCSI NCR53C9x.c: some cleanups # # - Make esp_bootup_reset() global again, since the Amiga Oktagon SCSI driver # needs it, and move its prototype from oktagon_esp.c to NCR53C9x.h # - Make esp_cmd() static in the debug case. It's already a local macro in the # non-debug case. # # Signed-off-by: Geert Uytterhoeven # Signed-off-by: James Bottomley # # drivers/scsi/oktagon_esp.c # 2005/01/17 05:28:33-08:00 geert@linux-m68k.org +0 -2 # SCSI NCR53C9x.c: some cleanups # # drivers/scsi/NCR53C9x.h # 2005/01/17 05:30:46-08:00 geert@linux-m68k.org +1 -1 # SCSI NCR53C9x.c: some cleanups # # drivers/scsi/NCR53C9x.c # 2005/01/17 11:29:36-08:00 geert@linux-m68k.org +2 -2 # SCSI NCR53C9x.c: some cleanups # # ChangeSet # 2005/01/19 09:01:56-08:00 dougg@torque.net # [PATCH] sg descriptor sense cleanup lk 2.6.11-rc1-bk1 # # - expand sense data handling to descriptor format # - make module parameters visible in # /sys/modules/sg/parameters # - add "readable" SCSI commands: READ(16), REPORT LUNS, # SERVICE_ACTION_IN, RECEIVE_DIAGNOSTIC, READ_LONG # and MAINTENANCE_IN_CMD to list # # Signed-off-by: Douglas Gilbert # Signed-off-by: James Bottomley # # drivers/scsi/sg.c # 2005/01/17 00:11:42-08:00 dougg@torque.net +19 -11 # sg descriptor sense cleanup lk 2.6.11-rc1-bk1 # # ChangeSet # 2005/01/18 15:23:25-08:00 rja@sgi.com # [IA64] contig.c save physical address of MCA save area # # Ashok Raj uncovered a problem while testing the MCA code # on a tiger box with contig memory. The virtual address # was getting saved instead of the physical address of the # MCA save area. This patch fixes that problem. # # Signed-off-by: Russ Anderson # Signed-off-by: Tony Luck # # arch/ia64/mm/contig.c # 2005/01/18 15:21:57-08:00 rja@sgi.com +1 -1 # save physical address of MCA save area # # ChangeSet # 2005/01/18 11:16:13-08:00 jejb@mulgrave.(none) # move the SCSI transport classes over to the generic transport class # # This converts the three transport classes (SPI, FC and iSCSI) over to # the generic transport class code. # # It also converts the internals of the SCSI mid-layer to use generic # transport class trigger points and pulls out some of the duplicated code. # # Signed-off-by: James Bottomley # # include/scsi/scsi_transport_spi.h # 2005/01/18 11:15:07-08:00 jejb@mulgrave.(none) +1 -0 # move the SCSI transport classes over to the generic transport class # # include/scsi/scsi_transport.h # 2005/01/18 11:15:07-08:00 jejb@mulgrave.(none) +11 -22 # move the SCSI transport classes over to the generic transport class # # include/scsi/scsi_host.h # 2005/01/18 11:15:07-08:00 jejb@mulgrave.(none) +3 -3 # move the SCSI transport classes over to the generic transport class # # include/scsi/scsi_device.h # 2005/01/18 11:15:07-08:00 jejb@mulgrave.(none) +4 -5 # move the SCSI transport classes over to the generic transport class # # drivers/scsi/scsi_transport_spi.c # 2005/01/18 11:15:07-08:00 jejb@mulgrave.(none) +92 -47 # move the SCSI transport classes over to the generic transport class # # drivers/scsi/scsi_transport_iscsi.c # 2005/01/18 11:15:07-08:00 jejb@mulgrave.(none) +53 -32 # move the SCSI transport classes over to the generic transport class # # drivers/scsi/scsi_transport_fc.c # 2005/01/18 11:15:07-08:00 jejb@mulgrave.(none) +67 -45 # move the SCSI transport classes over to the generic transport class # # drivers/scsi/scsi_sysfs.c # 2005/01/18 11:15:07-08:00 jejb@mulgrave.(none) +25 -106 # move the SCSI transport classes over to the generic transport class # # drivers/scsi/scsi_scan.c # 2005/01/18 11:15:06-08:00 jejb@mulgrave.(none) +6 -18 # move the SCSI transport classes over to the generic transport class # # drivers/scsi/scsi_priv.h # 2005/01/18 11:15:06-08:00 jejb@mulgrave.(none) +1 -1 # move the SCSI transport classes over to the generic transport class # # drivers/scsi/hosts.c # 2005/01/18 11:15:06-08:00 jejb@mulgrave.(none) +8 -13 # move the SCSI transport classes over to the generic transport class # # ChangeSet # 2005/01/18 11:04:34-08:00 jejb@mulgrave.(none) # add a generic device transport class # # Transport classes are a mechanism for providing transport specific # services to drivers that the more generic command processing layers # don't care about. A good example is the SCSI mid-layer not caring about # parallel transfer characteristics or providing services for domain # validation. Transport classes usually provide a transport specific API # at one end and a class interface at the other (for the user to # interrogate and set parameters). # # Originally, transport classes were SCSI specific. However, this code is # generic to the device model. As long as you have a generic device # representing a storage interface (or device) then you can attach a # transport class to it. The new code also allows an arbitrary number of # transport classes to be attached to a device, unlike SCSI which only # allowed one. This is going to be important for things like SATA and SAS # which share the PHY layer (and hence should be capable of sharing a PHY # transport class). # # The generic transport class is designed to operate identically to the # current SCSI transport classes, except that it uses generic devices # rather than SCSI devices. # # We have five events: # # setup # add # ----- # configure # ----- # remove # destroy # # With callbacks for setup configure and remove. # # There's also an anonymous transport class which can only respond to # configure events (and which has no attributes). # # Signed-off-by: Greg Kroah-Hartman # Signed-off-by: James Bottomley # # include/linux/transport_class.h # 2005/01/18 11:03:33-08:00 jejb@mulgrave.(none) +77 -0 # # include/linux/transport_class.h # 2005/01/18 11:03:33-08:00 jejb@mulgrave.(none) +0 -0 # BitKeeper file /home/jejb/BK/scsi-rc-fixes-2.6/include/linux/transport_class.h # # drivers/base/transport_class.c # 2005/01/18 11:03:32-08:00 jejb@mulgrave.(none) +272 -0 # # drivers/base/transport_class.c # 2005/01/18 11:03:32-08:00 jejb@mulgrave.(none) +0 -0 # BitKeeper file /home/jejb/BK/scsi-rc-fixes-2.6/drivers/base/transport_class.c # # drivers/base/Makefile # 2005/01/18 11:03:32-08:00 jejb@mulgrave.(none) +1 -1 # add a generic device transport class # # ChangeSet # 2005/01/18 10:55:19-08:00 jejb@mulgrave.(none) # Add attribute container to generic device model # # Attribute containers allows a single device to belong to an arbitrary # number of classes, each with an arbitrary number of attributes. # # This will be used as the basis for a generic transport class # # Signed-off-by: Greg Kroah-Hartman # Signed-off-by: James Bottomley # # include/linux/attribute_container.h # 2005/01/18 10:54:22-08:00 jejb@mulgrave.(none) +61 -0 # # include/linux/attribute_container.h # 2005/01/18 10:54:22-08:00 jejb@mulgrave.(none) +0 -0 # BitKeeper file /home/jejb/BK/scsi-rc-fixes-2.6/include/linux/attribute_container.h # # drivers/base/attribute_container.c # 2005/01/18 10:54:21-08:00 jejb@mulgrave.(none) +274 -0 # # drivers/base/init.c # 2005/01/18 10:54:21-08:00 jejb@mulgrave.(none) +2 -1 # Add attribute container to generic device model # # drivers/base/attribute_container.c # 2005/01/18 10:54:21-08:00 jejb@mulgrave.(none) +0 -0 # BitKeeper file /home/jejb/BK/scsi-rc-fixes-2.6/drivers/base/attribute_container.c # # drivers/base/Makefile # 2005/01/18 10:54:20-08:00 jejb@mulgrave.(none) +2 -1 # Add attribute container to generic device model # # ChangeSet # 2005/01/17 13:38:38-08:00 ecd@skynet.be # [SPARC64]: Missing user access return value checks in fs/binfmt_elf.c and fs/compat.c # # Signed-off-by: David S. Miller # # fs/compat_ioctl.c # 2005/01/17 13:37:56-08:00 ecd@skynet.be +12 -5 # [SPARC64]: Missing user access return value checks in fs/binfmt_elf.c and fs/compat.c # # fs/binfmt_elf.c # 2005/01/17 13:37:56-08:00 ecd@skynet.be +43 -19 # [SPARC64]: Missing user access return value checks in fs/binfmt_elf.c and fs/compat.c # # ChangeSet # 2005/01/17 12:08:43-06:00 jejb@mulgrave.(none) # fix use after potential free in scsi_cd_put # # kref_put could free the cd structure. We need a copy # of cd->device to do a scsi_device_put after the # kref_put. # # Signed-off-by: James Bottomley # # drivers/scsi/sr.c # 2005/01/17 12:08:00-06:00 jejb@mulgrave.(none) +3 -1 # fix use after potential free in scsi_cd_put # # ChangeSet # 2005/01/17 12:03:49-06:00 stern@rowland.harvard.edu # [PATCH] Fix reference to deallocated memory in sd.c # # This patch: # # http://linux-scsi.bkbits.net:8080/scsi-for-linus-2.6/cset@1.2034.95.5?nav=index.html|src/|src/drivers|src/drivers/scsi|related/drivers/scsi/sd.c # # is causing almost as much trouble as it fixed. If kref_put() drops the # last reference to the scsi_disk (this happens when the device file is # closed after the device has been hot-unplugged) then the call to # scsi_device_put() will take its argument from an area of memory that has # been deallocated. # # Signed-off-by: Alan Stern # Signed-off-by: James Bottomley # # drivers/scsi/sd.c # 2005/01/14 10:01:14-06:00 stern@rowland.harvard.edu +3 -1 # Fix reference to deallocated memory in sd.c # # ChangeSet # 2005/01/17 11:58:23-06:00 dougg@torque.net # [PATCH] scsi_debug dsense # # The dsense switch in the scsi_debug driver selects # whether fixed (default) or descriptor format sense # data is returned when an error/warning occurs. Due # to an oversight dsense was not sysfs visible. # # Signed-off-by: Douglas Gilbert # Signed-off-by: James Bottomley # # drivers/scsi/scsi_debug.c # 2005/01/12 22:34:43-06:00 dougg@torque.net +4 -2 # scsi_debug dsense # # ChangeSet # 2005/01/17 11:52:26-06:00 mark_salyzyn@adaptec.com # [PATCH] dpt_i2o: remove schedule_timeout() # # There was a patch to *remove* that line completely issued about a month # ago. It is a case of a second schedule_timeout left over from an editing # mistake made long ago in a distant galaxy. # # Signed-off-by: James Bottomley # # drivers/scsi/dpt_i2o.c # 2005/01/10 12:00:12-06:00 mark_salyzyn@adaptec.com +0 -1 # dpt_i2o: remove schedule_timeout() # # ChangeSet # 2005/01/17 11:47:26-06:00 domen@coderock.org # [PATCH] delete unused file dpt_osdutil.h # # Signed-off-by: Domen Puncer # Signed-off-by: James Bottomley # # BitKeeper/deleted/.del-dpt_osdutil.h~d761dac35b920619 # 2005/01/17 11:45:56-06:00 domen@coderock.org +0 -0 # Delete: drivers/scsi/dpt/dpt_osdutil.h # # ChangeSet # 2005/01/13 13:32:43+01:00 vojtech@suse.cz # input: Handle -EILSEQ return code in the HID driver completion # handlers as unplug. # Flush request queue on unplug, too. # # Signed-off-by: Vojtech Pavlik # # drivers/usb/input/hid-core.c # 2005/01/13 13:32:33+01:00 vojtech@suse.cz +18 -5 # input: Handle -EILSEQ return code in the HID driver completion # handlers as unplug. # Flush request queue on unplug, too. # # Signed-off-by: Vojtech Pavlik # # ChangeSet # 2005/01/13 13:20:07+01:00 vojtech@suse.cz # Merge bkbits:input-new into suse.cz:/home/vojtech/bk/input # # Documentation/kernel-parameters.txt # 2005/01/13 13:20:04+01:00 vojtech@suse.cz +0 -0 # Auto merged # # ChangeSet # 2005/01/11 17:45:14+01:00 vojtech@silver.ucw.cz # input: Add support for H-Wheel on Microsoft Explorer and Logitech MX # USB HID mice. # # Signed-off-by: Vojtech Pavlik # # drivers/usb/input/hid.h # 2005/01/11 17:45:02+01:00 vojtech@silver.ucw.cz +1 -0 # input: Add support for H-Wheel on Microsoft Explorer and Logitech MX # USB HID mice. # # drivers/usb/input/hid-input.c # 2005/01/11 17:45:02+01:00 vojtech@silver.ucw.cz +9 -3 # input: Add support for H-Wheel on Microsoft Explorer and Logitech MX # USB HID mice. # # drivers/usb/input/hid-debug.h # 2005/01/11 17:45:02+01:00 vojtech@silver.ucw.cz +14 -10 # input: Add support for H-Wheel on Microsoft Explorer and Logitech MX # USB HID mice. # # ChangeSet # 2005/01/11 13:15:31+01:00 vojtech@silver.ucw.cz # Merge silver.ucw.cz:/home/vojtech/bk/linus # into silver.ucw.cz:/home/vojtech/bk/input # # Documentation/kernel-parameters.txt # 2005/01/11 13:15:23+01:00 vojtech@silver.ucw.cz +0 -0 # Auto merged # # ChangeSet # 2005/01/11 11:05:32+01:00 vojtech@silver.ucw.cz # Merge bkbits:input into silver.ucw.cz:/home/vojtech/bk/input # # Documentation/kernel-parameters.txt # 2005/01/11 11:05:25+01:00 vojtech@silver.ucw.cz +0 -0 # Auto merged # # ChangeSet # 2005/01/02 11:54:40+01:00 vojtech@silver.ucw.cz # Merge silver.ucw.cz:/home/vojtech/bk/linus # into silver.ucw.cz:/home/vojtech/bk/input # # Documentation/kernel-parameters.txt # 2005/01/02 11:54:34+01:00 vojtech@silver.ucw.cz +0 -0 # Auto merged # # ChangeSet # 2004/12/27 13:32:13-06:00 jejb@pashleys.(none) # i386: reboot.c cleanups # # From: Adrian Bunk # # - arch/i386/kernel/reboot.c: make reboot_thru_bios static # - arch/i386/mach-visws/reboot.c: remove the unused reboot_thru_bios and # reboot_smp # - arch/i386/mach-voyager/voyager_basic.c: remove the unused reboot_thru_bios # - arch/i386/mach-voyager/voyager_smp.c: remove the unused reboot_smp # # Signed-off-by: Adrian Bunk # Signed-off-by: James Bottomley # # arch/i386/mach-voyager/voyager_smp.c # 2004/12/27 13:28:53-06:00 jejb@pashleys.(none) +0 -2 # i386: reboot.c cleanups # # arch/i386/mach-voyager/voyager_basic.c # 2004/12/27 13:28:53-06:00 jejb@pashleys.(none) +0 -2 # i386: reboot.c cleanups # # arch/i386/mach-visws/reboot.c # 2004/12/27 13:28:53-06:00 jejb@pashleys.(none) +0 -3 # i386: reboot.c cleanups # # arch/i386/kernel/reboot.c # 2004/12/27 13:28:53-06:00 jejb@pashleys.(none) +1 -1 # i386: reboot.c cleanups # # ChangeSet # 2004/12/27 11:35:05-06:00 jejb@pashleys.(none) # dma_release_declared_memory needs iounmap # # Spotted by: Jeff Garzik # # Signed-off-by: James Bottomley # # arch/i386/kernel/pci-dma.c # 2004/12/27 11:31:30-06:00 jejb@pashleys.(none) +1 -0 # dma_release_declared_memory needs iounmap # # ChangeSet # 2004/12/26 16:32:04-06:00 bunk@stusta.de # [PATCH] i386 voyager_smp.c: remove a duplicate #include # # Signed-off-by: Adrian Bunk # Signed-off-by: James Bottomley # # arch/i386/mach-voyager/voyager_smp.c # 2004/10/22 14:42:20-05:00 bunk@stusta.de +0 -1 # i386 voyager_smp.c: remove a duplicate #include # diff -Nru a/Documentation/dvb/README.dibusb b/Documentation/dvb/README.dibusb --- a/Documentation/dvb/README.dibusb 2005-01-28 14:11:40 -08:00 +++ b/Documentation/dvb/README.dibusb 2005-01-28 14:11:40 -08:00 @@ -26,7 +26,7 @@ - HAMA DVB-T USB device http://www.hama.de/portal/articleId*110620/action*2598 -- CTS Portable (Chinese Television System) +- CTS Portable (Chinese Television System) (2) http://www.2cts.tv/ctsportable/ - Unknown USB DVB-T device with vendor ID Hyper-Paltek @@ -46,16 +46,16 @@ Others: ------- -- Ultima Electronic/Artec T1 USB TVBOX (AN2135 and AN2235) +- Ultima Electronic/Artec T1 USB TVBOX (AN2135, AN2235, AN2235 with Panasonic Tuner) http://82.161.246.249/products-tvbox.html -- Compro Videomate DVB-U2000 - DVB-T USB +- Compro Videomate DVB-U2000 - DVB-T USB (2) http://www.comprousa.com/products/vmu2000.htm - Grandtec USB DVB-T http://www.grand.com.tw/ -- Avermedia AverTV DVBT USB +- Avermedia AverTV DVBT USB (2) http://www.avermedia.com/ - DiBcom USB DVB-T reference device (non-public) @@ -63,16 +63,33 @@ Supported devices USB2.0 ======================== -- Twinhan MagicBox II +- Twinhan MagicBox II (2) http://www.twinhan.com/product_terrestrial_7.asp -- Yakumo DVB-T mobile +- Hanftek UMT-010 (1) + http://www.globalsources.com/si/6008819757082/ProductDetail/Digital-TV/product_id-100046529 + +- Typhoon/Yakumo/HAMA DVB-T mobile USB2.0 (1) http://www.yakumo.de/produkte/index.php?pid=1&ag=DVB-T +- Artec T1 USB TVBOX (FX2) (2) + - DiBcom USB2.0 DVB-T reference device (non-public) +1) It is working almost. +2) No test reports received yet. + 0. NEWS: + 2004-01-13 - moved the mirrored pid_filter_table back to dvb-dibusb + - first almost working version for HanfTek UMT-010 + - found out, that Yakumo/HAMA/Typhoon are predessors of the HanfTek + 2004-01-10 - refactoring completed, now everything is very delightful + - tuner quirks for some weird devices (Artec T1 AN2235 device has sometimes a + Panasonic Tuner assembled). Tunerprobing implemented. Thanks a lot to Gunnar Wittich. + 2004-12-29 - after several days of struggling around bug of no returning URBs fixed. + 2004-12-26 - refactored the dibusb-driver, splitted into separate files + - i2c-probing enabled 2004-12-06 - possibility for demod i2c-address probing - new usb IDs (Compro,Artec) 2004-11-23 - merged changes from DiB3000MC_ver2.1 @@ -115,13 +132,15 @@ 1. How to use? NOTE: This driver was developed using Linux 2.6.6., -it is working with 2.6.7, 2.6.8.1, 2.6.9 . +it is working with 2.6.7 and above. Linux 2.4.x support is not planned, but patches are very welcome. NOTE: I'm using Debian testing, so the following explaination (especially the hotplug-path) needn't match your system, but probably it will :). +The driver is included in the kernel since Linux 2.6.10. + 1.1. Firmware The USB driver needs to download a firmware to start working. @@ -155,9 +174,13 @@ first have a look, which debug level are available: modinfo dib3000mb +modinfo dib3000-common +modinfo dib3000mc modinfo dvb-dibusb +modprobe dib3000-common debug= modprobe dib3000mb debug= +modprobe dib3000mc debug= modprobe dvb-dibusb debug= should do the trick. @@ -168,13 +191,11 @@ At this point you should be able to start a dvb-capable application. For myself I used mplayer, dvbscan, tzap and kaxtv, they are working. Using the device -as a slave device in vdr, was not working for me. Some work has to be done -(patches and comments are very welcome). +in vdr (at least the USB2.0 one) is working. 2. Known problems and bugs -TODO: -- signal-quality and strength calculations +- none this time 2.1. Adding support for devices @@ -202,9 +223,10 @@ maximum bandwidth of about 5-6 MBit/s when connected to a USB2.0 hub. This is not enough for receiving the complete transport stream of a DVB-T channel (which can be about 16 MBit/s). Normally this is not a -problem, if you only want to watch TV, but watching a channel while -recording another channel on the same frequency simply does not work. -This applies to all USB1.1 DVB-T devices. +problem, if you only want to watch TV (this does not apply for HDTV), +but watching a channel while recording another channel on the same +frequency simply does not work. This applies to all USB1.1 DVB-T +devices, not only dibusb) A special problem of the dibusb for the USB1.1 is, that the USB control IC has a problem with write accesses while having MPEG2-streaming @@ -218,14 +240,20 @@ these features is maybe a solution. Additionally this behaviour of VDR exceeds the USB1.1 bandwidth. +Update: +For the USB1.1 and VDR some work has been done (patches and comments are still +very welcome). Maybe the problem is solved in the meantime because I now use +the dmx_sw_filter function instead of dmx_sw_filter_packet. I hope the +linux-dvb software filter is able to get the best of the garbled TS. + 2.3. Comments Patches, comments and suggestions are very very welcome 3. Acknowledgements Amaury Demol (ademol@dibcom.fr) and Francois Kanounnikoff from DiBcom for - providing specs, code and help, on which the dvb-dibusb and dib3000mb are - based. + providing specs, code and help, on which the dvb-dibusb, dib3000mb and + dib3000mc are based. David Matthews for identifying a new device type (Artec T1 with AN2235) and for extending dibusb with remote control event handling. Thank you. diff -Nru a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware --- a/Documentation/dvb/get_dvb_firmware 2005-01-28 14:11:41 -08:00 +++ b/Documentation/dvb/get_dvb_firmware 2005-01-28 14:11:41 -08:00 @@ -21,7 +21,8 @@ use File::Temp qw/ tempdir /; use IO::Handle; -@components = ( "sp8870", "sp887x", "tda10045", "tda10046", "av7110", "dec2000t", "dec2540t", "dec3000s", "vp7041", "dibusb" ); +@components = ( "sp8870", "sp887x", "tda10045", "tda10046", "av7110", "dec2000t", + "dec2540t", "dec3000s", "vp7041", "dibusb", "nxt2002" ); # Check args syntax() if (scalar(@ARGV) != 1); @@ -231,6 +232,23 @@ verify($outfile,$hash); $outfile; +} + +sub nxt2002 { + my $sourcefile = "Broadband4PC_4_2_11.zip"; + my $url = "http://www.bbti.us/download/windows/$sourcefile"; + my $hash = "c6d2ea47a8f456d887ada0cfb718ff2a"; + my $outfile = "dvb-fe-nxt2002.fw"; + my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); + + checkstandard(); + + wgetfile($sourcefile, $url); + unzip($sourcefile, $tmpdir); + verify("$tmpdir/SkyNETU.sys", $hash); + extract("$tmpdir/SkyNETU.sys", 375832, 5908, $outfile); + + $outfile; } # --------------------------------------------------------------- diff -Nru a/Documentation/infiniband/user_mad.txt b/Documentation/infiniband/user_mad.txt --- a/Documentation/infiniband/user_mad.txt 2005-01-28 14:11:40 -08:00 +++ b/Documentation/infiniband/user_mad.txt 2005-01-28 14:11:40 -08:00 @@ -2,9 +2,10 @@ Device files - Each port of each InfiniBand device has a "umad" device attached. - For example, a two-port HCA will have two devices, while a switch - will have one device (for switch port 0). + Each port of each InfiniBand device has a "umad" device and an + "issm" device attached. For example, a two-port HCA will have two + umad devices and two issm devices, while a switch will have one + device of each type (for switch port 0). Creating MAD agents @@ -63,19 +64,36 @@ if (ret != sizeof mad) perror("write"); +Setting IsSM Capability Bit + + To set the IsSM capability bit for a port, simply open the + corresponding issm device file. If the IsSM bit is already set, + then the open call will block until the bit is cleared (or return + immediately with errno set to EAGAIN if the O_NONBLOCK flag is + passed to open()). The IsSM bit will be cleared when the issm file + is closed. No read, write or other operations can be performed on + the issm file. + /dev files To create the appropriate character device files automatically with udev, a rule like KERNEL="umad*", NAME="infiniband/%k" + KERNEL="issm*", NAME="infiniband/%k" - can be used. This will create a device node named + can be used. This will create device nodes named /dev/infiniband/umad0 + /dev/infiniband/issm0 for the first port, and so on. The InfiniBand device and port - associated with this device can be determined from the files + associated with these devices can be determined from the files /sys/class/infiniband_mad/umad0/ibdev /sys/class/infiniband_mad/umad0/port + + and + + /sys/class/infiniband_mad/issm0/ibdev + /sys/class/infiniband_mad/issm0/port diff -Nru a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt --- a/Documentation/ioctl-number.txt 2005-01-28 14:11:41 -08:00 +++ b/Documentation/ioctl-number.txt 2005-01-28 14:11:41 -08:00 @@ -146,7 +146,7 @@ 'p' 40-7F linux/nvram.h 'p' 80-9F user-space parport -'q' 00-1F linux/videotext.h conflict! +'q' 00-1F linux/serio.h 'q' 80-FF Internet PhoneJACK, Internet LineJACK 'r' 00-1F linux/msdos_fs.h @@ -164,6 +164,7 @@ 'z' 40-7F CAN bus card 0x80 00-1F linux/fb.h +0x81 00-1F linux/videotext.h 0x89 00-06 asm-i386/sockios.h 0x89 0B-DF linux/sockios.h 0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range diff -Nru a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt --- a/Documentation/kernel-parameters.txt 2005-01-28 14:11:41 -08:00 +++ b/Documentation/kernel-parameters.txt 2005-01-28 14:11:41 -08:00 @@ -1099,6 +1099,9 @@ root= [KNL] Root filesystem + rootdelay= [KNL] Delay (in seconds) to pause before attempting to + mount the root filesystem + rootflags= [KNL] Set root filesystem mount option string rootfstype= [KNL] Set root filesystem type diff -Nru a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt --- a/Documentation/networking/netdevices.txt 2005-01-28 14:11:40 -08:00 +++ b/Documentation/networking/netdevices.txt 2005-01-28 14:11:40 -08:00 @@ -45,9 +45,10 @@ Synchronization: dev->xmit_lock spinlock. When the driver sets NETIF_F_LLTX in dev->features this will be called without holding xmit_lock. In this case the driver - has to execute it's transmission routine in a completely lockless - manner. It is recommended only for queueless devices such - loopback and tunnels. + has to lock by itself when needed. It is recommended to use a try lock + for this and return -1 when the spin lock fails. + The locking there should also properly protect against + set_multicast_list Context: BHs disabled Notes: netif_queue_stopped() is guaranteed false Return codes: @@ -55,6 +56,8 @@ o NETDEV_TX_BUSY Cannot transmit packet, try later Usually a bug, means queue start/stop flow control is broken in the driver. Note: the driver must NOT put the skb in its DMA ring. + o NETDEV_TX_LOCKED Locking failed, please retry quickly. + Only valid when NETIF_F_LLTX is set. dev->tx_timeout: Synchronization: dev->xmit_lock spinlock. diff -Nru a/Documentation/vm/hugetlbpage.txt b/Documentation/vm/hugetlbpage.txt --- a/Documentation/vm/hugetlbpage.txt 2005-01-28 14:11:40 -08:00 +++ b/Documentation/vm/hugetlbpage.txt 2005-01-28 14:11:40 -08:00 @@ -1,8 +1,8 @@ The intent of this file is to give a brief summary of hugetlbpage support in the Linux kernel. This support is built on top of multiple page size support -that is provided by most modern architectures. For example, IA-32 -architecture supports 4K and 4M (2M in PAE mode) page sizes, IA-64 +that is provided by most modern architectures. For example, i386 +architecture supports 4K and 4M (2M in PAE mode) page sizes, ia64 architecture supports multiple page sizes 4K, 8K, 64K, 256K, 1M, 4M, 16M, 256M and ppc64 supports 4K and 16M. A TLB is a cache of virtual-to-physical translations. Typically this is a very scarce resource on processor. @@ -107,10 +107,10 @@ * SHM_HUGETLB in the shmget system call to inform the kernel that it is * requesting hugepages. * - * For the IA-64 architecture, the Linux kernel reserves Region number 4 for + * For the ia64 architecture, the Linux kernel reserves Region number 4 for * hugepages. That means the addresses starting with 0x800000... will need * to be specified. Specifying a fixed address is not required on ppc64, - * i386 or amd64. + * i386 or x86_64. * * Note: The default shared memory limit is quite low on many kernels, * you may need to increase it via: @@ -139,8 +139,8 @@ #define dprintf(x) printf(x) -/* Only IA64 requires this */ -#ifdef IA64 +/* Only ia64 requires this */ +#ifdef __ia64__ #define ADDR (void *)(0x8000000000000000UL) #define SHMAT_FLAGS (SHM_RND) #else @@ -204,10 +204,10 @@ * example, the app is requesting memory of size 256MB that is backed by * huge pages. * - * For IA-64 architecture, Linux kernel reserves Region number 4 for hugepages. + * For ia64 architecture, Linux kernel reserves Region number 4 for hugepages. * That means the addresses starting with 0x800000... will need to be * specified. Specifying a fixed address is not required on ppc64, i386 - * or amd64. + * or x86_64. */ #include #include @@ -219,8 +219,8 @@ #define LENGTH (256UL*1024*1024) #define PROTECTION (PROT_READ | PROT_WRITE) -/* Only IA64 requires this */ -#ifdef IA64 +/* Only ia64 requires this */ +#ifdef __ia64__ #define ADDR (void *)(0x8000000000000000UL) #define FLAGS (MAP_SHARED | MAP_FIXED) #else diff -Nru a/MAINTAINERS b/MAINTAINERS --- a/MAINTAINERS 2005-01-28 14:11:41 -08:00 +++ b/MAINTAINERS 2005-01-28 14:11:41 -08:00 @@ -283,8 +283,8 @@ S: Maintained ARM MFM AND FLOPPY DRIVERS -P: Dave Gilbert -M: linux@treblig.org +P: Ian Molton +M: spyro@f2s.com S: Maintained ARM/CORGI MACHINE SUPPORT @@ -1798,7 +1798,7 @@ PPP OVER ETHERNET P: Michal Ostrowski -M: mostrows@styx.uwaterloo.ca +M: mostrows@speakeasy.net S: Maintained PREEMPTIBLE KERNEL diff -Nru a/Makefile b/Makefile --- a/Makefile 2005-01-28 14:11:41 -08:00 +++ b/Makefile 2005-01-28 14:11:41 -08:00 @@ -331,7 +331,7 @@ PERL = perl CHECK = sparse -NOSTDINC_FLAGS := -nostdinc -isystem $(shell $(CC) -print-file-name=include) +NOSTDINC_FLAGS = -nostdinc -isystem $(shell $(CC) -print-file-name=include) CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ CHECKFLAGS += $(NOSTDINC_FLAGS) MODFLAGS = -DMODULE diff -Nru a/arch/alpha/lib/memmove.S b/arch/alpha/lib/memmove.S --- a/arch/alpha/lib/memmove.S 2005-01-28 14:11:40 -08:00 +++ b/arch/alpha/lib/memmove.S 2005-01-28 14:11:40 -08:00 @@ -12,18 +12,6 @@ .text .align 4 - .globl bcopy - .ent bcopy -bcopy: - ldgp $29, 0($27) - .prologue 1 - mov $16,$0 - mov $17,$16 - mov $0,$17 - br $31, memmove !samegp - .end bcopy - - .align 4 .globl memmove .ent memmove memmove: diff -Nru a/arch/alpha/oprofile/common.c b/arch/alpha/oprofile/common.c --- a/arch/alpha/oprofile/common.c 2005-01-28 14:11:40 -08:00 +++ b/arch/alpha/oprofile/common.c 2005-01-28 14:11:40 -08:00 @@ -138,7 +138,7 @@ return 0; } -void __init +int __init oprofile_arch_init(struct oprofile_operations *ops) { struct op_axp_model *lmodel = NULL; @@ -166,7 +166,7 @@ } if (!lmodel) - return; + return -ENODEV; model = lmodel; ops->create_files = op_axp_create_files; @@ -178,6 +178,8 @@ printk(KERN_INFO "oprofile: using %s performance monitoring.\n", lmodel->cpu_type); + + return 0; } diff -Nru a/arch/arm/kernel/debug.S b/arch/arm/kernel/debug.S --- a/arch/arm/kernel/debug.S 2005-01-28 14:11:40 -08:00 +++ b/arch/arm/kernel/debug.S 2005-01-28 14:11:40 -08:00 @@ -20,31 +20,8 @@ * printk isn't working). For DEBUGGING ONLY!!! Do not leave * references to these in a production kernel! */ -#if defined(CONFIG_ARCH_RPC) - .macro addruart,rx - mov \rx, #0xe0000000 - orr \rx, \rx, #0x00010000 - orr \rx, \rx, #0x00000fe0 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - .macro busyuart,rd,rx -1001: ldrb \rd, [\rx, #0x14] - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1001b - .endm - - .macro waituart,rd,rx -1001: ldrb \rd, [\rx, #0x18] - tst \rd, #0x10 - beq 1001b - .endm - -#elif defined(CONFIG_DEBUG_ICEDCC) +#if defined(CONFIG_DEBUG_ICEDCC) @@ debug using ARM EmbeddedICE DCC channel .macro addruart, rx .endm @@ -71,106 +48,12 @@ bne 1001b 1002: .endm - -#elif defined(CONFIG_ARCH_EBSA110) - .macro addruart,rx - mov \rx, #0xf0000000 - orr \rx, \rx, #0x00000be0 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #0x14] - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1002b - .endm - - .macro waituart,rd,rx -1001: ldrb \rd, [\rx, #0x18] - tst \rd, #0x10 - beq 1001b - .endm - -#elif defined(CONFIG_ARCH_SHARK) - .macro addruart,rx - mov \rx, #0xe0000000 - orr \rx, \rx, #0x000003f8 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx - mov \rd, #0 -1001: add \rd, \rd, #1 - teq \rd, #0x10000 - bne 1001b - .endm - - .macro waituart,rd,rx - .endm - -#elif defined(CONFIG_FOOTBRIDGE) - -#include - -#ifndef CONFIG_DEBUG_DC21285_PORT - /* For NetWinder debugging */ - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x7c000000 @ physical - movne \rx, #0xff000000 @ virtual - orr \rx, \rx, #0x000003f8 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #0x5] - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1002b - .endm - - .macro waituart,rd,rx -1001: ldrb \rd, [\rx, #0x6] - tst \rd, #0x10 - beq 1001b - .endm #else - /* For EBSA285 debugging */ - .equ dc21285_high, ARMCSR_BASE & 0xff000000 - .equ dc21285_low, ARMCSR_BASE & 0x00ffffff - - .macro addruart,rx - mov \rx, #dc21285_high - .if dc21285_low - orr \rx, \rx, #dc21285_low - .endif - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0x160] @ UARTDR - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x178] @ UARTFLG - tst \rd, #1 << 3 - bne 1001b - .endm - - .macro waituart,rd,rx - .endm +#include #endif -#elif defined(CONFIG_ARCH_FTVPCI) + +#if 0 +// #elif defined(CONFIG_ARCH_FTVPCI) .macro addruart,rx mrc p15, 0, \rx, c1, c0 tst \rx, #1 @ MMU enabled? @@ -190,547 +73,6 @@ .macro waituart,rd,rx .endm - -#elif defined(CONFIG_ARCH_SA1100) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x80000000 @ physical base address - movne \rx, #0xf8000000 @ virtual address - - @ We probe for the active serial port here, coherently with - @ the comment in include/asm-arm/arch-sa1100/uncompress.h. - @ We assume r1 can be clobbered. - - @ see if Ser3 is active - add \rx, \rx, #0x00050000 - ldr r1, [\rx, #UTCR3] - tst r1, #UTCR3_TXE - - @ if Ser3 is inactive, then try Ser1 - addeq \rx, \rx, #(0x00010000 - 0x00050000) - ldreq r1, [\rx, #UTCR3] - tsteq r1, #UTCR3_TXE - - @ if Ser1 is inactive, then try Ser2 - addeq \rx, \rx, #(0x00030000 - 0x00010000) - ldreq r1, [\rx, #UTCR3] - tsteq r1, #UTCR3_TXE - - @ if all ports are inactive, then there is nothing we can do - moveq pc, lr - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #UTDR] - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #UTSR1] - tst \rd, #UTSR1_TNF - beq 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #UTSR1] - tst \rd, #UTSR1_TBY - bne 1001b - .endm - -#elif defined(CONFIG_ARCH_PXA) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x40000000 @ physical - movne \rx, #io_p2v(0x40000000) @ virtual - orr \rx, \rx, #0x00100000 - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0] - .endm - - .macro busyuart,rd,rx -1002: ldr \rd, [\rx, #0x14] - tst \rd, #(1 << 6) - beq 1002b - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x14] - tst \rd, #(1 << 5) - beq 1001b - .endm -#elif defined(CONFIG_ARCH_CLPS7500) - .macro addruart,rx - mov \rx, #0xe0000000 - orr \rx, \rx, #0x00010000 - orr \rx, \rx, #0x00000be0 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx - .endm - - .macro waituart,rd,rx -1001: ldrb \rd, [\rx, #0x14] - tst \rd, #0x20 - beq 1001b - .endm - -#elif defined(CONFIG_ARCH_L7200) - - .equ io_virt, IO_BASE - .equ io_phys, IO_START - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #io_phys @ physical base address - movne \rx, #io_virt @ virtual address - add \rx, \rx, #0x00044000 @ UART1 -@ add \rx, \rx, #0x00045000 @ UART2 - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0x0] @ UARTDR - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full - bne 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy - bne 1001b - .endm - -#elif defined(CONFIG_ARCH_INTEGRATOR) - -#include - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x16000000 @ physical base address - movne \rx, #0xf0000000 @ virtual base - addne \rx, \rx, #0x16000000 >> 4 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx, #UART01x_DR] - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full - bne 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy - bne 1001b - .endm - -#elif defined(CONFIG_ARCH_CLPS711X) - -#include - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #CLPS7111_PHYS_BASE - movne \rx, #CLPS7111_VIRT_BASE -#ifndef CONFIG_DEBUG_CLPS711X_UART2 - add \rx, \rx, #0x0000 @ UART1 -#else - add \rx, \rx, #0x1000 @ UART2 -#endif - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0x0480] @ UARTDR - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x0140] @ SYSFLGx - tst \rd, #1 << 11 @ UBUSYx - bne 1001b - .endm - - .macro busyuart,rd,rx - tst \rx, #0x1000 @ UART2 does not have CTS here - bne 1002f -1001: ldr \rd, [\rx, #0x0140] @ SYSFLGx - tst \rd, #1 << 8 @ CTS - bne 1001b -1002: - .endm - -#elif defined(CONFIG_ARCH_CAMELOT) - -#include -#define UART00_TYPE -#include - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - ldr \rx, =EXC_UART00_BASE @ physical base address - orrne \rx, \rx, #0xff000000 @ virtual base - orrne \rx, \rx, #0x00f00000 - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #UART_TD(0)] - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #UART_TSR(0)] - and \rd, \rd, #UART_TSR_TX_LEVEL_MSK - cmp \rd, #15 - beq 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #UART_TSR(0)] - ands \rd, \rd, #UART_TSR_TX_LEVEL_MSK - bne 1001b - .endm - -#elif defined(CONFIG_ARCH_IOP3XX) - - .macro addruart,rx - mov \rx, #0xfe000000 @ physical -#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) - orr \rx, \rx, #0x00800000 @ location of the UART -#elif defined(CONFIG_ARCH_IOP331) - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x000fe000 @ Physical Base - movne \rx, #0 - orr \rx, \rx, #0xfe000000 - orr \rx, \rx, #0x00f00000 @ Virtual Base - orr \rx, \rx, #0x00001700 @ location of the UART -#else -#error Unknown IOP3XX implementation -#endif - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #0x5] - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1002b - .endm - - .macro waituart,rd,rx -#if !defined(CONFIG_ARCH_IQ80321) || !defined(CONFIG_ARCH_IQ31244) || !defined(CONFIG_ARCH_IQ80331) -1001: ldrb \rd, [\rx, #0x6] - tst \rd, #0x10 - beq 1001b -#endif - .endm - -#elif defined(CONFIG_ARCH_IXP4XX) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0xc8000000 - movne \rx, #0xff000000 - add \rx,\rx,#3 @ Uart regs are at off set of 3 if - @ byte writes used - Big Endian. - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro waituart,rd,rx -1002: ldrb \rd, [\rx, #0x14] - and \rd, \rd, #0x60 @ check THRE and TEMT bits - teq \rd, #0x60 - bne 1002b - .endm - - .macro busyuart,rd,rx - .endm - -#elif defined(CONFIG_ARCH_IXP2000) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0xc0000000 @ Physical base - movne \rx, #0xfe000000 @ virtual base - orrne \rx, \rx, #0x00f00000 - orr \rx, \rx, #0x00030000 -#ifdef __ARMEB__ - orr \rx, \rx, #0x00000003 -#endif - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1002: ldrb \rd, [\rx, #0x14] - tst \rd, #0x20 - beq 1002b - .endm - - .macro waituart,rd,rx - nop - nop - nop - .endm - -#elif defined(CONFIG_ARCH_OMAP) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0xff000000 @ physical base address - movne \rx, #0xfe000000 @ virtual base - orr \rx, \rx, #0x00fb0000 -#ifdef CONFIG_OMAP_LL_DEBUG_UART3 - orr \rx, \rx, #0x00009000 @ UART 3 -#endif -#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3) - orr \rx, \rx, #0x00000800 @ UART 2 & 3 -#endif - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] - .endm - - .macro busyuart,rd,rx -1001: ldrb \rd, [\rx, #(0x5 << 2)] @ OMAP-1510 and friends - and \rd, \rd, #0x60 - teq \rd, #0x60 - beq 1002f - ldrb \rd, [\rx, #(0x5 << 0)] @ OMAP-730 only - and \rd, \rd, #0x60 - teq \rd, #0x60 - bne 1001b -1002: - .endm - - .macro waituart,rd,rx - .endm - -#elif defined(CONFIG_ARCH_S3C2410) -#include -#include -#include -#define S3C2410_UART1_OFF (0x4000) -#define SHIFT_2440TXF (14-9) - - .macro addruart, rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 - ldreq \rx, = S3C2410_PA_UART - ldrne \rx, = S3C2410_VA_UART -#if CONFIG_DEBUG_S3C2410_UART != 0 - add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) -#endif - .endm - - .macro senduart,rd,rx - str \rd, [\rx, # S3C2410_UTXH ] - .endm - - .macro busyuart, rd, rx - ldr \rd, [ \rx, # S3C2410_UFCON ] - tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? - beq 1001f @ - @ FIFO enabled... -1003: - mrc p15, 0, \rd, c1, c0 - tst \rd, #1 - addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) - addne \rd, \rx, #(S3C2410_VA_GPIO - S3C2410_VA_UART) - bic \rd, \rd, #0xff000 - ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] - and \rd, \rd, #0x00ff0000 - teq \rd, #0x00440000 @ is it 2440? - - ldr \rd, [ \rx, # S3C2410_UFSTAT ] - moveq \rd, \rd, lsr #SHIFT_2440TXF - tst \rd, #S3C2410_UFSTAT_TXFULL - bne 1003b - b 1002f - -1001: - @ busy waiting for non fifo - ldr \rd, [ \rx, # S3C2410_UTRSTAT ] - tst \rd, #S3C2410_UTRSTAT_TXFE - beq 1001b - -1002: @ exit busyuart - .endm - - .macro waituart,rd,rx - - ldr \rd, [ \rx, # S3C2410_UFCON ] - tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? - beq 1001f @ - @ FIFO enabled... -1003: - mrc p15, 0, \rd, c1, c0 - tst \rd, #1 - addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) - addne \rd, \rx, #(S3C2410_VA_GPIO - S3C2410_VA_UART) - bic \rd, \rd, #0xff000 - ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] - and \rd, \rd, #0x00ff0000 - teq \rd, #0x00440000 @ is it 2440? - - ldr \rd, [ \rx, # S3C2410_UFSTAT ] - andne \rd, \rd, #S3C2410_UFSTAT_TXMASK - andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK - teq \rd, #0 - bne 1003b - b 1002f - -1001: - @ idle waiting for non fifo - ldr \rd, [ \rx, # S3C2410_UTRSTAT ] - tst \rd, #S3C2410_UTRSTAT_TXFE - beq 1001b - -1002: @ exit busyuart - .endm - -#elif defined(CONFIG_ARCH_LH7A40X) - @ It is not known if this will be appropriate for every 40x - @ board. - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - mov \rx, #0x00000700 @ offset from base - orreq \rx, \rx, #0x80000000 @ physical base - orrne \rx, \rx, #0xf8000000 @ virtual base - .endm - - .macro senduart,rd,rx - strb \rd, [\rx] @ DATA - .endm - - .macro busyuart,rd,rx @ spin while busy -1001: ldr \rd, [\rx, #0x10] @ STATUS - tst \rd, #1 << 3 @ BUSY (TX FIFO not empty) - bne 1001b @ yes, spin - .endm - - .macro waituart,rd,rx @ wait for Tx FIFO room -1001: ldrb \rd, [\rx, #0x10] @ STATUS - tst \rd, #1 << 5 @ TXFF (TX FIFO full) - bne 1001b @ yes, spin - .endm - - -#elif defined(CONFIG_ARCH_VERSATILE) - -#include - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x10000000 - movne \rx, #0xf1000000 @ virtual base - orr \rx, \rx, #0x001F0000 - orr \rx, \rx, #0x00001000 - .endm - - .macro senduart,rd,rx - strb \rd, [\rx, #UART01x_DR] - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full - bne 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy - bne 1001b - .endm - -#elif defined(CONFIG_ARCH_IMX) - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #0x00000000 @ physical - movne \rx, #0xe0000000 @ virtual - orr \rx, \rx, #0x00200000 - orr \rx, \rx, #0x00006000 @ UART1 offset - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0x40] @ TXDATA - .endm - - .macro waituart,rd,rx - .endm - - .macro busyuart,rd,rx -1002: ldr \rd, [\rx, #0x98] @ SR2 - tst \rd, #1 << 3 @ TXDC - beq 1002b @ wait until transmit done - .endm - -#elif defined(CONFIG_ARCH_H720X) - - .equ io_virt, IO_BASE - .equ io_phys, IO_START - - .macro addruart,rx - mrc p15, 0, \rx, c1, c0 - tst \rx, #1 @ MMU enabled? - moveq \rx, #io_phys @ physical base address - movne \rx, #io_virt @ virtual address - add \rx, \rx, #0x00020000 @ UART1 - .endm - - .macro senduart,rd,rx - str \rd, [\rx, #0x0] @ UARTDR - - .endm - - .macro waituart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full - bne 1001b - .endm - - .macro busyuart,rd,rx -1001: ldr \rd, [\rx, #0x18] @ UARTFLG - tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy - bne 1001b - .endm -#else -#error Unknown architecture #endif /* diff -Nru a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S --- a/arch/arm/kernel/entry-armv.S 2005-01-28 14:11:40 -08:00 +++ b/arch/arm/kernel/entry-armv.S 2005-01-28 14:11:40 -08:00 @@ -429,186 +429,131 @@ __INIT /* - * Vector stubs. NOTE that we only align 'vector_IRQ' to a cache line boundary, - * and we rely on each stub being exactly 48 (1.5 cache lines) in size. This - * means that we only ever load two cache lines for this code, or one if we're - * lucky. We also copy this code to 0x200 so that we can use branches in the + * Vector stubs. + * + * This code is copied to 0x200 or 0xffff0200 so we can use branches in the * vectors, rather than ldr's. - */ - .align 5 + * + * Common stub entry macro: + * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC + */ + .macro vector_stub, name, sym, correction=0 + .align 5 + +vector_\name: + ldr r13, .LCs\sym + .if \correction + sub lr, lr, #\correction + .endif + str lr, [r13] @ save lr_IRQ + mrs lr, spsr + str lr, [r13, #4] @ save spsr_IRQ + @ + @ now branch to the relevant MODE handling routine + @ + mrs r13, cpsr + bic r13, r13, #MODE_MASK + orr r13, r13, #MODE_SVC + msr spsr_cxsf, r13 @ switch to SVC_32 mode + + and lr, lr, #15 + ldr lr, [pc, lr, lsl #2] + movs pc, lr @ Changes mode and branches + .endm + __stubs_start: /* * Interrupt dispatcher - * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC */ -vector_IRQ: @ - @ save mode specific registers - @ - ldr r13, .LCsirq - sub lr, lr, #4 - str lr, [r13] @ save lr_IRQ - mrs lr, spsr - str lr, [r13, #4] @ save spsr_IRQ - @ - @ now branch to the relevant MODE handling routine - @ - mrs r13, cpsr - bic r13, r13, #MODE_MASK - orr r13, r13, #MODE_SVC - msr spsr_cxsf, r13 @ switch to SVC_32 mode - - and lr, lr, #15 - ldr lr, [pc, lr, lsl #2] - movs pc, lr @ Changes mode and branches - -.LCtab_irq: .word __irq_usr @ 0 (USR_26 / USR_32) - .word __irq_invalid @ 1 (FIQ_26 / FIQ_32) - .word __irq_invalid @ 2 (IRQ_26 / IRQ_32) - .word __irq_svc @ 3 (SVC_26 / SVC_32) - .word __irq_invalid @ 4 - .word __irq_invalid @ 5 - .word __irq_invalid @ 6 - .word __irq_invalid @ 7 - .word __irq_invalid @ 8 - .word __irq_invalid @ 9 - .word __irq_invalid @ a - .word __irq_invalid @ b - .word __irq_invalid @ c - .word __irq_invalid @ d - .word __irq_invalid @ e - .word __irq_invalid @ f + vector_stub irq, irq, 4 - .align 5 + .long __irq_usr @ 0 (USR_26 / USR_32) + .long __irq_invalid @ 1 (FIQ_26 / FIQ_32) + .long __irq_invalid @ 2 (IRQ_26 / IRQ_32) + .long __irq_svc @ 3 (SVC_26 / SVC_32) + .long __irq_invalid @ 4 + .long __irq_invalid @ 5 + .long __irq_invalid @ 6 + .long __irq_invalid @ 7 + .long __irq_invalid @ 8 + .long __irq_invalid @ 9 + .long __irq_invalid @ a + .long __irq_invalid @ b + .long __irq_invalid @ c + .long __irq_invalid @ d + .long __irq_invalid @ e + .long __irq_invalid @ f /* - * Data abort dispatcher - dispatches it to the correct handler for the processor mode + * Data abort dispatcher * Enter in ABT mode, spsr = USR CPSR, lr = USR PC */ -vector_data: @ - @ save mode specific registers - @ - ldr r13, .LCsabt - sub lr, lr, #8 - str lr, [r13] - mrs lr, spsr - str lr, [r13, #4] - @ - @ now branch to the relevant MODE handling routine - @ - mrs r13, cpsr - bic r13, r13, #MODE_MASK - orr r13, r13, #MODE_SVC - msr spsr_cxsf, r13 @ switch to SVC_32 mode - - and lr, lr, #15 - ldr lr, [pc, lr, lsl #2] - movs pc, lr @ Changes mode and branches - -.LCtab_dabt: .word __dabt_usr @ 0 (USR_26 / USR_32) - .word __dabt_invalid @ 1 (FIQ_26 / FIQ_32) - .word __dabt_invalid @ 2 (IRQ_26 / IRQ_32) - .word __dabt_svc @ 3 (SVC_26 / SVC_32) - .word __dabt_invalid @ 4 - .word __dabt_invalid @ 5 - .word __dabt_invalid @ 6 - .word __dabt_invalid @ 7 - .word __dabt_invalid @ 8 - .word __dabt_invalid @ 9 - .word __dabt_invalid @ a - .word __dabt_invalid @ b - .word __dabt_invalid @ c - .word __dabt_invalid @ d - .word __dabt_invalid @ e - .word __dabt_invalid @ f + vector_stub dabt, abt, 8 - .align 5 + .long __dabt_usr @ 0 (USR_26 / USR_32) + .long __dabt_invalid @ 1 (FIQ_26 / FIQ_32) + .long __dabt_invalid @ 2 (IRQ_26 / IRQ_32) + .long __dabt_svc @ 3 (SVC_26 / SVC_32) + .long __dabt_invalid @ 4 + .long __dabt_invalid @ 5 + .long __dabt_invalid @ 6 + .long __dabt_invalid @ 7 + .long __dabt_invalid @ 8 + .long __dabt_invalid @ 9 + .long __dabt_invalid @ a + .long __dabt_invalid @ b + .long __dabt_invalid @ c + .long __dabt_invalid @ d + .long __dabt_invalid @ e + .long __dabt_invalid @ f /* - * Prefetch abort dispatcher - dispatches it to the correct handler for the processor mode + * Prefetch abort dispatcher * Enter in ABT mode, spsr = USR CPSR, lr = USR PC */ -vector_prefetch: - @ - @ save mode specific registers - @ - ldr r13, .LCsabt - sub lr, lr, #4 - str lr, [r13] @ save lr_ABT - mrs lr, spsr - str lr, [r13, #4] @ save spsr_ABT - @ - @ now branch to the relevant MODE handling routine - @ - mrs r13, cpsr - bic r13, r13, #MODE_MASK - orr r13, r13, #MODE_SVC - msr spsr_cxsf, r13 @ switch to SVC_32 mode - - ands lr, lr, #15 - ldr lr, [pc, lr, lsl #2] - movs pc, lr - -.LCtab_pabt: .word __pabt_usr @ 0 (USR_26 / USR_32) - .word __pabt_invalid @ 1 (FIQ_26 / FIQ_32) - .word __pabt_invalid @ 2 (IRQ_26 / IRQ_32) - .word __pabt_svc @ 3 (SVC_26 / SVC_32) - .word __pabt_invalid @ 4 - .word __pabt_invalid @ 5 - .word __pabt_invalid @ 6 - .word __pabt_invalid @ 7 - .word __pabt_invalid @ 8 - .word __pabt_invalid @ 9 - .word __pabt_invalid @ a - .word __pabt_invalid @ b - .word __pabt_invalid @ c - .word __pabt_invalid @ d - .word __pabt_invalid @ e - .word __pabt_invalid @ f + vector_stub pabt, abt, 4 - .align 5 + .long __pabt_usr @ 0 (USR_26 / USR_32) + .long __pabt_invalid @ 1 (FIQ_26 / FIQ_32) + .long __pabt_invalid @ 2 (IRQ_26 / IRQ_32) + .long __pabt_svc @ 3 (SVC_26 / SVC_32) + .long __pabt_invalid @ 4 + .long __pabt_invalid @ 5 + .long __pabt_invalid @ 6 + .long __pabt_invalid @ 7 + .long __pabt_invalid @ 8 + .long __pabt_invalid @ 9 + .long __pabt_invalid @ a + .long __pabt_invalid @ b + .long __pabt_invalid @ c + .long __pabt_invalid @ d + .long __pabt_invalid @ e + .long __pabt_invalid @ f /* - * Undef instr entry dispatcher - dispatches it to the correct handler for the processor mode + * Undef instr entry dispatcher * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC */ -vector_undefinstr: - @ - @ save mode specific registers - @ - ldr r13, .LCsund - str lr, [r13] @ save lr_UND - mrs lr, spsr - str lr, [r13, #4] @ save spsr_UND - @ - @ now branch to the relevant MODE handling routine - @ - mrs r13, cpsr - bic r13, r13, #MODE_MASK - orr r13, r13, #MODE_SVC - msr spsr_cxsf, r13 @ switch to SVC_32 mode - - and lr, lr, #15 - ldr lr, [pc, lr, lsl #2] - movs pc, lr @ Changes mode and branches - -.LCtab_und: .word __und_usr @ 0 (USR_26 / USR_32) - .word __und_invalid @ 1 (FIQ_26 / FIQ_32) - .word __und_invalid @ 2 (IRQ_26 / IRQ_32) - .word __und_svc @ 3 (SVC_26 / SVC_32) - .word __und_invalid @ 4 - .word __und_invalid @ 5 - .word __und_invalid @ 6 - .word __und_invalid @ 7 - .word __und_invalid @ 8 - .word __und_invalid @ 9 - .word __und_invalid @ a - .word __und_invalid @ b - .word __und_invalid @ c - .word __und_invalid @ d - .word __und_invalid @ e - .word __und_invalid @ f + vector_stub und, und - .align 5 + .long __und_usr @ 0 (USR_26 / USR_32) + .long __und_invalid @ 1 (FIQ_26 / FIQ_32) + .long __und_invalid @ 2 (IRQ_26 / IRQ_32) + .long __und_svc @ 3 (SVC_26 / SVC_32) + .long __und_invalid @ 4 + .long __und_invalid @ 5 + .long __und_invalid @ 6 + .long __und_invalid @ 7 + .long __und_invalid @ 8 + .long __und_invalid @ 9 + .long __und_invalid @ a + .long __und_invalid @ b + .long __und_invalid @ c + .long __und_invalid @ d + .long __und_invalid @ e + .long __und_invalid @ f + + .align 5 /*============================================================================= * Undefined FIQs @@ -620,7 +565,7 @@ * other mode than FIQ... Ok you can switch to another mode, but you can't * get out of that mode without clobbering one register. */ -vector_FIQ: disable_fiq +vector_fiq: disable_fiq subs pc, lr, #4 /*============================================================================= @@ -650,13 +595,13 @@ .equ __real_stubs_start, .LCvectors + 0x200 .LCvectors: swi SYS_ERROR0 - b __real_stubs_start + (vector_undefinstr - __stubs_start) + b __real_stubs_start + (vector_und - __stubs_start) ldr pc, __real_stubs_start + (.LCvswi - __stubs_start) - b __real_stubs_start + (vector_prefetch - __stubs_start) - b __real_stubs_start + (vector_data - __stubs_start) + b __real_stubs_start + (vector_pabt - __stubs_start) + b __real_stubs_start + (vector_dabt - __stubs_start) b __real_stubs_start + (vector_addrexcptn - __stubs_start) - b __real_stubs_start + (vector_IRQ - __stubs_start) - b __real_stubs_start + (vector_FIQ - __stubs_start) + b __real_stubs_start + (vector_irq - __stubs_start) + b __real_stubs_start + (vector_fiq - __stubs_start) ENTRY(__trap_init) stmfd sp!, {r4 - r6, lr} diff -Nru a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c --- a/arch/arm/kernel/fiq.c 2005-01-28 14:11:41 -08:00 +++ b/arch/arm/kernel/fiq.c 2005-01-28 14:11:41 -08:00 @@ -46,6 +46,12 @@ #include #include +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +#warning This file requires GCC 3.3.x or older to build. Alternatively, +#warning please talk to GCC people to resolve the issues with the +#warning assembly clobber list. +#endif + static unsigned long no_fiq_insn; /* Default reacquire function @@ -89,16 +95,15 @@ */ void set_fiq_regs(struct pt_regs *regs) { - register unsigned long tmp, tmp2; + register unsigned long tmp; __asm__ volatile ( "mrs %0, cpsr\n\ - mov %1, %3\n\ - msr cpsr_c, %1 @ select FIQ mode\n\ + msr cpsr_c, %2 @ select FIQ mode\n\ mov r0, r0\n\ - ldmia %2, {r8 - r14}\n\ + ldmia %1, {r8 - r14}\n\ msr cpsr_c, %0 @ return to SVC mode\n\ mov r0, r0" - : "=&r" (tmp), "=&r" (tmp2) + : "=&r" (tmp) : "r" (®s->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE) /* These registers aren't modified by the above code in a way visible to the compiler, but we mark them as clobbers anyway @@ -109,16 +114,15 @@ void get_fiq_regs(struct pt_regs *regs) { - register unsigned long tmp, tmp2; + register unsigned long tmp; __asm__ volatile ( "mrs %0, cpsr\n\ - mov %1, %3\n\ - msr cpsr_c, %1 @ select FIQ mode\n\ + msr cpsr_c, %2 @ select FIQ mode\n\ mov r0, r0\n\ - stmia %2, {r8 - r14}\n\ + stmia %1, {r8 - r14}\n\ msr cpsr_c, %0 @ return to SVC mode\n\ mov r0, r0" - : "=&r" (tmp), "=&r" (tmp2) + : "=&r" (tmp) : "r" (®s->ARM_r8), "I" (PSR_I_BIT | PSR_F_BIT | FIQ_MODE) /* These registers aren't modified by the above code in a way visible to the compiler, but we mark them as clobbers anyway diff -Nru a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c --- a/arch/arm/mach-pxa/mainstone.c 2005-01-28 14:11:41 -08:00 +++ b/arch/arm/mach-pxa/mainstone.c 2005-01-28 14:11:41 -08:00 @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -120,6 +121,44 @@ .resource = smc91x_resources, }; +static int mst_audio_startup(snd_pcm_substream_t *substream, void *priv) +{ + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + MST_MSCWR2 &= ~MST_MSCWR2_AC97_SPKROFF; + return 0; +} + +static void mst_audio_shutdown(snd_pcm_substream_t *substream, void *priv) +{ + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + MST_MSCWR2 |= MST_MSCWR2_AC97_SPKROFF; +} + +static long mst_audio_suspend_mask; + +static void mst_audio_suspend(void *priv) +{ + mst_audio_suspend_mask = MST_MSCWR2; + MST_MSCWR2 |= MST_MSCWR2_AC97_SPKROFF; +} + +static void mst_audio_resume(void *priv) +{ + MST_MSCWR2 &= mst_audio_suspend_mask | ~MST_MSCWR2_AC97_SPKROFF; +} + +static pxa2xx_audio_ops_t mst_audio_ops = { + .startup = mst_audio_startup, + .shutdown = mst_audio_shutdown, + .suspend = mst_audio_suspend, + .resume = mst_audio_resume, +}; + +static struct platform_device mst_audio_device = { + .name = "pxa2xx-ac97", + .id = -1, + .dev = { .platform_data = &mst_audio_ops }, +}; static void mainstone_backlight_power(int on) { @@ -228,7 +267,14 @@ static void __init mainstone_init(void) { + /* + * On Mainstone, we route AC97_SYSCLK via GPIO45 to + * the audio daughter card + */ + pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD); + platform_device_register(&smc91x_device); + platform_device_register(&mst_audio_device); /* reading Mainstone's "Virtual Configuration Register" might be handy to select LCD type here */ diff -Nru a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c --- a/arch/arm/oprofile/common.c 2005-01-28 14:11:41 -08:00 +++ b/arch/arm/oprofile/common.c 2005-01-28 14:11:41 -08:00 @@ -105,12 +105,13 @@ up(&pmu_sem); } -void __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec) +int __init +pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec) { init_MUTEX(&pmu_sem); if (spec->init() < 0) - return; + return -ENODEV; pmu_model = spec; init_driverfs(); @@ -121,6 +122,8 @@ ops->stop = pmu_stop; ops->cpu_type = pmu_model->name; printk(KERN_INFO "oprofile: using %s PMU\n", spec->name); + + return 0; } void pmu_exit(void) diff -Nru a/arch/arm/oprofile/init.c b/arch/arm/oprofile/init.c --- a/arch/arm/oprofile/init.c 2005-01-28 14:11:40 -08:00 +++ b/arch/arm/oprofile/init.c 2005-01-28 14:11:40 -08:00 @@ -12,11 +12,15 @@ #include #include "op_arm_model.h" -void __init oprofile_arch_init(struct oprofile_operations *ops) +int __init oprofile_arch_init(struct oprofile_operations *ops) { + int ret = -ENODEV; + #ifdef CONFIG_CPU_XSCALE - pmu_init(ops, &op_xscale_spec); + ret = pmu_init(ops, &op_xscale_spec); #endif + + return ret; } void oprofile_arch_exit(void) diff -Nru a/arch/h8300/Makefile b/arch/h8300/Makefile --- a/arch/h8300/Makefile 2005-01-28 14:11:40 -08:00 +++ b/arch/h8300/Makefile 2005-01-28 14:11:40 -08:00 @@ -7,9 +7,6 @@ # # (C) Copyright 2002,2003 Yoshinori Sato # -ifndef include-config --include $(TOPDIR)/.config -endif platform-$(CONFIG_CPU_H8300H) := h8300h platform-$(CONFIG_CPU_H8S) := h8s @@ -47,9 +44,11 @@ head-y := arch/$(ARCH)/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o core-y += arch/$(ARCH)/kernel/ \ - arch/$(ARCH)/mm/ \ - arch/$(ARCH)/platform/$(PLATFORM)/ \ + arch/$(ARCH)/mm/ +ifdef PLATFORM +core-y += arch/$(ARCH)/platform/$(PLATFORM)/ \ arch/$(ARCH)/platform/$(PLATFORM)/$(BOARD)/ +endif libs-y += arch/$(ARCH)/lib/ $(LIBGCC) diff -Nru a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c --- a/arch/i386/kernel/apic.c 2005-01-28 14:11:41 -08:00 +++ b/arch/i386/kernel/apic.c 2005-01-28 14:11:41 -08:00 @@ -1046,9 +1046,7 @@ void __init setup_secondary_APIC_clock(void) { - local_irq_disable(); /* FIXME: Do we need this? --RR */ setup_APIC_timer(calibration_result); - local_irq_enable(); } void __init disable_APIC_timer(void) diff -Nru a/arch/i386/kernel/pci-dma.c b/arch/i386/kernel/pci-dma.c --- a/arch/i386/kernel/pci-dma.c 2005-01-28 14:11:41 -08:00 +++ b/arch/i386/kernel/pci-dma.c 2005-01-28 14:11:41 -08:00 @@ -122,6 +122,7 @@ if(!mem) return; dev->dma_mem = NULL; + iounmap(mem->virt_base); kfree(mem->bitmap); kfree(mem); } diff -Nru a/arch/i386/kernel/reboot.c b/arch/i386/kernel/reboot.c --- a/arch/i386/kernel/reboot.c 2005-01-28 14:11:40 -08:00 +++ b/arch/i386/kernel/reboot.c 2005-01-28 14:11:40 -08:00 @@ -20,7 +20,7 @@ void (*pm_power_off)(void); static int reboot_mode; -int reboot_thru_bios; +static int reboot_thru_bios; #ifdef CONFIG_SMP int reboot_smp = 0; diff -Nru a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c --- a/arch/i386/kernel/smpboot.c 2005-01-28 14:11:40 -08:00 +++ b/arch/i386/kernel/smpboot.c 2005-01-28 14:11:40 -08:00 @@ -383,8 +383,6 @@ setup_local_APIC(); map_cpu_to_logical_apicid(); - local_irq_enable(); - /* * Get our bogomips. */ @@ -397,7 +395,7 @@ smp_store_cpu_info(cpuid); disable_APIC_timer(); - local_irq_disable(); + /* * Allow the master to continue. */ @@ -439,6 +437,10 @@ */ local_flush_tlb(); cpu_set(smp_processor_id(), cpu_online_map); + + /* We can take interrupts now: we're officially "up". */ + local_irq_enable(); + wmb(); cpu_idle(); } diff -Nru a/arch/i386/mach-visws/reboot.c b/arch/i386/mach-visws/reboot.c --- a/arch/i386/mach-visws/reboot.c 2005-01-28 14:11:41 -08:00 +++ b/arch/i386/mach-visws/reboot.c 2005-01-28 14:11:41 -08:00 @@ -8,9 +8,6 @@ void (*pm_power_off)(void); -int reboot_thru_bios; -int reboot_smp; - void machine_restart(char * __unused) { #ifdef CONFIG_SMP diff -Nru a/arch/i386/mach-voyager/voyager_basic.c b/arch/i386/mach-voyager/voyager_basic.c --- a/arch/i386/mach-voyager/voyager_basic.c 2005-01-28 14:11:40 -08:00 +++ b/arch/i386/mach-voyager/voyager_basic.c 2005-01-28 14:11:40 -08:00 @@ -36,8 +36,6 @@ */ void (*pm_power_off)(void); -int reboot_thru_bios; - int voyager_level = 0; struct voyager_SUS *voyager_SUS = NULL; diff -Nru a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c --- a/arch/i386/mach-voyager/voyager_smp.c 2005-01-28 14:11:40 -08:00 +++ b/arch/i386/mach-voyager/voyager_smp.c 2005-01-28 14:11:40 -08:00 @@ -27,12 +27,9 @@ #include #include #include -#include #include #include - -int reboot_smp = 0; /* TLB state -- visible externally, indexed physically */ DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate) ____cacheline_aligned = { &init_mm, 0 }; diff -Nru a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c --- a/arch/i386/mm/ioremap.c 2005-01-28 14:11:40 -08:00 +++ b/arch/i386/mm/ioremap.c 2005-01-28 14:11:40 -08:00 @@ -238,8 +238,9 @@ } if ((p->flags >> 20) && p->phys_addr < virt_to_phys(high_memory) - 1) { + /* p->size includes the guard page, but cpa doesn't like that */ change_page_attr(virt_to_page(__va(p->phys_addr)), - p->size >> PAGE_SHIFT, + (p->size - PAGE_SIZE) >> PAGE_SHIFT, PAGE_KERNEL); global_flush_tlb(); } diff -Nru a/arch/i386/oprofile/init.c b/arch/i386/oprofile/init.c --- a/arch/i386/oprofile/init.c 2005-01-28 14:11:41 -08:00 +++ b/arch/i386/oprofile/init.c 2005-01-28 14:11:41 -08:00 @@ -21,7 +21,7 @@ extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); -void __init oprofile_arch_init(struct oprofile_operations * ops) +int __init oprofile_arch_init(struct oprofile_operations * ops) { int ret; @@ -35,6 +35,8 @@ ret = nmi_timer_init(ops); #endif ops->backtrace = x86_backtrace; + + return ret; } diff -Nru a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig --- a/arch/ia64/configs/tiger_defconfig 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/configs/tiger_defconfig 2005-01-28 14:11:40 -08:00 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10-rc1 -# Tue Nov 2 11:35:10 2004 +# Linux kernel version: 2.6.11-rc2 +# Sat Jan 22 11:17:02 2005 # # @@ -59,12 +59,14 @@ CONFIG_64BIT=y CONFIG_MMU=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_TIME_INTERPOLATION=y CONFIG_EFI=y CONFIG_GENERIC_IOMAP=y # CONFIG_IA64_GENERIC is not set CONFIG_IA64_DIG=y # CONFIG_IA64_HP_ZX1 is not set +# CONFIG_IA64_HP_ZX1_SWIOTLB is not set # CONFIG_IA64_SGI_SN2 is not set # CONFIG_IA64_HP_SIM is not set # CONFIG_ITANIUM is not set @@ -76,6 +78,7 @@ CONFIG_IA64_L1_CACHE_SHIFT=7 # CONFIG_NUMA is not set CONFIG_VIRTUAL_MEM_MAP=y +CONFIG_HOLES_IN_ZONE=y CONFIG_IA64_CYCLONE=y CONFIG_IOSAPIC=y CONFIG_FORCE_MAX_ZONEORDER=18 @@ -89,6 +92,7 @@ CONFIG_IA64_MCA_RECOVERY=y CONFIG_PERFMON=y CONFIG_IA64_PALINFO=y +CONFIG_ACPI_DEALLOCATE_IRQ=y # # Firmware Drivers @@ -110,8 +114,10 @@ CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_BUTTON=m +# CONFIG_ACPI_VIDEO is not set CONFIG_ACPI_FAN=m CONFIG_ACPI_PROCESSOR=m +# CONFIG_ACPI_HOTPLUG_CPU is not set CONFIG_ACPI_THERMAL=m CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set @@ -119,6 +125,7 @@ CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y +# CONFIG_ACPI_CONTAINER is not set # # Bus options (PCI, PCMCIA) @@ -137,7 +144,6 @@ CONFIG_HOTPLUG_PCI_ACPI=m # CONFIG_HOTPLUG_PCI_ACPI_IBM is not set # CONFIG_HOTPLUG_PCI_CPCI is not set -# CONFIG_HOTPLUG_PCI_PCIE is not set # CONFIG_HOTPLUG_PCI_SHPC is not set # @@ -174,6 +180,7 @@ # # Plug and Play support # +# CONFIG_PNP is not set # # Block devices @@ -182,12 +189,14 @@ # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=m +CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_INITRAMFS_SOURCE="" # CONFIG_CDROM_PKTCDVD is not set @@ -199,6 +208,7 @@ CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support @@ -285,6 +295,7 @@ # CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_FC_ATTRS=y +# CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers @@ -325,7 +336,6 @@ CONFIG_SCSI_QLA2300=m CONFIG_SCSI_QLA2322=m # CONFIG_SCSI_QLA6312 is not set -# CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set @@ -342,6 +352,7 @@ CONFIG_MD_RAID5=m CONFIG_MD_RAID6=m CONFIG_MD_MULTIPATH=m +# CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=m CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m @@ -392,6 +403,7 @@ # CONFIG_INET_IPCOMP is not set # CONFIG_INET_TUNNEL is not set CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set # CONFIG_IPV6 is not set # CONFIG_NETFILTER is not set @@ -471,7 +483,6 @@ # CONFIG_FORCEDETH is not set # CONFIG_DGRS is not set CONFIG_EEPRO100=m -# CONFIG_EEPRO100_PIO is not set CONFIG_E100=m # CONFIG_E100_NAPI is not set # CONFIG_FEALNX is not set @@ -564,12 +575,13 @@ # CONFIG_GAMEPORT_EMU10K1 is not set # CONFIG_GAMEPORT_VORTEX is not set # CONFIG_GAMEPORT_FM801 is not set -# CONFIG_GAMEPORT_CS461x is not set +# CONFIG_GAMEPORT_CS461X is not set CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set +CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set # @@ -598,6 +610,8 @@ CONFIG_SERIAL_NONSTANDARD=y # CONFIG_ROCKETPORT is not set # CONFIG_CYCLADES is not set +# CONFIG_MOXA_SMARTIO is not set +# CONFIG_ISI is not set # CONFIG_SYNCLINK is not set # CONFIG_SYNCLINKMP is not set # CONFIG_N_HDLC is not set @@ -645,7 +659,7 @@ # CONFIG_AGP=m CONFIG_AGP_I460=m -CONFIG_DRM=y +CONFIG_DRM=m CONFIG_DRM_TDFX=m CONFIG_DRM_R128=m CONFIG_DRM_RADEON=m @@ -691,6 +705,7 @@ # CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound @@ -722,6 +737,7 @@ # CONFIG_USB_EHCI_ROOT_HUB_TT is not set CONFIG_USB_OHCI_HCD=m CONFIG_USB_UHCI_HCD=y +# CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers @@ -729,6 +745,10 @@ # CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_RW_DETECT is not set @@ -762,7 +782,6 @@ # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set -# CONFIG_USB_HPUSBSCSI is not set # # USB Multimedia devices @@ -774,7 +793,7 @@ # # -# USB Network adaptors +# USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set @@ -796,7 +815,6 @@ # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set -# CONFIG_USB_TIGL is not set # CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set @@ -805,6 +823,7 @@ # CONFIG_USB_CYTHERM is not set # CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set +# CONFIG_USB_IDMOUSE is not set # CONFIG_USB_TEST is not set # @@ -817,6 +836,16 @@ # CONFIG_USB_GADGET is not set # +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + +# # File systems # CONFIG_EXT2_FS=y @@ -927,7 +956,7 @@ CONFIG_CIFS=m # CONFIG_CIFS_STATS is not set # CONFIG_CIFS_XATTR is not set -# CONFIG_CIFS_POSIX is not set +# CONFIG_CIFS_EXPERIMENTAL is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set @@ -1002,6 +1031,8 @@ # CONFIG_CRC_CCITT is not set CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set +CONFIG_GENERIC_HARDIRQS=y +CONFIG_GENERIC_IRQ_PROBE=y # # Profiling support @@ -1019,6 +1050,7 @@ # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_FS is not set CONFIG_IA64_GRANULE_16MB=y # CONFIG_IA64_GRANULE_64MB is not set # CONFIG_IA64_PRINT_HAZARDS is not set @@ -1055,7 +1087,12 @@ # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 is not set # CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_ANUBIS is not set # CONFIG_CRYPTO_DEFLATE is not set # CONFIG_CRYPTO_MICHAEL_MIC is not set # CONFIG_CRYPTO_CRC32C is not set # CONFIG_CRYPTO_TEST is not set + +# +# Hardware crypto devices +# diff -Nru a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c --- a/arch/ia64/ia32/binfmt_elf32.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/ia32/binfmt_elf32.c 2005-01-28 14:11:41 -08:00 @@ -103,7 +103,7 @@ if (insert_vm_struct(current->mm, vma)) { kmem_cache_free(vm_area_cachep, vma); up_write(¤t->mm->mmap_sem); - return; + BUG(); } } up_write(¤t->mm->mmap_sem); @@ -130,7 +130,7 @@ if (insert_vm_struct(current->mm, vma)) { kmem_cache_free(vm_area_cachep, vma); up_write(¤t->mm->mmap_sem); - return; + BUG(); } } up_write(¤t->mm->mmap_sem); @@ -153,7 +153,7 @@ if (insert_vm_struct(current->mm, vma)) { kmem_cache_free(vm_area_cachep, vma); up_write(¤t->mm->mmap_sem); - return; + BUG(); } } up_write(¤t->mm->mmap_sem); diff -Nru a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c --- a/arch/ia64/ia32/sys_ia32.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/ia32/sys_ia32.c 2005-01-28 14:11:41 -08:00 @@ -1973,10 +1973,10 @@ unsigned int __unused[4]; }; +#ifdef CONFIG_SYSCTL asmlinkage long sys32_sysctl (struct sysctl32 __user *args) { -#ifdef CONFIG_SYSCTL struct sysctl32 a32; mm_segment_t old_fs = get_fs (); void __user *oldvalp, *newvalp; @@ -2015,10 +2015,8 @@ return -EFAULT; return ret; -#else - return -ENOSYS; -#endif } +#endif asmlinkage long sys32_newuname (struct new_utsname __user *name) @@ -2656,7 +2654,7 @@ info.si_signo = 0; set_fs (KERNEL_DS); ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options, - uru ? &ru : NULL); + uru ? (struct rusage __user *) &ru : NULL); set_fs (old_fs); if (ret < 0 || info.si_signo == 0) diff -Nru a/arch/ia64/kernel/domain.c b/arch/ia64/kernel/domain.c --- a/arch/ia64/kernel/domain.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/kernel/domain.c 2005-01-28 14:11:41 -08:00 @@ -151,10 +151,9 @@ * Set up domains. Isolated domains just stay on the dummy domain. */ for_each_cpu_mask(i, cpu_default_map) { - int node = cpu_to_node(i); int group; struct sched_domain *sd = NULL, *p; - cpumask_t nodemask = node_to_cpumask(node); + cpumask_t nodemask = node_to_cpumask(cpu_to_node(i)); cpus_and(nodemask, nodemask, cpu_default_map); @@ -172,7 +171,7 @@ sd = &per_cpu(node_domains, i); *sd = SD_NODE_INIT; - sd->span = sched_domain_node_span(node); + sd->span = sched_domain_node_span(cpu_to_node(i)); sd->parent = p; cpus_and(sd->span, sd->span, cpu_default_map); #endif diff -Nru a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c --- a/arch/ia64/kernel/efi.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/kernel/efi.c 2005-01-28 14:11:40 -08:00 @@ -778,6 +778,7 @@ } return 0; } +EXPORT_SYMBOL(efi_mem_attributes); int valid_phys_addr_range (unsigned long phys_addr, unsigned long *size) diff -Nru a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S --- a/arch/ia64/kernel/entry.S 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/kernel/entry.S 2005-01-28 14:11:40 -08:00 @@ -3,7 +3,7 @@ * * Kernel entry points. * - * Copyright (C) 1998-2003 Hewlett-Packard Co + * Copyright (C) 1998-2003, 2005 Hewlett-Packard Co * David Mosberger-Tang * Copyright (C) 1999, 2002-2003 * Asit Mallick @@ -51,8 +51,11 @@ * setup a null register window frame. */ ENTRY(ia64_execve) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(3) - alloc loc1=ar.pfs,3,2,4,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) + alloc loc1=ar.pfs,8,2,4,0 mov loc0=rp .body mov out0=in0 // filename @@ -113,8 +116,11 @@ * u64 tls) */ GLOBAL_ENTRY(sys_clone2) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(6) - alloc r16=ar.pfs,6,2,6,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) + alloc r16=ar.pfs,8,2,6,0 DO_SAVE_SWITCH_STACK adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp mov loc0=rp @@ -142,8 +148,11 @@ * Deprecated. Use sys_clone2() instead. */ GLOBAL_ENTRY(sys_clone) - .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(5) - alloc r16=ar.pfs,5,2,6,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8) + alloc r16=ar.pfs,8,2,6,0 DO_SAVE_SWITCH_STACK adds r2=PT(R16)+IA64_SWITCH_STACK_SIZE+16,sp mov loc0=rp @@ -633,10 +642,12 @@ * r13: restored (user-level thread pointer) * r14: cleared * r15: restored (syscall #) - * r16-r19: cleared + * r16-r17: cleared + * r18: user-level b6 + * r19: cleared * r20: user-level ar.fpsr * r21: user-level b0 - * r22: user-level b6 + * r22: cleared * r23: user-level ar.bspstore * r24: user-level ar.rnat * r25: user-level ar.unat @@ -661,7 +672,7 @@ * ar.csd: cleared * ar.ssd: cleared */ -GLOBAL_ENTRY(ia64_leave_syscall) +ENTRY(ia64_leave_syscall) PT_REGS_UNWIND_INFO(0) /* * work.need_resched etc. mustn't get changed by this CPU before it returns to @@ -690,79 +701,80 @@ (pUStk) cmp.eq.unc p6,p0=r0,r0 // p6 <- pUStk #endif .work_processed_syscall: - adds r16=PT(LOADRS)+16,r12 - adds r17=PT(AR_BSPSTORE)+16,r12 + adds r2=PT(LOADRS)+16,r12 + adds r3=PT(AR_BSPSTORE)+16,r12 adds r18=TI_FLAGS+IA64_TASK_SIZE,r13 ;; (p6) ld4 r31=[r18] // load current_thread_info()->flags - ld8 r19=[r16],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs" - nop.i 0 + ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs" + mov b7=r0 // clear b7 ;; - ld8 r23=[r17],PT(R9)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage) - ld8 r22=[r16],PT(R8)-PT(B6) // load b6 + ld8 r23=[r3],PT(R9)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage) + ld8 r18=[r2],PT(R8)-PT(B6) // load b6 (p6) and r15=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE? ;; - - mov.m ar.ccv=r0 // clear ar.ccv + mov r16=ar.bsp // M2 get existing backing store pointer (p6) cmp4.ne.unc p6,p0=r15, r0 // any special work pending? (p6) br.cond.spnt .work_pending ;; // start restoring the state saved on the kernel stack (struct pt_regs): - ld8.fill r8=[r16],16 - ld8.fill r9=[r17],16 + ld8.fill r8=[r2],16 + ld8.fill r9=[r3],16 mov f6=f0 // clear f6 ;; - ld8.fill r10=[r16],16 - ld8.fill r11=[r17],16 + invala // M0|1 invalidate ALAT + rsm psr.i | psr.ic // M2 initiate turning off of interrupt and interruption collection + mov f9=f0 // clear f9 + + ld8.fill r10=[r2],16 + ld8.fill r11=[r3],16 mov f7=f0 // clear f7 ;; - ld8 r29=[r16],16 // load cr.ipsr - ld8 r28=[r17],16 // load cr.iip + ld8 r29=[r2],16 // load cr.ipsr + ld8 r28=[r3],16 // load cr.iip mov f8=f0 // clear f8 ;; - ld8 r30=[r16],16 // load cr.ifs - ld8 r25=[r17],16 // load ar.unat + ld8 r30=[r2],16 // M0|1 load cr.ifs + mov.m ar.ssd=r0 // M2 clear ar.ssd cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs ;; - rsm psr.i | psr.ic // initiate turning off of interrupt and interruption collection - invala // invalidate ALAT - mov f9=f0 // clear f9 - - mov.m ar.ssd=r0 // clear ar.ssd - mov.m ar.csd=r0 // clear ar.csd + ld8 r25=[r3],16 // M0|1 load ar.unat + mov.m ar.csd=r0 // M2 clear ar.csd + mov r22=r0 // clear r22 + ;; + ld8 r26=[r2],PT(B0)-PT(AR_PFS) // M0|1 load ar.pfs +(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled mov f10=f0 // clear f10 ;; - ld8 r26=[r16],16 // load ar.pfs - ld8 r27=[r17],PT(PR)-PT(AR_RSC) // load ar.rsc + ld8 r21=[r2],PT(AR_RNAT)-PT(B0) // load b0 + ld8 r27=[r3],PT(PR)-PT(AR_RSC) // load ar.rsc mov f11=f0 // clear f11 ;; - ld8 r24=[r16],PT(B0)-PT(AR_RNAT) // load ar.rnat (may be garbage) - ld8 r31=[r17],PT(R1)-PT(PR) // load predicates + ld8 r24=[r2],PT(AR_FPSR)-PT(AR_RNAT) // load ar.rnat (may be garbage) + ld8 r31=[r3],PT(R1)-PT(PR) // load predicates (pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13 ;; - ld8 r21=[r16],PT(R12)-PT(B0) // load b0 - ld8.fill r1=[r17],16 // load r1 -(pUStk) mov r3=1 - ;; - ld8.fill r12=[r16],16 - ld8.fill r13=[r17],16 - mov r2=r0 // clear r2 + ld8 r20=[r2],PT(R12)-PT(AR_FPSR) // load ar.fpsr + ld8.fill r1=[r3],16 // load r1 +(pUStk) mov r17=1 ;; - ld8 r20=[r16] // load ar.fpsr - ld8.fill r15=[r17] // load r15 - mov b7=r0 // clear b7 + srlz.d // M0 ensure interruption collection is off + ld8.fill r13=[r3],16 + nop.i 0 ;; -(pUStk) st1 [r14]=r3 - addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0 + ld8.fill r12=[r2] // restore r12 (sp) + ld8.fill r15=[r3] // restore r15 + addl r3=THIS_CPU(ia64_phys_stacked_size_p8),r0 + ;; +(pUStk) ld4 r3=[r3] // r3 = cpu_data->phys_stacked_size_p8 +(pUStk) st1 [r14]=r17 + mov b6=r18 // I0 restore b6 ;; - mov r16=ar.bsp // get existing backing store pointer - srlz.i // ensure interruption collection is off + shr.u r18=r19,16 // I0|1 get byte size of existing "dirty" partition mov r14=r0 // clear r14 - ;; - ld4 r17=[r17] // r17 = cpu_data->phys_stacked_size_p8 - mov b6=r22 // restore b6 - shr.u r18=r19,16 // get byte size of existing "dirty" partition (pKStk) br.cond.dpnt.many skip_rbs_switch + + mov.m ar.ccv=r0 // clear ar.ccv (pNonSys) br.cond.dpnt.many dont_preserve_current_frame br.cond.sptk.many rbs_switch END(ia64_leave_syscall) @@ -883,12 +895,16 @@ srlz.i // ensure interruption collection is off mov ar.ccv=r15 ;; + ldf.fill f11=[r2] bsw.0 // switch back to bank 0 (no stop bit required beforehand...) ;; - ldf.fill f11=[r2] -(pUStk) mov r18=IA64_KR(CURRENT) // Itanium 2: 12 cycle read latency +(pUStk) mov r18=IA64_KR(CURRENT)// M2 (12 cycle read latency) adds r16=PT(CR_IPSR)+16,r12 adds r17=PT(CR_IIP)+16,r12 + +(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled + nop.i 0 + nop.i 0 ;; ld8 r29=[r16],16 // load cr.ipsr ld8 r28=[r17],16 // load cr.iip @@ -901,7 +917,7 @@ cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs ;; ld8 r24=[r16],16 // load ar.rnat (may be garbage) - ld8 r23=[r17],16// load ar.bspstore (may be garbage) + ld8 r23=[r17],16 // load ar.bspstore (may be garbage) ;; ld8 r31=[r16],16 // load predicates ld8 r21=[r17],16 // load b0 @@ -971,6 +987,7 @@ shladd in0=loc1,3,r17 mov in1=0 ;; + .align 32 rse_clear_invalid: #ifdef CONFIG_ITANIUM // cycle 0 @@ -1031,23 +1048,33 @@ loadrs ;; skip_rbs_switch: -(pLvSys) mov r19=r0 // clear r19 for leave_syscall, no-op otherwise - mov b0=r21 - mov ar.pfs=r26 -(pUStk) mov ar.bspstore=r23 -(p9) mov cr.ifs=r30 -(pLvSys)mov r16=r0 // clear r16 for leave_syscall, no-op otherwise - mov cr.ipsr=r29 - mov ar.fpsr=r20 -(pLvSys)mov r17=r0 // clear r17 for leave_syscall, no-op otherwise - mov cr.iip=r28 - ;; -(pUStk) mov ar.rnat=r24 // must happen with RSE in lazy mode -(pLvSys)mov r18=r0 // clear r18 for leave_syscall, no-op otherwise - mov ar.rsc=r27 - mov ar.unat=r25 - mov pr=r31,-1 - rfi + mov ar.unat=r25 // M2 +(pKStk) extr.u r22=r22,21,1 // I0 extract current value of psr.pp from r22 +(pLvSys)mov r19=r0 // A clear r19 for leave_syscall, no-op otherwise + ;; +(pUStk) mov ar.bspstore=r23 // M2 +(pKStk) dep r29=r22,r29,21,1 // I0 update ipsr.pp with psr.pp +(pLvSys)mov r16=r0 // A clear r16 for leave_syscall, no-op otherwise + ;; + mov cr.ipsr=r29 // M2 + mov ar.pfs=r26 // I0 +(pLvSys)mov r17=r0 // A clear r17 for leave_syscall, no-op otherwise + +(p9) mov cr.ifs=r30 // M2 + mov b0=r21 // I0 +(pLvSys)mov r18=r0 // A clear r18 for leave_syscall, no-op otherwise + + mov ar.fpsr=r20 // M2 + mov cr.iip=r28 // M2 + nop 0 + ;; +(pUStk) mov ar.rnat=r24 // M2 must happen with RSE in lazy mode + nop 0 +(pLvSys)mov r2=r0 + + mov ar.rsc=r27 // M2 + mov pr=r31,-1 // I0 + rfi // B /* * On entry: @@ -1198,7 +1225,10 @@ ENTRY(sys_rt_sigreturn) PT_REGS_UNWIND_INFO(0) - alloc r2=ar.pfs,0,0,1,0 + /* + * Allocate 8 input registers since ptrace() may clobber them + */ + alloc r2=ar.pfs,8,0,1,0 .prologue PT_REGS_SAVES(16) adds sp=-16,sp diff -Nru a/arch/ia64/kernel/entry.h b/arch/ia64/kernel/entry.h --- a/arch/ia64/kernel/entry.h 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/kernel/entry.h 2005-01-28 14:11:40 -08:00 @@ -1,14 +1,25 @@ #include /* - * Preserved registers that are shared between code in ivt.S and entry.S. Be - * careful not to step on these! + * Preserved registers that are shared between code in ivt.S and + * entry.S. Be careful not to step on these! */ -#define pLvSys p1 /* set 1 if leave from syscall; otherwise, set 0 */ -#define pKStk p2 /* will leave_{kernel,syscall} return to kernel-stacks? */ -#define pUStk p3 /* will leave_{kernel,syscall} return to user-stacks? */ -#define pSys p4 /* are we processing a (synchronous) system call? */ -#define pNonSys p5 /* complement of pSys */ +#define PRED_LEAVE_SYSCALL 1 /* TRUE iff leave from syscall */ +#define PRED_KERNEL_STACK 2 /* returning to kernel-stacks? */ +#define PRED_USER_STACK 3 /* returning to user-stacks? */ +#define PRED_SYSCALL 4 /* inside a system call? */ +#define PRED_NON_SYSCALL 5 /* complement of PRED_SYSCALL */ + +#ifdef __ASSEMBLY__ +# define PASTE2(x,y) x##y +# define PASTE(x,y) PASTE2(x,y) + +# define pLvSys PASTE(p,PRED_LEAVE_SYSCALL) +# define pKStk PASTE(p,PRED_KERNEL_STACK) +# define pUStk PASTE(p,PRED_USER_STACK) +# define pSys PASTE(p,PRED_SYSCALL) +# define pNonSys PASTE(p,PRED_NON_SYSCALL) +#endif #define PT(f) (IA64_PT_REGS_##f##_OFFSET) #define SW(f) (IA64_SWITCH_STACK_##f##_OFFSET) diff -Nru a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S --- a/arch/ia64/kernel/fsys.S 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/kernel/fsys.S 2005-01-28 14:11:41 -08:00 @@ -612,8 +612,9 @@ ;; mov rp=r2 // set the real return addr tbit.z p8,p0=r3,TIF_SYSCALL_TRACE - -(p8) br.call.sptk.many b6=b6 // ignore this return addr + ;; +(p10) br.cond.spnt.many ia64_ret_from_syscall // p10==true means out registers are more than 8 +(p8) br.call.sptk.many b6=b6 // ignore this return addr br.cond.sptk ia64_trace_syscall END(fsys_bubble_down) diff -Nru a/arch/ia64/kernel/gate.S b/arch/ia64/kernel/gate.S --- a/arch/ia64/kernel/gate.S 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/kernel/gate.S 2005-01-28 14:11:41 -08:00 @@ -81,6 +81,7 @@ LOAD_FSYSCALL_TABLE(r14) mov r16=IA64_KR(CURRENT) // 12 cycle read latency + tnat.nz p10,p9=r15 mov r19=NR_syscalls-1 ;; shladd r18=r17,3,r14 @@ -119,7 +120,8 @@ #endif mov r10=-1 - mov r8=ENOSYS +(p10) mov r8=EINVAL +(p9) mov r8=ENOSYS FSYS_RETURN END(__kernel_syscall_via_epc) diff -Nru a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c --- a/arch/ia64/kernel/irq.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/kernel/irq.c 2005-01-28 14:11:41 -08:00 @@ -32,35 +32,7 @@ printk(KERN_ERR "Unexpected irq vector 0x%x on CPU %u!\n", irq, smp_processor_id()); } -/* - * do_IRQ handles all normal device IRQ's (the special - * SMP cross-CPU interrupts have their own specific - * handlers). - */ -unsigned int do_IRQ(unsigned long irq, struct pt_regs *regs) -{ - return __do_IRQ(irq, regs); -} - -#ifdef CONFIG_SMP -/* - * This is updated when the user sets irq affinity via /proc - */ -cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS]; -static unsigned long pending_irq_redir[BITS_TO_LONGS(NR_IRQS)]; -#endif - #ifdef CONFIG_IA64_GENERIC -irq_desc_t * __ia64_irq_desc (unsigned int irq) -{ - return irq_desc + irq; -} - -ia64_vector __ia64_irq_to_vector (unsigned int irq) -{ - return (ia64_vector) irq; -} - unsigned int __ia64_local_vector_to_irq (ia64_vector vec) { return (unsigned int) vec; @@ -113,27 +85,19 @@ seq_putc(p, '\n'); skip: spin_unlock_irqrestore(&irq_desc[i].lock, flags); - } else if (i == NR_IRQS) { -#if defined(CONFIG_X86_LOCAL_APIC) - seq_puts(p, "LOC: "); - for (j = 0; j < NR_CPUS; j++) - if (cpu_online(j)) - seq_printf(p, "%10u ", - irq_stat[j].apic_timer_irqs); - seq_putc(p, '\n'); -#endif + } else if (i == NR_IRQS) seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); -#if defined(CONFIG_X86_IO_APIC) - seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count)); -#endif - } return 0; } #ifdef CONFIG_SMP +/* + * This is updated when the user sets irq affinity via /proc + */ +cpumask_t __cacheline_aligned pending_irq_cpumask[NR_IRQS]; +static unsigned long pending_irq_redir[BITS_TO_LONGS(NR_IRQS)]; static cpumask_t irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = CPU_MASK_ALL }; - static char irq_redir [NR_IRQS]; // = { [0 ... NR_IRQS-1] = 1 }; void set_irq_affinity_info (unsigned int irq, int hwid, int redir) @@ -250,7 +214,7 @@ for (irq=0; irq < NR_IRQS; irq++) { if (vectors_in_migration[irq]) { vectors_in_migration[irq]=0; - do_IRQ(irq, NULL); + __do_IRQ(irq, NULL); } } diff -Nru a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c --- a/arch/ia64/kernel/irq_ia64.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/kernel/irq_ia64.c 2005-01-28 14:11:40 -08:00 @@ -90,8 +90,6 @@ printk(KERN_WARNING "%s: double free!\n", __FUNCTION__); } -extern unsigned int do_IRQ(unsigned long irq, struct pt_regs *regs); - #ifdef CONFIG_SMP # define IS_RESCHEDULE(vec) (vec == IA64_IPI_RESCHEDULE) #else @@ -150,7 +148,7 @@ ia64_setreg(_IA64_REG_CR_TPR, vector); ia64_srlz_d(); - do_IRQ(local_vector_to_irq(vector), regs); + __do_IRQ(local_vector_to_irq(vector), regs); /* * Disable interrupts and send EOI: @@ -201,7 +199,7 @@ * Probably could shared code. */ vectors_in_migration[local_vector_to_irq(vector)]=0; - do_IRQ(local_vector_to_irq(vector), NULL); + __do_IRQ(local_vector_to_irq(vector), NULL); /* * Disable interrupts and send EOI diff -Nru a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S --- a/arch/ia64/kernel/ivt.S 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/kernel/ivt.S 2005-01-28 14:11:40 -08:00 @@ -51,6 +51,7 @@ #include #include #include +#include #if 1 # define PSR_DEFAULT_BITS psr.ac @@ -732,10 +733,12 @@ ssm psr.ic | PSR_DEFAULT_BITS ;; srlz.i // guarantee that interruption collection is on + mov r3=NR_syscalls - 1 ;; (p15) ssm psr.i // restore psr.i + // p10==true means out registers are more than 8 or r15's Nat is true +(p10) br.cond.spnt.many ia64_ret_from_syscall ;; - mov r3=NR_syscalls - 1 movl r16=sys_call_table adds r15=-1024,r15 // r15 contains the syscall number---subtract 1024 @@ -836,8 +839,11 @@ * On exit: * - executing on bank 1 registers * - psr.ic enabled, interrupts restored + * - p10: TRUE if syscall is invoked with more than 8 out + * registers or r15's Nat is true * - r1: kernel's gp * - r3: preserved (same as on entry) + * - r8: -EINVAL if p10 is true * - r12: points to kernel stack * - r13: points to current task * - p15: TRUE if interrupts need to be re-enabled @@ -871,12 +877,17 @@ ;; st8 [r16]=r19,PT(AR_RNAT)-PT(CR_IFS) // store ar.pfs.pfm in cr.ifs + extr.u r11=r19,7,7 // I0 // get sol of ar.pfs + and r8=0x7f,r19 // A // get sof of ar.pfs + st8 [r17]=r27,PT(AR_BSPSTORE)-PT(AR_RSC)// save ar.rsc + tbit.nz p15,p0=r29,IA64_PSR_I_BIT // I0 (p9) mov in1=-1 + ;; (pUStk) sub r18=r18,r22 // r18=RSE.ndirty*8 - tbit.nz p15,p0=r29,IA64_PSR_I_BIT tnat.nz p10,p0=in2 + add r11=8,r11 ;; (pKStk) adds r16=PT(PR)-PT(AR_RNAT),r16 // skip over ar_rnat field (pKStk) adds r17=PT(B0)-PT(AR_BSPSTORE),r17 // skip over ar_bspstore field @@ -904,25 +915,29 @@ (p13) mov in5=-1 ;; st8 [r16]=r21,PT(R8)-PT(AR_FPSR) // save ar.fpsr - st8.spill [r17]=r15 // save r15 tnat.nz p14,p0=in6 + cmp.lt p10,p9=r11,r8 // frame size can't be more than local+8 ;; stf8 [r16]=f1 // ensure pt_regs.r8 != 0 (see handle_syscall_error) +(p9) tnat.nz p10,p0=r15 adds r12=-16,r1 // switch to kernel memory stack (with 16 bytes of scratch) + + st8.spill [r17]=r15 // save r15 tnat.nz p8,p0=in7 + nop.i 0 mov r13=r2 // establish `current' movl r1=__gp // establish kernel global pointer ;; (p14) mov in6=-1 (p8) mov in7=-1 - tnat.nz p9,p0=r15 + nop.i 0 cmp.eq pSys,pNonSys=r0,r0 // set pSys=1, pNonSys=0 movl r17=FPSR_DEFAULT ;; mov.m ar.fpsr=r17 // set ar.fpsr to kernel default value -(p9) mov r15=-1 +(p10) mov r8=-EINVAL br.ret.sptk.many b7 END(ia64_syscall_setup) diff -Nru a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c --- a/arch/ia64/kernel/mca.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/kernel/mca.c 2005-01-28 14:11:40 -08:00 @@ -882,8 +882,6 @@ &ia64_sal_to_os_handoff_state, &ia64_os_to_sal_handoff_state)); -return_to_sal: - if (recover) { sal_log_record_header_t *rh = IA64_LOG_CURR_BUFFER(SAL_INFO_TYPE_MCA); rh->severity = sal_log_severity_corrected; diff -Nru a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c --- a/arch/ia64/kernel/mca_drv.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/kernel/mca_drv.c 2005-01-28 14:11:41 -08:00 @@ -52,7 +52,7 @@ MCA_IS_GLOBAL = 1 } mca_type_t; -#define MAX_PAGE_ISOLATE 32 +#define MAX_PAGE_ISOLATE 1024 static struct page *page_isolate[MAX_PAGE_ISOLATE]; static int num_page_isolate = 0; diff -Nru a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c --- a/arch/ia64/kernel/process.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/kernel/process.c 2005-01-28 14:11:40 -08:00 @@ -40,6 +40,8 @@ #include #include +#include "entry.h" + #ifdef CONFIG_PERFMON # include #endif @@ -630,7 +632,7 @@ return 1; /* f0-f31 are always valid so we always return 1 */ } -asmlinkage long +long sys_execve (char __user *filename, char __user * __user *argv, char __user * __user *envp, struct pt_regs *regs) { @@ -667,7 +669,7 @@ regs.pt.cr_ifs = 1UL << 63; /* mark as valid, empty frame */ regs.sw.ar_fpsr = regs.pt.ar_fpsr = ia64_getreg(_IA64_REG_AR_FPSR); regs.sw.ar_bspstore = (unsigned long) current + IA64_RBS_OFFSET; - + regs.sw.pr = (1 << PRED_KERNEL_STACK); return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s.pt, 0, NULL, NULL); } EXPORT_SYMBOL(kernel_thread); diff -Nru a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c --- a/arch/ia64/kernel/ptrace.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/kernel/ptrace.c 2005-01-28 14:11:41 -08:00 @@ -31,9 +31,6 @@ #include "entry.h" -#define p4 (1UL << 4) /* for pSys (see entry.h) */ -#define p5 (1UL << 5) /* for pNonSys (see entry.h) */ - /* * Bits in the PSR that we allow ptrace() to change: * be, up, ac, mfl, mfh (the user mask; five bits total) @@ -669,8 +666,8 @@ } unw_get_pr(&prev_info, &pr); - pr &= ~pSys; - pr |= pNonSys; + pr &= ~(1UL << PRED_SYSCALL); + pr |= (1UL << PRED_NON_SYSCALL); unw_set_pr(&prev_info, pr); pt->cr_ifs = (1UL << 63) | cfm; diff -Nru a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c --- a/arch/ia64/kernel/smpboot.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/kernel/smpboot.c 2005-01-28 14:11:40 -08:00 @@ -612,8 +612,7 @@ */ return; } - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ/10); + msleep(100); } printk(KERN_ERR "CPU %u didn't die...\n", cpu); } diff -Nru a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c --- a/arch/ia64/kernel/unwind.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/kernel/unwind.c 2005-01-28 14:11:41 -08:00 @@ -47,8 +47,6 @@ #include "entry.h" #include "unwind_i.h" -#define p5 5 - #define UNW_LOG_CACHE_SIZE 7 /* each unw_script is ~256 bytes in size */ #define UNW_CACHE_SIZE (1 << UNW_LOG_CACHE_SIZE) @@ -1899,7 +1897,7 @@ num_regs = 0; if ((info->flags & UNW_FLAG_INTERRUPT_FRAME)) { info->pt = info->sp + 16; - if ((pr & (1UL << pNonSys)) != 0) + if ((pr & (1UL << PRED_NON_SYSCALL)) != 0) num_regs = *info->cfm_loc & 0x7f; /* size of frame */ info->pfs_loc = (unsigned long *) (info->pt + offsetof(struct pt_regs, ar_pfs)); @@ -1945,7 +1943,7 @@ int unw_unwind_to_user (struct unw_frame_info *info) { - unsigned long ip; + unsigned long ip, sp; while (unw_unwind(info) >= 0) { if (unw_get_rp(info, &ip) < 0) { @@ -1954,6 +1952,9 @@ __FUNCTION__, ip); return -1; } + unw_get_sp(info, &sp); + if (sp >= (unsigned long)info->task + IA64_STK_OFFSET) + break; if (ip < FIXADDR_USER_END) return 0; } diff -Nru a/arch/ia64/lib/bitop.c b/arch/ia64/lib/bitop.c --- a/arch/ia64/lib/bitop.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/lib/bitop.c 2005-01-28 14:11:41 -08:00 @@ -8,7 +8,7 @@ * Find next zero bit in a bitmap reasonably efficiently.. */ -int __find_next_zero_bit (void *addr, unsigned long size, unsigned long offset) +int __find_next_zero_bit (const void *addr, unsigned long size, unsigned long offset) { unsigned long *p = ((unsigned long *) addr) + (offset >> 6); unsigned long result = offset & ~63UL; diff -Nru a/arch/ia64/lib/memcpy.S b/arch/ia64/lib/memcpy.S --- a/arch/ia64/lib/memcpy.S 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/lib/memcpy.S 2005-01-28 14:11:40 -08:00 @@ -15,22 +15,6 @@ */ #include -GLOBAL_ENTRY(bcopy) - .regstk 3,0,0,0 - mov r8=in0 - mov in0=in1 - ;; - mov in1=r8 - // gas doesn't handle control flow across procedures, so it doesn't - // realize that a stop bit is needed before the "alloc" instruction - // below -{ - nop.m 0 - nop.f 0 - nop.i 0 -} ;; -END(bcopy) - // FALL THROUGH GLOBAL_ENTRY(memcpy) # define MEM_LAT 21 /* latency to memory */ diff -Nru a/arch/ia64/lib/memcpy_mck.S b/arch/ia64/lib/memcpy_mck.S --- a/arch/ia64/lib/memcpy_mck.S 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/lib/memcpy_mck.S 2005-01-28 14:11:41 -08:00 @@ -17,15 +17,6 @@ #define EK(y...) EX(y) -GLOBAL_ENTRY(bcopy) - .regstk 3,0,0,0 - mov r8=in0 - mov in0=in1 - ;; - mov in1=r8 - ;; -END(bcopy) - /* McKinley specific optimization */ #define retval r8 diff -Nru a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c --- a/arch/ia64/mm/contig.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/mm/contig.c 2005-01-28 14:11:40 -08:00 @@ -195,7 +195,7 @@ __per_cpu_offset[cpu] = (char *) cpu_data - __per_cpu_start; cpu_data += PERCPU_PAGE_SIZE; per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu]; - __per_cpu_mca[cpu] = (unsigned long)mca_data; + __per_cpu_mca[cpu] = (unsigned long)__pa(mca_data); mca_data += PERCPU_MCA_SIZE; } } diff -Nru a/arch/ia64/oprofile/init.c b/arch/ia64/oprofile/init.c --- a/arch/ia64/oprofile/init.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/oprofile/init.c 2005-01-28 14:11:40 -08:00 @@ -16,13 +16,17 @@ extern void perfmon_exit(void); extern void ia64_backtrace(struct pt_regs * const regs, unsigned int depth); -void __init oprofile_arch_init(struct oprofile_operations * ops) +int __init oprofile_arch_init(struct oprofile_operations * ops) { + int ret = -ENODEV; + #ifdef CONFIG_PERFMON /* perfmon_init() can fail, but we have no way to report it */ - perfmon_init(ops); + ret = perfmon_init(ops); #endif ops->backtrace = ia64_backtrace; + + return ret; } diff -Nru a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c --- a/arch/ia64/pci/pci.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/pci/pci.c 2005-01-28 14:11:40 -08:00 @@ -539,7 +539,8 @@ */ vma->vm_flags |= (VM_SHM | VM_RESERVED | VM_IO); - if (write_combine) + if (write_combine && efi_range_is_wc(vma->vm_start, + vma->vm_end - vma->vm_start)) vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); else vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); diff -Nru a/arch/ia64/sn/include/shub.h b/arch/ia64/sn/include/shub.h --- a/arch/ia64/sn/include/shub.h 2005-01-28 14:11:40 -08:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,39 +0,0 @@ -/* - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (c) 2001-2004 Silicon Graphics, Inc. All rights reserved. - */ - -#ifndef _ASM_IA64_SN_SHUB_H -#define _ASM_IA64_SN_SHUB_H - - -#define MD_MEM_BANKS 4 - - -/* - * Junk Bus Address Space - * The junk bus is used to access the PROM, LED's, and UART. It's - * accessed through the local block MMR space. The data path is - * 16 bits wide. This space requires address bits 31-27 to be set, and - * is further divided by address bits 26:15. - * The LED addresses are write-only. To read the LEDs, you need to use - * SH_JUNK_BUS_LED0-3, defined in shub_mmr.h - * - */ -#define SH_REAL_JUNK_BUS_LED0 0x7fed00000UL -#define SH_REAL_JUNK_BUS_LED1 0x7fed10000UL -#define SH_REAL_JUNK_BUS_LED2 0x7fed20000UL -#define SH_REAL_JUNK_BUS_LED3 0x7fed30000UL -#define SH_JUNK_BUS_UART0 0x7fed40000UL -#define SH_JUNK_BUS_UART1 0x7fed40008UL -#define SH_JUNK_BUS_UART2 0x7fed40010UL -#define SH_JUNK_BUS_UART3 0x7fed40018UL -#define SH_JUNK_BUS_UART4 0x7fed40020UL -#define SH_JUNK_BUS_UART5 0x7fed40028UL -#define SH_JUNK_BUS_UART6 0x7fed40030UL -#define SH_JUNK_BUS_UART7 0x7fed40038UL - -#endif /* _ASM_IA64_SN_SHUB_H */ diff -Nru a/arch/ia64/sn/kernel/bte_error.c b/arch/ia64/sn/kernel/bte_error.c --- a/arch/ia64/sn/kernel/bte_error.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/sn/kernel/bte_error.c 2005-01-28 14:11:40 -08:00 @@ -15,6 +15,7 @@ #include "xtalk/xwidgetdev.h" #include "xtalk/hubdev.h" #include +#include /* * Bte error handling is done in two parts. The first captures diff -Nru a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c --- a/arch/ia64/sn/kernel/irq.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/sn/kernel/irq.c 2005-01-28 14:11:40 -08:00 @@ -183,7 +183,9 @@ sn_irq_info = sn_irq_info->irq_next; +#ifdef CONFIG_SMP set_irq_affinity_info((irq & 0xff), cpuphys, 0); +#endif } else { break; /* snp_affinity failed the intr_alloc */ } @@ -201,16 +203,6 @@ sn_end_irq, sn_set_affinity_irq }; - -struct irq_desc *sn_irq_desc(unsigned int irq) -{ - return (irq_desc + irq); -} - -u8 sn_irq_to_vector(unsigned int irq) -{ - return irq; -} unsigned int sn_local_vector_to_irq(u8 vector) { diff -Nru a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c --- a/arch/ia64/sn/kernel/setup.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ia64/sn/kernel/setup.c 2005-01-28 14:11:40 -08:00 @@ -163,13 +163,12 @@ void __init early_sn_setup(void) { - void ia64_sal_handler_init(void *entry_point, void *gpval); efi_system_table_t *efi_systab; efi_config_table_t *config_tables; struct ia64_sal_systab *sal_systab; struct ia64_sal_desc_entry_point *ep; char *p; - int i; + int i, j; /* * Parse enough of the SAL tables to locate the SAL entry point. Since, console @@ -185,19 +184,21 @@ 0) { sal_systab = __va(config_tables[i].table); p = (char *)(sal_systab + 1); - for (i = 0; i < sal_systab->entry_count; i++) { + for (j = 0; j < sal_systab->entry_count; j++) { if (*p == SAL_DESC_ENTRY_POINT) { ep = (struct ia64_sal_desc_entry_point *)p; ia64_sal_handler_init(__va (ep->sal_proc), __va(ep->gp)); - break; + return; } p += SAL_DESC_SIZE(*p); } } } + /* Uh-oh, SAL not available?? */ + printk(KERN_ERR "failed to find SAL entry point\n"); } extern int platform_intr_list[]; diff -Nru a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c 2005-01-28 14:11:41 -08:00 @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 2004-2005 Silicon Graphics, Inc. All rights reserved. * * SGI Altix topology and hardware performance monitoring API. * Mark Goodwin . @@ -374,6 +374,42 @@ return r; } +/* map SAL hwperf error code to system error code */ +static int sn_hwperf_map_err(int hwperf_err) +{ + int e; + + switch(hwperf_err) { + case SN_HWPERF_OP_OK: + e = 0; + break; + + case SN_HWPERF_OP_NOMEM: + e = -ENOMEM; + break; + + case SN_HWPERF_OP_NO_PERM: + e = -EPERM; + break; + + case SN_HWPERF_OP_IO_ERROR: + e = -EIO; + break; + + case SN_HWPERF_OP_BUSY: + case SN_HWPERF_OP_RECONFIGURE: + e = -EAGAIN; + break; + + case SN_HWPERF_OP_INVAL: + default: + e = -EINVAL; + break; + } + + return e; +} + /* * ioctl for "sn_hwperf" misc device */ @@ -511,12 +547,20 @@ op_info.v0 = &v0; op_info.op = op; r = sn_hwperf_op_cpu(&op_info); + if (r) { + r = sn_hwperf_map_err(r); + goto error; + } break; default: /* all other ops are a direct SAL call */ r = ia64_sn_hwperf_op(sn_hwperf_master_nasid, op, a.arg, a.sz, (u64) p, 0, 0, &v0); + if (r) { + r = sn_hwperf_map_err(r); + goto error; + } a.v0 = v0; break; } diff -Nru a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c --- a/arch/ia64/sn/pci/pci_dma.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ia64/sn/pci/pci_dma.c 2005-01-28 14:11:41 -08:00 @@ -3,52 +3,85 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 2000,2002-2004 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 2000,2002-2005 Silicon Graphics, Inc. All rights reserved. * - * Routines for PCI DMA mapping. See Documentation/DMA-mapping.txt for + * Routines for PCI DMA mapping. See Documentation/DMA-API.txt for * a description of how these routines should be used. */ #include +#include #include #include "pci/pcibus_provider_defs.h" #include "pci/pcidev.h" #include "pci/pcibr_provider.h" -void sn_pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, - int direction); +#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset) +#define SG_ENT_PHYS_ADDRESS(SG) virt_to_phys(SG_ENT_VIRT_ADDRESS(SG)) /** - * sn_pci_alloc_consistent - allocate memory for coherent DMA - * @hwdev: device to allocate for + * sn_dma_supported - test a DMA mask + * @dev: device to test + * @mask: DMA mask to test + * + * Return whether the given PCI device DMA address mask can be supported + * properly. For example, if your device can only drive the low 24-bits + * during PCI bus mastering, then you would pass 0x00ffffff as the mask to + * this function. Of course, SN only supports devices that have 32 or more + * address bits when using the PMU. + */ +int sn_dma_supported(struct device *dev, u64 mask) +{ + BUG_ON(dev->bus != &pci_bus_type); + + if (mask < 0x7fffffff) + return 0; + return 1; +} +EXPORT_SYMBOL(sn_dma_supported); + +/** + * sn_dma_set_mask - set the DMA mask + * @dev: device to set + * @dma_mask: new mask + * + * Set @dev's DMA mask if the hw supports it. + */ +int sn_dma_set_mask(struct device *dev, u64 dma_mask) +{ + BUG_ON(dev->bus != &pci_bus_type); + + if (!sn_dma_supported(dev, dma_mask)) + return 0; + + *dev->dma_mask = dma_mask; + return 1; +} +EXPORT_SYMBOL(sn_dma_set_mask); + +/** + * sn_dma_alloc_coherent - allocate memory for coherent DMA + * @dev: device to allocate for * @size: size of the region * @dma_handle: DMA (bus) address + * @flags: memory allocation flags * - * pci_alloc_consistent() returns a pointer to a memory region suitable for + * dma_alloc_coherent() returns a pointer to a memory region suitable for * coherent DMA traffic to/from a PCI device. On SN platforms, this means * that @dma_handle will have the %PCIIO_DMA_CMD flag set. * * This interface is usually used for "command" streams (e.g. the command - * queue for a SCSI controller). See Documentation/DMA-mapping.txt for + * queue for a SCSI controller). See Documentation/DMA-API.txt for * more information. - * - * Also known as platform_pci_alloc_consistent() by the IA64 machvec code. */ -void *sn_pci_alloc_consistent(struct pci_dev *hwdev, size_t size, - dma_addr_t * dma_handle) +void *sn_dma_alloc_coherent(struct device *dev, size_t size, + dma_addr_t * dma_handle, int flags) { void *cpuaddr; unsigned long phys_addr; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); - if (bussoft == NULL) { - return NULL; - } - - if (! IS_PCI_BRIDGE_ASIC(bussoft->bs_asic_type)) { - return NULL; /* unsupported asic type */ - } + BUG_ON(dev->bus != &pci_bus_type); /* * Allocate the memory. @@ -66,151 +99,52 @@ /* * 64 bit address translations should never fail. * 32 bit translations can fail if there are insufficient mapping - * resources. + * resources. */ - *dma_handle = pcibr_dma_map(pcidev_info, phys_addr, size, SN_PCIDMA_CONSISTENT); + *dma_handle = pcibr_dma_map(pcidev_info, phys_addr, size, + SN_PCIDMA_CONSISTENT); if (!*dma_handle) { - printk(KERN_ERR - "sn_pci_alloc_consistent(): failed *dma_handle = 0x%lx hwdev->dev.coherent_dma_mask = 0x%lx \n", - *dma_handle, hwdev->dev.coherent_dma_mask); + printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); free_pages((unsigned long)cpuaddr, get_order(size)); return NULL; } return cpuaddr; } +EXPORT_SYMBOL(sn_dma_alloc_coherent); /** - * sn_pci_free_consistent - free memory associated with coherent DMAable region - * @hwdev: device to free for + * sn_pci_free_coherent - free memory associated with coherent DMAable region + * @dev: device to free for * @size: size to free - * @vaddr: kernel virtual address to free + * @cpu_addr: kernel virtual address to free * @dma_handle: DMA address associated with this region * - * Frees the memory allocated by pci_alloc_consistent(). Also known - * as platform_pci_free_consistent() by the IA64 machvec code. + * Frees the memory allocated by dma_alloc_coherent(), potentially unmapping + * any associated IOMMU mappings. */ -void -sn_pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr, - dma_addr_t dma_handle) +void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, + dma_addr_t dma_handle) { - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); - if (! bussoft) { - return; - } + BUG_ON(dev->bus != &pci_bus_type); pcibr_dma_unmap(pcidev_info, dma_handle, 0); - free_pages((unsigned long)vaddr, get_order(size)); -} - -/** - * sn_pci_map_sg - map a scatter-gather list for DMA - * @hwdev: device to map for - * @sg: scatterlist to map - * @nents: number of entries - * @direction: direction of the DMA transaction - * - * Maps each entry of @sg for DMA. Also known as platform_pci_map_sg by the - * IA64 machvec code. - */ -int -sn_pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, - int direction) -{ - - int i; - unsigned long phys_addr; - struct scatterlist *saved_sg = sg; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); - - /* can't go anywhere w/o a direction in life */ - if (direction == PCI_DMA_NONE) - BUG(); - - if (! bussoft) { - return 0; - } - - /* SN cannot support DMA addresses smaller than 32 bits. */ - if (hwdev->dma_mask < 0x7fffffff) - return 0; - - /* - * Setup a DMA address for each entry in the - * scatterlist. - */ - for (i = 0; i < nents; i++, sg++) { - phys_addr = - __pa((unsigned long)page_address(sg->page) + sg->offset); - sg->dma_address = pcibr_dma_map(pcidev_info, phys_addr, sg->length, 0); - - if (!sg->dma_address) { - printk(KERN_ERR "sn_pci_map_sg: Unable to allocate " - "anymore page map entries.\n"); - /* - * We will need to free all previously allocated entries. - */ - if (i > 0) { - sn_pci_unmap_sg(hwdev, saved_sg, i, direction); - } - return (0); - } - - sg->dma_length = sg->length; - } - - return nents; - -} - -/** - * sn_pci_unmap_sg - unmap a scatter-gather list - * @hwdev: device to unmap - * @sg: scatterlist to unmap - * @nents: number of scatterlist entries - * @direction: DMA direction - * - * Unmap a set of streaming mode DMA translations. Again, cpu read rules - * concerning calls here are the same as for pci_unmap_single() below. Also - * known as sn_pci_unmap_sg() by the IA64 machvec code. - */ -void -sn_pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, - int direction) -{ - int i; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); - - /* can't go anywhere w/o a direction in life */ - if (direction == PCI_DMA_NONE) - BUG(); - - if (! bussoft) { - return; - } - - for (i = 0; i < nents; i++, sg++) { - pcibr_dma_unmap(pcidev_info, sg->dma_address, direction); - sg->dma_address = (dma_addr_t) NULL; - sg->dma_length = 0; - } + free_pages((unsigned long)cpu_addr, get_order(size)); } +EXPORT_SYMBOL(sn_dma_free_coherent); /** - * sn_pci_map_single - map a single region for DMA - * @hwdev: device to map for - * @ptr: kernel virtual address of the region to map + * sn_dma_map_single - map a single page for DMA + * @dev: device to map for + * @cpu_addr: kernel virtual address of the region to map * @size: size of the region * @direction: DMA direction * - * Map the region pointed to by @ptr for DMA and return the - * DMA address. Also known as platform_pci_map_single() by - * the IA64 machvec code. + * Map the region pointed to by @cpu_addr for DMA and return the + * DMA address. * * We map this to the one step pcibr_dmamap_trans interface rather than * the two step pcibr_dmamap_alloc/pcibr_dmamap_addr because we have @@ -218,262 +152,150 @@ * (which is pretty much unacceptable). * * TODO: simplify our interface; - * get rid of dev_desc and vhdl (seems redundant given a pci_dev); * figure out how to save dmamap handle so can use two step. */ -dma_addr_t -sn_pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) +dma_addr_t sn_dma_map_single(struct device *dev, void *cpu_addr, size_t size, + int direction) { dma_addr_t dma_addr; unsigned long phys_addr; - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); - - if (direction == PCI_DMA_NONE) - BUG(); + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); - if (bussoft == NULL) { - return 0; - } - - if (! IS_PCI_BRIDGE_ASIC(bussoft->bs_asic_type)) { - return 0; /* unsupported asic type */ - } - - /* SN cannot support DMA addresses smaller than 32 bits. */ - if (hwdev->dma_mask < 0x7fffffff) - return 0; - - /* - * Call our dmamap interface - */ + BUG_ON(dev->bus != &pci_bus_type); - phys_addr = __pa(ptr); + phys_addr = __pa(cpu_addr); dma_addr = pcibr_dma_map(pcidev_info, phys_addr, size, 0); if (!dma_addr) { - printk(KERN_ERR "pci_map_single: Unable to allocate anymore " - "page map entries.\n"); + printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); return 0; } - return ((dma_addr_t) dma_addr); + return dma_addr; } +EXPORT_SYMBOL(sn_dma_map_single); /** - * sn_pci_dma_sync_single_* - make sure all DMAs or CPU accesses - * have completed - * @hwdev: device to sync - * @dma_handle: DMA address to sync + * sn_dma_unmap_single - unamp a DMA mapped page + * @dev: device to sync + * @dma_addr: DMA address to sync * @size: size of region * @direction: DMA direction * * This routine is supposed to sync the DMA region specified - * by @dma_handle into the 'coherence domain'. We do not need to do - * anything on our platform. + * by @dma_handle into the coherence domain. On SN, we're always cache + * coherent, so we just need to free any ATEs associated with this mapping. */ -void -sn_pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, - int direction) +void sn_dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, + int direction) { - struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(hwdev); - struct pcibus_bussoft *bussoft = SN_PCIDEV_BUSSOFT(hwdev); - - if (direction == PCI_DMA_NONE) - BUG(); - - if (bussoft == NULL) { - return; - } - - if (! IS_PCI_BRIDGE_ASIC(bussoft->bs_asic_type)) { - return; /* unsupported asic type */ - } + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); + BUG_ON(dev->bus != &pci_bus_type); pcibr_dma_unmap(pcidev_info, dma_addr, direction); } +EXPORT_SYMBOL(sn_dma_unmap_single); /** - * sn_dma_supported - test a DMA mask - * @hwdev: device to test - * @mask: DMA mask to test + * sn_dma_unmap_sg - unmap a DMA scatterlist + * @dev: device to unmap + * @sg: scatterlist to unmap + * @nhwentries: number of scatterlist entries + * @direction: DMA direction * - * Return whether the given PCI device DMA address mask can be supported - * properly. For example, if your device can only drive the low 24-bits - * during PCI bus mastering, then you would pass 0x00ffffff as the mask to - * this function. Of course, SN only supports devices that have 32 or more - * address bits when using the PMU. We could theoretically support <32 bit - * cards using direct mapping, but we'll worry about that later--on the off - * chance that someone actually wants to use such a card. + * Unmap a set of streaming mode DMA translations. */ -int sn_pci_dma_supported(struct pci_dev *hwdev, u64 mask) -{ - if (mask < 0x7fffffff) - return 0; - return 1; -} - -/* - * New generic DMA routines just wrap sn2 PCI routines until we - * support other bus types (if ever). - */ - -int sn_dma_supported(struct device *dev, u64 mask) -{ - BUG_ON(dev->bus != &pci_bus_type); - - return sn_pci_dma_supported(to_pci_dev(dev), mask); -} - -EXPORT_SYMBOL(sn_dma_supported); - -int sn_dma_set_mask(struct device *dev, u64 dma_mask) +void sn_dma_unmap_sg(struct device *dev, struct scatterlist *sg, + int nhwentries, int direction) { - BUG_ON(dev->bus != &pci_bus_type); - - if (!sn_dma_supported(dev, dma_mask)) - return 0; - - *dev->dma_mask = dma_mask; - return 1; -} - -EXPORT_SYMBOL(sn_dma_set_mask); - -void *sn_dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t * dma_handle, int flag) -{ - BUG_ON(dev->bus != &pci_bus_type); - - return sn_pci_alloc_consistent(to_pci_dev(dev), size, dma_handle); -} - -EXPORT_SYMBOL(sn_dma_alloc_coherent); + int i; + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); -void -sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, - dma_addr_t dma_handle) -{ BUG_ON(dev->bus != &pci_bus_type); - sn_pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); + for (i = 0; i < nhwentries; i++, sg++) { + pcibr_dma_unmap(pcidev_info, sg->dma_address, direction); + sg->dma_address = (dma_addr_t) NULL; + sg->dma_length = 0; + } } +EXPORT_SYMBOL(sn_dma_unmap_sg); -EXPORT_SYMBOL(sn_dma_free_coherent); - -dma_addr_t -sn_dma_map_single(struct device *dev, void *cpu_addr, size_t size, +/** + * sn_dma_map_sg - map a scatterlist for DMA + * @dev: device to map for + * @sg: scatterlist to map + * @nhwentries: number of entries + * @direction: direction of the DMA transaction + * + * Maps each entry of @sg for DMA. + */ +int sn_dma_map_sg(struct device *dev, struct scatterlist *sg, int nhwentries, int direction) { - BUG_ON(dev->bus != &pci_bus_type); - - return sn_pci_map_single(to_pci_dev(dev), cpu_addr, size, - (int)direction); -} - -EXPORT_SYMBOL(sn_dma_map_single); - -void -sn_dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, - int direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - sn_pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); -} - -EXPORT_SYMBOL(sn_dma_unmap_single); + unsigned long phys_addr; + struct scatterlist *saved_sg = sg; + struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(to_pci_dev(dev)); + int i; -dma_addr_t -sn_dma_map_page(struct device *dev, struct page *page, - unsigned long offset, size_t size, int direction) -{ BUG_ON(dev->bus != &pci_bus_type); - return pci_map_page(to_pci_dev(dev), page, offset, size, - (int)direction); -} - -EXPORT_SYMBOL(sn_dma_map_page); - -void -sn_dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, - int direction) -{ - BUG_ON(dev->bus != &pci_bus_type); + /* + * Setup a DMA address for each entry in the scatterlist. + */ + for (i = 0; i < nhwentries; i++, sg++) { + phys_addr = SG_ENT_PHYS_ADDRESS(sg); + sg->dma_address = pcibr_dma_map(pcidev_info, phys_addr, + sg->length, 0); - pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); -} + if (!sg->dma_address) { + printk(KERN_ERR "%s: out of ATEs\n", __FUNCTION__); -EXPORT_SYMBOL(sn_dma_unmap_page); + /* + * Free any successfully allocated entries. + */ + if (i > 0) + sn_dma_unmap_sg(dev, saved_sg, i, direction); + return 0; + } -int -sn_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, - int direction) -{ - BUG_ON(dev->bus != &pci_bus_type); + sg->dma_length = sg->length; + } - return sn_pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); + return nhwentries; } - EXPORT_SYMBOL(sn_dma_map_sg); -void -sn_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, - int direction) -{ - BUG_ON(dev->bus != &pci_bus_type); - - sn_pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); -} - -EXPORT_SYMBOL(sn_dma_unmap_sg); - -void -sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, - size_t size, int direction) +void sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, + size_t size, int direction) { BUG_ON(dev->bus != &pci_bus_type); } - EXPORT_SYMBOL(sn_dma_sync_single_for_cpu); -void -sn_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, - size_t size, int direction) +void sn_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, + size_t size, int direction) { BUG_ON(dev->bus != &pci_bus_type); } - EXPORT_SYMBOL(sn_dma_sync_single_for_device); -void -sn_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, - int direction) +void sn_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, + int nelems, int direction) { BUG_ON(dev->bus != &pci_bus_type); } - EXPORT_SYMBOL(sn_dma_sync_sg_for_cpu); -void -sn_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, - int nelems, int direction) +void sn_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, + int nelems, int direction) { BUG_ON(dev->bus != &pci_bus_type); } +EXPORT_SYMBOL(sn_dma_sync_sg_for_device); int sn_dma_mapping_error(dma_addr_t dma_addr) { return 0; } - -EXPORT_SYMBOL(sn_dma_sync_sg_for_device); -EXPORT_SYMBOL(sn_pci_unmap_single); -EXPORT_SYMBOL(sn_pci_map_single); -EXPORT_SYMBOL(sn_pci_map_sg); -EXPORT_SYMBOL(sn_pci_unmap_sg); -EXPORT_SYMBOL(sn_pci_alloc_consistent); -EXPORT_SYMBOL(sn_pci_free_consistent); -EXPORT_SYMBOL(sn_pci_dma_supported); EXPORT_SYMBOL(sn_dma_mapping_error); char *sn_pci_get_legacy_mem(struct pci_bus *bus) diff -Nru a/arch/m32r/oprofile/init.c b/arch/m32r/oprofile/init.c --- a/arch/m32r/oprofile/init.c 2005-01-28 14:11:40 -08:00 +++ b/arch/m32r/oprofile/init.c 2005-01-28 14:11:40 -08:00 @@ -12,8 +12,9 @@ #include #include -void __init oprofile_arch_init(struct oprofile_operations * ops) +int __init oprofile_arch_init(struct oprofile_operations * ops) { + return -ENODEV; } void oprofile_arch_exit(void) diff -Nru a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c --- a/arch/mips/kernel/linux32.c 2005-01-28 14:11:41 -08:00 +++ b/arch/mips/kernel/linux32.c 2005-01-28 14:11:41 -08:00 @@ -468,8 +468,7 @@ if (!(file->f_mode & FMODE_READ)) goto out; pos = merge_64(a4, a5); - ret = locks_verify_area(FLOCK_VERIFY_READ, file->f_dentry->d_inode, - file, pos, count); + ret = rw_verify_area(READ, file, &pos, count); if (ret) goto out; ret = -EINVAL; @@ -504,8 +503,7 @@ if (!(file->f_mode & FMODE_WRITE)) goto out; pos = merge_64(a4, a5); - ret = locks_verify_area(FLOCK_VERIFY_WRITE, file->f_dentry->d_inode, - file, pos, count); + ret = rw_verify_area(WRITE, file, &pos, count); if (ret) goto out; ret = -EINVAL; @@ -1192,13 +1190,6 @@ copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)); } return error; -} - -#else /* CONFIG_SYSCTL */ - -asmlinkage long sys32_sysctl(struct sysctl_args32 *args) -{ - return -ENOSYS; } #endif /* CONFIG_SYSCTL */ diff -Nru a/arch/mips/lib/csum_partial_copy.c b/arch/mips/lib/csum_partial_copy.c --- a/arch/mips/lib/csum_partial_copy.c 2005-01-28 14:11:41 -08:00 +++ b/arch/mips/lib/csum_partial_copy.c 2005-01-28 14:11:41 -08:00 @@ -16,7 +16,7 @@ /* * copy while checksumming, otherwise like csum_partial */ -unsigned int csum_partial_copy_nocheck(const char *src, char *dst, +unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst, int len, unsigned int sum) { /* @@ -33,7 +33,7 @@ * Copy from userspace and compute checksum. If we catch an exception * then zero the rest of the buffer. */ -unsigned int csum_partial_copy_from_user (const char *src, char *dst, +unsigned int csum_partial_copy_from_user (const unsigned char *src, unsigned char *dst, int len, unsigned int sum, int *err_ptr) { int missing; diff -Nru a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c --- a/arch/parisc/kernel/sys_parisc32.c 2005-01-28 14:11:40 -08:00 +++ b/arch/parisc/kernel/sys_parisc32.c 2005-01-28 14:11:40 -08:00 @@ -165,12 +165,6 @@ return error; } -#else /* CONFIG_SYSCTL */ - -asmlinkage long sys32_sysctl(struct __sysctl_args *args) -{ - return -ENOSYS; -} #endif /* CONFIG_SYSCTL */ asmlinkage long sys32_sched_rr_get_interval(pid_t pid, diff -Nru a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c --- a/arch/parisc/lib/memcpy.c 2005-01-28 14:11:41 -08:00 +++ b/arch/parisc/lib/memcpy.c 2005-01-28 14:11:41 -08:00 @@ -515,16 +515,8 @@ return dst; } -void bcopy(const void * srcp, void * destp, size_t count) -{ - mtsp(get_kernel_space(), 1); - mtsp(get_kernel_space(), 2); - pa_memcpy(destp, srcp, count); -} - EXPORT_SYMBOL(copy_to_user); EXPORT_SYMBOL(copy_from_user); EXPORT_SYMBOL(copy_in_user); EXPORT_SYMBOL(memcpy); -EXPORT_SYMBOL(bcopy); #endif diff -Nru a/arch/parisc/oprofile/init.c b/arch/parisc/oprofile/init.c --- a/arch/parisc/oprofile/init.c 2005-01-28 14:11:40 -08:00 +++ b/arch/parisc/oprofile/init.c 2005-01-28 14:11:40 -08:00 @@ -12,8 +12,9 @@ #include #include -void __init oprofile_arch_init(struct oprofile_operations * ops) +int __init oprofile_arch_init(struct oprofile_operations * ops) { + return -ENODEV; } diff -Nru a/arch/ppc/boot/common/misc-common.c b/arch/ppc/boot/common/misc-common.c --- a/arch/ppc/boot/common/misc-common.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc/boot/common/misc-common.c 2005-01-28 14:11:40 -08:00 @@ -52,7 +52,6 @@ void puts(const char *); void putc(const char c); void puthex(unsigned long val); -void _bcopy(char *src, char *dst, int len); void gunzip(void *, int, unsigned char *, int *); static int _cvt(unsigned long val, char *buf, long radix, char *digits); diff -Nru a/arch/ppc/configs/mpc8540_ads_defconfig b/arch/ppc/configs/mpc8540_ads_defconfig --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/configs/mpc8540_ads_defconfig 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,707 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc1 +# Thu Jan 20 01:23:13 2005 +# +CONFIG_MMU=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_HAVE_DEC_LOCK=y +CONFIG_PPC=y +CONFIG_PPC32=y +CONFIG_GENERIC_NVRAM=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_EMBEDDED=y +# CONFIG_KALLSYMS is not set +CONFIG_FUTEX=y +# CONFIG_EPOLL is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# Processor +# +# CONFIG_6xx is not set +# CONFIG_40x is not set +# CONFIG_44x is not set +# CONFIG_POWER3 is not set +# CONFIG_POWER4 is not set +# CONFIG_8xx is not set +CONFIG_E500=y +CONFIG_BOOKE=y +CONFIG_FSL_BOOKE=y +CONFIG_SPE=y +CONFIG_MATH_EMULATION=y +# CONFIG_CPU_FREQ is not set +CONFIG_PPC_GEN550=y +CONFIG_85xx=y +CONFIG_PPC_INDIRECT_PCI_BE=y + +# +# Freescale 85xx options +# +CONFIG_MPC8540_ADS=y +# CONFIG_MPC8555_CDS is not set +# CONFIG_MPC8560_ADS is not set +# CONFIG_SBC8560 is not set +CONFIG_MPC8540=y + +# +# Platform options +# +# CONFIG_SMP is not set +# CONFIG_PREEMPT is not set +# CONFIG_HIGHMEM is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_CMDLINE_BOOL is not set + +# +# Bus options +# +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_LEGACY_PROC is not set +CONFIG_PCI_NAMES=y + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# Advanced setup +# +# CONFIG_ADVANCED_OPTIONS is not set + +# +# Default settings for advanced configuration options are used +# +CONFIG_HIGHMEM_START=0xfe000000 +CONFIG_LOWMEM_SIZE=0x30000000 +CONFIG_KERNEL_START=0xc0000000 +CONFIG_TASK_SIZE=0x80000000 +CONFIG_BOOT_LOAD=0x00800000 + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=32768 +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_LBD is not set +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set + +# +# ATA/ATAPI/MFM/RLL support +# +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_SCSI is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Fusion MPT device support +# + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_IEEE1394 is not set + +# +# I2O device support +# +# CONFIG_I2O is not set + +# +# Macintosh device drivers +# + +# +# Networking support +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +# CONFIG_NETLINK_DEV is not set +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set +# CONFIG_IPV6 is not set +# CONFIG_NETFILTER is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set + +# +# Tulip family network device support +# +# CONFIG_NET_TULIP is not set +# CONFIG_HP100 is not set +# CONFIG_NET_PCI is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +CONFIG_GIANFAR=y +CONFIG_GFAR_NAPI=y + +# +# Ethernet (10000 Mbit) +# +# CONFIG_IXGB is not set +# CONFIG_S2IO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input I/O drivers +# +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +# CONFIG_SERIO is not set +# CONFIG_SERIO_I8042 is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Character devices +# +# CONFIG_VT is not set +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +CONFIG_GEN_RTC=y +# CONFIG_GEN_RTC_X is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_RAW_DRIVER is not set + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_ISA is not set +CONFIG_I2C_MPC=y +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Hardware Sensors Chip support +# +# CONFIG_I2C_SENSOR is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_FSCHER is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83627HF is not set + +# +# Other I2C Chip support +# +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Misc devices +# + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVPTS_FS_XATTR is not set +CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_NFSD is not set +CONFIG_ROOT_NFS=y +CONFIG_LOCKD=y +# CONFIG_EXPORTFS is not set +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +# CONFIG_MSDOS_PARTITION is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_EFI_PARTITION is not set + +# +# Native Language Support +# +# CONFIG_NLS is not set + +# +# Library routines +# +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Kernel hacking +# +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_SERIAL_TEXT_DEBUG is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Hardware crypto devices +# diff -Nru a/arch/ppc/configs/mpc8555_cds_defconfig b/arch/ppc/configs/mpc8555_cds_defconfig --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/configs/mpc8555_cds_defconfig 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,718 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc1 +# Thu Jan 20 01:25:35 2005 +# +CONFIG_MMU=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_HAVE_DEC_LOCK=y +CONFIG_PPC=y +CONFIG_PPC32=y +CONFIG_GENERIC_NVRAM=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_EMBEDDED=y +# CONFIG_KALLSYMS is not set +CONFIG_FUTEX=y +# CONFIG_EPOLL is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# Processor +# +# CONFIG_6xx is not set +# CONFIG_40x is not set +# CONFIG_44x is not set +# CONFIG_POWER3 is not set +# CONFIG_POWER4 is not set +# CONFIG_8xx is not set +CONFIG_E500=y +CONFIG_BOOKE=y +CONFIG_FSL_BOOKE=y +CONFIG_SPE=y +CONFIG_MATH_EMULATION=y +# CONFIG_CPU_FREQ is not set +CONFIG_PPC_GEN550=y +CONFIG_85xx=y +CONFIG_PPC_INDIRECT_PCI_BE=y + +# +# Freescale 85xx options +# +# CONFIG_MPC8540_ADS is not set +CONFIG_MPC8555_CDS=y +# CONFIG_MPC8560_ADS is not set +# CONFIG_SBC8560 is not set +CONFIG_MPC8555=y +CONFIG_85xx_PCI2=y + +# +# Platform options +# +CONFIG_CPM2=y +# CONFIG_PC_KEYBOARD is not set +# CONFIG_SMP is not set +# CONFIG_PREEMPT is not set +# CONFIG_HIGHMEM is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_CMDLINE_BOOL is not set + +# +# Bus options +# +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_LEGACY_PROC is not set +CONFIG_PCI_NAMES=y + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# Advanced setup +# +# CONFIG_ADVANCED_OPTIONS is not set + +# +# Default settings for advanced configuration options are used +# +CONFIG_HIGHMEM_START=0xfe000000 +CONFIG_LOWMEM_SIZE=0x30000000 +CONFIG_KERNEL_START=0xc0000000 +CONFIG_TASK_SIZE=0x80000000 +CONFIG_BOOT_LOAD=0x00800000 + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=32768 +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_LBD is not set +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set + +# +# ATA/ATAPI/MFM/RLL support +# +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_SCSI is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Fusion MPT device support +# + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_IEEE1394 is not set + +# +# I2O device support +# +# CONFIG_I2O is not set + +# +# Macintosh device drivers +# + +# +# Networking support +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +# CONFIG_NETLINK_DEV is not set +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set +# CONFIG_IPV6 is not set +# CONFIG_NETFILTER is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set + +# +# Tulip family network device support +# +# CONFIG_NET_TULIP is not set +# CONFIG_HP100 is not set +# CONFIG_NET_PCI is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +CONFIG_GIANFAR=y +CONFIG_GFAR_NAPI=y + +# +# Ethernet (10000 Mbit) +# +# CONFIG_IXGB is not set +# CONFIG_S2IO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input I/O drivers +# +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +# CONFIG_SERIO is not set +# CONFIG_SERIO_I8042 is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Character devices +# +# CONFIG_VT is not set +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_NR_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_CPM is not set +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +CONFIG_GEN_RTC=y +# CONFIG_GEN_RTC_X is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_RAW_DRIVER is not set + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_ISA is not set +CONFIG_I2C_MPC=y +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Hardware Sensors Chip support +# +# CONFIG_I2C_SENSOR is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_FSCHER is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83627HF is not set + +# +# Other I2C Chip support +# +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Misc devices +# + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVPTS_FS_XATTR is not set +CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_NFSD is not set +CONFIG_ROOT_NFS=y +CONFIG_LOCKD=y +# CONFIG_EXPORTFS is not set +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +# CONFIG_MSDOS_PARTITION is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_EFI_PARTITION is not set + +# +# Native Language Support +# +# CONFIG_NLS is not set +# CONFIG_SCC_ENET is not set +# CONFIG_FEC_ENET is not set + +# +# CPM2 Options +# + +# +# Library routines +# +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Kernel hacking +# +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_KGDB_CONSOLE is not set +# CONFIG_SERIAL_TEXT_DEBUG is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Hardware crypto devices +# diff -Nru a/arch/ppc/configs/mpc8560_ads_defconfig b/arch/ppc/configs/mpc8560_ads_defconfig --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/arch/ppc/configs/mpc8560_ads_defconfig 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,719 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.11-rc1 +# Thu Jan 20 01:24:56 2005 +# +CONFIG_MMU=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_HAVE_DEC_LOCK=y +CONFIG_PPC=y +CONFIG_PPC32=y +CONFIG_GENERIC_NVRAM=y + +# +# Code maturity level options +# +CONFIG_EXPERIMENTAL=y +CONFIG_CLEAN_COMPILE=y +CONFIG_BROKEN_ON_SMP=y + +# +# General setup +# +CONFIG_LOCALVERSION="" +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +CONFIG_SYSCTL=y +# CONFIG_AUDIT is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_HOTPLUG is not set +CONFIG_KOBJECT_UEVENT=y +# CONFIG_IKCONFIG is not set +CONFIG_EMBEDDED=y +# CONFIG_KALLSYMS is not set +CONFIG_FUTEX=y +# CONFIG_EPOLL is not set +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set +CONFIG_SHMEM=y +CONFIG_CC_ALIGN_FUNCTIONS=0 +CONFIG_CC_ALIGN_LABELS=0 +CONFIG_CC_ALIGN_LOOPS=0 +CONFIG_CC_ALIGN_JUMPS=0 +# CONFIG_TINY_SHMEM is not set + +# +# Loadable module support +# +# CONFIG_MODULES is not set + +# +# Processor +# +# CONFIG_6xx is not set +# CONFIG_40x is not set +# CONFIG_44x is not set +# CONFIG_POWER3 is not set +# CONFIG_POWER4 is not set +# CONFIG_8xx is not set +CONFIG_E500=y +CONFIG_BOOKE=y +CONFIG_FSL_BOOKE=y +CONFIG_SPE=y +CONFIG_MATH_EMULATION=y +# CONFIG_CPU_FREQ is not set +CONFIG_85xx=y +CONFIG_PPC_INDIRECT_PCI_BE=y + +# +# Freescale 85xx options +# +# CONFIG_MPC8540_ADS is not set +# CONFIG_MPC8555_CDS is not set +CONFIG_MPC8560_ADS=y +# CONFIG_SBC8560 is not set +CONFIG_MPC8560=y + +# +# Platform options +# +CONFIG_CPM2=y +# CONFIG_PC_KEYBOARD is not set +# CONFIG_SMP is not set +# CONFIG_PREEMPT is not set +# CONFIG_HIGHMEM is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_MISC is not set +# CONFIG_CMDLINE_BOOL is not set + +# +# Bus options +# +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_LEGACY_PROC is not set +CONFIG_PCI_NAMES=y + +# +# PCCARD (PCMCIA/CardBus) support +# +# CONFIG_PCCARD is not set + +# +# PC-card bridges +# + +# +# Advanced setup +# +# CONFIG_ADVANCED_OPTIONS is not set + +# +# Default settings for advanced configuration options are used +# +CONFIG_HIGHMEM_START=0xfe000000 +CONFIG_LOWMEM_SIZE=0x30000000 +CONFIG_KERNEL_START=0xc0000000 +CONFIG_TASK_SIZE=0x80000000 +CONFIG_BOOT_LOAD=0x00800000 + +# +# Device Drivers +# + +# +# Generic Driver Options +# +CONFIG_STANDALONE=y +CONFIG_PREVENT_FIRMWARE_BUILD=y +# CONFIG_FW_LOADER is not set + +# +# Memory Technology Devices (MTD) +# +# CONFIG_MTD is not set + +# +# Parallel port support +# +# CONFIG_PARPORT is not set + +# +# Plug and Play support +# + +# +# Block devices +# +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_SX8 is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=32768 +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +# CONFIG_LBD is not set +# CONFIG_CDROM_PKTCDVD is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_ATA_OVER_ETH is not set + +# +# ATA/ATAPI/MFM/RLL support +# +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_SCSI is not set + +# +# Multi-device support (RAID and LVM) +# +# CONFIG_MD is not set + +# +# Fusion MPT device support +# + +# +# IEEE 1394 (FireWire) support +# +# CONFIG_IEEE1394 is not set + +# +# I2O device support +# +# CONFIG_I2O is not set + +# +# Macintosh device drivers +# + +# +# Networking support +# +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +# CONFIG_NETLINK_DEV is not set +CONFIG_UNIX=y +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +CONFIG_SYN_COOKIES=y +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_IP_TCPDIAG=y +# CONFIG_IP_TCPDIAG_IPV6 is not set +# CONFIG_IPV6 is not set +# CONFIG_NETFILTER is not set + +# +# SCTP Configuration (EXPERIMENTAL) +# +# CONFIG_IP_SCTP is not set +# CONFIG_ATM is not set +# CONFIG_BRIDGE is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_NET_DIVERT is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set + +# +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set +# CONFIG_NET_CLS_ROUTE is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_HAMRADIO is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set + +# +# ARCnet devices +# +# CONFIG_ARCNET is not set + +# +# Ethernet (10 or 100Mbit) +# +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_HAPPYMEAL is not set +# CONFIG_SUNGEM is not set +# CONFIG_NET_VENDOR_3COM is not set + +# +# Tulip family network device support +# +# CONFIG_NET_TULIP is not set +# CONFIG_HP100 is not set +# CONFIG_NET_PCI is not set + +# +# Ethernet (1000 Mbit) +# +# CONFIG_ACENIC is not set +# CONFIG_DL2K is not set +# CONFIG_E1000 is not set +# CONFIG_NS83820 is not set +# CONFIG_HAMACHI is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_R8169 is not set +# CONFIG_SK98LIN is not set +# CONFIG_TIGON3 is not set +CONFIG_GIANFAR=y +CONFIG_GFAR_NAPI=y + +# +# Ethernet (10000 Mbit) +# +# CONFIG_IXGB is not set +# CONFIG_S2IO is not set + +# +# Token Ring devices +# +# CONFIG_TR is not set + +# +# Wireless LAN (non-hamradio) +# +# CONFIG_NET_RADIO is not set + +# +# Wan interfaces +# +# CONFIG_WAN is not set +# CONFIG_FDDI is not set +# CONFIG_HIPPI is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_SHAPER is not set +# CONFIG_NETCONSOLE is not set + +# +# ISDN subsystem +# +# CONFIG_ISDN is not set + +# +# Telephony Support +# +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y + +# +# Userland interfaces +# +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_TSDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input I/O drivers +# +# CONFIG_GAMEPORT is not set +CONFIG_SOUND_GAMEPORT=y +# CONFIG_SERIO is not set +# CONFIG_SERIO_I8042 is not set + +# +# Input Device Drivers +# +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Character devices +# +# CONFIG_VT is not set +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +# CONFIG_SERIAL_8250 is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_CPM=y +CONFIG_SERIAL_CPM_CONSOLE=y +CONFIG_SERIAL_CPM_SCC1=y +# CONFIG_SERIAL_CPM_SCC2 is not set +# CONFIG_SERIAL_CPM_SCC3 is not set +CONFIG_SERIAL_CPM_SCC4=y +# CONFIG_SERIAL_CPM_SMC1 is not set +# CONFIG_SERIAL_CPM_SMC2 is not set +CONFIG_UNIX98_PTYS=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 + +# +# IPMI +# +# CONFIG_IPMI_HANDLER is not set + +# +# Watchdog Cards +# +# CONFIG_WATCHDOG is not set +# CONFIG_NVRAM is not set +CONFIG_GEN_RTC=y +# CONFIG_GEN_RTC_X is not set +# CONFIG_DTLK is not set +# CONFIG_R3964 is not set +# CONFIG_APPLICOM is not set + +# +# Ftape, the floppy tape device driver +# +# CONFIG_AGP is not set +# CONFIG_DRM is not set +# CONFIG_RAW_DRIVER is not set + +# +# I2C support +# +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y + +# +# I2C Algorithms +# +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALGOPCA is not set + +# +# I2C Hardware Bus support +# +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_I810 is not set +# CONFIG_I2C_ISA is not set +CONFIG_I2C_MPC=y +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_PROSAVAGE is not set +# CONFIG_I2C_SAVAGE4 is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_VOODOO3 is not set +# CONFIG_I2C_PCA_ISA is not set + +# +# Hardware Sensors Chip support +# +# CONFIG_I2C_SENSOR is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_FSCHER is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83627HF is not set + +# +# Other I2C Chip support +# +# CONFIG_SENSORS_EEPROM is not set +# CONFIG_SENSORS_PCF8574 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_RTC8564 is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CHIP is not set + +# +# Dallas's 1-wire bus +# +# CONFIG_W1 is not set + +# +# Misc devices +# + +# +# Multimedia devices +# +# CONFIG_VIDEO_DEV is not set + +# +# Digital Video Broadcasting Devices +# +# CONFIG_DVB is not set + +# +# Graphics support +# +# CONFIG_FB is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Sound +# +# CONFIG_SOUND is not set + +# +# USB support +# +# CONFIG_USB is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y + +# +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information +# + +# +# USB Gadget Support +# +# CONFIG_USB_GADGET is not set + +# +# MMC/SD Card support +# +# CONFIG_MMC is not set + +# +# InfiniBand support +# +# CONFIG_INFINIBAND is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +CONFIG_EXT3_FS=y +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_JBD=y +# CONFIG_JBD_DEBUG is not set +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_XFS_FS is not set +# CONFIG_MINIX_FS is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_QUOTA is not set +CONFIG_DNOTIFY=y +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_KCORE=y +CONFIG_SYSFS=y +# CONFIG_DEVFS_FS is not set +# CONFIG_DEVPTS_FS_XATTR is not set +CONFIG_TMPFS=y +# CONFIG_TMPFS_XATTR is not set +# CONFIG_HUGETLB_PAGE is not set +CONFIG_RAMFS=y + +# +# Miscellaneous filesystems +# +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_CRAMFS is not set +# CONFIG_VXFS_FS is not set +# CONFIG_HPFS_FS is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_SYSV_FS is not set +# CONFIG_UFS_FS is not set + +# +# Network File Systems +# +CONFIG_NFS_FS=y +# CONFIG_NFS_V3 is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_DIRECTIO is not set +# CONFIG_NFSD is not set +CONFIG_ROOT_NFS=y +CONFIG_LOCKD=y +# CONFIG_EXPORTFS is not set +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_FS is not set +# CONFIG_CIFS is not set +# CONFIG_NCP_FS is not set +# CONFIG_CODA_FS is not set +# CONFIG_AFS_FS is not set + +# +# Partition Types +# +CONFIG_PARTITION_ADVANCED=y +# CONFIG_ACORN_PARTITION is not set +# CONFIG_OSF_PARTITION is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_MAC_PARTITION is not set +# CONFIG_MSDOS_PARTITION is not set +# CONFIG_LDM_PARTITION is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_ULTRIX_PARTITION is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_EFI_PARTITION is not set + +# +# Native Language Support +# +# CONFIG_NLS is not set +# CONFIG_SCC_ENET is not set +# CONFIG_FEC_ENET is not set + +# +# CPM2 Options +# + +# +# Library routines +# +# CONFIG_CRC_CCITT is not set +CONFIG_CRC32=y +# CONFIG_LIBCRC32C is not set + +# +# Profiling support +# +# CONFIG_PROFILING is not set + +# +# Kernel hacking +# +# CONFIG_DEBUG_KERNEL is not set +# CONFIG_KGDB_CONSOLE is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set + +# +# Cryptographic options +# +# CONFIG_CRYPTO is not set + +# +# Hardware crypto devices +# diff -Nru a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c --- a/arch/ppc/kernel/pci.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc/kernel/pci.c 2005-01-28 14:11:40 -08:00 @@ -1712,7 +1712,11 @@ if (flags & IORESOURCE_IO) return ioport_map(start, len); if (flags & IORESOURCE_MEM) - return (void __iomem *) start; + /* Not checking IORESOURCE_CACHEABLE because PPC does + * not currently distinguish between ioremap and + * ioremap_nocache. + */ + return ioremap(start, len); /* What? */ return NULL; } diff -Nru a/arch/ppc/lib/string.S b/arch/ppc/lib/string.S --- a/arch/ppc/lib/string.S 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc/lib/string.S 2005-01-28 14:11:41 -08:00 @@ -216,12 +216,6 @@ bdnz 8b blr -_GLOBAL(bcopy) - mr r6,r3 - mr r3,r4 - mr r4,r6 - b memcpy - /* * This version uses dcbz on the complete cache lines in the * destination area to reduce memory traffic. This requires that diff -Nru a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.h 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.h 2005-01-28 14:11:40 -08:00 @@ -60,8 +60,10 @@ #define MPC85XX_PCI1_IO_SIZE 0x01000000 /* PCI 2 memory map */ -#define MPC85XX_PCI2_LOWER_IO 0x01000000 -#define MPC85XX_PCI2_UPPER_IO 0x01ffffff +/* Note: the standard PPC fixups will cause IO space to get bumped by + * hose->io_base_virt - isa_io_base => MPC85XX_PCI1_IO_SIZE */ +#define MPC85XX_PCI2_LOWER_IO 0x00000000 +#define MPC85XX_PCI2_UPPER_IO 0x00ffffff #define MPC85XX_PCI2_LOWER_MEM 0xa0000000 #define MPC85XX_PCI2_UPPER_MEM 0xbfffffff diff -Nru a/arch/ppc/platforms/chrp_pci.c b/arch/ppc/platforms/chrp_pci.c --- a/arch/ppc/platforms/chrp_pci.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc/platforms/chrp_pci.c 2005-01-28 14:11:41 -08:00 @@ -97,8 +97,10 @@ rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 *val) { + struct pci_controller *hose = bus->sysdata; unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) - | ((bus->number & 0xff) << 16); + | (((bus->number - hose->first_busno) & 0xff) << 16) + | (hose->index << 24); unsigned long ret = ~0UL; int rval; @@ -111,8 +113,10 @@ rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset, int len, u32 val) { + struct pci_controller *hose = bus->sysdata; unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8) - | ((bus->number & 0xff) << 16); + | (((bus->number - hose->first_busno) & 0xff) << 16) + | (hose->index << 24); int rval; rval = call_rtas("write-pci-config", 3, 1, NULL, addr, len, val); @@ -186,6 +190,22 @@ iounmap(reg); } +/* Marvell Discovery II based Pegasos 2 */ +static void __init setup_peg2(struct pci_controller *hose, struct device_node *dev) +{ + struct device_node *root = find_path_device("/"); + struct device_node *rtas; + + rtas = of_find_node_by_name (root, "rtas"); + if (rtas) { + hose->ops = &rtas_pci_ops; + } else { + printk ("RTAS supporting Pegasos OF not found, please upgrade" + " your firmware\n"); + } + pci_assign_all_busses = 1; +} + void __init chrp_find_bridges(void) { @@ -195,7 +215,7 @@ struct pci_controller *hose; unsigned int *dma; char *model, *machine; - int is_longtrail = 0, is_mot = 0; + int is_longtrail = 0, is_mot = 0, is_pegasos = 0; struct device_node *root = find_path_device("/"); /* @@ -207,6 +227,10 @@ if (machine != NULL) { is_longtrail = strncmp(machine, "IBM,LongTrail", 13) == 0; is_mot = strncmp(machine, "MOT", 3) == 0; + if (strncmp(machine, "Pegasos2", 8) == 0) + is_pegasos = 2; + else if (strncmp(machine, "Pegasos", 7) == 0) + is_pegasos = 1; } for (dev = root->child; dev != NULL; dev = dev->sibling) { if (dev->type == NULL || strcmp(dev->type, "pci") != 0) @@ -257,6 +281,10 @@ hose->ops = &gg2_pci_ops; hose->cfg_data = p; gg2_pci_config_base = p; + } else if (is_pegasos == 1) { + setup_indirect_pci(hose, 0xfec00cf8, 0xfee00cfc); + } else if (is_pegasos == 2) { + setup_peg2(hose, dev); } else { printk("No methods for %s (model %s), using RTAS\n", dev->full_name, model); @@ -275,5 +303,7 @@ } } - ppc_md.pcibios_fixup = chrp_pcibios_fixup; + /* Do not fixup interrupts from OF tree on pegasos */ + if (is_pegasos != 0) + ppc_md.pcibios_fixup = chrp_pcibios_fixup; } diff -Nru a/arch/ppc/platforms/chrp_setup.c b/arch/ppc/platforms/chrp_setup.c --- a/arch/ppc/platforms/chrp_setup.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc/platforms/chrp_setup.c 2005-01-28 14:11:41 -08:00 @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -68,6 +69,9 @@ extern unsigned long pmac_find_end_of_memory(void); extern int of_show_percpuinfo(struct seq_file *, int); +int _chrp_type; +EXPORT_SYMBOL(_chrp_type); + /* * XXX this should be in xmon.h, but putting it there means xmon.h * has to include (to get irqreturn_t), which @@ -214,8 +218,33 @@ } -void __init -chrp_setup_arch(void) +static void __init pegasos_set_l2cr(void) +{ + struct device_node *np; + + /* On Pegasos, enable the l2 cache if needed, as the OF forgets it */ + if (_chrp_type != _CHRP_Pegasos) + return; + + /* Enable L2 cache if needed */ + np = find_type_devices("cpu"); + if (np != NULL) { + unsigned int *l2cr = (unsigned int *) + get_property (np, "l2cr", NULL); + if (l2cr == NULL) { + printk ("Pegasos l2cr : no cpu l2cr property found\n"); + return; + } + if (!((*l2cr) & 0x80000000)) { + printk ("Pegasos l2cr : L2 cache was not active, " + "activating\n"); + _set_L2CR(0); + _set_L2CR((*l2cr) | 0x80000000); + } + } +} + +void __init chrp_setup_arch(void) { struct device_node *device; @@ -232,6 +261,9 @@ #endif ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */ + /* On pegasos, enable the L2 cache if not already done by OF */ + pegasos_set_l2cr(); + /* Lookup PCI host bridges */ chrp_find_bridges(); @@ -402,15 +434,17 @@ chrp_find_openpic(); - prom_get_irq_senses(init_senses, NUM_8259_INTERRUPTS, NR_IRQS); - OpenPIC_InitSenses = init_senses; - OpenPIC_NumInitSenses = NR_IRQS - NUM_8259_INTERRUPTS; - - openpic_init(NUM_8259_INTERRUPTS); - /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */ - openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade", - i8259_irq); + if (OpenPIC_Addr) { + prom_get_irq_senses(init_senses, NUM_8259_INTERRUPTS, NR_IRQS); + OpenPIC_InitSenses = init_senses; + OpenPIC_NumInitSenses = NR_IRQS - NUM_8259_INTERRUPTS; + + openpic_init(NUM_8259_INTERRUPTS); + /* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */ + openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade", + i8259_irq); + } for (i = 0; i < NUM_8259_INTERRUPTS; i++) irq_desc[i].handler = &i8259_pic; i8259_init(chrp_int_ack); @@ -450,6 +484,9 @@ chrp_init(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { + struct device_node *root = find_path_device ("/"); + char *machine = NULL; + #ifdef CONFIG_BLK_DEV_INITRD /* take care of initrd if we have one */ if ( r6 ) @@ -464,12 +501,29 @@ DMA_MODE_WRITE = 0x48; isa_io_base = CHRP_ISA_IO_BASE; /* default value */ + if (root) + machine = get_property(root, "model", NULL); + if (machine && strncmp(machine, "Pegasos", 7) == 0) { + _chrp_type = _CHRP_Pegasos; + } else if (machine && strncmp(machine, "IBM", 3) == 0) { + _chrp_type = _CHRP_IBM; + } else if (machine && strncmp(machine, "MOT", 3) == 0) { + _chrp_type = _CHRP_Motorola; + } else { + /* Let's assume it is an IBM chrp if all else fails */ + _chrp_type = _CHRP_IBM; + } + ppc_md.setup_arch = chrp_setup_arch; ppc_md.show_percpuinfo = of_show_percpuinfo; ppc_md.show_cpuinfo = chrp_show_cpuinfo; + ppc_md.irq_canonicalize = chrp_irq_canonicalize; ppc_md.init_IRQ = chrp_init_IRQ; - ppc_md.get_irq = openpic_get_irq; + if (_chrp_type == _CHRP_Pegasos) + ppc_md.get_irq = i8259_irq; + else + ppc_md.get_irq = openpic_get_irq; ppc_md.init = chrp_init2; diff -Nru a/arch/ppc/platforms/chrp_time.c b/arch/ppc/platforms/chrp_time.c --- a/arch/ppc/platforms/chrp_time.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc/platforms/chrp_time.c 2005-01-28 14:11:40 -08:00 @@ -41,6 +41,8 @@ int base; rtcs = find_compatible_devices("rtc", "pnpPNP,b00"); + if (rtcs == NULL) + rtcs = find_compatible_devices("rtc", "ds1385-rtc"); if (rtcs == NULL || rtcs->addrs == NULL) return 0; base = rtcs->addrs[0].address; diff -Nru a/arch/ppc/syslib/gen550_dbg.c b/arch/ppc/syslib/gen550_dbg.c --- a/arch/ppc/syslib/gen550_dbg.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc/syslib/gen550_dbg.c 2005-01-28 14:11:40 -08:00 @@ -29,6 +29,11 @@ #define SERIAL_BAUD 9600 +/* SERIAL_PORT_DFNS is defined in */ +#ifndef SERIAL_PORT_DFNS +#define SERIAL_PORT_DFNS +#endif + static struct serial_state rs_table[RS_TABLE_SIZE] = { SERIAL_PORT_DFNS /* defined in */ }; @@ -154,6 +159,7 @@ rs_table[i].port = serial_req->iobase; rs_table[i].iomem_base = serial_req->membase; rs_table[i].iomem_reg_shift = serial_req->regshift; + rs_table[i].baud_base = serial_req->uartclk ? serial_req->uartclk / 16 : BASE_BAUD; } #ifdef CONFIG_SERIAL_TEXT_DEBUG diff -Nru a/arch/ppc/syslib/prom_init.c b/arch/ppc/syslib/prom_init.c --- a/arch/ppc/syslib/prom_init.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc/syslib/prom_init.c 2005-01-28 14:11:41 -08:00 @@ -810,6 +810,9 @@ char *p, *d; unsigned long phys; void *result[3]; + char model[32]; + phandle node; + int rc; /* Default */ phys = (unsigned long) &_stext; @@ -866,11 +869,20 @@ klimit = (char *) (mem - offset); - /* If we are already running at 0xc0000000, we assume we were - * loaded by an OF bootloader which did set a BAT for us. - * This breaks OF translate so we force phys to be 0. - */ - if (offset == 0) { + node = call_prom("finddevice", 1, 1, "/"); + rc = call_prom("getprop", 4, 1, node, "model", model, sizeof(model)); + if (rc > 0 && !strncmp (model, "Pegasos", 7) + && strncmp (model, "Pegasos2", 8)) { + /* Pegasos 1 has a broken translate method in the OF, + * and furthermore the BATs are mapped 1:1 so the phys + * address calculated above is correct, so let's use + * it directly. + */ + } else if (offset == 0) { + /* If we are already running at 0xc0000000, we assume we were + * loaded by an OF bootloader which did set a BAT for us. + * This breaks OF translate so we force phys to be 0. + */ prom_print("(already at 0xc0000000) phys=0\n"); phys = 0; } else if ((int) call_prom("getprop", 4, 1, prom_chosen, "mmu", diff -Nru a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig --- a/arch/ppc64/Kconfig 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc64/Kconfig 2005-01-28 14:11:40 -08:00 @@ -234,6 +234,11 @@ Say Y here if you are building a kernel for a desktop system. Say N if you are unsure. +config EEH + bool "PCI Extended Error Handling (EEH)" if EMBEDDED + depends on PPC_PSERIES + default y if !EMBEDDED + # # Use the generic interrupt handling code in kernel/irq/: # diff -Nru a/arch/ppc64/boot/main.c b/arch/ppc64/boot/main.c --- a/arch/ppc64/boot/main.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/boot/main.c 2005-01-28 14:11:41 -08:00 @@ -73,7 +73,7 @@ void *stdout; void *stderr; -#define DEBUG +#undef DEBUG static unsigned long claim_base = PROG_START; diff -Nru a/arch/ppc64/boot/string.S b/arch/ppc64/boot/string.S --- a/arch/ppc64/boot/string.S 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc64/boot/string.S 2005-01-28 14:11:40 -08:00 @@ -96,13 +96,6 @@ bdnz 8b blr - .globl bcopy -bcopy: - mr r6,r3 - mr r3,r4 - mr r4,r6 - b memcpy - .globl memmove memmove: cmplw 0,r3,r4 diff -Nru a/arch/ppc64/configs/pSeries_defconfig b/arch/ppc64/configs/pSeries_defconfig --- a/arch/ppc64/configs/pSeries_defconfig 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/configs/pSeries_defconfig 2005-01-28 14:11:41 -08:00 @@ -268,7 +268,7 @@ # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set -CONFIG_SCSI_IBMVSCSI=m +CONFIG_SCSI_IBMVSCSI=y # CONFIG_SCSI_INIA100 is not set CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 @@ -492,7 +492,7 @@ # # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set -CONFIG_IBMVETH=m +CONFIG_IBMVETH=y CONFIG_NET_PCI=y CONFIG_PCNET32=y # CONFIG_AMD8111_ETH is not set diff -Nru a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile --- a/arch/ppc64/kernel/Makefile 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/kernel/Makefile 2005-01-28 14:11:41 -08:00 @@ -30,9 +30,10 @@ obj-$(CONFIG_PPC_MULTIPLATFORM) += nvram.o i8259.o prom_init.o prom.o mpic.o obj-$(CONFIG_PPC_PSERIES) += pSeries_pci.o pSeries_lpar.o pSeries_hvCall.o \ - eeh.o pSeries_nvram.o rtasd.o ras.o \ + pSeries_nvram.o rtasd.o ras.o \ xics.o rtas.o pSeries_setup.o pSeries_iommu.o +obj-$(CONFIG_EEH) += eeh.o obj-$(CONFIG_PROC_FS) += proc_ppc64.o obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o obj-$(CONFIG_SMP) += smp.o diff -Nru a/arch/ppc64/kernel/eeh.c b/arch/ppc64/kernel/eeh.c --- a/arch/ppc64/kernel/eeh.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/kernel/eeh.c 2005-01-28 14:11:41 -08:00 @@ -764,8 +764,6 @@ struct device_node *phb, *np; struct eeh_early_enable_info info; - init_pci_config_tokens(); - np = of_find_node_by_path("/rtas"); if (np == NULL) return; diff -Nru a/arch/ppc64/kernel/entry.S b/arch/ppc64/kernel/entry.S --- a/arch/ppc64/kernel/entry.S 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc64/kernel/entry.S 2005-01-28 14:11:40 -08:00 @@ -185,10 +185,10 @@ beq- 1f /* only restore r13 if */ ld r13,GPR13(r1) /* returning to usermode */ 1: ld r2,GPR2(r1) - ld r1,GPR1(r1) li r12,MSR_RI andc r10,r10,r12 mtmsrd r10,1 /* clear MSR.RI */ + ld r1,GPR1(r1) mtlr r4 mtcr r5 mtspr SRR0,r7 diff -Nru a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S --- a/arch/ppc64/kernel/head.S 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc64/kernel/head.S 2005-01-28 14:11:40 -08:00 @@ -2145,10 +2145,12 @@ ioremap_dir: .space 4096 +#ifdef CONFIG_SMP /* 1 page segment table per cpu (max 48, cpu0 allocated at STAB0_PHYS_ADDR) */ .globl stab_array stab_array: .space 4096 * 48 +#endif /* * This space gets a copy of optional info passed to us by the bootstrap diff -Nru a/arch/ppc64/kernel/iSeries_pci_reset.c b/arch/ppc64/kernel/iSeries_pci_reset.c --- a/arch/ppc64/kernel/iSeries_pci_reset.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/kernel/iSeries_pci_reset.c 2005-01-28 14:11:41 -08:00 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -49,7 +50,7 @@ int iSeries_Device_ToggleReset(struct pci_dev *PciDev, int AssertTime, int DelayTime) { - unsigned long AssertDelay, WaitDelay; + unsigned int AssertDelay, WaitDelay; struct iSeries_Device_Node *DeviceNode = (struct iSeries_Device_Node *)PciDev->sysdata; @@ -62,14 +63,14 @@ * Set defaults, Assert is .5 second, Wait is 3 seconds. */ if (AssertTime == 0) - AssertDelay = (5 * HZ) / 10; + AssertDelay = 500; else - AssertDelay = (AssertTime * HZ) / 10; + AssertDelay = AssertTime * 100; if (DelayTime == 0) - WaitDelay = (30 * HZ) / 10; + WaitDelay = 3000; else - WaitDelay = (DelayTime * HZ) / 10; + WaitDelay = DelayTime * 100; /* * Assert reset @@ -77,8 +78,7 @@ DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode), 0x00, DeviceNode->AgentId, 1); if (DeviceNode->ReturnCode == 0) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(AssertDelay); /* Sleep for the time */ + msleep(AssertDelay); /* Sleep for the time */ DeviceNode->ReturnCode = HvCallPci_setSlotReset(ISERIES_BUS(DeviceNode), 0x00, DeviceNode->AgentId, 0); @@ -86,8 +86,7 @@ /* * Wait for device to reset */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(WaitDelay); + msleep(WaitDelay); } if (DeviceNode->ReturnCode == 0) PCIFR("Slot 0x%04X.%02 Reset\n", ISERIES_BUS(DeviceNode), diff -Nru a/arch/ppc64/kernel/iomap.c b/arch/ppc64/kernel/iomap.c --- a/arch/ppc64/kernel/iomap.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc64/kernel/iomap.c 2005-01-28 14:11:40 -08:00 @@ -113,7 +113,7 @@ if (flags & IORESOURCE_IO) return ioport_map(start, len); if (flags & IORESOURCE_MEM) - return (void __iomem *) start; + return ioremap(start, len); /* What? */ return NULL; } diff -Nru a/arch/ppc64/kernel/pSeries_setup.c b/arch/ppc64/kernel/pSeries_setup.c --- a/arch/ppc64/kernel/pSeries_setup.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc64/kernel/pSeries_setup.c 2005-01-28 14:11:40 -08:00 @@ -40,7 +40,6 @@ #include #include #include - #include #include #include @@ -59,13 +58,12 @@ #include #include #include - -#include "i8259.h" #include -#include #include +#include "i8259.h" #include "mpic.h" +#include "pci.h" #ifdef DEBUG #define DBG(fmt...) udbg_printf(fmt) @@ -73,7 +71,6 @@ #define DBG(fmt...) #endif -extern void find_and_init_phbs(void); extern void pSeries_final_fixup(void); extern void pSeries_get_boot_time(struct rtc_time *rtc_time); @@ -87,10 +84,6 @@ int fwnmi_active; /* TRUE if an FWNMI handler is present */ -unsigned long virtPython0Facilities = 0; // python0 facility area (memory mapped io) (64-bit format) VIRTUAL address. - -extern unsigned long loops_per_jiffy; - extern unsigned long ppc_proc_freq; extern unsigned long ppc_tb_freq; @@ -230,7 +223,7 @@ fwnmi_init(); /* Find and initialize PCI host bridges */ - /* iSeries needs to be done much later. */ + init_pci_config_tokens(); eeh_init(); find_and_init_phbs(); diff -Nru a/arch/ppc64/kernel/pSeries_smp.c b/arch/ppc64/kernel/pSeries_smp.c --- a/arch/ppc64/kernel/pSeries_smp.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc64/kernel/pSeries_smp.c 2005-01-28 14:11:40 -08:00 @@ -107,8 +107,7 @@ cpu_status = query_cpu_stopped(pcpu); if (cpu_status == 0 || cpu_status == -1) break; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/5); + msleep(200); } if (cpu_status != 0) { printk("Querying DEAD? cpu %i (%i) shows %i\n", diff -Nru a/arch/ppc64/kernel/process.c b/arch/ppc64/kernel/process.c --- a/arch/ppc64/kernel/process.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/kernel/process.c 2005-01-28 14:11:41 -08:00 @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include @@ -255,7 +255,7 @@ printk("NIP: %016lX XER: %08X LR: %016lX CTR: %016lX\n", regs->nip, (unsigned int)regs->xer, regs->link, regs->ctr); printk("REGS: %p TRAP: %04lx %s (%s)\n", - regs, regs->trap, print_tainted(), UTS_RELEASE); + regs, regs->trap, print_tainted(), system_utsname.release); printk("MSR: %016lx EE: %01x PR: %01x FP: %01x ME: %01x " "IR/DR: %01x%01x CR: %08X\n", regs->msr, regs->msr&MSR_EE ? 1 : 0, regs->msr&MSR_PR ? 1 : 0, diff -Nru a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c --- a/arch/ppc64/kernel/prom.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/kernel/prom.c 2005-01-28 14:11:41 -08:00 @@ -717,6 +717,7 @@ dad->next->sibling = np; dad->next = np; } + kref_init(&np->kref); } while(1) { u32 sz, noff; @@ -1475,24 +1476,31 @@ * @node: Node to inc refcount, NULL is supported to * simplify writing of callers * - * Returns the node itself or NULL if gone. + * Returns node. */ struct device_node *of_node_get(struct device_node *node) { - if (node && !OF_IS_STALE(node)) { - atomic_inc(&node->_users); - return node; - } - return NULL; + if (node) + kref_get(&node->kref); + return node; } EXPORT_SYMBOL(of_node_get); +static inline struct device_node * kref_to_device_node(struct kref *kref) +{ + return container_of(kref, struct device_node, kref); +} + /** - * of_node_cleanup - release a dynamically allocated node - * @arg: Node to be released + * of_node_release - release a dynamically allocated node + * @kref: kref element of the node to be released + * + * In of_node_put() this function is passed to kref_put() + * as the destructor. */ -static void of_node_cleanup(struct device_node *node) +static void of_node_release(struct kref *kref) { + struct device_node *node = kref_to_device_node(kref); struct property *prop = node->properties; if (!OF_IS_DYNAMIC(node)) @@ -1518,19 +1526,8 @@ */ void of_node_put(struct device_node *node) { - if (!node) - return; - - WARN_ON(0 == atomic_read(&node->_users)); - - if (OF_IS_STALE(node)) { - if (atomic_dec_and_test(&node->_users)) { - of_node_cleanup(node); - return; - } - } - else - atomic_dec(&node->_users); + if (node) + kref_put(&node->kref, of_node_release); } EXPORT_SYMBOL(of_node_put); @@ -1773,6 +1770,7 @@ np->properties = proplist; OF_MARK_DYNAMIC(np); + kref_init(&np->kref); of_node_get(np); np->parent = derive_parent(path); if (!np->parent) { @@ -1809,8 +1807,9 @@ } /* - * Remove an OF device node from the system. - * Caller should have already "gotten" np. + * "Unplug" a node from the device tree. The caller must hold + * a reference to the node. The memory associated with the node + * is not freed until its refcount goes to zero. */ int of_remove_node(struct device_node *np) { @@ -1828,7 +1827,6 @@ of_cleanup_node(np); write_lock(&devtree_lock); - OF_MARK_STALE(np); remove_node_proc_entries(np); if (allnodes == np) allnodes = np->allnext; @@ -1853,6 +1851,7 @@ } write_unlock(&devtree_lock); of_node_put(parent); + of_node_put(np); /* Must decrement the refcount */ return 0; } diff -Nru a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c --- a/arch/ppc64/kernel/signal.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc64/kernel/signal.c 2005-01-28 14:11:40 -08:00 @@ -67,7 +67,7 @@ struct siginfo info; /* 64 bit ABI allows for 288 bytes below sp before decrementing it. */ char abigap[288]; -}; +} __attribute__ ((aligned (16))); /* @@ -254,7 +254,7 @@ newsp = (current->sas_ss_sp + current->sas_ss_size); } - return (void __user *)((newsp - frame_size) & -8ul); + return (void __user *)((newsp - frame_size) & -16ul); } /* diff -Nru a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c --- a/arch/ppc64/kernel/smp.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/kernel/smp.c 2005-01-28 14:11:41 -08:00 @@ -459,8 +459,7 @@ * hotplug case. Wait five seconds. */ for (c = 25; c && !cpu_callin_map[cpu]; c--) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/5); + msleep(200); } #endif diff -Nru a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c --- a/arch/ppc64/kernel/sys_ppc32.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/kernel/sys_ppc32.c 2005-01-28 14:11:41 -08:00 @@ -492,6 +492,7 @@ return do_sys_settimeofday(tv ? &kts : NULL, tz ? &ktz : NULL); } +#ifdef CONFIG_SYSVIPC long sys32_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr, u32 fifth) { @@ -556,6 +557,7 @@ return -ENOSYS; } +#endif /* Note: it is necessary to treat out_fd and in_fd as unsigned ints, * with the corresponding cast to a signed int to insure that the @@ -1104,6 +1106,7 @@ return sys_umask((int)mask); } +#ifdef CONFIG_SYSCTL struct __sysctl_args32 { u32 name; int nlen; @@ -1153,6 +1156,7 @@ } return error; } +#endif asmlinkage int sys32_olduname(struct oldold_utsname __user * name) { diff -Nru a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c --- a/arch/ppc64/kernel/traps.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc64/kernel/traps.c 2005-01-28 14:11:40 -08:00 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -137,8 +138,7 @@ if (panic_on_oops) { printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n"); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(5 * HZ); + ssleep(5); panic("Fatal exception"); } do_exit(SIGSEGV); diff -Nru a/arch/ppc64/mm/hash_utils.c b/arch/ppc64/mm/hash_utils.c --- a/arch/ppc64/mm/hash_utils.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/mm/hash_utils.c 2005-01-28 14:11:41 -08:00 @@ -294,12 +294,6 @@ vsid = get_kernel_vsid(ea); break; #if 0 - case EEH_REGION_ID: - /* - * Should only be hit if there is an access to MMIO space - * which is protected by EEH. - * Send the problem up to do_page_fault - */ case KERNEL_REGION_ID: /* * Should never get here - entire 0xC0... region is bolted. diff -Nru a/arch/ppc64/mm/slb.c b/arch/ppc64/mm/slb.c --- a/arch/ppc64/mm/slb.c 2005-01-28 14:11:40 -08:00 +++ b/arch/ppc64/mm/slb.c 2005-01-28 14:11:40 -08:00 @@ -78,7 +78,7 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm) { unsigned long offset = get_paca()->slb_cache_ptr; - unsigned long esid_data; + unsigned long esid_data = 0; unsigned long pc = KSTK_EIP(tsk); unsigned long stack = KSTK_ESP(tsk); unsigned long unmapped_base; @@ -97,11 +97,8 @@ } /* Workaround POWER5 < DD2.1 issue */ - if (offset == 1 || offset > SLB_CACHE_ENTRIES) { - /* flush segment in EEH region, we shouldn't ever - * access addresses in this region. */ - asm volatile("slbie %0" : : "r"(EEHREGIONBASE)); - } + if (offset == 1 || offset > SLB_CACHE_ENTRIES) + asm volatile("slbie %0" : : "r" (esid_data)); get_paca()->slb_cache_ptr = 0; get_paca()->context = mm->context; diff -Nru a/arch/ppc64/oprofile/common.c b/arch/ppc64/oprofile/common.c --- a/arch/ppc64/oprofile/common.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/oprofile/common.c 2005-01-28 14:11:41 -08:00 @@ -125,7 +125,7 @@ return 0; } -void __init oprofile_arch_init(struct oprofile_operations *ops) +int __init oprofile_arch_init(struct oprofile_operations *ops) { unsigned int pvr; @@ -170,7 +170,7 @@ break; default: - return; + return -ENODEV; } ops->create_files = op_ppc64_create_files; @@ -181,6 +181,8 @@ printk(KERN_INFO "oprofile: using %s performance monitoring.\n", ops->cpu_type); + + return 0; } void oprofile_arch_exit(void) diff -Nru a/arch/ppc64/xmon/xmon.c b/arch/ppc64/xmon/xmon.c --- a/arch/ppc64/xmon/xmon.c 2005-01-28 14:11:41 -08:00 +++ b/arch/ppc64/xmon/xmon.c 2005-01-28 14:11:41 -08:00 @@ -624,6 +624,17 @@ return 0; } +/* On systems with a hypervisor, we can't set the DABR + (data address breakpoint register) directly. */ +static void set_controlled_dabr(unsigned long val) +{ + if (systemcfg->platform == PLATFORM_PSERIES_LPAR) { + int rc = plpar_hcall_norets(H_SET_DABR, val); + if (rc != H_Success) + xmon_printf("Warning: setting DABR failed (%d)\n", rc); + } else + set_dabr(val); +} static struct bpt *at_breakpoint(unsigned long pc) { @@ -711,7 +722,7 @@ static void insert_cpu_bpts(void) { if (dabr.enabled) - set_dabr(dabr.address | (dabr.enabled & 7)); + set_controlled_dabr(dabr.address | (dabr.enabled & 7)); if (iabr && (cur_cpu_spec->cpu_features & CPU_FTR_IABR)) set_iabr(iabr->address | (iabr->enabled & (BP_IABR|BP_IABR_TE))); @@ -739,7 +750,7 @@ static void remove_cpu_bpts(void) { - set_dabr(0); + set_controlled_dabr(0); if ((cur_cpu_spec->cpu_features & CPU_FTR_IABR)) set_iabr(0); } @@ -1049,8 +1060,8 @@ "b [cnt] set breakpoint at given instr addr\n" "bc clear all breakpoints\n" "bc clear breakpoint number n or at addr\n" - "bi [cnt] set hardware instr breakpoint (broken?)\n" - "bd [cnt] set hardware data breakpoint (broken?)\n" + "bi [cnt] set hardware instr breakpoint (POWER3/RS64 only)\n" + "bd [cnt] set hardware data breakpoint\n" ""; static void diff -Nru a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c --- a/arch/s390/kernel/compat_linux.c 2005-01-28 14:11:41 -08:00 +++ b/arch/s390/kernel/compat_linux.c 2005-01-28 14:11:41 -08:00 @@ -906,6 +906,7 @@ return ret; } +#ifdef CONFIG_SYSCTL struct __sysctl_args32 { u32 name; int nlen; @@ -953,6 +954,7 @@ } return error; } +#endif struct stat64_emu31 { unsigned long long st_dev; diff -Nru a/arch/s390/lib/string.c b/arch/s390/lib/string.c --- a/arch/s390/lib/string.c 2005-01-28 14:11:40 -08:00 +++ b/arch/s390/lib/string.c 2005-01-28 14:11:40 -08:00 @@ -357,21 +357,6 @@ EXPORT_SYMBOL(memcpy); /** - * bcopy - Copy one area of memory to another - * @src: Where to copy from - * @dest: Where to copy to - * @n: The size of the area. - * - * Note that this is the same as memcpy(), with the arguments reversed. - * memcpy() is the standard, bcopy() is a legacy BSD function. - */ -void bcopy(const void *srcp, void *destp, size_t n) -{ - __builtin_memcpy(destp, srcp, n); -} -EXPORT_SYMBOL(bcopy); - -/** * memset - Fill a region of memory with the given value * @s: Pointer to the start of the area. * @c: The byte to fill the area with diff -Nru a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c --- a/arch/s390/oprofile/init.c 2005-01-28 14:11:41 -08:00 +++ b/arch/s390/oprofile/init.c 2005-01-28 14:11:41 -08:00 @@ -12,8 +12,9 @@ #include #include -void __init oprofile_arch_init(struct oprofile_operations* ops) +int __init oprofile_arch_init(struct oprofile_operations* ops) { + return -ENODEV; } void oprofile_arch_exit(void) diff -Nru a/arch/sh/oprofile/op_model_null.c b/arch/sh/oprofile/op_model_null.c --- a/arch/sh/oprofile/op_model_null.c 2005-01-28 14:11:40 -08:00 +++ b/arch/sh/oprofile/op_model_null.c 2005-01-28 14:11:40 -08:00 @@ -12,8 +12,9 @@ #include #include -void __init oprofile_arch_init(struct oprofile_operations *ops) +int __init oprofile_arch_init(struct oprofile_operations *ops) { + return -ENODEV; } void oprofile_arch_exit(void) diff -Nru a/arch/sparc/Kconfig b/arch/sparc/Kconfig --- a/arch/sparc/Kconfig 2005-01-28 14:11:40 -08:00 +++ b/arch/sparc/Kconfig 2005-01-28 14:11:40 -08:00 @@ -380,6 +380,8 @@ source "drivers/usb/Kconfig" +source "drivers/infiniband/Kconfig" + source "drivers/char/watchdog/Kconfig" source "arch/sparc/Kconfig.debug" diff -Nru a/arch/sparc/kernel/muldiv.c b/arch/sparc/kernel/muldiv.c --- a/arch/sparc/kernel/muldiv.c 2005-01-28 14:11:41 -08:00 +++ b/arch/sparc/kernel/muldiv.c 2005-01-28 14:11:41 -08:00 @@ -4,6 +4,9 @@ * * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) + * + * 2004-12-25 Krzysztof Helt (krzysztof.h1@wp.pl) + * - fixed registers constrains in inline assembly declarations */ #include @@ -132,7 +135,7 @@ "mov %%o0, %0\n\t" "mov %%o1, %1\n\t" : "=r" (rs1), "=r" (rs2) - : + : "0" (rs1), "1" (rs2) : "o0", "o1", "o2", "o3", "o4", "o5", "o7", "cc"); #ifdef DEBUG_MULDIV printk ("0x%x%08x\n", rs2, rs1); @@ -152,7 +155,7 @@ "mov %%o0, %0\n\t" "mov %%o1, %1\n\t" : "=r" (rs1), "=r" (rs2) - : + : "0" (rs1), "1" (rs2) : "o0", "o1", "o2", "o3", "o4", "o5", "o7", "cc"); #ifdef DEBUG_MULDIV printk ("0x%x%08x\n", rs2, rs1); @@ -181,7 +184,7 @@ "mov %%o1, %0\n\t" "mov %%o0, %1\n\t" : "=r" (rs1), "=r" (rs2) - : "r" (regs->y) + : "r" (regs->y), "0" (rs1), "1" (rs2) : "o0", "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "cc"); #ifdef DEBUG_MULDIV @@ -210,7 +213,7 @@ "mov %%o1, %0\n\t" "mov %%o0, %1\n\t" : "=r" (rs1), "=r" (rs2) - : "r" (regs->y) + : "r" (regs->y), "0" (rs1), "1" (rs2) : "o0", "o1", "o2", "o3", "o4", "o5", "o7", "g1", "g2", "g3", "cc"); #ifdef DEBUG_MULDIV diff -Nru a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c --- a/arch/sparc/kernel/sparc_ksyms.c 2005-01-28 14:11:40 -08:00 +++ b/arch/sparc/kernel/sparc_ksyms.c 2005-01-28 14:11:40 -08:00 @@ -75,7 +75,6 @@ extern int __memcmp(const void *, const void *, __kernel_size_t); extern int __strncmp(const char *, const char *, __kernel_size_t); -extern void bcopy (const char *, char *, int); extern int __ashrdi3(int, int); extern int __ashldi3(int, int); extern int __lshrdi3(int, int); @@ -261,7 +260,6 @@ EXPORT_SYMBOL(__prom_getsibling); /* sparc library symbols */ -EXPORT_SYMBOL(bcopy); EXPORT_SYMBOL(memchr); EXPORT_SYMBOL(memscan); EXPORT_SYMBOL(strlen); diff -Nru a/arch/sparc/lib/memcpy.S b/arch/sparc/lib/memcpy.S --- a/arch/sparc/lib/memcpy.S 2005-01-28 14:11:41 -08:00 +++ b/arch/sparc/lib/memcpy.S 2005-01-28 14:11:41 -08:00 @@ -1,5 +1,5 @@ -/* memcpy.S: Sparc optimized memcpy, bcopy and memmove code - * Hand optimized from GNU libc's memcpy, bcopy and memmove +/* memcpy.S: Sparc optimized memcpy and memmove code + * Hand optimized from GNU libc's memcpy and memmove * Copyright (C) 1991,1996 Free Software Foundation * Copyright (C) 1995 Linus Torvalds (Linus.Torvalds@helsinki.fi) * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) @@ -192,13 +192,6 @@ retl nop ! Only bcopy returns here and it retuns void... -FUNC(bcopy) - mov %o0, %o3 - mov %o1, %o0 - mov %o3, %o1 - tst %o2 - bcs 0b - /* Do the cmp in the delay slot */ #ifdef __KERNEL__ FUNC(amemmove) FUNC(__memmove) diff -Nru a/arch/sparc64/defconfig b/arch/sparc64/defconfig --- a/arch/sparc64/defconfig 2005-01-28 14:11:40 -08:00 +++ b/arch/sparc64/defconfig 2005-01-28 14:11:40 -08:00 @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.10 -# Mon Jan 10 11:24:25 2005 +# Linux kernel version: 2.6.11-rc1 +# Fri Jan 21 20:03:21 2005 # CONFIG_64BIT=y CONFIG_MMU=y @@ -66,13 +66,13 @@ CONFIG_NR_CPUS=4 CONFIG_CPU_FREQ=y # CONFIG_CPU_FREQ_DEBUG is not set -CONFIG_CPU_FREQ_PROC_INTF=y +CONFIG_CPU_FREQ_STAT=m +CONFIG_CPU_FREQ_STAT_DETAILS=y CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set CONFIG_CPU_FREQ_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_POWERSAVE=m CONFIG_CPU_FREQ_GOV_USERSPACE=m -# CONFIG_CPU_FREQ_24_API is not set CONFIG_CPU_FREQ_GOV_ONDEMAND=m CONFIG_CPU_FREQ_TABLE=y CONFIG_US3_FREQ=m @@ -189,6 +189,7 @@ # CONFIG_LOGO_LINUX_VGA16 is not set # CONFIG_LOGO_LINUX_CLUT224 is not set CONFIG_LOGO_SUN_CLUT224=y +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Serial drivers @@ -228,6 +229,7 @@ # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m @@ -247,6 +249,7 @@ CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y +CONFIG_ATA_OVER_ETH=m # # ATA/ATAPI/MFM/RLL support @@ -1202,6 +1205,7 @@ CONFIG_SENSORS_LM90=m CONFIG_SENSORS_MAX1619=m CONFIG_SENSORS_PC87360=m +CONFIG_SENSORS_SMSC47B397=m CONFIG_SENSORS_SMSC47M1=m CONFIG_SENSORS_VIA686A=m CONFIG_SENSORS_W83781D=m @@ -1759,6 +1763,7 @@ # CONFIG_USB_SERIAL_IR is not set CONFIG_USB_SERIAL_EDGEPORT=m # CONFIG_USB_SERIAL_EDGEPORT_TI is not set +CONFIG_USB_SERIAL_GARMIN=m CONFIG_USB_SERIAL_IPW=m CONFIG_USB_SERIAL_KEYSPAN_PDA=m CONFIG_USB_SERIAL_KEYSPAN=m @@ -1779,6 +1784,7 @@ CONFIG_USB_SERIAL_MCT_U232=m CONFIG_USB_SERIAL_PL2303=m # CONFIG_USB_SERIAL_SAFE is not set +CONFIG_USB_SERIAL_TI=m CONFIG_USB_SERIAL_CYBERJACK=m CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m @@ -1789,7 +1795,6 @@ # CONFIG_USB_EMI62=m CONFIG_USB_EMI26=m -# CONFIG_USB_TIGL is not set CONFIG_USB_AUERSWALD=m CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m @@ -1798,6 +1803,7 @@ CONFIG_USB_CYTHERM=m CONFIG_USB_PHIDGETKIT=m CONFIG_USB_PHIDGETSERVO=m +CONFIG_USB_IDMOUSE=m CONFIG_USB_TEST=m # @@ -1863,6 +1869,7 @@ # CONFIG_DEBUG_KOBJECT is not set CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set +CONFIG_DEBUG_FS=y # CONFIG_DEBUG_STACK_USAGE is not set CONFIG_KPROBES=y # CONFIG_DEBUG_DCFLUSH is not set diff -Nru a/arch/sparc64/lib/memmove.S b/arch/sparc64/lib/memmove.S --- a/arch/sparc64/lib/memmove.S 2005-01-28 14:11:41 -08:00 +++ b/arch/sparc64/lib/memmove.S 2005-01-28 14:11:41 -08:00 @@ -8,18 +8,16 @@ .align 32 .globl memmove .type memmove,#function -memmove: +memmove: /* o0=dst o1=src o2=len */ mov %o0, %g1 cmp %o0, %o1 - blu,pt %xcc, memcpy - sub %o0, %o1, %g5 - add %o1, %o2, %g3 - cmp %g3, %o0 bleu,pt %xcc, memcpy add %o1, %o2, %g5 - add %o0, %o2, %o5 - + cmp %g5, %o0 + bleu,pt %xcc, memcpy + add %o0, %o2, %o5 sub %g5, 1, %o1 + sub %o5, 1, %o0 1: ldub [%o1], %g5 subcc %o2, 1, %o2 diff -Nru a/arch/sparc64/oprofile/init.c b/arch/sparc64/oprofile/init.c --- a/arch/sparc64/oprofile/init.c 2005-01-28 14:11:41 -08:00 +++ b/arch/sparc64/oprofile/init.c 2005-01-28 14:11:41 -08:00 @@ -12,8 +12,9 @@ #include #include -void __init oprofile_arch_init(struct oprofile_operations * ops) +int __init oprofile_arch_init(struct oprofile_operations * ops) { + return -ENODEV; } diff -Nru a/arch/um/sys-x86_64/sysrq.c b/arch/um/sys-x86_64/sysrq.c --- a/arch/um/sys-x86_64/sysrq.c 2005-01-28 14:11:41 -08:00 +++ b/arch/um/sys-x86_64/sysrq.c 2005-01-28 14:11:41 -08:00 @@ -5,7 +5,7 @@ */ #include "linux/kernel.h" -#include "linux/version.h" +#include "linux/utsname.h" #include "linux/module.h" #include "asm/current.h" #include "asm/ptrace.h" @@ -16,7 +16,7 @@ printk("\n"); print_modules(); printk("Pid: %d, comm: %.20s %s %s\n", - current->pid, current->comm, print_tainted(), UTS_RELEASE); + current->pid, current->comm, print_tainted(), system_utsname.release); printk("RIP: %04lx:[<%016lx>] ", PT_REGS_CS(regs) & 0xffff, PT_REGS_RIP(regs)); printk("\nRSP: %016lx EFLAGS: %08lx\n", PT_REGS_RSP(regs), diff -Nru a/arch/v850/lib/memcpy.c b/arch/v850/lib/memcpy.c --- a/arch/v850/lib/memcpy.c 2005-01-28 14:11:40 -08:00 +++ b/arch/v850/lib/memcpy.c 2005-01-28 14:11:40 -08:00 @@ -60,11 +60,6 @@ return dst; } -void bcopy (const char *src, char *dst, int size) -{ - memcpy (dst, src, size); -} - void *memmove (void *dst, const void *src, __kernel_size_t size) { if ((unsigned long)dst < (unsigned long)src diff -Nru a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig --- a/arch/x86_64/Kconfig 2005-01-28 14:11:41 -08:00 +++ b/arch/x86_64/Kconfig 2005-01-28 14:11:41 -08:00 @@ -52,15 +52,6 @@ config EARLY_PRINTK bool default y - help - Write kernel log output directly into the VGA buffer or to a serial - port. - - This is useful for kernel debugging when your machine crashes very - early before the console code is initialized. For normal operation - it is not recommended because it looks ugly and doesn't cooperate - with klogd/syslogd or the X server. You should normally N here, - unless you want to debug such a crash. config HPET_TIMER bool diff -Nru a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c --- a/arch/x86_64/ia32/sys_ia32.c 2005-01-28 14:11:40 -08:00 +++ b/arch/x86_64/ia32/sys_ia32.c 2005-01-28 14:11:40 -08:00 @@ -653,6 +653,7 @@ } +#ifdef CONFIG_SYSCTL struct sysctl_ia32 { unsigned int name; int nlen; @@ -667,9 +668,6 @@ asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *args32) { -#ifndef CONFIG_SYSCTL - return -ENOSYS; -#else struct sysctl_ia32 a32; mm_segment_t old_fs = get_fs (); void *oldvalp, *newvalp; @@ -710,8 +708,8 @@ return -EFAULT; return ret; -#endif } +#endif /* warning: next two assume little endian */ asmlinkage long @@ -1081,8 +1079,6 @@ { return sys_lookup_dcookie(((u64)addr_high << 32) | addr_low, buf, len); } - -cond_syscall(sys32_ipc) static int __init ia32_init (void) { diff -Nru a/arch/x86_64/kernel/asm-offsets.c b/arch/x86_64/kernel/asm-offsets.c --- a/arch/x86_64/kernel/asm-offsets.c 2005-01-28 14:11:40 -08:00 +++ b/arch/x86_64/kernel/asm-offsets.c 2005-01-28 14:11:40 -08:00 @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -61,6 +62,8 @@ offsetof (struct rt_sigframe32, uc.uc_mcontext)); BLANK(); #endif - + DEFINE(SIZEOF_PBE, sizeof(struct pbe)); + DEFINE(pbe_address, offsetof(struct pbe, address)); + DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address)); return 0; } diff -Nru a/arch/x86_64/kernel/early_printk.c b/arch/x86_64/kernel/early_printk.c --- a/arch/x86_64/kernel/early_printk.c 2005-01-28 14:11:41 -08:00 +++ b/arch/x86_64/kernel/early_printk.c 2005-01-28 14:11:41 -08:00 @@ -198,9 +198,6 @@ early_console = &early_serial_console; } else if (!strncmp(buf, "vga", 3)) { early_console = &early_vga_console; - } else { - early_console = NULL; - return -1; } early_console_initialized = 1; register_console(early_console); diff -Nru a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S --- a/arch/x86_64/kernel/entry.S 2005-01-28 14:11:40 -08:00 +++ b/arch/x86_64/kernel/entry.S 2005-01-28 14:11:40 -08:00 @@ -41,7 +41,6 @@ #include #include #include -#include .code64 diff -Nru a/arch/x86_64/kernel/module.c b/arch/x86_64/kernel/module.c --- a/arch/x86_64/kernel/module.c 2005-01-28 14:11:41 -08:00 +++ b/arch/x86_64/kernel/module.c 2005-01-28 14:11:41 -08:00 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff -Nru a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c --- a/arch/x86_64/kernel/process.c 2005-01-28 14:11:40 -08:00 +++ b/arch/x86_64/kernel/process.c 2005-01-28 14:11:40 -08:00 @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include @@ -232,7 +232,7 @@ printk("\n"); print_modules(); printk("Pid: %d, comm: %.20s %s %s\n", - current->pid, current->comm, print_tainted(), UTS_RELEASE); + current->pid, current->comm, print_tainted(), system_utsname.release); printk("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->rip); printk_address(regs->rip); printk("\nRSP: %04lx:%016lx EFLAGS: %08lx\n", regs->ss, regs->rsp, regs->eflags); diff -Nru a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c --- a/arch/x86_64/kernel/setup.c 2005-01-28 14:11:40 -08:00 +++ b/arch/x86_64/kernel/setup.c 2005-01-28 14:11:40 -08:00 @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include diff -Nru a/arch/x86_64/kernel/suspend_asm.S b/arch/x86_64/kernel/suspend_asm.S --- a/arch/x86_64/kernel/suspend_asm.S 2005-01-28 14:11:41 -08:00 +++ b/arch/x86_64/kernel/suspend_asm.S 2005-01-28 14:11:41 -08:00 @@ -1,6 +1,9 @@ -/* Originally gcc generated, modified by hand +/* Copyright 2004,2005 Pavel Machek , Andi Kleen , Rafael J. Wysocki * - * This may not use any stack, nor any variable that is not "NoSave": + * Distribute under GPLv2. + * + * swsusp_arch_resume may not use any stack, nor any variable that is + * not "NoSave" during copying pages: * * Its rewriting one kernel image with another. What is stack in "old" * image could very well be data page in "new" image, and overwriting @@ -11,6 +14,7 @@ #include #include #include +#include ENTRY(swsusp_arch_suspend) @@ -49,43 +53,28 @@ movq %rcx, %cr3; movq %rax, %cr4; # turn PGE back on + movq pagedir_nosave(%rip), %rdx + /* compute the limit */ movl nr_copy_pages(%rip), %eax - xorl %ecx, %ecx - movq $0, %r10 testl %eax, %eax jz done -.L105: - xorl %esi, %esi - movq $0, %r11 - jmp .L104 - .p2align 4,,7 -copy_one_page: - movq %r10, %rcx -.L104: - movq pagedir_nosave(%rip), %rdx - movq %rcx, %rax - salq $5, %rax - movq 8(%rdx,%rax), %rcx - movq (%rdx,%rax), %rax - movzbl (%rsi,%rax), %eax - movb %al, (%rsi,%rcx) - - movq %cr3, %rax; # flush TLB - movq %rax, %cr3; - - movq %r11, %rax - incq %rax - cmpq $4095, %rax - movq %rax, %rsi - movq %rax, %r11 - jbe copy_one_page - movq %r10, %rax - incq %rax - movq %rax, %rcx - movq %rax, %r10 - mov nr_copy_pages(%rip), %eax - cmpq %rax, %rcx - jb .L105 + movq %rdx,%r8 + movl $SIZEOF_PBE,%r9d + mul %r9 # with rax, clobbers rdx + movq %r8, %rdx + addq %r8, %rax +loop: + /* get addresses from the pbe and copy the page */ + movq pbe_address(%rdx), %rsi + movq pbe_orig_address(%rdx), %rdi + movq $512, %rcx + rep + movsq + + /* progress to the next pbe */ + addq $SIZEOF_PBE, %rdx + cmpq %rax, %rdx + jb loop done: movl $24, %eax movl %eax, %ds diff -Nru a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c --- a/arch/x86_64/kernel/time.c 2005-01-28 14:11:41 -08:00 +++ b/arch/x86_64/kernel/time.c 2005-01-28 14:11:41 -08:00 @@ -1029,7 +1029,6 @@ * For (3), we use interrupts at 64Hz or user specified periodic * frequency, whichever is higher. */ -#include #include extern irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs); diff -Nru a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c --- a/arch/x86_64/kernel/traps.c 2005-01-28 14:11:40 -08:00 +++ b/arch/x86_64/kernel/traps.c 2005-01-28 14:11:40 -08:00 @@ -405,15 +405,6 @@ do_exit(SIGSEGV); } -static inline unsigned long get_cr2(void) -{ - unsigned long address; - - /* get the address */ - __asm__("movq %%cr2,%0":"=r" (address)); - return address; -} - static void do_trap(int trapnr, int signr, char *str, struct pt_regs * regs, long error_code, siginfo_t *info) { @@ -917,7 +908,7 @@ set_intr_gate(0,÷_error); set_intr_gate_ist(1,&debug,DEBUG_STACK); set_intr_gate_ist(2,&nmi,NMI_STACK); - set_intr_gate(3,&int3); + set_system_gate(3,&int3); set_system_gate(4,&overflow); /* int4-5 can be called from all */ set_system_gate(5,&bounds); set_intr_gate(6,&invalid_op); diff -Nru a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c --- a/arch/x86_64/kernel/x8664_ksyms.c 2005-01-28 14:11:40 -08:00 +++ b/arch/x86_64/kernel/x8664_ksyms.c 2005-01-28 14:11:40 -08:00 @@ -30,7 +30,6 @@ #include #include #include -#include #include #include diff -Nru a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c --- a/arch/x86_64/mm/ioremap.c 2005-01-28 14:11:41 -08:00 +++ b/arch/x86_64/mm/ioremap.c 2005-01-28 14:11:41 -08:00 @@ -265,8 +265,9 @@ unmap_vm_area(p); if ((p->flags >> 20) && p->phys_addr + p->size - 1 < virt_to_phys(high_memory)) { + /* p->size includes the guard page, but cpa doesn't like that */ change_page_attr(virt_to_page(__va(p->phys_addr)), - p->size >> PAGE_SHIFT, + (p->size - PAGE_SIZE) >> PAGE_SHIFT, PAGE_KERNEL); global_flush_tlb(); } diff -Nru a/arch/x86_64/mm/k8topology.c b/arch/x86_64/mm/k8topology.c --- a/arch/x86_64/mm/k8topology.c 2005-01-28 14:11:41 -08:00 +++ b/arch/x86_64/mm/k8topology.c 2005-01-28 14:11:41 -08:00 @@ -59,7 +59,7 @@ printk(KERN_INFO "Scanning NUMA topology in Northbridge %d\n", nb); reg = read_pci_config(0, nb, 0, 0x60); - numnodes = ((reg >> 4) & 7) + 1; + numnodes = ((reg >> 4) & 0xF) + 1; printk(KERN_INFO "Number of nodes %d\n", numnodes); diff -Nru a/drivers/base/Makefile b/drivers/base/Makefile --- a/drivers/base/Makefile 2005-01-28 14:11:41 -08:00 +++ b/drivers/base/Makefile 2005-01-28 14:11:41 -08:00 @@ -2,7 +2,8 @@ obj-y := core.o sys.o interface.o bus.o \ driver.o class.o class_simple.o platform.o \ - cpu.o firmware.o init.o map.o dmapool.o + cpu.o firmware.o init.o map.o dmapool.o \ + attribute_container.o transport_class.o obj-y += power/ obj-$(CONFIG_FW_LOADER) += firmware_class.o obj-$(CONFIG_NUMA) += node.o diff -Nru a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/base/attribute_container.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,274 @@ +/* + * attribute_container.c - implementation of a simple container for classes + * + * Copyright (c) 2005 - James Bottomley + * + * This file is licensed under GPLv2 + * + * The basic idea here is to enable a device to be attached to an + * aritrary numer of classes without having to allocate storage for them. + * Instead, the contained classes select the devices they need to attach + * to via a matching function. + */ + +#include +#include +#include +#include +#include +#include +#include + +/* This is a private structure used to tie the classdev and the + * container .. it should never be visible outside this file */ +struct internal_container { + struct list_head node; + struct attribute_container *cont; + struct class_device classdev; +}; + +/** + * attribute_container_classdev_to_container - given a classdev, return the container + * + * @classdev: the class device created by attribute_container_add_device. + * + * Returns the container associated with this classdev. + */ +struct attribute_container * +attribute_container_classdev_to_container(struct class_device *classdev) +{ + struct internal_container *ic = + container_of(classdev, struct internal_container, classdev); + return ic->cont; +} +EXPORT_SYMBOL_GPL(attribute_container_classdev_to_container); + +static struct list_head attribute_container_list; + +static DECLARE_MUTEX(attribute_container_mutex); + +/** + * attribute_container_register - register an attribute container + * + * @cont: The container to register. This must be allocated by the + * callee and should also be zeroed by it. + */ +int +attribute_container_register(struct attribute_container *cont) +{ + INIT_LIST_HEAD(&cont->node); + INIT_LIST_HEAD(&cont->containers); + + down(&attribute_container_mutex); + list_add_tail(&cont->node, &attribute_container_list); + up(&attribute_container_mutex); + + return 0; +} +EXPORT_SYMBOL_GPL(attribute_container_register); + +/** + * attribute_container_unregister - remove a container registration + * + * @cont: previously registered container to remove + */ +int +attribute_container_unregister(struct attribute_container *cont) +{ + int retval = -EBUSY; + down(&attribute_container_mutex); + if (!list_empty(&cont->containers)) + goto out; + retval = 0; + list_del(&cont->node); + out: + up(&attribute_container_mutex); + return retval; + +} +EXPORT_SYMBOL_GPL(attribute_container_unregister); + +/* private function used as class release */ +static void attribute_container_release(struct class_device *classdev) +{ + struct internal_container *ic + = container_of(classdev, struct internal_container, classdev); + struct device *dev = classdev->dev; + + kfree(ic); + put_device(dev); +} + +/** + * attribute_container_add_device - see if any container is interested in dev + * + * @dev: device to add attributes to + * @fn: function to trigger addition of class device. + * + * This function allocates storage for the class device(s) to be + * attached to dev (one for each matching attribute_container). If no + * fn is provided, the code will simply register the class device via + * class_device_add. If a function is provided, it is expected to add + * the class device at the appropriate time. One of the things that + * might be necessary is to allocate and initialise the classdev and + * then add it a later time. To do this, call this routine for + * allocation and initialisation and then use + * attribute_container_device_trigger() to call class_device_add() on + * it. Note: after this, the class device contains a reference to dev + * which is not relinquished until the release of the classdev. + */ +void +attribute_container_add_device(struct device *dev, + int (*fn)(struct attribute_container *, + struct device *, + struct class_device *)) +{ + struct attribute_container *cont; + + down(&attribute_container_mutex); + list_for_each_entry(cont, &attribute_container_list, node) { + struct internal_container *ic; + + if (attribute_container_no_classdevs(cont)) + continue; + + if (!cont->match(cont, dev)) + continue; + ic = kmalloc(sizeof(struct internal_container), GFP_KERNEL); + if (!ic) { + dev_printk(KERN_ERR, dev, "failed to allocate class container\n"); + continue; + } + memset(ic, 0, sizeof(struct internal_container)); + INIT_LIST_HEAD(&ic->node); + ic->cont = cont; + class_device_initialize(&ic->classdev); + ic->classdev.dev = get_device(dev); + ic->classdev.class = cont->class; + cont->class->release = attribute_container_release; + strcpy(ic->classdev.class_id, dev->bus_id); + if (fn) + fn(cont, dev, &ic->classdev); + else + class_device_add(&ic->classdev); + list_add_tail(&ic->node, &cont->containers); + } + up(&attribute_container_mutex); +} + +/** + * attribute_container_remove_device - make device eligible for removal. + * + * @dev: The generic device + * @fn: A function to call to remove the device + * + * This routine triggers device removal. If fn is NULL, then it is + * simply done via class_device_unregister (note that if something + * still has a reference to the classdev, then the memory occupied + * will not be freed until the classdev is released). If you want a + * two phase release: remove from visibility and then delete the + * device, then you should use this routine with a fn that calls + * class_device_del() and then use + * attribute_container_device_trigger() to do the final put on the + * classdev. + */ +void +attribute_container_remove_device(struct device *dev, + void (*fn)(struct attribute_container *, + struct device *, + struct class_device *)) +{ + struct attribute_container *cont; + + down(&attribute_container_mutex); + list_for_each_entry(cont, &attribute_container_list, node) { + struct internal_container *ic, *tmp; + + if (attribute_container_no_classdevs(cont)) + continue; + + if (!cont->match(cont, dev)) + continue; + list_for_each_entry_safe(ic, tmp, &cont->containers, node) { + if (dev != ic->classdev.dev) + continue; + list_del(&ic->node); + if (fn) + fn(cont, dev, &ic->classdev); + else + class_device_unregister(&ic->classdev); + } + } + up(&attribute_container_mutex); +} +EXPORT_SYMBOL_GPL(attribute_container_remove_device); + +/** + * attribute_container_device_trigger - execute a trigger for each matching classdev + * + * @dev: The generic device to run the trigger for + * @fn the function to execute for each classdev. + * + * This funcion is for executing a trigger when you need to know both + * the container and the classdev. If you only care about the + * container, then use attribute_container_trigger() instead. + */ +void +attribute_container_device_trigger(struct device *dev, + int (*fn)(struct attribute_container *, + struct device *, + struct class_device *)) +{ + struct attribute_container *cont; + + down(&attribute_container_mutex); + list_for_each_entry(cont, &attribute_container_list, node) { + struct internal_container *ic, *tmp; + + if (!cont->match(cont, dev)) + continue; + + list_for_each_entry_safe(ic, tmp, &cont->containers, node) { + if (dev == ic->classdev.dev) + fn(cont, dev, &ic->classdev); + } + } + up(&attribute_container_mutex); +} +EXPORT_SYMBOL_GPL(attribute_container_device_trigger); + +/** + * attribute_container_trigger - trigger a function for each matching container + * + * @dev: The generic device to activate the trigger for + * @fn: the function to trigger + * + * This routine triggers a function that only needs to know the + * matching containers (not the classdev) associated with a device. + * It is more lightweight than attribute_container_device_trigger, so + * should be used in preference unless the triggering function + * actually needs to know the classdev. + */ +void +attribute_container_trigger(struct device *dev, + int (*fn)(struct attribute_container *, + struct device *)) +{ + struct attribute_container *cont; + + down(&attribute_container_mutex); + list_for_each_entry(cont, &attribute_container_list, node) { + if (cont->match(cont, dev)) + fn(cont, dev); + } + up(&attribute_container_mutex); +} +EXPORT_SYMBOL_GPL(attribute_container_trigger); + + +int __init +attribute_container_init(void) +{ + INIT_LIST_HEAD(&attribute_container_list); + return 0; +} diff -Nru a/drivers/base/init.c b/drivers/base/init.c --- a/drivers/base/init.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/base/init.c 2005-01-28 14:11:40 -08:00 @@ -17,7 +17,7 @@ extern int platform_bus_init(void); extern int system_bus_init(void); extern int cpu_dev_init(void); - +extern int attribute_container_init(void); /** * driver_init - initialize driver model. * @@ -39,4 +39,5 @@ platform_bus_init(); system_bus_init(); cpu_dev_init(); + attribute_container_init(); } diff -Nru a/drivers/base/transport_class.c b/drivers/base/transport_class.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/base/transport_class.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,272 @@ +/* + * transport_class.c - implementation of generic transport classes + * using attribute_containers + * + * Copyright (c) 2005 - James Bottomley + * + * This file is licensed under GPLv2 + * + * The basic idea here is to allow any "device controller" (which + * would most often be a Host Bus Adapter" to use the services of one + * or more tranport classes for performing transport specific + * services. Transport specific services are things that the generic + * command layer doesn't want to know about (speed settings, line + * condidtioning, etc), but which the user might be interested in. + * Thus, the HBA's use the routines exported by the transport classes + * to perform these functions. The transport classes export certain + * values to the user via sysfs using attribute containers. + * + * Note: because not every HBA will care about every transport + * attribute, there's a many to one relationship that goes like this: + * + * transport class<-----attribute container<----class device + * + * Usually the attribute container is per-HBA, but the design doesn't + * mandate that. Although most of the services will be specific to + * the actual external storage connection used by the HBA, the generic + * transport class is framed entirely in terms of generic devices to + * allow it to be used by any physical HBA in the system. + */ +#include +#include + +/** + * transport_class_register - register an initial transport class + * + * @tclass: a pointer to the transport class structure to be initialised + * + * The transport class contains an embedded class which is used to + * identify it. The caller should initialise this structure with + * zeros and then generic class must have been initialised with the + * actual transport class unique name. There's a macro + * DECLARE_TRANSPORT_CLASS() to do this (declared classes still must + * be registered). + * + * Returns 0 on success or error on failure. + */ +int transport_class_register(struct transport_class *tclass) +{ + return class_register(&tclass->class); +} +EXPORT_SYMBOL_GPL(transport_class_register); + +/** + * transport_class_unregister - unregister a previously registered class + * + * @tclass: The transport class to unregister + * + * Must be called prior to deallocating the memory for the transport + * class. + */ +void transport_class_unregister(struct transport_class *tclass) +{ + class_unregister(&tclass->class); +} +EXPORT_SYMBOL_GPL(transport_class_unregister); + +static int anon_transport_dummy_function(struct device *dev) +{ + /* do nothing */ + return 0; +} + +/** + * anon_transport_class_register - register an anonymous class + * + * @atc: The anon transport class to register + * + * The anonymous transport class contains both a transport class and a + * container. The idea of an anonymous class is that it never + * actually has any device attributes associated with it (and thus + * saves on container storage). So it can only be used for triggering + * events. Use prezero and then use DECLARE_ANON_TRANSPORT_CLASS() to + * initialise the anon transport class storage. + */ +int anon_transport_class_register(struct anon_transport_class *atc) +{ + int error; + atc->container.class = &atc->tclass.class; + attribute_container_set_no_classdevs(&atc->container); + error = attribute_container_register(&atc->container); + if (error) + return error; + atc->tclass.setup = anon_transport_dummy_function; + atc->tclass.remove = anon_transport_dummy_function; + return 0; +} +EXPORT_SYMBOL_GPL(anon_transport_class_register); + +/** + * anon_transport_class_unregister - unregister an anon class + * + * @atc: Pointer to the anon transport class to unregister + * + * Must be called prior to deallocating the memory for the anon + * transport class. + */ +void anon_transport_class_unregister(struct anon_transport_class *atc) +{ + attribute_container_unregister(&atc->container); +} +EXPORT_SYMBOL_GPL(anon_transport_class_unregister); + +static int transport_setup_classdev(struct attribute_container *cont, + struct device *dev, + struct class_device *classdev) +{ + struct transport_class *tclass = class_to_transport_class(cont->class); + + if (tclass->setup) + tclass->setup(dev); + + return 0; +} + +/** + * transport_setup_device - declare a new dev for transport class association + * but don't make it visible yet. + * + * @dev: the generic device representing the entity being added + * + * Usually, dev represents some component in the HBA system (either + * the HBA itself or a device remote across the HBA bus). This + * routine is simply a trigger point to see if any set of transport + * classes wishes to associate with the added device. This allocates + * storage for the class device and initialises it, but does not yet + * add it to the system or add attributes to it (you do this with + * transport_add_device). If you have no need for a separate setup + * and add operations, use transport_register_device (see + * transport_class.h). + */ + +void transport_setup_device(struct device *dev) +{ + attribute_container_add_device(dev, transport_setup_classdev); +} +EXPORT_SYMBOL_GPL(transport_setup_device); + + +static int transport_add_classdev(struct attribute_container *cont, + struct device *dev, + struct class_device *classdev) +{ + struct class_device_attribute **attrs = cont->attrs; + int i, error; + + error = class_device_add(classdev); + if (error) + return error; + for (i = 0; attrs[i]; i++) { + error = class_device_create_file(classdev, attrs[i]); + if (error) + return error; + } + + return 0; +} + +/** + * transport_add_device - declare a new dev for transport class association + * + * @dev: the generic device representing the entity being added + * + * Usually, dev represents some component in the HBA system (either + * the HBA itself or a device remote across the HBA bus). This + * routine is simply a trigger point used to add the device to the + * system and register attributes for it. + */ + +void transport_add_device(struct device *dev) +{ + attribute_container_device_trigger(dev, transport_add_classdev); +} +EXPORT_SYMBOL_GPL(transport_add_device); + +static int transport_configure(struct attribute_container *cont, + struct device *dev) +{ + struct transport_class *tclass = class_to_transport_class(cont->class); + + if (tclass->configure) + tclass->configure(dev); + + return 0; +} + +/** + * transport_configure_device - configure an already set up device + * + * @dev: generic device representing device to be configured + * + * The idea of configure is simply to provide a point within the setup + * process to allow the transport class to extract information from a + * device after it has been setup. This is used in SCSI because we + * have to have a setup device to begin using the HBA, but after we + * send the initial inquiry, we use configure to extract the device + * parameters. The device need not have been added to be configured. + */ +void transport_configure_device(struct device *dev) +{ + attribute_container_trigger(dev, transport_configure); +} +EXPORT_SYMBOL_GPL(transport_configure_device); + +static int transport_remove_classdev(struct attribute_container *cont, + struct device *dev, + struct class_device *classdev) +{ + struct transport_class *tclass = class_to_transport_class(cont->class); + + if (tclass->remove) + tclass->remove(dev); + + return 0; +} + + +/** + * transport_remove_device - remove the visibility of a device + * + * @dev: generic device to remove + * + * This call removes the visibility of the device (to the user from + * sysfs), but does not destroy it. To eliminate a device entirely + * you must also call transport_destroy_device. If you don't need to + * do remove and destroy as separate operations, use + * transport_unregister_device() (see transport_class.h) which will + * perform both calls for you. + */ +void transport_remove_device(struct device *dev) +{ + attribute_container_device_trigger(dev, transport_remove_classdev); +} +EXPORT_SYMBOL_GPL(transport_remove_device); + +static void transport_destroy_classdev(struct attribute_container *cont, + struct device *dev, + struct class_device *classdev) +{ + struct transport_class *tclass = class_to_transport_class(cont->class); + + if (tclass->remove != anon_transport_dummy_function) + class_device_put(classdev); +} + + +/** + * transport_destroy_device - destroy a removed device + * + * @dev: device to eliminate from the transport class. + * + * This call triggers the elimination of storage associated with the + * transport classdev. Note: all it really does is relinquish a + * reference to the classdev. The memory will not be freed until the + * last reference goes to zero. Note also that the classdev retains a + * reference count on dev, so dev too will remain for as long as the + * transport class device remains around. + */ +void transport_destroy_device(struct device *dev) +{ + attribute_container_remove_device(dev, transport_destroy_classdev); +} +EXPORT_SYMBOL_GPL(transport_destroy_device); diff -Nru a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c --- a/drivers/block/aoe/aoeblk.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/block/aoe/aoeblk.c 2005-01-28 14:11:40 -08:00 @@ -245,7 +245,7 @@ d->fw_ver, (long long)d->ssize); } -void __exit +void aoeblk_exit(void) { kmem_cache_destroy(buf_pool_cache); @@ -254,19 +254,12 @@ int __init aoeblk_init(void) { - int n; - buf_pool_cache = kmem_cache_create("aoe_bufs", sizeof(struct buf), 0, 0, NULL, NULL); if (buf_pool_cache == NULL) return -ENOMEM; - n = register_blkdev(AOE_MAJOR, DEVICE_NAME); - if (n < 0) { - printk(KERN_ERR "aoe: aoeblk_init: can't register major\n"); - return n; - } return 0; } diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c --- a/drivers/block/genhd.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/block/genhd.c 2005-01-28 14:11:40 -08:00 @@ -300,7 +300,7 @@ return NULL; } -int __init device_init(void) +static int __init genhd_device_init(void) { bdev_map = kobj_map_init(base_probe, &block_subsys); blk_dev_init(); @@ -308,7 +308,7 @@ return 0; } -subsys_initcall(device_init); +subsys_initcall(genhd_device_init); diff -Nru a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c --- a/drivers/bluetooth/bt3c_cs.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/bluetooth/bt3c_cs.c 2005-01-28 14:11:41 -08:00 @@ -771,7 +771,7 @@ static void bt3c_config(dev_link_t *link) { - static ioaddr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; + static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; client_handle_t handle = link->handle; bt3c_info_t *info = link->priv; tuple_t tuple; diff -Nru a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c --- a/drivers/bluetooth/btuart_cs.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/bluetooth/btuart_cs.c 2005-01-28 14:11:41 -08:00 @@ -690,7 +690,7 @@ static void btuart_config(dev_link_t *link) { - static ioaddr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; + static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; client_handle_t handle = link->handle; btuart_info_t *info = link->priv; tuple_t tuple; diff -Nru a/drivers/cdrom/aztcd.c b/drivers/cdrom/aztcd.c --- a/drivers/cdrom/aztcd.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/cdrom/aztcd.c 2005-01-28 14:11:41 -08:00 @@ -165,7 +165,6 @@ Torben Mathiasen */ -#include #include #include "aztcd.h" @@ -1708,8 +1707,8 @@ printk(KERN_INFO "aztcd: (C) 1994-98 W.Zimmermann\n"); if (azt_port == -1) { printk - ("aztcd: KernelVersion=%s DriverVersion=%s For IDE/ATAPI-drives use ide-cd.c\n", - UTS_RELEASE, AZT_VERSION); + ("aztcd: DriverVersion=%s For IDE/ATAPI-drives use ide-cd.c\n", + AZT_VERSION); } else printk ("aztcd: DriverVersion=%s BaseAddress=0x%x For IDE/ATAPI-drives use ide-cd.c\n", diff -Nru a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c --- a/drivers/cdrom/mcdx.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/cdrom/mcdx.c 2005-01-28 14:11:40 -08:00 @@ -56,7 +56,6 @@ = "$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $"; #endif -#include #include #include @@ -1265,11 +1264,7 @@ int __init mcdx_init(void) { int drive; -#ifdef MODULE - xwarn("Version 2.14(hs) for " UTS_RELEASE "\n"); -#else xwarn("Version 2.14(hs) \n"); -#endif xwarn("$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $\n"); diff -Nru a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c --- a/drivers/char/drm/drm_vm.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/char/drm/drm_vm.c 2005-01-28 14:11:41 -08:00 @@ -34,6 +34,9 @@ */ #include "drmP.h" +#if defined(__ia64__) +#include +#endif /** @@ -612,8 +615,13 @@ vma->vm_flags |= VM_IO; /* not in core dump */ } #if defined(__ia64__) - if (map->type != _DRM_AGP) - vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); + if (efi_range_is_wc(vma->vm_start, vma->vm_end - + vma->vm_start)) + vma->vm_page_prot = + pgprot_writecombine(vma->vm_page_prot); + else + vma->vm_page_prot = + pgprot_noncached(vma->vm_page_prot); #endif offset = dev->driver->get_reg_ofs(dev); #ifdef __sparc__ diff -Nru a/drivers/char/ftape/compressor/zftape-compress.c b/drivers/char/ftape/compressor/zftape-compress.c --- a/drivers/char/ftape/compressor/zftape-compress.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/char/ftape/compressor/zftape-compress.c 2005-01-28 14:11:41 -08:00 @@ -27,7 +27,6 @@ * changed * appropriately. See below. */ -#include #include #include #include @@ -1174,11 +1173,10 @@ printk( KERN_INFO "(c) 1997 Claus-Justus Heine (claus@momo.math.rwth-aachen.de)\n" KERN_INFO "Compressor for zftape (lzrw3 algorithm)\n" -KERN_INFO "Compiled for kernel version %s\n", UTS_RELEASE); } #else /* !MODULE */ /* print a short no-nonsense boot message */ - printk("zftape compressor v1.00a 970514 for Linux " UTS_RELEASE "\n"); + printk("zftape compressor v1.00a 970514\n"); printk("For use with " FTAPE_VERSION "\n"); #endif /* MODULE */ TRACE(ft_t_info, "zft_compressor_init @ 0x%p", zft_compressor_init); diff -Nru a/drivers/char/ftape/lowlevel/ftape-init.c b/drivers/char/ftape/lowlevel/ftape-init.c --- a/drivers/char/ftape/lowlevel/ftape-init.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/char/ftape/lowlevel/ftape-init.c 2005-01-28 14:11:41 -08:00 @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -74,11 +73,10 @@ KERN_INFO "(c) 1995-1996 Kai Harrekilde-Petersen (khp@dolphinics.no)\n" KERN_INFO "(c) 1996-1997 Claus-Justus Heine (claus@momo.math.rwth-aachen.de)\n" KERN_INFO "QIC-117 driver for QIC-40/80/3010/3020 floppy tape drives\n" -KERN_INFO "Compiled for Linux version %s\n", UTS_RELEASE); } #else /* !MODULE */ /* print a short no-nonsense boot message */ - printk(KERN_INFO FTAPE_VERSION " for Linux " UTS_RELEASE "\n"); + printk(KERN_INFO FTAPE_VERSION "\n"); #endif /* MODULE */ TRACE(ft_t_info, "installing QIC-117 floppy tape hardware drive ... "); TRACE(ft_t_info, "ftape_init @ 0x%p", ftape_init); diff -Nru a/drivers/char/ftape/zftape/zftape-init.c b/drivers/char/ftape/zftape/zftape-init.c --- a/drivers/char/ftape/zftape/zftape-init.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/char/ftape/zftape/zftape-init.c 2005-01-28 14:11:41 -08:00 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -319,13 +318,11 @@ KERN_INFO "Support for QIC-113 compatible volume table, dynamic memory allocation\n" KERN_INFO -"and builtin compression (lzrw3 algorithm).\n" -KERN_INFO -"Compiled for Linux version %s\n", UTS_RELEASE); +"and builtin compression (lzrw3 algorithm).\n"); } #else /* !MODULE */ /* print a short no-nonsense boot message */ - printk(KERN_INFO ZFTAPE_VERSION " for Linux " UTS_RELEASE "\n"); + printk(KERN_INFO ZFTAPE_VERSION "\n"); #endif /* MODULE */ TRACE(ft_t_info, "zft_init @ 0x%p", zft_init); TRACE(ft_t_info, diff -Nru a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c --- a/drivers/infiniband/core/user_mad.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/core/user_mad.c 2005-01-28 14:11:40 -08:00 @@ -43,9 +43,9 @@ #include #include #include -#include #include +#include #include #include @@ -55,7 +55,7 @@ MODULE_LICENSE("Dual BSD/GPL"); enum { - IB_UMAD_MAX_PORTS = 256, + IB_UMAD_MAX_PORTS = 64, IB_UMAD_MAX_AGENTS = 32 }; @@ -63,6 +63,12 @@ int devnum; struct cdev dev; struct class_device class_dev; + + int sm_devnum; + struct cdev sm_dev; + struct class_device sm_class_dev; + struct semaphore sm_sem; + struct ib_device *ib_dev; struct ib_umad_device *umad_dev; u8 port_num; @@ -93,7 +99,7 @@ static dev_t base_dev; static spinlock_t map_lock; -static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS); +static DECLARE_BITMAP(dev_map, IB_UMAD_MAX_PORTS * 2); static void ib_umad_add_one(struct ib_device *device); static void ib_umad_remove_one(struct ib_device *device); @@ -502,14 +508,62 @@ } static struct file_operations umad_fops = { - .owner = THIS_MODULE, - .read = ib_umad_read, - .write = ib_umad_write, - .poll = ib_umad_poll, + .owner = THIS_MODULE, + .read = ib_umad_read, + .write = ib_umad_write, + .poll = ib_umad_poll, .unlocked_ioctl = ib_umad_ioctl, - .compat_ioctl = ib_umad_ioctl, - .open = ib_umad_open, - .release = ib_umad_close + .compat_ioctl = ib_umad_ioctl, + .open = ib_umad_open, + .release = ib_umad_close +}; + +static int ib_umad_sm_open(struct inode *inode, struct file *filp) +{ + struct ib_umad_port *port = + container_of(inode->i_cdev, struct ib_umad_port, sm_dev); + struct ib_port_modify props = { + .set_port_cap_mask = IB_PORT_SM + }; + int ret; + + if (filp->f_flags & O_NONBLOCK) { + if (down_trylock(&port->sm_sem)) + return -EAGAIN; + } else { + if (down_interruptible(&port->sm_sem)) + return -ERESTARTSYS; + } + + ret = ib_modify_port(port->ib_dev, port->port_num, 0, &props); + if (ret) { + up(&port->sm_sem); + return ret; + } + + filp->private_data = port; + + return 0; +} + +static int ib_umad_sm_close(struct inode *inode, struct file *filp) +{ + struct ib_umad_port *port = filp->private_data; + struct ib_port_modify props = { + .clr_port_cap_mask = IB_PORT_SM + }; + int ret; + + ret = ib_modify_port(port->ib_dev, port->port_num, 0, &props); + up(&port->sm_sem); + + return ret; +} + +static struct file_operations umad_sm_fops = { + .owner = THIS_MODULE, + .open = ib_umad_sm_open, + .release = ib_umad_sm_close }; static struct ib_client umad_client = { @@ -520,17 +574,18 @@ static ssize_t show_dev(struct class_device *class_dev, char *buf) { - struct ib_umad_port *port = - container_of(class_dev, struct ib_umad_port, class_dev); + struct ib_umad_port *port = class_get_devdata(class_dev); - return print_dev_t(buf, port->dev.dev); + if (class_dev == &port->class_dev) + return print_dev_t(buf, port->dev.dev); + else + return print_dev_t(buf, port->sm_dev.dev); } static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL); static ssize_t show_ibdev(struct class_device *class_dev, char *buf) { - struct ib_umad_port *port = - container_of(class_dev, struct ib_umad_port, class_dev); + struct ib_umad_port *port = class_get_devdata(class_dev); return sprintf(buf, "%s\n", port->ib_dev->name); } @@ -538,8 +593,7 @@ static ssize_t show_port(struct class_device *class_dev, char *buf) { - struct ib_umad_port *port = - container_of(class_dev, struct ib_umad_port, class_dev); + struct ib_umad_port *port = class_get_devdata(class_dev); return sprintf(buf, "%d\n", port->port_num); } @@ -555,11 +609,16 @@ static void ib_umad_release_port(struct class_device *class_dev) { - struct ib_umad_port *port = - container_of(class_dev, struct ib_umad_port, class_dev); + struct ib_umad_port *port = class_get_devdata(class_dev); + + if (class_dev == &port->class_dev) { + cdev_del(&port->dev); + clear_bit(port->devnum, dev_map); + } else { + cdev_del(&port->sm_dev); + clear_bit(port->sm_devnum, dev_map); + } - cdev_del(&port->dev); - clear_bit(port->devnum, dev_map); kref_put(&port->umad_dev->ref, ib_umad_release_dev); } @@ -574,6 +633,94 @@ } static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL); +static int ib_umad_init_port(struct ib_device *device, int port_num, + struct ib_umad_port *port) +{ + spin_lock(&map_lock); + port->devnum = find_first_zero_bit(dev_map, IB_UMAD_MAX_PORTS); + if (port->devnum >= IB_UMAD_MAX_PORTS) { + spin_unlock(&map_lock); + return -1; + } + port->sm_devnum = find_next_zero_bit(dev_map, IB_UMAD_MAX_PORTS * 2, IB_UMAD_MAX_PORTS); + if (port->sm_devnum >= IB_UMAD_MAX_PORTS * 2) { + spin_unlock(&map_lock); + return -1; + } + set_bit(port->devnum, dev_map); + set_bit(port->sm_devnum, dev_map); + spin_unlock(&map_lock); + + port->ib_dev = device; + port->port_num = port_num; + init_MUTEX(&port->sm_sem); + + cdev_init(&port->dev, &umad_fops); + port->dev.owner = THIS_MODULE; + kobject_set_name(&port->dev.kobj, "umad%d", port->devnum); + if (cdev_add(&port->dev, base_dev + port->devnum, 1)) + return -1; + + port->class_dev.class = &umad_class; + port->class_dev.dev = device->dma_device; + + snprintf(port->class_dev.class_id, BUS_ID_SIZE, "umad%d", port->devnum); + + if (class_device_register(&port->class_dev)) + goto err_cdev; + + class_set_devdata(&port->class_dev, port); + kref_get(&port->umad_dev->ref); + + if (class_device_create_file(&port->class_dev, &class_device_attr_dev)) + goto err_class; + if (class_device_create_file(&port->class_dev, &class_device_attr_ibdev)) + goto err_class; + if (class_device_create_file(&port->class_dev, &class_device_attr_port)) + goto err_class; + + cdev_init(&port->sm_dev, &umad_sm_fops); + port->sm_dev.owner = THIS_MODULE; + kobject_set_name(&port->dev.kobj, "issm%d", port->sm_devnum - IB_UMAD_MAX_PORTS); + if (cdev_add(&port->sm_dev, base_dev + port->sm_devnum, 1)) + return -1; + + port->sm_class_dev.class = &umad_class; + port->sm_class_dev.dev = device->dma_device; + + snprintf(port->sm_class_dev.class_id, BUS_ID_SIZE, "issm%d", port->sm_devnum - IB_UMAD_MAX_PORTS); + + if (class_device_register(&port->sm_class_dev)) + goto err_sm_cdev; + + class_set_devdata(&port->sm_class_dev, port); + kref_get(&port->umad_dev->ref); + + if (class_device_create_file(&port->sm_class_dev, &class_device_attr_dev)) + goto err_sm_class; + if (class_device_create_file(&port->sm_class_dev, &class_device_attr_ibdev)) + goto err_sm_class; + if (class_device_create_file(&port->sm_class_dev, &class_device_attr_port)) + goto err_sm_class; + + return 0; + +err_sm_class: + class_device_unregister(&port->sm_class_dev); + +err_sm_cdev: + cdev_del(&port->sm_dev); + +err_class: + class_device_unregister(&port->class_dev); + +err_cdev: + cdev_del(&port->dev); + clear_bit(port->devnum, dev_map); + + return -1; +} + static void ib_umad_add_one(struct ib_device *device) { struct ib_umad_device *umad_dev; @@ -602,58 +749,20 @@ for (i = s; i <= e; ++i) { umad_dev->port[i - s].umad_dev = umad_dev; - kref_get(&umad_dev->ref); - spin_lock(&map_lock); - umad_dev->port[i - s].devnum = - find_first_zero_bit(dev_map, IB_UMAD_MAX_PORTS); - if (umad_dev->port[i - s].devnum >= IB_UMAD_MAX_PORTS) { - spin_unlock(&map_lock); + if (ib_umad_init_port(device, i, &umad_dev->port[i - s])) goto err; - } - set_bit(umad_dev->port[i - s].devnum, dev_map); - spin_unlock(&map_lock); - - umad_dev->port[i - s].ib_dev = device; - umad_dev->port[i - s].port_num = i; - - cdev_init(&umad_dev->port[i - s].dev, &umad_fops); - umad_dev->port[i - s].dev.owner = THIS_MODULE; - kobject_set_name(&umad_dev->port[i - s].dev.kobj, - "umad%d", umad_dev->port[i - s].devnum); - if (cdev_add(&umad_dev->port[i - s].dev, base_dev + - umad_dev->port[i - s].devnum, 1)) - goto err; - - umad_dev->port[i - s].class_dev.class = &umad_class; - umad_dev->port[i - s].class_dev.dev = device->dma_device; - snprintf(umad_dev->port[i - s].class_dev.class_id, - BUS_ID_SIZE, "umad%d", umad_dev->port[i - s].devnum); - if (class_device_register(&umad_dev->port[i - s].class_dev)) - goto err_class; - - if (class_device_create_file(&umad_dev->port[i - s].class_dev, - &class_device_attr_dev)) - goto err_class; - if (class_device_create_file(&umad_dev->port[i - s].class_dev, - &class_device_attr_ibdev)) - goto err_class; - if (class_device_create_file(&umad_dev->port[i - s].class_dev, - &class_device_attr_port)) - goto err_class; } ib_set_client_data(device, &umad_client, umad_dev); return; -err_class: - cdev_del(&umad_dev->port[i - s].dev); - clear_bit(umad_dev->port[i - s].devnum, dev_map); - err: - while (--i >= s) + while (--i >= s) { class_device_unregister(&umad_dev->port[i - s].class_dev); + class_device_unregister(&umad_dev->port[i - s].sm_class_dev); + } kref_put(&umad_dev->ref, ib_umad_release_dev); } @@ -666,8 +775,10 @@ if (!umad_dev) return; - for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i) + for (i = 0; i <= umad_dev->end_port - umad_dev->start_port; ++i) { class_device_unregister(&umad_dev->port[i].class_dev); + class_device_unregister(&umad_dev->port[i].sm_class_dev); + } kref_put(&umad_dev->ref, ib_umad_release_dev); } @@ -678,7 +789,7 @@ spin_lock_init(&map_lock); - ret = alloc_chrdev_region(&base_dev, 0, IB_UMAD_MAX_PORTS, + ret = alloc_chrdev_region(&base_dev, 0, IB_UMAD_MAX_PORTS * 2, "infiniband_mad"); if (ret) { printk(KERN_ERR "user_mad: couldn't get device number\n"); @@ -705,13 +816,11 @@ return 0; - ib_unregister_client(&umad_client); - out_class: class_unregister(&umad_class); out_chrdev: - unregister_chrdev_region(base_dev, IB_UMAD_MAX_PORTS); + unregister_chrdev_region(base_dev, IB_UMAD_MAX_PORTS * 2); out: return ret; @@ -721,7 +830,7 @@ { ib_unregister_client(&umad_client); class_unregister(&umad_class); - unregister_chrdev_region(base_dev, IB_UMAD_MAX_PORTS); + unregister_chrdev_region(base_dev, IB_UMAD_MAX_PORTS * 2); } module_init(ib_umad_init); diff -Nru a/drivers/infiniband/hw/mthca/Kconfig b/drivers/infiniband/hw/mthca/Kconfig --- a/drivers/infiniband/hw/mthca/Kconfig 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/hw/mthca/Kconfig 2005-01-28 14:11:40 -08:00 @@ -14,13 +14,3 @@ This option causes the mthca driver produce a bunch of debug messages. Select this is you are developing the driver or trying to diagnose a problem. - -config INFINIBAND_MTHCA_SSE_DOORBELL - bool "SSE doorbell code" - depends on INFINIBAND_MTHCA && X86 && !X86_64 - default n - ---help--- - This option will have the mthca driver use SSE instructions - to ring hardware doorbell registers. This may improve - performance for some workloads, but the driver will not run - on processors without SSE instructions. diff -Nru a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c --- a/drivers/infiniband/hw/mthca/mthca_cmd.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_cmd.c 2005-01-28 14:11:41 -08:00 @@ -36,6 +36,7 @@ #include #include #include +#include #include "mthca_dev.h" #include "mthca_config_reg.h" @@ -509,7 +510,8 @@ return mthca_cmd(dev, 0, 0, 0, CMD_SYS_DIS, HZ, status); } -int mthca_MAP_FA(struct mthca_dev *dev, struct mthca_icm *icm, u8 *status) +static int mthca_map_cmd(struct mthca_dev *dev, u16 op, struct mthca_icm *icm, + u64 virt, u8 *status) { u32 *inbox; dma_addr_t indma; @@ -518,12 +520,17 @@ int nent = 0; int i; int err = 0; - int ts = 0; + int ts = 0, tc = 0; inbox = pci_alloc_consistent(dev->pdev, PAGE_SIZE, &indma); + if (!inbox) + return -ENOMEM; + memset(inbox, 0, PAGE_SIZE); - for (mthca_icm_first(icm, &iter); !mthca_icm_last(&iter); mthca_icm_next(&iter)) { + for (mthca_icm_first(icm, &iter); + !mthca_icm_last(&iter); + mthca_icm_next(&iter)) { /* * We have to pass pages that are aligned to their * size, so find the least significant 1 in the @@ -538,13 +545,20 @@ goto out; } for (i = 0; i < mthca_icm_size(&iter) / (1 << lg); ++i, ++nent) { + if (virt != -1) { + *((__be64 *) (inbox + nent * 4)) = + cpu_to_be64(virt); + virt += 1 << lg; + } + *((__be64 *) (inbox + nent * 4 + 2)) = cpu_to_be64((mthca_icm_addr(&iter) + - (i << lg)) | - (lg - 12)); + (i << lg)) | (lg - 12)); ts += 1 << (lg - 10); + ++tc; + if (nent == PAGE_SIZE / 16) { - err = mthca_cmd(dev, indma, nent, 0, CMD_MAP_FA, + err = mthca_cmd(dev, indma, nent, 0, op, CMD_TIME_CLASS_B, status); if (err || *status) goto out; @@ -553,18 +567,33 @@ } } - if (nent) { - err = mthca_cmd(dev, indma, nent, 0, CMD_MAP_FA, + if (nent) + err = mthca_cmd(dev, indma, nent, 0, op, CMD_TIME_CLASS_B, status); - } - mthca_dbg(dev, "Mapped %d KB of host memory for FW.\n", ts); + switch (op) { + case CMD_MAP_FA: + mthca_dbg(dev, "Mapped %d chunks/%d KB for FW.\n", tc, ts); + break; + case CMD_MAP_ICM_AUX: + mthca_dbg(dev, "Mapped %d chunks/%d KB for ICM aux.\n", tc, ts); + break; + case CMD_MAP_ICM: + mthca_dbg(dev, "Mapped %d chunks/%d KB at %llx for ICM.\n", + tc, ts, (unsigned long long) virt - (ts << 10)); + break; + } out: pci_free_consistent(dev->pdev, PAGE_SIZE, inbox, indma); return err; } +int mthca_MAP_FA(struct mthca_dev *dev, struct mthca_icm *icm, u8 *status) +{ + return mthca_map_cmd(dev, CMD_MAP_FA, icm, -1, status); +} + int mthca_UNMAP_FA(struct mthca_dev *dev, u8 *status) { return mthca_cmd(dev, 0, 0, 0, CMD_UNMAP_FA, CMD_TIME_CLASS_B, status); @@ -1068,8 +1097,11 @@ #define INIT_HCA_MTT_BASE_OFFSET (INIT_HCA_TPT_OFFSET + 0x10) #define INIT_HCA_UAR_OFFSET 0x120 #define INIT_HCA_UAR_BASE_OFFSET (INIT_HCA_UAR_OFFSET + 0x00) +#define INIT_HCA_UARC_SZ_OFFSET (INIT_HCA_UAR_OFFSET + 0x09) +#define INIT_HCA_LOG_UAR_SZ_OFFSET (INIT_HCA_UAR_OFFSET + 0x0a) #define INIT_HCA_UAR_PAGE_SZ_OFFSET (INIT_HCA_UAR_OFFSET + 0x0b) #define INIT_HCA_UAR_SCATCH_BASE_OFFSET (INIT_HCA_UAR_OFFSET + 0x10) +#define INIT_HCA_UAR_CTX_BASE_OFFSET (INIT_HCA_UAR_OFFSET + 0x18) inbox = pci_alloc_consistent(dev->pdev, INIT_HCA_IN_SIZE, &indma); if (!inbox) @@ -1117,7 +1149,8 @@ /* TPT attributes */ MTHCA_PUT(inbox, param->mpt_base, INIT_HCA_MPT_BASE_OFFSET); - MTHCA_PUT(inbox, param->mtt_seg_sz, INIT_HCA_MTT_SEG_SZ_OFFSET); + if (dev->hca_type != ARBEL_NATIVE) + MTHCA_PUT(inbox, param->mtt_seg_sz, INIT_HCA_MTT_SEG_SZ_OFFSET); MTHCA_PUT(inbox, param->log_mpt_sz, INIT_HCA_LOG_MPT_SZ_OFFSET); MTHCA_PUT(inbox, param->mtt_base, INIT_HCA_MTT_BASE_OFFSET); @@ -1125,7 +1158,14 @@ { u8 uar_page_sz = PAGE_SHIFT - 12; MTHCA_PUT(inbox, uar_page_sz, INIT_HCA_UAR_PAGE_SZ_OFFSET); - MTHCA_PUT(inbox, param->uar_scratch_base, INIT_HCA_UAR_SCATCH_BASE_OFFSET); + } + + MTHCA_PUT(inbox, param->uar_scratch_base, INIT_HCA_UAR_SCATCH_BASE_OFFSET); + + if (dev->hca_type == ARBEL_NATIVE) { + MTHCA_PUT(inbox, param->log_uarc_sz, INIT_HCA_UARC_SZ_OFFSET); + MTHCA_PUT(inbox, param->log_uar_sz, INIT_HCA_LOG_UAR_SZ_OFFSET); + MTHCA_PUT(inbox, param->uarc_base, INIT_HCA_UAR_CTX_BASE_OFFSET); } err = mthca_cmd(dev, indma, 0, 0, CMD_INIT_HCA, @@ -1199,6 +1239,103 @@ return mthca_cmd(dev, 0, 0, panic, CMD_CLOSE_HCA, HZ, status); } +int mthca_SET_IB(struct mthca_dev *dev, struct mthca_set_ib_param *param, + int port, u8 *status) +{ + u32 *inbox; + dma_addr_t indma; + int err; + u32 flags = 0; + +#define SET_IB_IN_SIZE 0x40 +#define SET_IB_FLAGS_OFFSET 0x00 +#define SET_IB_FLAG_SIG (1 << 18) +#define SET_IB_FLAG_RQK (1 << 0) +#define SET_IB_CAP_MASK_OFFSET 0x04 +#define SET_IB_SI_GUID_OFFSET 0x08 + + inbox = pci_alloc_consistent(dev->pdev, SET_IB_IN_SIZE, &indma); + if (!inbox) + return -ENOMEM; + + memset(inbox, 0, SET_IB_IN_SIZE); + + flags |= param->set_si_guid ? SET_IB_FLAG_SIG : 0; + flags |= param->reset_qkey_viol ? SET_IB_FLAG_RQK : 0; + MTHCA_PUT(inbox, flags, SET_IB_FLAGS_OFFSET); + + MTHCA_PUT(inbox, param->cap_mask, SET_IB_CAP_MASK_OFFSET); + MTHCA_PUT(inbox, param->si_guid, SET_IB_SI_GUID_OFFSET); + + err = mthca_cmd(dev, indma, port, 0, CMD_SET_IB, + CMD_TIME_CLASS_B, status); + + pci_free_consistent(dev->pdev, INIT_HCA_IN_SIZE, inbox, indma); + return err; +} + +int mthca_MAP_ICM(struct mthca_dev *dev, struct mthca_icm *icm, u64 virt, u8 *status) +{ + return mthca_map_cmd(dev, CMD_MAP_ICM, icm, virt, status); +} + +int mthca_MAP_ICM_page(struct mthca_dev *dev, u64 dma_addr, u64 virt, u8 *status) +{ + u64 *inbox; + dma_addr_t indma; + int err; + + inbox = pci_alloc_consistent(dev->pdev, 16, &indma); + if (!inbox) + return -ENOMEM; + + inbox[0] = cpu_to_be64(virt); + inbox[1] = cpu_to_be64(dma_addr | (PAGE_SHIFT - 12)); + + err = mthca_cmd(dev, indma, 1, 0, CMD_MAP_ICM, CMD_TIME_CLASS_B, status); + + pci_free_consistent(dev->pdev, 16, inbox, indma); + + if (!err) + mthca_dbg(dev, "Mapped page at %llx for ICM.\n", + (unsigned long long) virt); + + return err; +} + +int mthca_UNMAP_ICM(struct mthca_dev *dev, u64 virt, u32 page_count, u8 *status) +{ + return mthca_cmd(dev, virt, page_count, 0, CMD_UNMAP_ICM, CMD_TIME_CLASS_B, status); +} + +int mthca_MAP_ICM_AUX(struct mthca_dev *dev, struct mthca_icm *icm, u8 *status) +{ + return mthca_map_cmd(dev, CMD_MAP_ICM_AUX, icm, -1, status); +} + +int mthca_UNMAP_ICM_AUX(struct mthca_dev *dev, u8 *status) +{ + return mthca_cmd(dev, 0, 0, 0, CMD_UNMAP_ICM_AUX, CMD_TIME_CLASS_B, status); +} + +int mthca_SET_ICM_SIZE(struct mthca_dev *dev, u64 icm_size, u64 *aux_pages, + u8 *status) +{ + int ret = mthca_cmd_imm(dev, icm_size, aux_pages, 0, 0, CMD_SET_ICM_SIZE, + CMD_TIME_CLASS_A, status); + + if (ret || status) + return ret; + + /* + * Arbel page size is always 4 KB; round up number of system + * pages needed. + */ + *aux_pages = (*aux_pages + (1 << (PAGE_SHIFT - 12)) - 1) >> (PAGE_SHIFT - 12); + + return 0; +} + int mthca_SW2HW_MPT(struct mthca_dev *dev, void *mpt_entry, int mpt_index, u8 *status) { @@ -1490,13 +1627,24 @@ CMD_TIME_CLASS_B, status); } -int mthca_MAD_IFC(struct mthca_dev *dev, int ignore_mkey, int port, - void *in_mad, void *response_mad, u8 *status) { +int mthca_MAD_IFC(struct mthca_dev *dev, int ignore_mkey, int ignore_bkey, + int port, struct ib_wc* in_wc, struct ib_grh* in_grh, + void *in_mad, void *response_mad, u8 *status) +{ void *box; dma_addr_t dma; int err; + u32 in_modifier = port; + u8 op_modifier = 0; -#define MAD_IFC_BOX_SIZE 512 +#define MAD_IFC_BOX_SIZE 0x400 +#define MAD_IFC_MY_QPN_OFFSET 0x100 +#define MAD_IFC_RQPN_OFFSET 0x104 +#define MAD_IFC_SL_OFFSET 0x108 +#define MAD_IFC_G_PATH_OFFSET 0x109 +#define MAD_IFC_RLID_OFFSET 0x10a +#define MAD_IFC_PKEY_OFFSET 0x10e +#define MAD_IFC_GRH_OFFSET 0x140 box = pci_alloc_consistent(dev->pdev, MAD_IFC_BOX_SIZE, &dma); if (!box) @@ -1504,11 +1652,46 @@ memcpy(box, in_mad, 256); - err = mthca_cmd_box(dev, dma, dma + 256, port, !!ignore_mkey, + /* + * Key check traps can't be generated unless we have in_wc to + * tell us where to send the trap. + */ + if (ignore_mkey || !in_wc) + op_modifier |= 0x1; + if (ignore_bkey || !in_wc) + op_modifier |= 0x2; + + if (in_wc) { + u8 val; + + memset(box + 256, 0, 256); + + MTHCA_PUT(box, in_wc->qp_num, MAD_IFC_MY_QPN_OFFSET); + MTHCA_PUT(box, in_wc->src_qp, MAD_IFC_RQPN_OFFSET); + + val = in_wc->sl << 4; + MTHCA_PUT(box, val, MAD_IFC_SL_OFFSET); + + val = in_wc->dlid_path_bits | + (in_wc->wc_flags & IB_WC_GRH ? 0x80 : 0); + MTHCA_PUT(box, val, MAD_IFC_GRH_OFFSET); + + MTHCA_PUT(box, in_wc->slid, MAD_IFC_RLID_OFFSET); + MTHCA_PUT(box, in_wc->pkey_index, MAD_IFC_PKEY_OFFSET); + + if (in_grh) + memcpy((u8 *) box + MAD_IFC_GRH_OFFSET, in_grh, 40); + + op_modifier |= 0x10; + + in_modifier |= in_wc->slid << 16; + } + + err = mthca_cmd_box(dev, dma, dma + 512, in_modifier, op_modifier, CMD_MAD_IFC, CMD_TIME_CLASS_C, status); if (!err && !*status) - memcpy(response_mad, box + 256, 256); + memcpy(response_mad, box + 512, 256); pci_free_consistent(dev->pdev, MAD_IFC_BOX_SIZE, box, dma); return err; @@ -1573,4 +1756,9 @@ pci_unmap_single(dev->pdev, indma, 16, PCI_DMA_TODEVICE); return err; +} + +int mthca_NOP(struct mthca_dev *dev, u8 *status) +{ + return mthca_cmd(dev, 0, 0x1f, 0, CMD_NOP, msecs_to_jiffies(100), status); } diff -Nru a/drivers/infiniband/hw/mthca/mthca_cmd.h b/drivers/infiniband/hw/mthca/mthca_cmd.h --- a/drivers/infiniband/hw/mthca/mthca_cmd.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_cmd.h 2005-01-28 14:11:40 -08:00 @@ -174,27 +174,30 @@ struct mthca_init_hca_param { u64 qpc_base; - u8 log_num_qps; u64 eec_base; - u8 log_num_eecs; u64 srqc_base; - u8 log_num_srqs; u64 cqc_base; - u8 log_num_cqs; u64 eqpc_base; u64 eeec_base; u64 eqc_base; - u8 log_num_eqs; u64 rdb_base; u64 mc_base; + u64 mpt_base; + u64 mtt_base; + u64 uar_scratch_base; + u64 uarc_base; u16 log_mc_entry_sz; u16 mc_hash_sz; + u8 log_num_qps; + u8 log_num_eecs; + u8 log_num_srqs; + u8 log_num_cqs; + u8 log_num_eqs; u8 log_mc_table_sz; - u64 mpt_base; u8 mtt_seg_sz; u8 log_mpt_sz; - u64 mtt_base; - u64 uar_scratch_base; + u8 log_uar_sz; + u8 log_uarc_sz; }; struct mthca_init_ib_param { @@ -212,6 +215,13 @@ u64 si_guid; }; +struct mthca_set_ib_param { + int set_si_guid; + int reset_qkey_viol; + u64 si_guid; + u32 cap_mask; +}; + int mthca_cmd_use_events(struct mthca_dev *dev); void mthca_cmd_use_polling(struct mthca_dev *dev); void mthca_cmd_event(struct mthca_dev *dev, u16 token, @@ -238,6 +248,15 @@ int port, u8 *status); int mthca_CLOSE_IB(struct mthca_dev *dev, int port, u8 *status); int mthca_CLOSE_HCA(struct mthca_dev *dev, int panic, u8 *status); +int mthca_SET_IB(struct mthca_dev *dev, struct mthca_set_ib_param *param, + int port, u8 *status); +int mthca_MAP_ICM(struct mthca_dev *dev, struct mthca_icm *icm, u64 virt, u8 *status); +int mthca_MAP_ICM_page(struct mthca_dev *dev, u64 dma_addr, u64 virt, u8 *status); +int mthca_UNMAP_ICM(struct mthca_dev *dev, u64 virt, u32 page_count, u8 *status); +int mthca_MAP_ICM_AUX(struct mthca_dev *dev, struct mthca_icm *icm, u8 *status); +int mthca_UNMAP_ICM_AUX(struct mthca_dev *dev, u8 *status); +int mthca_SET_ICM_SIZE(struct mthca_dev *dev, u64 icm_size, u64 *aux_pages, + u8 *status); int mthca_SW2HW_MPT(struct mthca_dev *dev, void *mpt_entry, int mpt_index, u8 *status); int mthca_HW2SW_MPT(struct mthca_dev *dev, void *mpt_entry, @@ -261,7 +280,8 @@ void *qp_context, u8 *status); int mthca_CONF_SPECIAL_QP(struct mthca_dev *dev, int type, u32 qpn, u8 *status); -int mthca_MAD_IFC(struct mthca_dev *dev, int ignore_mkey, int port, +int mthca_MAD_IFC(struct mthca_dev *dev, int ignore_mkey, int ignore_bkey, + int port, struct ib_wc* in_wc, struct ib_grh* in_grh, void *in_mad, void *response_mad, u8 *status); int mthca_READ_MGM(struct mthca_dev *dev, int index, void *mgm, u8 *status); @@ -269,6 +289,7 @@ u8 *status); int mthca_MGID_HASH(struct mthca_dev *dev, void *gid, u16 *hash, u8 *status); +int mthca_NOP(struct mthca_dev *dev, u8 *status); #define MAILBOX_ALIGN(x) ((void *) ALIGN((unsigned long) (x), MTHCA_CMD_MAILBOX_ALIGN)) diff -Nru a/drivers/infiniband/hw/mthca/mthca_config_reg.h b/drivers/infiniband/hw/mthca/mthca_config_reg.h --- a/drivers/infiniband/hw/mthca/mthca_config_reg.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_config_reg.h 2005-01-28 14:11:40 -08:00 @@ -43,13 +43,8 @@ #define MTHCA_ECR_SIZE 0x00008 #define MTHCA_ECR_CLR_BASE 0x80708 #define MTHCA_ECR_CLR_SIZE 0x00008 -#define MTHCA_ECR_OFFSET (MTHCA_ECR_BASE - MTHCA_HCR_BASE) -#define MTHCA_ECR_CLR_OFFSET (MTHCA_ECR_CLR_BASE - MTHCA_HCR_BASE) +#define MTHCA_MAP_ECR_SIZE (MTHCA_ECR_SIZE + MTHCA_ECR_CLR_SIZE) #define MTHCA_CLR_INT_BASE 0xf00d8 #define MTHCA_CLR_INT_SIZE 0x00008 - -#define MTHCA_MAP_HCR_SIZE (MTHCA_ECR_CLR_BASE + \ - MTHCA_ECR_CLR_SIZE - \ - MTHCA_HCR_BASE) #endif /* MTHCA_CONFIG_REG_H */ diff -Nru a/drivers/infiniband/hw/mthca/mthca_dev.h b/drivers/infiniband/hw/mthca/mthca_dev.h --- a/drivers/infiniband/hw/mthca/mthca_dev.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_dev.h 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 Topspin Communications. All rights reserved. + * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -153,10 +153,12 @@ }; struct mthca_mr_table { - struct mthca_alloc mpt_alloc; - int max_mtt_order; - unsigned long **mtt_buddy; - u64 mtt_base; + struct mthca_alloc mpt_alloc; + int max_mtt_order; + unsigned long **mtt_buddy; + u64 mtt_base; + struct mthca_icm_table *mtt_table; + struct mthca_icm_table *mpt_table; }; struct mthca_eq_table { @@ -164,23 +166,29 @@ void __iomem *clr_int; u32 clr_mask; struct mthca_eq eq[MTHCA_NUM_EQ]; + u64 icm_virt; + struct page *icm_page; + dma_addr_t icm_dma; int have_irq; u8 inta_pin; }; struct mthca_cq_table { - struct mthca_alloc alloc; - spinlock_t lock; - struct mthca_array cq; + struct mthca_alloc alloc; + spinlock_t lock; + struct mthca_array cq; + struct mthca_icm_table *table; }; struct mthca_qp_table { - struct mthca_alloc alloc; - u32 rdb_base; - int rdb_shift; - int sqp_start; - spinlock_t lock; - struct mthca_array qp; + struct mthca_alloc alloc; + u32 rdb_base; + int rdb_shift; + int sqp_start; + spinlock_t lock; + struct mthca_array qp; + struct mthca_icm_table *qp_table; + struct mthca_icm_table *eqp_table; }; struct mthca_av_table { @@ -216,7 +224,8 @@ u64 clr_int_base; u64 eq_arm_base; u64 eq_set_ci_base; - struct mthca_icm *icm; + struct mthca_icm *fw_icm; + struct mthca_icm *aux_icm; u16 fw_pages; } arbel; } fw; @@ -225,8 +234,10 @@ u64 ddr_end; MTHCA_DECLARE_DOORBELL_LOCK(doorbell_lock) + struct semaphore cap_mask_mutex; void __iomem *hcr; + void __iomem *ecr_base; void __iomem *clr_base; void __iomem *kar; @@ -328,6 +339,9 @@ int list_len, u64 iova, u64 total_size, u32 access, struct mthca_mr *mr); void mthca_free_mr(struct mthca_dev *dev, struct mthca_mr *mr); + +int mthca_map_eq_icm(struct mthca_dev *dev, u64 icm_virt); +void mthca_unmap_eq_icm(struct mthca_dev *dev); int mthca_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry); diff -Nru a/drivers/infiniband/hw/mthca/mthca_doorbell.h b/drivers/infiniband/hw/mthca/mthca_doorbell.h --- a/drivers/infiniband/hw/mthca/mthca_doorbell.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_doorbell.h 2005-01-28 14:11:40 -08:00 @@ -32,9 +32,7 @@ * $Id: mthca_doorbell.h 1349 2004-12-16 21:09:43Z roland $ */ -#include #include -#include #define MTHCA_RD_DOORBELL 0x00 #define MTHCA_SEND_DOORBELL 0x10 @@ -59,51 +57,13 @@ __raw_writeq(*(u64 *) val, dest); } -#elif defined(CONFIG_INFINIBAND_MTHCA_SSE_DOORBELL) -/* Use SSE to write 64 bits atomically without a lock. */ - -#define MTHCA_DECLARE_DOORBELL_LOCK(name) -#define MTHCA_INIT_DOORBELL_LOCK(ptr) do { } while (0) -#define MTHCA_GET_DOORBELL_LOCK(ptr) (NULL) - -static inline unsigned long mthca_get_fpu(void) -{ - unsigned long cr0; - - preempt_disable(); - asm volatile("mov %%cr0,%0; clts" : "=r" (cr0)); - return cr0; -} - -static inline void mthca_put_fpu(unsigned long cr0) -{ - asm volatile("mov %0,%%cr0" : : "r" (cr0)); - preempt_enable(); -} - -static inline void mthca_write64(u32 val[2], void __iomem *dest, - spinlock_t *doorbell_lock) -{ - /* i386 stack is aligned to 8 bytes, so this should be OK: */ - u8 xmmsave[8] __attribute__((aligned(8))); - unsigned long cr0; - - cr0 = mthca_get_fpu(); - - asm volatile ( - "movlps %%xmm0,(%0); \n\t" - "movlps (%1),%%xmm0; \n\t" - "movlps %%xmm0,(%2); \n\t" - "movlps (%0),%%xmm0; \n\t" - : - : "r" (xmmsave), "r" (val), "r" (dest) - : "memory" ); - - mthca_put_fpu(cr0); -} - #else -/* Just fall back to a spinlock to protect the doorbell */ + +/* + * Just fall back to a spinlock to protect the doorbell if + * BITS_PER_LONG is 32 -- there's no portable way to do atomic 64-bit + * MMIO writes. + */ #define MTHCA_DECLARE_DOORBELL_LOCK(name) spinlock_t name; #define MTHCA_INIT_DOORBELL_LOCK(ptr) spin_lock_init(ptr) diff -Nru a/drivers/infiniband/hw/mthca/mthca_eq.c b/drivers/infiniband/hw/mthca/mthca_eq.c --- a/drivers/infiniband/hw/mthca/mthca_eq.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_eq.c 2005-01-28 14:11:41 -08:00 @@ -164,12 +164,12 @@ MTHCA_ASYNC_EVENT_MASK; } -static inline void set_eq_ci(struct mthca_dev *dev, int eqn, int ci) +static inline void set_eq_ci(struct mthca_dev *dev, struct mthca_eq *eq, u32 ci) { u32 doorbell[2]; - doorbell[0] = cpu_to_be32(MTHCA_EQ_DB_SET_CI | eqn); - doorbell[1] = cpu_to_be32(ci); + doorbell[0] = cpu_to_be32(MTHCA_EQ_DB_SET_CI | eq->eqn); + doorbell[1] = cpu_to_be32(ci & (eq->nent - 1)); mthca_write64(doorbell, dev->kar + MTHCA_EQ_DOORBELL, @@ -200,21 +200,22 @@ MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); } -static inline struct mthca_eqe *get_eqe(struct mthca_eq *eq, int entry) +static inline struct mthca_eqe *get_eqe(struct mthca_eq *eq, u32 entry) { - return eq->page_list[entry * MTHCA_EQ_ENTRY_SIZE / PAGE_SIZE].buf - + (entry * MTHCA_EQ_ENTRY_SIZE) % PAGE_SIZE; + unsigned long off = (entry & (eq->nent - 1)) * MTHCA_EQ_ENTRY_SIZE; + return eq->page_list[off / PAGE_SIZE].buf + off % PAGE_SIZE; } -static inline int next_eqe_sw(struct mthca_eq *eq) +static inline struct mthca_eqe* next_eqe_sw(struct mthca_eq *eq) { - return !(MTHCA_EQ_ENTRY_OWNER_HW & - get_eqe(eq, eq->cons_index)->owner); + struct mthca_eqe* eqe; + eqe = get_eqe(eq, eq->cons_index); + return (MTHCA_EQ_ENTRY_OWNER_HW & eqe->owner) ? NULL : eqe; } -static inline void set_eqe_hw(struct mthca_eq *eq, int entry) +static inline void set_eqe_hw(struct mthca_eqe *eqe) { - get_eqe(eq, entry)->owner = MTHCA_EQ_ENTRY_OWNER_HW; + eqe->owner = MTHCA_EQ_ENTRY_OWNER_HW; } static void port_change(struct mthca_dev *dev, int port, int active) @@ -235,10 +236,10 @@ { struct mthca_eqe *eqe; int disarm_cqn; + int eqes_found = 0; - while (next_eqe_sw(eq)) { + while ((eqe = next_eqe_sw(eq))) { int set_ci = 0; - eqe = get_eqe(eq, eq->cons_index); /* * Make sure we read EQ entry contents after we've @@ -328,12 +329,13 @@ break; }; - set_eqe_hw(eq, eq->cons_index); - eq->cons_index = (eq->cons_index + 1) & (eq->nent - 1); + set_eqe_hw(eqe); + ++eq->cons_index; + eqes_found = 1; if (set_ci) { wmb(); /* see comment below */ - set_eq_ci(dev, eq->eqn, eq->cons_index); + set_eq_ci(dev, eq, eq->cons_index); set_ci = 0; } } @@ -347,8 +349,10 @@ * possibility of the HCA writing an entry and then * having set_eqe_hw() overwrite the owner field. */ - wmb(); - set_eq_ci(dev, eq->eqn, eq->cons_index); + if (likely(eqes_found)) { + wmb(); + set_eq_ci(dev, eq, eq->cons_index); + } eq_req_not(dev, eq->eqn); } @@ -362,10 +366,11 @@ if (dev->eq_table.clr_mask) writel(dev->eq_table.clr_mask, dev->eq_table.clr_int); - while ((ecr = readl(dev->hcr + MTHCA_ECR_OFFSET + 4)) != 0) { + if ((ecr = readl(dev->ecr_base + 4)) != 0) { work = 1; - writel(ecr, dev->hcr + MTHCA_ECR_CLR_OFFSET + 4); + writel(ecr, dev->ecr_base + + MTHCA_ECR_CLR_BASE - MTHCA_ECR_BASE + 4); for (i = 0; i < MTHCA_NUM_EQ; ++i) if (ecr & dev->eq_table.eq[i].ecr_mask) @@ -381,7 +386,6 @@ struct mthca_eq *eq = eq_ptr; struct mthca_dev *dev = eq->dev; - writel(eq->ecr_mask, dev->hcr + MTHCA_ECR_CLR_OFFSET + 4); mthca_eq_int(dev, eq); /* MSI-X vectors always belong to us */ @@ -441,7 +445,7 @@ } for (i = 0; i < nent; ++i) - set_eqe_hw(eq, i); + set_eqe_hw(get_eqe(eq, i)); eq->eqn = mthca_alloc(&dev->eq_table.alloc); if (eq->eqn == -1) @@ -572,6 +576,50 @@ if (dev->eq_table.eq[i].have_irq) free_irq(dev->eq_table.eq[i].msi_x_vector, dev->eq_table.eq + i); +} + +int __devinit mthca_map_eq_icm(struct mthca_dev *dev, u64 icm_virt) +{ + int ret; + u8 status; + + /* + * We assume that mapping one page is enough for the whole EQ + * context table. This is fine with all current HCAs, because + * we only use 32 EQs and each EQ uses 32 bytes of context + * memory, or 1 KB total. + */ + dev->eq_table.icm_virt = icm_virt; + dev->eq_table.icm_page = alloc_page(GFP_HIGHUSER); + if (!dev->eq_table.icm_page) + return -ENOMEM; + dev->eq_table.icm_dma = pci_map_page(dev->pdev, dev->eq_table.icm_page, 0, + PAGE_SIZE, PCI_DMA_BIDIRECTIONAL); + if (pci_dma_mapping_error(dev->eq_table.icm_dma)) { + __free_page(dev->eq_table.icm_page); + return -ENOMEM; + } + + ret = mthca_MAP_ICM_page(dev, dev->eq_table.icm_dma, icm_virt, &status); + if (!ret && status) + ret = -EINVAL; + if (ret) { + pci_unmap_page(dev->pdev, dev->eq_table.icm_dma, PAGE_SIZE, + PCI_DMA_BIDIRECTIONAL); + __free_page(dev->eq_table.icm_page); + } + + return ret; +} + +void __devexit mthca_unmap_eq_icm(struct mthca_dev *dev) +{ + u8 status; + + mthca_UNMAP_ICM(dev, dev->eq_table.icm_virt, PAGE_SIZE / 4096, &status); + pci_unmap_page(dev->pdev, dev->eq_table.icm_dma, PAGE_SIZE, + PCI_DMA_BIDIRECTIONAL); + __free_page(dev->eq_table.icm_page); } int __devinit mthca_init_eq_table(struct mthca_dev *dev) diff -Nru a/drivers/infiniband/hw/mthca/mthca_mad.c b/drivers/infiniband/hw/mthca/mthca_mad.c --- a/drivers/infiniband/hw/mthca/mthca_mad.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_mad.c 2005-01-28 14:11:41 -08:00 @@ -232,8 +232,9 @@ return IB_MAD_RESULT_SUCCESS; err = mthca_MAD_IFC(to_mdev(ibdev), - !!(mad_flags & IB_MAD_IGNORE_MKEY), - port_num, in_mad, out_mad, + mad_flags & IB_MAD_IGNORE_MKEY, + mad_flags & IB_MAD_IGNORE_BKEY, + port_num, in_wc, in_grh, in_mad, out_mad, &status); if (err) { mthca_err(to_mdev(ibdev), "MAD_IFC failed\n"); diff -Nru a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c --- a/drivers/infiniband/hw/mthca/mthca_main.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_main.c 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 Topspin Communications. All rights reserved. + * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -40,10 +40,6 @@ #include #include -#ifdef CONFIG_INFINIBAND_MTHCA_SSE_DOORBELL -#include -#endif - #include "mthca_dev.h" #include "mthca_config_reg.h" #include "mthca_cmd.h" @@ -82,12 +78,9 @@ .num_cq = 1 << 16, .num_mcg = 1 << 13, .num_mpt = 1 << 17, - .num_mtt = 1 << 20 -}; - -enum { - MTHCA_TAVOR_NUM_UDAV = 1 << 15, - MTHCA_ARBEL_UARC_SIZE = 1 << 18 + .num_mtt = 1 << 20, + .num_udav = 1 << 15, /* Tavor only */ + .uarc_size = 1 << 18, /* Arbel only */ }; static int __devinit mthca_tune_pci(struct mthca_dev *mdev) @@ -207,58 +200,58 @@ err = mthca_QUERY_FW(mdev, &status); if (err) { mthca_err(mdev, "QUERY_FW command failed, aborting.\n"); - goto err_out_disable; + goto err_disable; } if (status) { mthca_err(mdev, "QUERY_FW returned status 0x%02x, " "aborting.\n", status); err = -EINVAL; - goto err_out_disable; + goto err_disable; } err = mthca_QUERY_DDR(mdev, &status); if (err) { mthca_err(mdev, "QUERY_DDR command failed, aborting.\n"); - goto err_out_disable; + goto err_disable; } if (status) { mthca_err(mdev, "QUERY_DDR returned status 0x%02x, " "aborting.\n", status); err = -EINVAL; - goto err_out_disable; + goto err_disable; } err = mthca_dev_lim(mdev, &dev_lim); profile = default_profile; - profile.num_uar = dev_lim.uar_size / PAGE_SIZE; - profile.num_udav = MTHCA_TAVOR_NUM_UDAV; + profile.num_uar = dev_lim.uar_size / PAGE_SIZE; + profile.uarc_size = 0; err = mthca_make_profile(mdev, &profile, &dev_lim, &init_hca); - if (err) - goto err_out_disable; + if (err < 0) + goto err_disable; err = mthca_INIT_HCA(mdev, &init_hca, &status); if (err) { mthca_err(mdev, "INIT_HCA command failed, aborting.\n"); - goto err_out_disable; + goto err_disable; } if (status) { mthca_err(mdev, "INIT_HCA returned status 0x%02x, " "aborting.\n", status); err = -EINVAL; - goto err_out_disable; + goto err_disable; } err = mthca_QUERY_ADAPTER(mdev, &adapter, &status); if (err) { mthca_err(mdev, "QUERY_ADAPTER command failed, aborting.\n"); - goto err_out_disable; + goto err_close; } if (status) { mthca_err(mdev, "QUERY_ADAPTER returned status 0x%02x, " "aborting.\n", status); err = -EINVAL; - goto err_out_close; + goto err_close; } mdev->eq_table.inta_pin = adapter.inta_pin; @@ -266,10 +259,10 @@ return 0; -err_out_close: +err_close: mthca_CLOSE_HCA(mdev, 0, &status); -err_out_disable: +err_disable: mthca_SYS_DIS(mdev, &status); return err; @@ -282,15 +275,15 @@ /* FIXME: use HCA-attached memory for FW if present */ - mdev->fw.arbel.icm = + mdev->fw.arbel.fw_icm = mthca_alloc_icm(mdev, mdev->fw.arbel.fw_pages, GFP_HIGHUSER | __GFP_NOWARN); - if (!mdev->fw.arbel.icm) { + if (!mdev->fw.arbel.fw_icm) { mthca_err(mdev, "Couldn't allocate FW area, aborting.\n"); return -ENOMEM; } - err = mthca_MAP_FA(mdev, mdev->fw.arbel.icm, &status); + err = mthca_MAP_FA(mdev, mdev->fw.arbel.fw_icm, &status); if (err) { mthca_err(mdev, "MAP_FA command failed, aborting.\n"); goto err_free; @@ -317,13 +310,146 @@ mthca_UNMAP_FA(mdev, &status); err_free: - mthca_free_icm(mdev, mdev->fw.arbel.icm); + mthca_free_icm(mdev, mdev->fw.arbel.fw_icm); + return err; +} + +static int __devinit mthca_init_icm(struct mthca_dev *mdev, + struct mthca_dev_lim *dev_lim, + struct mthca_init_hca_param *init_hca, + u64 icm_size) +{ + u64 aux_pages; + u8 status; + int err; + + err = mthca_SET_ICM_SIZE(mdev, icm_size, &aux_pages, &status); + if (err) { + mthca_err(mdev, "SET_ICM_SIZE command failed, aborting.\n"); + return err; + } + if (status) { + mthca_err(mdev, "SET_ICM_SIZE returned status 0x%02x, " + "aborting.\n", status); + return -EINVAL; + } + + mthca_dbg(mdev, "%lld KB of HCA context requires %lld KB aux memory.\n", + (unsigned long long) icm_size >> 10, + (unsigned long long) aux_pages << 2); + + mdev->fw.arbel.aux_icm = mthca_alloc_icm(mdev, aux_pages, + GFP_HIGHUSER | __GFP_NOWARN); + if (!mdev->fw.arbel.aux_icm) { + mthca_err(mdev, "Couldn't allocate aux memory, aborting.\n"); + return -ENOMEM; + } + + err = mthca_MAP_ICM_AUX(mdev, mdev->fw.arbel.aux_icm, &status); + if (err) { + mthca_err(mdev, "MAP_ICM_AUX command failed, aborting.\n"); + goto err_free_aux; + } + if (status) { + mthca_err(mdev, "MAP_ICM_AUX returned status 0x%02x, aborting.\n", status); + err = -EINVAL; + goto err_free_aux; + } + + err = mthca_map_eq_icm(mdev, init_hca->eqc_base); + if (err) { + mthca_err(mdev, "Failed to map EQ context memory, aborting.\n"); + goto err_unmap_aux; + } + + mdev->mr_table.mtt_table = mthca_alloc_icm_table(mdev, init_hca->mtt_base, + mdev->limits.num_mtt_segs * + init_hca->mtt_seg_sz, + mdev->limits.reserved_mtts * + init_hca->mtt_seg_sz, 1); + if (!mdev->mr_table.mtt_table) { + mthca_err(mdev, "Failed to map MTT context memory, aborting.\n"); + err = -ENOMEM; + goto err_unmap_eq; + } + + mdev->mr_table.mpt_table = mthca_alloc_icm_table(mdev, init_hca->mpt_base, + mdev->limits.num_mpts * + dev_lim->mpt_entry_sz, + mdev->limits.reserved_mrws * + dev_lim->mpt_entry_sz, 1); + if (!mdev->mr_table.mpt_table) { + mthca_err(mdev, "Failed to map MPT context memory, aborting.\n"); + err = -ENOMEM; + goto err_unmap_mtt; + } + + mdev->qp_table.qp_table = mthca_alloc_icm_table(mdev, init_hca->qpc_base, + mdev->limits.num_qps * + dev_lim->qpc_entry_sz, + mdev->limits.reserved_qps * + dev_lim->qpc_entry_sz, 1); + if (!mdev->qp_table.qp_table) { + mthca_err(mdev, "Failed to map QP context memory, aborting.\n"); + err = -ENOMEM; + goto err_unmap_mpt; + } + + mdev->qp_table.eqp_table = mthca_alloc_icm_table(mdev, init_hca->eqpc_base, + mdev->limits.num_qps * + dev_lim->eqpc_entry_sz, + mdev->limits.reserved_qps * + dev_lim->eqpc_entry_sz, 1); + if (!mdev->qp_table.eqp_table) { + mthca_err(mdev, "Failed to map EQP context memory, aborting.\n"); + err = -ENOMEM; + goto err_unmap_qp; + } + + mdev->cq_table.table = mthca_alloc_icm_table(mdev, init_hca->cqc_base, + mdev->limits.num_cqs * + dev_lim->cqc_entry_sz, + mdev->limits.reserved_cqs * + dev_lim->cqc_entry_sz, 1); + if (!mdev->cq_table.table) { + mthca_err(mdev, "Failed to map CQ context memory, aborting.\n"); + err = -ENOMEM; + goto err_unmap_eqp; + } + + return 0; + +err_unmap_eqp: + mthca_free_icm_table(mdev, mdev->qp_table.eqp_table); + +err_unmap_qp: + mthca_free_icm_table(mdev, mdev->qp_table.qp_table); + +err_unmap_mpt: + mthca_free_icm_table(mdev, mdev->mr_table.mpt_table); + +err_unmap_mtt: + mthca_free_icm_table(mdev, mdev->mr_table.mtt_table); + +err_unmap_eq: + mthca_unmap_eq_icm(mdev); + +err_unmap_aux: + mthca_UNMAP_ICM_AUX(mdev, &status); + +err_free_aux: + mthca_free_icm(mdev, mdev->fw.arbel.aux_icm); + return err; } static int __devinit mthca_init_arbel(struct mthca_dev *mdev) { - struct mthca_dev_lim dev_lim; + struct mthca_dev_lim dev_lim; + struct mthca_profile profile; + struct mthca_init_hca_param init_hca; + struct mthca_adapter adapter; + u64 icm_size; u8 status; int err; @@ -355,26 +481,77 @@ err = mthca_load_fw(mdev); if (err) { mthca_err(mdev, "Failed to start FW, aborting.\n"); - goto err_out_disable; + goto err_disable; } err = mthca_dev_lim(mdev, &dev_lim); if (err) { mthca_err(mdev, "QUERY_DEV_LIM command failed, aborting.\n"); - goto err_out_stop_fw; + goto err_stop_fw; } - mthca_warn(mdev, "Sorry, native MT25208 mode support is not done, " - "aborting.\n"); - err = -ENODEV; + profile = default_profile; + profile.num_uar = dev_lim.uar_size / PAGE_SIZE; + profile.num_udav = 0; + + icm_size = mthca_make_profile(mdev, &profile, &dev_lim, &init_hca); + if ((int) icm_size < 0) { + err = icm_size; + goto err_stop_fw; + } + + err = mthca_init_icm(mdev, &dev_lim, &init_hca, icm_size); + if (err) + goto err_stop_fw; -err_out_stop_fw: + err = mthca_INIT_HCA(mdev, &init_hca, &status); + if (err) { + mthca_err(mdev, "INIT_HCA command failed, aborting.\n"); + goto err_free_icm; + } + if (status) { + mthca_err(mdev, "INIT_HCA returned status 0x%02x, " + "aborting.\n", status); + err = -EINVAL; + goto err_free_icm; + } + + err = mthca_QUERY_ADAPTER(mdev, &adapter, &status); + if (err) { + mthca_err(mdev, "QUERY_ADAPTER command failed, aborting.\n"); + goto err_free_icm; + } + if (status) { + mthca_err(mdev, "QUERY_ADAPTER returned status 0x%02x, " + "aborting.\n", status); + err = -EINVAL; + goto err_free_icm; + } + + mdev->eq_table.inta_pin = adapter.inta_pin; + mdev->rev_id = adapter.revision_id; + + return 0; + +err_free_icm: + mthca_free_icm_table(mdev, mdev->cq_table.table); + mthca_free_icm_table(mdev, mdev->qp_table.eqp_table); + mthca_free_icm_table(mdev, mdev->qp_table.qp_table); + mthca_free_icm_table(mdev, mdev->mr_table.mpt_table); + mthca_free_icm_table(mdev, mdev->mr_table.mtt_table); + mthca_unmap_eq_icm(mdev); + + mthca_UNMAP_ICM_AUX(mdev, &status); + mthca_free_icm(mdev, mdev->fw.arbel.aux_icm); + +err_stop_fw: mthca_UNMAP_FA(mdev, &status); - mthca_free_icm(mdev, mdev->fw.arbel.icm); + mthca_free_icm(mdev, mdev->fw.arbel.fw_icm); -err_out_disable: +err_disable: if (!(mdev->mthca_flags & MTHCA_FLAG_NO_LAM)) mthca_DISABLE_LAM(mdev, &status); + return err; } @@ -389,6 +566,7 @@ static int __devinit mthca_setup_hca(struct mthca_dev *dev) { int err; + u8 status; MTHCA_INIT_DOORBELL_LOCK(&dev->doorbell_lock); @@ -403,82 +581,101 @@ if (err) { mthca_err(dev, "Failed to initialize " "memory region table, aborting.\n"); - goto err_out_pd_table_free; + goto err_pd_table_free; } err = mthca_pd_alloc(dev, &dev->driver_pd); if (err) { mthca_err(dev, "Failed to create driver PD, " "aborting.\n"); - goto err_out_mr_table_free; + goto err_mr_table_free; + } + + if (dev->hca_type == ARBEL_NATIVE) { + mthca_warn(dev, "Sorry, native MT25208 mode support is not done, " + "aborting.\n"); + err = -ENODEV; + goto err_pd_free; } err = mthca_init_eq_table(dev); if (err) { mthca_err(dev, "Failed to initialize " "event queue table, aborting.\n"); - goto err_out_pd_free; + goto err_pd_free; } err = mthca_cmd_use_events(dev); if (err) { mthca_err(dev, "Failed to switch to event-driven " "firmware commands, aborting.\n"); - goto err_out_eq_table_free; + goto err_eq_table_free; } + err = mthca_NOP(dev, &status); + if (err || status) { + mthca_err(dev, "NOP command failed to generate interrupt, aborting.\n"); + if (dev->mthca_flags & (MTHCA_FLAG_MSI | MTHCA_FLAG_MSI_X)) + mthca_err(dev, "Try again with MSI/MSI-X disabled.\n"); + else + mthca_err(dev, "BIOS or ACPI interrupt routing problem?\n"); + + goto err_cmd_poll; + } else + mthca_dbg(dev, "NOP command IRQ test passed\n"); + err = mthca_init_cq_table(dev); if (err) { mthca_err(dev, "Failed to initialize " "completion queue table, aborting.\n"); - goto err_out_cmd_poll; + goto err_cmd_poll; } err = mthca_init_qp_table(dev); if (err) { mthca_err(dev, "Failed to initialize " "queue pair table, aborting.\n"); - goto err_out_cq_table_free; + goto err_cq_table_free; } err = mthca_init_av_table(dev); if (err) { mthca_err(dev, "Failed to initialize " "address vector table, aborting.\n"); - goto err_out_qp_table_free; + goto err_qp_table_free; } err = mthca_init_mcg_table(dev); if (err) { mthca_err(dev, "Failed to initialize " "multicast group table, aborting.\n"); - goto err_out_av_table_free; + goto err_av_table_free; } return 0; -err_out_av_table_free: +err_av_table_free: mthca_cleanup_av_table(dev); -err_out_qp_table_free: +err_qp_table_free: mthca_cleanup_qp_table(dev); -err_out_cq_table_free: +err_cq_table_free: mthca_cleanup_cq_table(dev); -err_out_cmd_poll: +err_cmd_poll: mthca_cmd_use_polling(dev); -err_out_eq_table_free: +err_eq_table_free: mthca_cleanup_eq_table(dev); -err_out_pd_free: +err_pd_free: mthca_pd_free(dev, &dev->driver_pd); -err_out_mr_table_free: +err_mr_table_free: mthca_cleanup_mr_table(dev); -err_out_pd_table_free: +err_pd_table_free: mthca_cleanup_pd_table(dev); return err; } @@ -498,57 +695,83 @@ */ if (!request_mem_region(pci_resource_start(pdev, 0) + MTHCA_HCR_BASE, - MTHCA_MAP_HCR_SIZE, - DRV_NAME)) - return -EBUSY; + MTHCA_HCR_SIZE, + DRV_NAME)) { + err = -EBUSY; + goto err_hcr_failed; + } + + if (!request_mem_region(pci_resource_start(pdev, 0) + + MTHCA_ECR_BASE, + MTHCA_MAP_ECR_SIZE, + DRV_NAME)) { + err = -EBUSY; + goto err_ecr_failed; + } if (!request_mem_region(pci_resource_start(pdev, 0) + MTHCA_CLR_INT_BASE, MTHCA_CLR_INT_SIZE, DRV_NAME)) { err = -EBUSY; - goto err_out_bar0_beg; + goto err_int_failed; } + err = pci_request_region(pdev, 2, DRV_NAME); if (err) - goto err_out_bar0_end; + goto err_bar2_failed; if (!ddr_hidden) { err = pci_request_region(pdev, 4, DRV_NAME); if (err) - goto err_out_bar2; + goto err_bar4_failed; } return 0; -err_out_bar0_beg: - release_mem_region(pci_resource_start(pdev, 0) + - MTHCA_HCR_BASE, - MTHCA_MAP_HCR_SIZE); +err_bar4_failed: + + pci_release_region(pdev, 2); +err_bar2_failed: -err_out_bar0_end: release_mem_region(pci_resource_start(pdev, 0) + MTHCA_CLR_INT_BASE, MTHCA_CLR_INT_SIZE); +err_int_failed: + + release_mem_region(pci_resource_start(pdev, 0) + + MTHCA_ECR_BASE, + MTHCA_MAP_ECR_SIZE); +err_ecr_failed: + + release_mem_region(pci_resource_start(pdev, 0) + + MTHCA_HCR_BASE, + MTHCA_HCR_SIZE); +err_hcr_failed: -err_out_bar2: - pci_release_region(pdev, 2); return err; } static void mthca_release_regions(struct pci_dev *pdev, int ddr_hidden) { - release_mem_region(pci_resource_start(pdev, 0) + - MTHCA_HCR_BASE, - MTHCA_MAP_HCR_SIZE); + if (!ddr_hidden) + pci_release_region(pdev, 4); + + pci_release_region(pdev, 2); + release_mem_region(pci_resource_start(pdev, 0) + MTHCA_CLR_INT_BASE, MTHCA_CLR_INT_SIZE); - pci_release_region(pdev, 2); - if (!ddr_hidden) - pci_release_region(pdev, 4); + + release_mem_region(pci_resource_start(pdev, 0) + + MTHCA_ECR_BASE, + MTHCA_MAP_ECR_SIZE); + + release_mem_region(pci_resource_start(pdev, 0) + + MTHCA_HCR_BASE, + MTHCA_HCR_SIZE); } static int __devinit mthca_enable_msi_x(struct mthca_dev *mdev) @@ -582,8 +805,18 @@ mthca_CLOSE_HCA(mdev, 0, &status); if (mdev->hca_type == ARBEL_NATIVE) { + mthca_free_icm_table(mdev, mdev->cq_table.table); + mthca_free_icm_table(mdev, mdev->qp_table.eqp_table); + mthca_free_icm_table(mdev, mdev->qp_table.qp_table); + mthca_free_icm_table(mdev, mdev->mr_table.mpt_table); + mthca_free_icm_table(mdev, mdev->mr_table.mtt_table); + mthca_unmap_eq_icm(mdev); + + mthca_UNMAP_ICM_AUX(mdev, &status); + mthca_free_icm(mdev, mdev->fw.arbel.aux_icm); + mthca_UNMAP_FA(mdev, &status); - mthca_free_icm(mdev, mdev->fw.arbel.icm); + mthca_free_icm(mdev, mdev->fw.arbel.fw_icm); if (!(mdev->mthca_flags & MTHCA_FLAG_NO_LAM)) mthca_DISABLE_LAM(mdev, &status); @@ -623,13 +856,13 @@ pci_resource_len(pdev, 0) != 1 << 20) { dev_err(&pdev->dev, "Missing DCS, aborting."); err = -ENODEV; - goto err_out_disable_pdev; + goto err_disable_pdev; } if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM) || pci_resource_len(pdev, 2) != 1 << 23) { dev_err(&pdev->dev, "Missing UAR, aborting."); err = -ENODEV; - goto err_out_disable_pdev; + goto err_disable_pdev; } if (!(pci_resource_flags(pdev, 4) & IORESOURCE_MEM)) ddr_hidden = 1; @@ -638,7 +871,7 @@ if (err) { dev_err(&pdev->dev, "Cannot obtain PCI resources, " "aborting.\n"); - goto err_out_disable_pdev; + goto err_disable_pdev; } pci_set_master(pdev); @@ -649,7 +882,7 @@ err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); if (err) { dev_err(&pdev->dev, "Can't set PCI DMA mask, aborting.\n"); - goto err_out_free_res; + goto err_free_res; } } err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); @@ -660,7 +893,7 @@ if (err) { dev_err(&pdev->dev, "Can't set consistent PCI DMA mask, " "aborting.\n"); - goto err_out_free_res; + goto err_free_res; } } @@ -669,7 +902,7 @@ dev_err(&pdev->dev, "Device struct alloc failed, " "aborting.\n"); err = -ENOMEM; - goto err_out_free_res; + goto err_free_res; } mdev->pdev = pdev; @@ -686,7 +919,7 @@ err = mthca_reset(mdev); if (err) { mthca_err(mdev, "Failed to reset HCA, aborting.\n"); - goto err_out_free_dev; + goto err_free_dev; } if (msi_x && !mthca_enable_msi_x(mdev)) @@ -700,20 +933,30 @@ mdev->cmd.use_events = 0; mthca_base = pci_resource_start(pdev, 0); - mdev->hcr = ioremap(mthca_base + MTHCA_HCR_BASE, MTHCA_MAP_HCR_SIZE); + mdev->hcr = ioremap(mthca_base + MTHCA_HCR_BASE, MTHCA_HCR_SIZE); if (!mdev->hcr) { mthca_err(mdev, "Couldn't map command register, " "aborting.\n"); err = -ENOMEM; - goto err_out_free_dev; + goto err_free_dev; } + mdev->clr_base = ioremap(mthca_base + MTHCA_CLR_INT_BASE, MTHCA_CLR_INT_SIZE); if (!mdev->clr_base) { - mthca_err(mdev, "Couldn't map command register, " + mthca_err(mdev, "Couldn't map interrupt clear register, " + "aborting.\n"); + err = -ENOMEM; + goto err_iounmap; + } + + mdev->ecr_base = ioremap(mthca_base + MTHCA_ECR_BASE, + MTHCA_ECR_SIZE + MTHCA_ECR_CLR_SIZE); + if (!mdev->ecr_base) { + mthca_err(mdev, "Couldn't map ecr register, " "aborting.\n"); err = -ENOMEM; - goto err_out_iounmap; + goto err_iounmap_clr; } mthca_base = pci_resource_start(pdev, 2); @@ -722,37 +965,37 @@ mthca_err(mdev, "Couldn't map kernel access region, " "aborting.\n"); err = -ENOMEM; - goto err_out_iounmap_clr; + goto err_iounmap_ecr; } err = mthca_tune_pci(mdev); if (err) - goto err_out_iounmap_kar; + goto err_iounmap_kar; err = mthca_init_hca(mdev); if (err) - goto err_out_iounmap_kar; + goto err_iounmap_kar; err = mthca_setup_hca(mdev); if (err) - goto err_out_close; + goto err_close; err = mthca_register_device(mdev); if (err) - goto err_out_cleanup; + goto err_cleanup; err = mthca_create_agents(mdev); if (err) - goto err_out_unregister; + goto err_unregister; pci_set_drvdata(pdev, mdev); return 0; -err_out_unregister: +err_unregister: mthca_unregister_device(mdev); -err_out_cleanup: +err_cleanup: mthca_cleanup_mcg_table(mdev); mthca_cleanup_av_table(mdev); mthca_cleanup_qp_table(mdev); @@ -765,19 +1008,22 @@ mthca_cleanup_mr_table(mdev); mthca_cleanup_pd_table(mdev); -err_out_close: +err_close: mthca_close_hca(mdev); -err_out_iounmap_kar: +err_iounmap_kar: iounmap(mdev->kar); -err_out_iounmap_clr: +err_iounmap_ecr: + iounmap(mdev->ecr_base); + +err_iounmap_clr: iounmap(mdev->clr_base); -err_out_iounmap: +err_iounmap: iounmap(mdev->hcr); -err_out_free_dev: +err_free_dev: if (mdev->mthca_flags & MTHCA_FLAG_MSI_X) pci_disable_msix(pdev); if (mdev->mthca_flags & MTHCA_FLAG_MSI) @@ -785,10 +1031,10 @@ ib_dealloc_device(&mdev->ib_dev); -err_out_free_res: +err_free_res: mthca_release_regions(pdev, ddr_hidden); -err_out_disable_pdev: +err_disable_pdev: pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); return err; @@ -822,6 +1068,7 @@ mthca_close_hca(mdev); iounmap(mdev->hcr); + iounmap(mdev->ecr_base); iounmap(mdev->clr_base); if (mdev->mthca_flags & MTHCA_FLAG_MSI_X) @@ -865,22 +1112,6 @@ static int __init mthca_init(void) { int ret; - - /* - * TODO: measure whether dynamically choosing doorbell code at - * runtime affects our performance. Is there a "magic" way to - * choose without having to follow a function pointer every - * time we ring a doorbell? - */ -#ifdef CONFIG_INFINIBAND_MTHCA_SSE_DOORBELL - if (!cpu_has_xmm) { - printk(KERN_ERR PFX "mthca was compiled with SSE doorbell code, but\n"); - printk(KERN_ERR PFX "the current CPU does not support SSE.\n"); - printk(KERN_ERR PFX "Turn off CONFIG_INFINIBAND_MTHCA_SSE_DOORBELL " - "and recompile.\n"); - return -ENODEV; - } -#endif ret = pci_register_driver(&mthca_driver); return ret < 0 ? ret : 0; diff -Nru a/drivers/infiniband/hw/mthca/mthca_memfree.c b/drivers/infiniband/hw/mthca/mthca_memfree.c --- a/drivers/infiniband/hw/mthca/mthca_memfree.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_memfree.c 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 Topspin Communications. All rights reserved. + * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -34,6 +34,16 @@ #include "mthca_memfree.h" #include "mthca_dev.h" +#include "mthca_cmd.h" + +/* + * We allocate in as big chunks as we can, up to a maximum of 256 KB + * per chunk. + */ +enum { + MTHCA_ICM_ALLOC_SIZE = 1 << 18, + MTHCA_TABLE_CHUNK_SIZE = 1 << 18 +}; void mthca_free_icm(struct mthca_dev *dev, struct mthca_icm *icm) { @@ -71,11 +81,7 @@ INIT_LIST_HEAD(&icm->chunk_list); - /* - * We allocate in as big chunks as we can, up to a maximum of - * 256 KB per chunk. - */ - cur_order = get_order(1 << 18); + cur_order = get_order(MTHCA_ICM_ALLOC_SIZE); while (npages > 0) { if (!chunk) { @@ -130,4 +136,71 @@ fail: mthca_free_icm(dev, icm); return NULL; +} + +struct mthca_icm_table *mthca_alloc_icm_table(struct mthca_dev *dev, + u64 virt, unsigned size, + unsigned reserved, + int use_lowmem) +{ + struct mthca_icm_table *table; + int num_icm; + int i; + u8 status; + + num_icm = size / MTHCA_TABLE_CHUNK_SIZE; + + table = kmalloc(sizeof *table + num_icm * sizeof *table->icm, GFP_KERNEL); + if (!table) + return NULL; + + table->virt = virt; + table->num_icm = num_icm; + init_MUTEX(&table->sem); + + for (i = 0; i < num_icm; ++i) + table->icm[i] = NULL; + + for (i = 0; i < (reserved + MTHCA_TABLE_CHUNK_SIZE - 1) / MTHCA_TABLE_CHUNK_SIZE; ++i) { + table->icm[i] = mthca_alloc_icm(dev, MTHCA_TABLE_CHUNK_SIZE >> PAGE_SHIFT, + (use_lowmem ? GFP_KERNEL : GFP_HIGHUSER) | + __GFP_NOWARN); + if (!table->icm[i]) + goto err; + if (mthca_MAP_ICM(dev, table->icm[i], virt + i * MTHCA_TABLE_CHUNK_SIZE, + &status) || status) { + mthca_free_icm(dev, table->icm[i]); + table->icm[i] = NULL; + goto err; + } + } + + return table; + +err: + for (i = 0; i < num_icm; ++i) + if (table->icm[i]) { + mthca_UNMAP_ICM(dev, virt + i * MTHCA_TABLE_CHUNK_SIZE, + MTHCA_TABLE_CHUNK_SIZE >> 12, &status); + mthca_free_icm(dev, table->icm[i]); + } + + kfree(table); + + return NULL; +} + +void mthca_free_icm_table(struct mthca_dev *dev, struct mthca_icm_table *table) +{ + int i; + u8 status; + + for (i = 0; i < table->num_icm; ++i) + if (table->icm[i]) { + mthca_UNMAP_ICM(dev, table->virt + i * MTHCA_TABLE_CHUNK_SIZE, + MTHCA_TABLE_CHUNK_SIZE >> 12, &status); + mthca_free_icm(dev, table->icm[i]); + } + + kfree(table); } diff -Nru a/drivers/infiniband/hw/mthca/mthca_memfree.h b/drivers/infiniband/hw/mthca/mthca_memfree.h --- a/drivers/infiniband/hw/mthca/mthca_memfree.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_memfree.h 2005-01-28 14:11:41 -08:00 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 Topspin Communications. All rights reserved. + * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -38,8 +38,10 @@ #include #include +#include + #define MTHCA_ICM_CHUNK_LEN \ - ((512 - sizeof (struct list_head) - 2 * sizeof (int)) / \ + ((256 - sizeof (struct list_head) - 2 * sizeof (int)) / \ (sizeof (struct scatterlist))) struct mthca_icm_chunk { @@ -53,6 +55,13 @@ struct list_head chunk_list; }; +struct mthca_icm_table { + u64 virt; + int num_icm; + struct semaphore sem; + struct mthca_icm *icm[0]; +}; + struct mthca_icm_iter { struct mthca_icm *icm; struct mthca_icm_chunk *chunk; @@ -64,6 +73,12 @@ struct mthca_icm *mthca_alloc_icm(struct mthca_dev *dev, int npages, unsigned int gfp_mask); void mthca_free_icm(struct mthca_dev *dev, struct mthca_icm *icm); + +struct mthca_icm_table *mthca_alloc_icm_table(struct mthca_dev *dev, + u64 virt, unsigned size, + unsigned reserved, + int use_lowmem); +void mthca_free_icm_table(struct mthca_dev *dev, struct mthca_icm_table *table); static inline void mthca_icm_first(struct mthca_icm *icm, struct mthca_icm_iter *iter) diff -Nru a/drivers/infiniband/hw/mthca/mthca_profile.c b/drivers/infiniband/hw/mthca/mthca_profile.c --- a/drivers/infiniband/hw/mthca/mthca_profile.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_profile.c 2005-01-28 14:11:41 -08:00 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 Topspin Communications. All rights reserved. + * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -60,7 +60,7 @@ MTHCA_NUM_PDS = 1 << 15 }; -int mthca_make_profile(struct mthca_dev *dev, +u64 mthca_make_profile(struct mthca_dev *dev, struct mthca_profile *request, struct mthca_dev_lim *dev_lim, struct mthca_init_hca_param *init_hca) @@ -116,6 +116,8 @@ profile[i].type = i; profile[i].log_num = max(ffs(profile[i].num) - 1, 0); profile[i].size *= profile[i].num; + if (dev->hca_type == ARBEL_NATIVE) + profile[i].size = max(profile[i].size, (u64) PAGE_SIZE); } if (dev->hca_type == ARBEL_NATIVE) { @@ -239,6 +241,10 @@ case MTHCA_RES_UDAV: dev->av_table.ddr_av_base = profile[i].start; dev->av_table.num_ddr_avs = profile[i].num; + case MTHCA_RES_UARC: + init_hca->uarc_base = profile[i].start; + init_hca->log_uarc_sz = ffs(request->uarc_size) - 13; + init_hca->log_uar_sz = ffs(request->num_uar) - 1; default: break; } @@ -251,5 +257,5 @@ dev->limits.num_pds = MTHCA_NUM_PDS; kfree(profile); - return 0; + return total_size; } diff -Nru a/drivers/infiniband/hw/mthca/mthca_profile.h b/drivers/infiniband/hw/mthca/mthca_profile.h --- a/drivers/infiniband/hw/mthca/mthca_profile.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_profile.h 2005-01-28 14:11:41 -08:00 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004 Topspin Communications. All rights reserved. + * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -50,7 +50,7 @@ int uarc_size; }; -int mthca_make_profile(struct mthca_dev *mdev, +u64 mthca_make_profile(struct mthca_dev *mdev, struct mthca_profile *request, struct mthca_dev_lim *dev_lim, struct mthca_init_hca_param *init_hca); diff -Nru a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c --- a/drivers/infiniband/hw/mthca/mthca_provider.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_provider.c 2005-01-28 14:11:41 -08:00 @@ -59,8 +59,8 @@ in_mad->method = IB_MGMT_METHOD_GET; in_mad->attr_id = IB_SMP_ATTR_NODE_INFO; - err = mthca_MAD_IFC(to_mdev(ibdev), 1, - 1, in_mad, out_mad, + err = mthca_MAD_IFC(to_mdev(ibdev), 1, 1, + 1, NULL, NULL, in_mad, out_mad, &status); if (err) goto out; @@ -104,8 +104,8 @@ in_mad->attr_id = IB_SMP_ATTR_PORT_INFO; in_mad->attr_mod = cpu_to_be32(port); - err = mthca_MAD_IFC(to_mdev(ibdev), 1, - port, in_mad, out_mad, + err = mthca_MAD_IFC(to_mdev(ibdev), 1, 1, + port, NULL, NULL, in_mad, out_mad, &status); if (err) goto out; @@ -137,7 +137,35 @@ u8 port, int port_modify_mask, struct ib_port_modify *props) { - return 0; + struct mthca_set_ib_param set_ib; + struct ib_port_attr attr; + int err; + u8 status; + + if (down_interruptible(&to_mdev(ibdev)->cap_mask_mutex)) + return -ERESTARTSYS; + + err = mthca_query_port(ibdev, port, &attr); + if (err) + goto out; + + set_ib.set_si_guid = 0; + set_ib.reset_qkey_viol = !!(port_modify_mask & IB_PORT_RESET_QKEY_CNTR); + + set_ib.cap_mask = (attr.port_cap_flags | props->set_port_cap_mask) & + ~props->clr_port_cap_mask; + + err = mthca_SET_IB(to_mdev(ibdev), &set_ib, port, &status); + if (err) + goto out; + if (status) { + err = -EINVAL; + goto out; + } + +out: + up(&to_mdev(ibdev)->cap_mask_mutex); + return err; } static int mthca_query_pkey(struct ib_device *ibdev, @@ -161,8 +189,8 @@ in_mad->attr_id = IB_SMP_ATTR_PKEY_TABLE; in_mad->attr_mod = cpu_to_be32(index / 32); - err = mthca_MAD_IFC(to_mdev(ibdev), 1, - port, in_mad, out_mad, + err = mthca_MAD_IFC(to_mdev(ibdev), 1, 1, + port, NULL, NULL, in_mad, out_mad, &status); if (err) goto out; @@ -200,8 +228,8 @@ in_mad->attr_id = IB_SMP_ATTR_PORT_INFO; in_mad->attr_mod = cpu_to_be32(port); - err = mthca_MAD_IFC(to_mdev(ibdev), 1, - port, in_mad, out_mad, + err = mthca_MAD_IFC(to_mdev(ibdev), 1, 1, + port, NULL, NULL, in_mad, out_mad, &status); if (err) goto out; @@ -220,8 +248,8 @@ in_mad->attr_id = IB_SMP_ATTR_GUID_INFO; in_mad->attr_mod = cpu_to_be32(index / 8); - err = mthca_MAD_IFC(to_mdev(ibdev), 1, - port, in_mad, out_mad, + err = mthca_MAD_IFC(to_mdev(ibdev), 1, 1, + port, NULL, NULL, in_mad, out_mad, &status); if (err) goto out; @@ -605,6 +633,8 @@ dev->ib_dev.attach_mcast = mthca_multicast_attach; dev->ib_dev.detach_mcast = mthca_multicast_detach; dev->ib_dev.process_mad = mthca_process_mad; + + init_MUTEX(&dev->cap_mask_mutex); ret = ib_register_device(&dev->ib_dev); if (ret) diff -Nru a/drivers/infiniband/hw/mthca/mthca_provider.h b/drivers/infiniband/hw/mthca/mthca_provider.h --- a/drivers/infiniband/hw/mthca/mthca_provider.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/hw/mthca/mthca_provider.h 2005-01-28 14:11:40 -08:00 @@ -66,11 +66,11 @@ struct mthca_dev *dev; int eqn; u32 ecr_mask; + u32 cons_index; u16 msi_x_vector; u16 msi_x_entry; int have_irq; int nent; - int cons_index; struct mthca_buf_list *page_list; struct mthca_mr mr; }; diff -Nru a/drivers/infiniband/include/ib_verbs.h b/drivers/infiniband/include/ib_verbs.h --- a/drivers/infiniband/include/ib_verbs.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/include/ib_verbs.h 2005-01-28 14:11:40 -08:00 @@ -154,25 +154,28 @@ }; enum ib_port_cap_flags { - IB_PORT_SM = (1<<31), - IB_PORT_NOTICE_SUP = (1<<30), - IB_PORT_TRAP_SUP = (1<<29), - IB_PORT_AUTO_MIGR_SUP = (1<<27), - IB_PORT_SL_MAP_SUP = (1<<26), - IB_PORT_MKEY_NVRAM = (1<<25), - IB_PORT_PKEY_NVRAM = (1<<24), - IB_PORT_LED_INFO_SUP = (1<<23), - IB_PORT_SM_DISABLED = (1<<22), - IB_PORT_SYS_IMAGE_GUID_SUP = (1<<21), - IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP = (1<<20), - IB_PORT_CM_SUP = (1<<16), - IB_PORT_SNMP_TUNNEL_SUP = (1<<15), - IB_PORT_REINIT_SUP = (1<<14), - IB_PORT_DEVICE_MGMT_SUP = (1<<13), - IB_PORT_VENDOR_CLASS_SUP = (1<<12), - IB_PORT_DR_NOTICE_SUP = (1<<11), - IB_PORT_PORT_NOTICE_SUP = (1<<10), - IB_PORT_BOOT_MGMT_SUP = (1<<9) + IB_PORT_SM = 1 << 1, + IB_PORT_NOTICE_SUP = 1 << 2, + IB_PORT_TRAP_SUP = 1 << 3, + IB_PORT_OPT_IPD_SUP = 1 << 4, + IB_PORT_AUTO_MIGR_SUP = 1 << 5, + IB_PORT_SL_MAP_SUP = 1 << 6, + IB_PORT_MKEY_NVRAM = 1 << 7, + IB_PORT_PKEY_NVRAM = 1 << 8, + IB_PORT_LED_INFO_SUP = 1 << 9, + IB_PORT_SM_DISABLED = 1 << 10, + IB_PORT_SYS_IMAGE_GUID_SUP = 1 << 11, + IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP = 1 << 12, + IB_PORT_CM_SUP = 1 << 16, + IB_PORT_SNMP_TUNNEL_SUP = 1 << 17, + IB_PORT_REINIT_SUP = 1 << 18, + IB_PORT_DEVICE_MGMT_SUP = 1 << 19, + IB_PORT_VENDOR_CLASS_SUP = 1 << 20, + IB_PORT_DR_NOTICE_SUP = 1 << 21, + IB_PORT_CAP_MASK_NOTICE_SUP = 1 << 22, + IB_PORT_BOOT_MGMT_SUP = 1 << 23, + IB_PORT_LINK_LATENCY_SUP = 1 << 24, + IB_PORT_CLIENT_REG_SUP = 1 << 25 }; enum ib_port_width { diff -Nru a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h --- a/drivers/infiniband/ulp/ipoib/ipoib.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/ulp/ipoib/ipoib.h 2005-01-28 14:11:40 -08:00 @@ -104,10 +104,10 @@ }; /* - * Device private locking: netdev->xmit_lock protects members used - * in TX fast path. - * lock protects everything else. lock nests inside of xmit_lock (ie - * xmit_lock must be acquired first if needed). + * Device private locking: tx_lock protects members used in TX fast + * path (and we use LLTX so upper layers don't do extra locking). + * lock protects everything else. lock nests inside of tx_lock (ie + * tx_lock must be acquired first if needed). */ struct ipoib_dev_priv { spinlock_t lock; @@ -150,6 +150,7 @@ struct ipoib_buf *rx_ring; + spinlock_t tx_lock; struct ipoib_buf *tx_ring; unsigned tx_head; unsigned tx_tail; diff -Nru a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2005-01-28 14:11:41 -08:00 @@ -247,12 +247,12 @@ dev_kfree_skb_any(tx_req->skb); - spin_lock_irqsave(&dev->xmit_lock, flags); + spin_lock_irqsave(&priv->tx_lock, flags); ++priv->tx_tail; if (netif_queue_stopped(dev) && priv->tx_head - priv->tx_tail <= IPOIB_TX_RING_SIZE / 2) netif_wake_queue(dev); - spin_unlock_irqrestore(&dev->xmit_lock, flags); + spin_unlock_irqrestore(&priv->tx_lock, flags); if (wc->status != IB_WC_SUCCESS && wc->status != IB_WC_WR_FLUSH_ERR) @@ -509,7 +509,7 @@ goto timeout; } - yield(); + msleep(1); } ipoib_dbg(priv, "All sends and receives done.\n"); @@ -535,7 +535,7 @@ break; } - yield(); + msleep(1); } return 0; diff -Nru a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c 2005-01-28 14:11:40 -08:00 @@ -411,7 +411,7 @@ /* * We can only be called from ipoib_start_xmit, so we're - * inside dev->xmit_lock -- no need to save/restore flags. + * inside tx_lock -- no need to save/restore flags. */ spin_lock(&priv->lock); @@ -483,7 +483,7 @@ /* * We can only be called from ipoib_start_xmit, so we're - * inside dev->xmit_lock -- no need to save/restore flags. + * inside tx_lock -- no need to save/restore flags. */ spin_lock(&priv->lock); @@ -526,11 +526,27 @@ spin_unlock(&priv->lock); } -/* Called with dev->xmit_lock held and IRQs disabled. */ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct ipoib_dev_priv *priv = netdev_priv(dev); struct ipoib_neigh *neigh; + unsigned long flags; + + local_irq_save(flags); + if (!spin_trylock(&priv->tx_lock)) { + local_irq_restore(flags); + return NETDEV_TX_LOCKED; + } + + /* + * Check if our queue is stopped. Since we have the LLTX bit + * set, we can't rely on netif_stop_queue() preventing our + * xmit function from being called with a full queue. + */ + if (unlikely(netif_queue_stopped(dev))) { + spin_unlock_irqrestore(&priv->tx_lock, flags); + return NETDEV_TX_BUSY; + } if (skb->dst && skb->dst->neighbour) { if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) { @@ -585,6 +601,7 @@ } out: + spin_unlock_irqrestore(&priv->tx_lock, flags); return NETDEV_TX_OK; } @@ -780,7 +797,7 @@ dev->addr_len = INFINIBAND_ALEN; dev->type = ARPHRD_INFINIBAND; dev->tx_queue_len = IPOIB_TX_RING_SIZE * 2; - dev->features = NETIF_F_VLAN_CHALLENGED; + dev->features = NETIF_F_VLAN_CHALLENGED | NETIF_F_LLTX; /* MTU will be reset when mcast join happens */ dev->mtu = IPOIB_PACKET_SIZE - IPOIB_ENCAP_LEN; @@ -795,6 +812,7 @@ priv->dev = dev; spin_lock_init(&priv->lock); + spin_lock_init(&priv->tx_lock); init_MUTEX(&priv->mcast_mutex); init_MUTEX(&priv->vlan_mutex); diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c --- a/drivers/input/keyboard/atkbd.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/input/keyboard/atkbd.c 2005-01-28 14:11:41 -08:00 @@ -234,6 +234,7 @@ input_regs(dev, regs); if (value == 3) { input_report_key(dev, code, 1); + input_sync(dev); input_report_key(dev, code, 0); } else input_event(dev, EV_KEY, code, value); @@ -352,6 +353,7 @@ "to make it known.\n", code & 0x80 ? "e0" : "", code & 0x7f); } + input_sync(&atkbd->dev); break; case ATKBD_SCR_1: scroll = 1 - atkbd->release * 2; diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c --- a/drivers/input/serio/i8042.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/input/serio/i8042.c 2005-01-28 14:11:40 -08:00 @@ -458,12 +458,11 @@ } /* - * i8042_enable_mux_mode checks whether the controller has an active - * multiplexor and puts the chip into Multiplexed (as opposed to - * Legacy) mode. + * i8042_set_mux_mode checks whether the controller has an active + * multiplexor and puts the chip into Multiplexed (1) or Legacy (0) mode. */ -static int i8042_enable_mux_mode(struct i8042_values *values, unsigned char *mux_version) +static int i8042_set_mux_mode(unsigned int mode, unsigned char *mux_version) { unsigned char param; @@ -482,11 +481,11 @@ param = 0xf0; if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0x0f) return -1; - param = 0x56; + param = mode ? 0x56 : 0xf6; if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0xa9) return -1; - param = 0xa4; - if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param == 0x5b) + param = mode ? 0xa4 : 0xa5; + if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param == (mode ? 0x5b : 0x5a)) return -1; if (mux_version) @@ -540,11 +539,11 @@ { unsigned char mux_version; - if (i8042_enable_mux_mode(values, &mux_version)) + if (i8042_set_mux_mode(1, &mux_version)) return -1; - /* Workaround for broken chips which seem to support MUX, but in reality don't. */ - /* They all report version 10.12 */ + /* Workaround for interference with USB Legacy emulation */ + /* that causes a v10.12 MUX to be found. */ if (mux_version == 0xAC) return -1; @@ -774,12 +773,21 @@ */ void i8042_controller_reset(void) { - if (i8042_reset) { - unsigned char param; + unsigned char param; + +/* + * Reset the controller if requested. + */ + if (i8042_reset) if (i8042_command(¶m, I8042_CMD_CTL_TEST)) printk(KERN_ERR "i8042.c: i8042 controller reset timeout.\n"); - } + +/* + * Disable MUX mode if present. + */ + + i8042_set_mux_mode(0, NULL); /* * Restore the original control register setting. @@ -888,7 +896,7 @@ } if (i8042_mux_present) - if (i8042_enable_mux_mode(&i8042_aux_values, NULL) || + if (i8042_set_mux_mode(1, NULL) || i8042_enable_mux_ports(&i8042_aux_values)) { printk(KERN_WARNING "i8042: failed to resume active multiplexor, mouse won't work.\n"); } diff -Nru a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c --- a/drivers/input/serio/libps2.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/input/serio/libps2.c 2005-01-28 14:11:40 -08:00 @@ -223,7 +223,8 @@ } /* - * ps2_handle_ack() + * ps2_handle_ack() is supposed to be used in interrupt handler + * to properly process ACK/NAK of a command from a PS/2 device. */ int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data) @@ -250,18 +251,27 @@ } /* Fall through */ default: - return 1; + return 0; } + if (!ps2dev->nak && ps2dev->cmdcnt) ps2dev->flags |= PS2_FLAG_CMD | PS2_FLAG_CMD1; ps2dev->flags &= ~PS2_FLAG_ACK; wake_up_interruptible(&ps2dev->wait); - return data == PS2_RET_ACK || data == PS2_RET_NAK; + if (data != PS2_RET_ACK) + ps2_handle_response(ps2dev, data); + + return 1; } +/* + * ps2_handle_response() is supposed to be used in interrupt handler + * to properly store device's response to a command and notify process + * waiting for completion of the command. + */ int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data) { diff -Nru a/drivers/md/dm-io.c b/drivers/md/dm-io.c --- a/drivers/md/dm-io.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/md/dm-io.c 2005-01-28 14:11:41 -08:00 @@ -149,22 +149,6 @@ return 0; } -static inline void bs_bio_init(struct bio *bio) -{ - bio->bi_next = NULL; - bio->bi_flags = 1 << BIO_UPTODATE; - bio->bi_rw = 0; - bio->bi_vcnt = 0; - bio->bi_idx = 0; - bio->bi_phys_segments = 0; - bio->bi_hw_segments = 0; - bio->bi_size = 0; - bio->bi_max_vecs = 0; - bio->bi_end_io = NULL; - atomic_set(&bio->bi_cnt, 1); - bio->bi_private = NULL; -} - static unsigned _bio_count = 0; struct bio *bio_set_alloc(struct bio_set *bs, int gfp_mask, int nr_iovecs) { diff -Nru a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c --- a/drivers/md/dm-ioctl.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/md/dm-ioctl.c 2005-01-28 14:11:40 -08:00 @@ -1,6 +1,6 @@ /* * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. - * Copyright (C) 2004 Red Hat, Inc. All rights reserved. + * Copyright (C) 2004 - 2005 Red Hat, Inc. All rights reserved. * * This file is released under the GPL. */ @@ -520,19 +520,22 @@ if (dm_suspended(md)) param->flags |= DM_SUSPEND_FLAG; - bdev = bdget_disk(disk, 0); - if (!bdev) - return -ENXIO; - param->dev = huge_encode_dev(MKDEV(disk->major, disk->first_minor)); - /* - * Yes, this will be out of date by the time it gets back - * to userland, but it is still very useful ofr - * debugging. - */ - param->open_count = bdev->bd_openers; - bdput(bdev); + if (!(param->flags & DM_SKIP_BDGET_FLAG)) { + bdev = bdget_disk(disk, 0); + if (!bdev) + return -ENXIO; + + /* + * Yes, this will be out of date by the time it gets back + * to userland, but it is still very useful for + * debugging. + */ + param->open_count = bdev->bd_openers; + bdput(bdev); + } else + param->open_count = -1; if (disk->policy) param->flags |= DM_READONLY_FLAG; diff -Nru a/drivers/md/dm-log.c b/drivers/md/dm-log.c --- a/drivers/md/dm-log.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/md/dm-log.c 2005-01-28 14:11:41 -08:00 @@ -17,9 +17,6 @@ int dm_register_dirty_log_type(struct dirty_log_type *type) { - if (!try_module_get(type->module)) - return -EINVAL; - spin_lock(&_lock); type->use_count = 0; list_add(&type->list, &_log_types); @@ -34,10 +31,8 @@ if (type->use_count) DMWARN("Attempt to unregister a log type that is still in use"); - else { + else list_del(&type->list); - module_put(type->module); - } spin_unlock(&_lock); @@ -51,6 +46,10 @@ spin_lock(&_lock); list_for_each_entry (type, &_log_types, list) if (!strcmp(type_name, type->name)) { + if (!type->use_count && !try_module_get(type->module)){ + spin_unlock(&_lock); + return NULL; + } type->use_count++; spin_unlock(&_lock); return type; @@ -63,7 +62,8 @@ static void put_type(struct dirty_log_type *type) { spin_lock(&_lock); - type->use_count--; + if (!--type->use_count) + module_put(type->module); spin_unlock(&_lock); } diff -Nru a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c --- a/drivers/md/dm-raid1.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/md/dm-raid1.c 2005-01-28 14:11:41 -08:00 @@ -1158,10 +1158,11 @@ return 0; } -static void mirror_suspend(struct dm_target *ti) +static void mirror_postsuspend(struct dm_target *ti) { struct mirror_set *ms = (struct mirror_set *) ti->private; struct dirty_log *log = ms->rh.log; + rh_stop_recovery(&ms->rh); if (log->type->suspend && log->type->suspend(log)) /* FIXME: need better error handling */ @@ -1220,7 +1221,7 @@ .dtr = mirror_dtr, .map = mirror_map, .end_io = mirror_end_io, - .suspend = mirror_suspend, + .postsuspend = mirror_postsuspend, .resume = mirror_resume, .status = mirror_status, }; diff -Nru a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c --- a/drivers/md/dm-stripe.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/md/dm-stripe.c 2005-01-28 14:11:40 -08:00 @@ -173,9 +173,8 @@ struct stripe_c *sc = (struct stripe_c *) ti->private; sector_t offset = bio->bi_sector - ti->begin; - uint32_t chunk = (uint32_t) (offset >> sc->chunk_shift); - uint32_t stripe = chunk % sc->stripes; /* 32bit modulus */ - chunk = chunk / sc->stripes; + sector_t chunk = offset >> sc->chunk_shift; + uint32_t stripe = do_div(chunk, sc->stripes); bio->bi_bdev = sc->stripe[stripe].dev->bdev; bio->bi_sector = sc->stripe[stripe].physical_start + @@ -210,7 +209,7 @@ static struct target_type stripe_target = { .name = "striped", - .version= {1, 0, 1}, + .version= {1, 0, 2}, .module = THIS_MODULE, .ctr = stripe_ctr, .dtr = stripe_dtr, diff -Nru a/drivers/md/dm-table.c b/drivers/md/dm-table.c --- a/drivers/md/dm-table.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/md/dm-table.c 2005-01-28 14:11:41 -08:00 @@ -849,16 +849,30 @@ return t->mode; } -void dm_table_suspend_targets(struct dm_table *t) +static void suspend_targets(struct dm_table *t, unsigned postsuspend) { - int i; + int i = t->num_targets; + struct dm_target *ti = t->targets; - for (i = 0; i < t->num_targets; i++) { - struct dm_target *ti = t->targets + i; + while (i--) { + if (postsuspend) { + if (ti->type->postsuspend) + ti->type->postsuspend(ti); + } else if (ti->type->presuspend) + ti->type->presuspend(ti); - if (ti->type->suspend) - ti->type->suspend(ti); + ti++; } +} + +void dm_table_presuspend_targets(struct dm_table *t) +{ + return suspend_targets(t, 0); +} + +void dm_table_postsuspend_targets(struct dm_table *t) +{ + return suspend_targets(t, 1); } void dm_table_resume_targets(struct dm_table *t) diff -Nru a/drivers/md/dm.c b/drivers/md/dm.c --- a/drivers/md/dm.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/md/dm.c 2005-01-28 14:11:41 -08:00 @@ -919,8 +919,10 @@ struct dm_table *map = dm_get_table(md); if (atomic_dec_and_test(&md->holders)) { - if (!test_bit(DMF_SUSPENDED, &md->flags) && map) - dm_table_suspend_targets(map); + if (!test_bit(DMF_SUSPENDED, &md->flags) && map) { + dm_table_presuspend_targets(map); + dm_table_postsuspend_targets(map); + } __unbind(md); free_dev(md); } @@ -1032,7 +1034,11 @@ return -EINVAL; } + map = dm_get_table(md); + if (map) + dm_table_presuspend_targets(map); __lock_fs(md); + up_read(&md->lock); /* @@ -1055,7 +1061,6 @@ up_write(&md->lock); /* unplug */ - map = dm_get_table(md); if (map) { dm_table_unplug_all(map); dm_table_put(map); @@ -1090,7 +1095,7 @@ map = dm_get_table(md); if (map) - dm_table_suspend_targets(map); + dm_table_postsuspend_targets(map); dm_table_put(map); up_write(&md->lock); diff -Nru a/drivers/md/dm.h b/drivers/md/dm.h --- a/drivers/md/dm.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/md/dm.h 2005-01-28 14:11:40 -08:00 @@ -115,7 +115,8 @@ unsigned int dm_table_get_num_targets(struct dm_table *t); struct list_head *dm_table_get_devices(struct dm_table *t); int dm_table_get_mode(struct dm_table *t); -void dm_table_suspend_targets(struct dm_table *t); +void dm_table_presuspend_targets(struct dm_table *t); +void dm_table_postsuspend_targets(struct dm_table *t); void dm_table_resume_targets(struct dm_table *t); int dm_table_any_congested(struct dm_table *t, int bdi_bits); void dm_table_unplug_all(struct dm_table *t); diff -Nru a/drivers/media/Kconfig b/drivers/media/Kconfig --- a/drivers/media/Kconfig 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/Kconfig 2005-01-28 14:11:41 -08:00 @@ -47,5 +47,8 @@ config VIDEO_IR tristate +config VIDEO_TVEEPROM + tristate + endmenu diff -Nru a/drivers/media/common/ir-common.c b/drivers/media/common/ir-common.c --- a/drivers/media/common/ir-common.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/common/ir-common.c 2005-01-28 14:11:41 -08:00 @@ -1,5 +1,5 @@ /* - * $Id: ir-common.c,v 1.5 2004/11/07 13:17:15 kraxel Exp $ + * $Id: ir-common.c,v 1.6 2004/12/10 12:33:39 kraxel Exp $ * * some common structs and functions to handle infrared remotes via * input layer ... @@ -22,6 +22,7 @@ */ #include +#include #include diff -Nru a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c --- a/drivers/media/common/saa7146_core.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/common/saa7146_core.c 2005-01-28 14:11:41 -08:00 @@ -380,8 +380,8 @@ /* disable all irqs */ saa7146_write(dev, IER, 0); - /* shut down all dma transfers */ - saa7146_write(dev, MC1, 0x00ff0000); + /* shut down all dma transfers and rps tasks */ + saa7146_write(dev, MC1, 0x30ff0000); /* clear out any rps-signals pending */ saa7146_write(dev, MC2, 0xf8000000); diff -Nru a/drivers/media/dvb/b2c2/Kconfig b/drivers/media/dvb/b2c2/Kconfig --- a/drivers/media/dvb/b2c2/Kconfig 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/b2c2/Kconfig 2005-01-28 14:11:41 -08:00 @@ -4,9 +4,11 @@ select DVB_STV0299 select DVB_MT352 select DVB_MT312 + select DVB_NXT2002 help Support for the Skystar2 PCI DVB card by Technisat, which - is equipped with the FlexCopII chipset by B2C2. + is equipped with the FlexCopII chipset by B2C2, and + for the B2C2/BBTI Air2PC-ATSC card. Say Y if you own such a device and want to use it. @@ -17,7 +19,7 @@ select DVB_MT352 help Support for the Air/Sky/Cable2PC USB DVB device by B2C2. Currently - this does nothing, but providing basic function for the used usb + the does nothing, but providing basic function for the used usb protocol. Say Y if you own such a device and want to use it. diff -Nru a/drivers/media/dvb/b2c2/b2c2-usb-core.c b/drivers/media/dvb/b2c2/b2c2-usb-core.c --- a/drivers/media/dvb/b2c2/b2c2-usb-core.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/b2c2/b2c2-usb-core.c 2005-01-28 14:11:41 -08:00 @@ -33,7 +33,7 @@ } static int debug; -module_param(debug, int, 0x644); +module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "set debugging level (1=info,ts=2,ctrl=4 (or-able))."); #define deb_info(args...) dprintk(0x01,args) @@ -89,12 +89,22 @@ /* request types */ typedef enum { + +/* something is wrong with this part RTYPE_READ_DW = (1 << 6), RTYPE_WRITE_DW_1 = (3 << 6), RTYPE_READ_V8_MEMORY = (6 << 6), RTYPE_WRITE_V8_MEMORY = (7 << 6), RTYPE_WRITE_V8_FLASH = (8 << 6), RTYPE_GENERIC = (9 << 6), +*/ + RTYPE_READ_DW = (3 << 6), + RTYPE_WRITE_DW_1 = (1 << 6), + + RTYPE_READ_V8_MEMORY = (6 << 6), + RTYPE_WRITE_V8_MEMORY = (7 << 6), + RTYPE_WRITE_V8_FLASH = (8 << 6), + RTYPE_GENERIC = (9 << 6), } b2c2_usb_request_type_t; /* request */ @@ -391,9 +401,9 @@ } /* initialising and submitting iso urbs */ for (i = 0; i < B2C2_USB_NUM_ISO_URB; i++) { - deb_info("initializing and submitting urb no. %d (buf_offset: %d).\n",i,buffer_offset); int frame_offset = 0; struct urb *urb = b2c2->iso_urb[i]; + deb_info("initializing and submitting urb no. %d (buf_offset: %d).\n",i,buffer_offset); urb->dev = b2c2->udev; urb->context = b2c2; diff -Nru a/drivers/media/dvb/b2c2/skystar2.c b/drivers/media/dvb/b2c2/skystar2.c --- a/drivers/media/dvb/b2c2/skystar2.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/b2c2/skystar2.c 2005-01-28 14:11:41 -08:00 @@ -53,7 +53,7 @@ #include "stv0299.h" #include "mt352.h" #include "mt312.h" - +#include "nxt2002.h" static int debug; static int enable_hw_filters = 2; @@ -1379,10 +1379,7 @@ write_reg_dw(adapter, 0x008, adapter->dmaq1.bus_addr & 0xfffffffc); udelay(1000); - if (subbuffers == 0) - dma_enable_disable_irq(adapter, 0, 1, 0); - else - dma_enable_disable_irq(adapter, 0, 1, 1); + dma_enable_disable_irq(adapter, 0, 1, subbuffers ? 1 : 0); irq_dma_enable_disable_irq(adapter, 1); @@ -1681,84 +1678,80 @@ return IRQ_HANDLED; } -static void init_dma_queue(struct adapter *adapter) +static int init_dma_queue_one(struct adapter *adapter, struct dmaq *dmaq, + int size, int dmaq_offset) { + struct pci_dev *pdev = adapter->pdev; dma_addr_t dma_addr; - if (adapter->dmaq1.buffer != 0) - return; - - adapter->dmaq1.head = 0; - adapter->dmaq1.tail = 0; - adapter->dmaq1.buffer = NULL; - - adapter->dmaq1.buffer = pci_alloc_consistent(adapter->pdev, SIZE_OF_BUF_DMA1 + 0x80, &dma_addr); + dmaq->head = 0; + dmaq->tail = 0; - if (adapter->dmaq1.buffer != 0) { - memset(adapter->dmaq1.buffer, 0, SIZE_OF_BUF_DMA1); - - adapter->dmaq1.bus_addr = dma_addr; - adapter->dmaq1.buffer_size = SIZE_OF_BUF_DMA1; - - dma_init_dma(adapter, 0); + dmaq->buffer = pci_alloc_consistent(pdev, size + 0x80, &dma_addr); + if (!dmaq->buffer) + return -ENOMEM; - adapter->dma_status = adapter->dma_status | 0x10000000; + dmaq->bus_addr = dma_addr; + dmaq->buffer_size = size; - ddprintk("%s: allocated dma buffer at 0x%p, length=%d\n", __FUNCTION__, adapter->dmaq1.buffer, SIZE_OF_BUF_DMA1); + dma_init_dma(adapter, dmaq_offset); - } else { + ddprintk("%s: allocated dma buffer at 0x%p, length=%d\n", + __FUNCTION__, dmaq->buffer, size); - adapter->dma_status = adapter->dma_status & ~0x10000000; + return 0; } - if (adapter->dmaq2.buffer != 0) - return; - - adapter->dmaq2.head = 0; - adapter->dmaq2.tail = 0; - adapter->dmaq2.buffer = NULL; - - adapter->dmaq2.buffer = pci_alloc_consistent(adapter->pdev, SIZE_OF_BUF_DMA2 + 0x80, &dma_addr); - - if (adapter->dmaq2.buffer != 0) { - memset(adapter->dmaq2.buffer, 0, SIZE_OF_BUF_DMA2); - - adapter->dmaq2.bus_addr = dma_addr; - adapter->dmaq2.buffer_size = SIZE_OF_BUF_DMA2; - - dma_init_dma(adapter, 1); - - adapter->dma_status = adapter->dma_status | 0x20000000; - - ddprintk("%s: allocated dma buffer at 0x%p, length=%d\n", __FUNCTION__, adapter->dmaq2.buffer, (int) SIZE_OF_BUF_DMA2); +static int init_dma_queue(struct adapter *adapter) +{ + struct { + struct dmaq *dmaq; + u32 dma_status; + int size; + } dmaq_desc[] = { + { &adapter->dmaq1, 0x10000000, SIZE_OF_BUF_DMA1 }, + { &adapter->dmaq2, 0x20000000, SIZE_OF_BUF_DMA2 } + }, *p = dmaq_desc; + int i; - } else { + for (i = 0; i < 2; i++, p++) { + if (init_dma_queue_one(adapter, p->dmaq, p->size, i) < 0) + adapter->dma_status &= ~p->dma_status; + else + adapter->dma_status |= p->dma_status; + } + return (adapter->dma_status & 0x30000000) ? 0 : -ENOMEM; +} - adapter->dma_status = adapter->dma_status & ~0x20000000; +static void free_dma_queue_one(struct adapter *adapter, struct dmaq *dmaq) +{ + if (dmaq->buffer) { + pci_free_consistent(adapter->pdev, dmaq->buffer_size + 0x80, + dmaq->buffer, dmaq->bus_addr); + memset(dmaq, 0, sizeof(*dmaq)); } } static void free_dma_queue(struct adapter *adapter) { - if (adapter->dmaq1.buffer != 0) { - pci_free_consistent(adapter->pdev, SIZE_OF_BUF_DMA1 + 0x80, adapter->dmaq1.buffer, adapter->dmaq1.bus_addr); + struct dmaq *dmaq[] = { + &adapter->dmaq1, + &adapter->dmaq2, + NULL + }, **p; - adapter->dmaq1.bus_addr = 0; - adapter->dmaq1.head = 0; - adapter->dmaq1.tail = 0; - adapter->dmaq1.buffer_size = 0; - adapter->dmaq1.buffer = NULL; - } - - if (adapter->dmaq2.buffer != 0) { - pci_free_consistent(adapter->pdev, SIZE_OF_BUF_DMA2 + 0x80, adapter->dmaq2.buffer, adapter->dmaq2.bus_addr); - - adapter->dmaq2.bus_addr = 0; - adapter->dmaq2.head = 0; - adapter->dmaq2.tail = 0; - adapter->dmaq2.buffer_size = 0; - adapter->dmaq2.buffer = NULL; + for (p = dmaq; *p; p++) + free_dma_queue_one(adapter, *p); } + +static void release_adapter(struct adapter *adapter) +{ + struct pci_dev *pdev = adapter->pdev; + + iounmap(adapter->io_mem); + pci_disable_device(pdev); + pci_release_region(pdev, 0); + pci_release_region(pdev, 1); } static void free_adapter_object(struct adapter *adapter) @@ -1766,16 +1759,9 @@ dprintk("%s:\n", __FUNCTION__); close_stream(adapter, 0); - - if (adapter->irq != 0) free_irq(adapter->irq, adapter); - free_dma_queue(adapter); - - if (adapter->io_mem) - iounmap(adapter->io_mem); - - if (adapter != 0) + release_adapter(adapter); kfree(adapter); } @@ -1784,21 +1770,24 @@ static int claim_adapter(struct adapter *adapter) { struct pci_dev *pdev = adapter->pdev; - u16 var; + int ret; - if (!request_region(pci_resource_start(pdev, 1), pci_resource_len(pdev, 1), skystar2_pci_driver.name)) - return -EBUSY; + ret = pci_request_region(pdev, 1, skystar2_pci_driver.name); + if (ret < 0) + goto out; - if (!request_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0), skystar2_pci_driver.name)) - return -EBUSY; + ret = pci_request_region(pdev, 0, skystar2_pci_driver.name); + if (ret < 0) + goto err_pci_release_1; pci_read_config_byte(pdev, PCI_CLASS_REVISION, &adapter->card_revision); dprintk("%s: card revision %x \n", __FUNCTION__, adapter->card_revision); - if (pci_enable_device(pdev)) - return -EIO; + ret = pci_enable_device(pdev); + if (ret < 0) + goto err_pci_release_0; pci_read_config_word(pdev, 4, &var); @@ -1811,13 +1800,23 @@ if (!adapter->io_mem) { dprintk("%s: can not map io memory\n", __FUNCTION__); - - return 2; + ret = -EIO; + goto err_pci_disable; } dprintk("%s: io memory maped at %p\n", __FUNCTION__, adapter->io_mem); - return 1; + ret = 1; +out: + return ret; + +err_pci_disable: + pci_disable_device(pdev); +err_pci_release_0: + pci_release_region(pdev, 0); +err_pci_release_1: + pci_release_region(pdev, 1); + goto out; } /* @@ -1873,11 +1872,12 @@ { struct adapter *adapter; u32 tmp; + int ret = -ENOMEM; - if (!(adapter = kmalloc(sizeof(struct adapter), GFP_KERNEL))) { + adapter = kmalloc(sizeof(struct adapter), GFP_KERNEL); + if (!adapter) { dprintk("%s: out of memory!\n", __FUNCTION__); - - return -ENOMEM; + goto out; } memset(adapter, 0, sizeof(struct adapter)); @@ -1887,20 +1887,16 @@ adapter->pdev = pdev; adapter->irq = pdev->irq; - if ((claim_adapter(adapter)) != 1) { - free_adapter_object(adapter); - - return -ENODEV; - } + ret = claim_adapter(adapter); + if (ret < 0) + goto err_kfree; irq_dma_enable_disable_irq(adapter, 0); - if (request_irq(pdev->irq, isr, 0x4000000, "Skystar2", adapter) != 0) { + ret = request_irq(pdev->irq, isr, 0x4000000, "Skystar2", adapter); + if (ret < 0) { dprintk("%s: unable to allocate irq=%d !\n", __FUNCTION__, pdev->irq); - - free_adapter_object(adapter); - - return -ENODEV; + goto err_release_adapter; } read_reg_dw(adapter, 0x208); @@ -1908,13 +1904,9 @@ write_reg_dw(adapter, 0x210, 0xb2ff); write_reg_dw(adapter, 0x208, 0x40); - init_dma_queue(adapter); - - if ((adapter->dma_status & 0x30000000) == 0) { - free_adapter_object(adapter); - - return -ENODEV; - } + ret = init_dma_queue(adapter); + if (ret < 0) + goto err_free_irq; adapter->b2c2_revision = (read_reg_dw(adapter, 0x204) >> 0x18); @@ -1931,11 +1923,8 @@ default: printk("%s: The revision of the FlexCop chip on your card is %d\n", __FILE__, adapter->b2c2_revision); printk("%s: This driver works only with FlexCopII(rev.130), FlexCopIIB(rev.195) and FlexCopIII(rev.192).\n", __FILE__); - free_adapter_object(adapter); - pci_set_drvdata(pdev, NULL); - release_region(pci_resource_start(pdev, 1), pci_resource_len(pdev, 1)); - release_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); - return -ENODEV; + ret = -ENODEV; + goto err_free_dma_queue; } decide_how_many_hw_filters(adapter); @@ -1979,16 +1968,26 @@ ctrl_enable_mac(adapter, 1); } - spin_lock_init(&adapter->lock); + adapter->lock = SPIN_LOCK_UNLOCKED; - return 0; +out: + return ret; + +err_free_dma_queue: + free_dma_queue(adapter); +err_free_irq: + free_irq(pdev->irq, adapter); +err_release_adapter: + release_adapter(adapter); +err_kfree: + pci_set_drvdata(pdev, NULL); + kfree(adapter); + goto out; } static void driver_halt(struct pci_dev *pdev) { - struct adapter *adapter; - - adapter = pci_get_drvdata(pdev); + struct adapter *adapter = pci_get_drvdata(pdev); irq_dma_enable_disable_irq(adapter, 0); @@ -1998,9 +1997,9 @@ pci_set_drvdata(pdev, NULL); - release_region(pci_resource_start(pdev, 1), pci_resource_len(pdev, 1)); - - release_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); + pci_disable_device(pdev); + pci_release_region(pdev, 1); + pci_release_region(pdev, 0); } static int dvb_start_feed(struct dvb_demux_feed *dvbdmxfeed) @@ -2325,11 +2324,22 @@ +static int nxt2002_request_firmware(struct dvb_frontend* fe, const struct firmware **fw, char* name) +{ + struct adapter* adapter = (struct adapter*) fe->dvb->priv; + + return request_firmware(fw, name, &adapter->pdev->dev); +} + +static struct nxt2002_config samsung_tbmv_config = { + .demod_address = 0x0A, + .request_firmware = nxt2002_request_firmware, +}; static int samsung_tdtc9251dh0_demod_init(struct dvb_frontend* fe) { - static u8 mt352_clock_config [] = { 0x89, 0x10, 0x2d }; + static u8 mt352_clock_config [] = { 0x89, 0x18, 0x2d }; static u8 mt352_reset [] = { 0x50, 0x80 }; static u8 mt352_adc_ctl_1_cfg [] = { 0x8E, 0x40 }; static u8 mt352_agc_cfg [] = { 0x67, 0x28, 0xa1 }; @@ -2407,7 +2417,15 @@ static void frontend_init(struct adapter *skystar2) { switch(skystar2->pdev->device) { - case 0x2103: // Technisat Skystar2 OR Technisat Airstar2 + case 0x2103: // Technisat Skystar2 OR Technisat Airstar2 (DVB-T or ATSC) + + // Attempt to load the Nextwave nxt2002 for ATSC support + skystar2->fe = nxt2002_attach(&samsung_tbmv_config, &skystar2->i2c_adap); + if (skystar2->fe != NULL) { + skystar2->fe_sleep = skystar2->fe->ops->sleep; + skystar2->fe->ops->sleep = flexcop_sleep; + break; + } // try the skystar2 v2.6 first (stv0299/Samsung tbmu24112(sl1935)) skystar2->fe = stv0299_attach(&samsung_tbmu24112_config, &skystar2->i2c_adap); @@ -2462,26 +2480,24 @@ struct adapter *adapter; struct dvb_adapter *dvb_adapter; struct dvb_demux *dvbdemux; + struct dmx_demux *dmx; + int ret = -ENODEV; - int ret; - - if (pdev == NULL) - return -ENODEV; + if (!pdev) + goto out; - if (driver_initialize(pdev) != 0) - return -ENODEV; - - dvb_register_adapter(&dvb_adapter, skystar2_pci_driver.name, THIS_MODULE); + ret = driver_initialize(pdev); + if (ret < 0) + goto out; - if (dvb_adapter == NULL) { + ret = dvb_register_adapter(&dvb_adapter, skystar2_pci_driver.name, + THIS_MODULE); + if (ret < 0) { printk("%s: Error registering DVB adapter\n", __FUNCTION__); - - driver_halt(pdev); - - return -ENODEV; + goto err_halt; } - adapter = (struct adapter *) pci_get_drvdata(pdev); + adapter = pci_get_drvdata(pdev); dvb_adapter->priv = adapter; adapter->dvb_adapter = dvb_adapter; @@ -2504,14 +2520,13 @@ adapter->i2c_adap.algo_data = NULL; adapter->i2c_adap.id = I2C_ALGO_BIT; - if (i2c_add_adapter(&adapter->i2c_adap) < 0) { - dvb_unregister_adapter (adapter->dvb_adapter); - return -ENOMEM; - } + ret = i2c_add_adapter(&adapter->i2c_adap); + if (ret < 0) + goto err_dvb_unregister; dvbdemux = &adapter->demux; - dvbdemux->priv = (void *) adapter; + dvbdemux->priv = adapter; dvbdemux->filternum = N_PID_SLOTS; dvbdemux->feednum = N_PID_SLOTS; dvbdemux->start_feed = dvb_start_feed; @@ -2519,68 +2534,87 @@ dvbdemux->write_to_decoder = NULL; dvbdemux->dmx.capabilities = (DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING); - dvb_dmx_init(&adapter->demux); + ret = dvb_dmx_init(&adapter->demux); + if (ret < 0) + goto err_i2c_del; - adapter->hw_frontend.source = DMX_FRONTEND_0; + dmx = &dvbdemux->dmx; + adapter->hw_frontend.source = DMX_FRONTEND_0; adapter->dmxdev.filternum = N_PID_SLOTS; - adapter->dmxdev.demux = &dvbdemux->dmx; + adapter->dmxdev.demux = dmx; adapter->dmxdev.capabilities = 0; - dvb_dmxdev_init(&adapter->dmxdev, adapter->dvb_adapter); + ret = dvb_dmxdev_init(&adapter->dmxdev, adapter->dvb_adapter); + if (ret < 0) + goto err_dmx_release; - ret = dvbdemux->dmx.add_frontend(&dvbdemux->dmx, &adapter->hw_frontend); + ret = dmx->add_frontend(dmx, &adapter->hw_frontend); if (ret < 0) - return ret; + goto err_dmxdev_release; adapter->mem_frontend.source = DMX_MEMORY_FE; - ret = dvbdemux->dmx.add_frontend(&dvbdemux->dmx, &adapter->mem_frontend); + ret = dmx->add_frontend(dmx, &adapter->mem_frontend); if (ret < 0) - return ret; + goto err_remove_hw_frontend; - ret = dvbdemux->dmx.connect_frontend(&dvbdemux->dmx, &adapter->hw_frontend); + ret = dmx->connect_frontend(dmx, &adapter->hw_frontend); if (ret < 0) - return ret; + goto err_remove_mem_frontend; dvb_net_init(adapter->dvb_adapter, &adapter->dvbnet, &dvbdemux->dmx); frontend_init(adapter); +out: + return ret; - return 0; +err_remove_mem_frontend: + dvbdemux->dmx.remove_frontend(&dvbdemux->dmx, &adapter->mem_frontend); +err_remove_hw_frontend: + dvbdemux->dmx.remove_frontend(&dvbdemux->dmx, &adapter->hw_frontend); +err_dmxdev_release: + dvb_dmxdev_release(&adapter->dmxdev); +err_dmx_release: + dvb_dmx_release(&adapter->demux); +err_i2c_del: + i2c_del_adapter(&adapter->i2c_adap); +err_dvb_unregister: + dvb_unregister_adapter(adapter->dvb_adapter); +err_halt: + driver_halt(pdev); + goto out; } static void skystar2_remove(struct pci_dev *pdev) { - struct adapter *adapter; + struct adapter *adapter = pci_get_drvdata(pdev); struct dvb_demux *dvbdemux; + struct dmx_demux *dmx; - if (pdev == NULL) + if (!adapter) return; - adapter = pci_get_drvdata(pdev); - - if (adapter != NULL) { dvb_net_release(&adapter->dvbnet); dvbdemux = &adapter->demux; + dmx = &dvbdemux->dmx; - dvbdemux->dmx.close(&dvbdemux->dmx); - dvbdemux->dmx.remove_frontend(&dvbdemux->dmx, &adapter->hw_frontend); - dvbdemux->dmx.remove_frontend(&dvbdemux->dmx, &adapter->mem_frontend); + dmx->close(dmx); + dmx->remove_frontend(dmx, &adapter->hw_frontend); + dmx->remove_frontend(dmx, &adapter->mem_frontend); dvb_dmxdev_release(&adapter->dmxdev); - dvb_dmx_release(&adapter->demux); + dvb_dmx_release(dvbdemux); + + if (adapter->fe != NULL) + dvb_unregister_frontend(adapter->fe); - if (adapter->fe != NULL) dvb_unregister_frontend(adapter->fe); + dvb_unregister_adapter(adapter->dvb_adapter); - if (adapter->dvb_adapter != NULL) { i2c_del_adapter(&adapter->i2c_adap); - dvb_unregister_adapter(adapter->dvb_adapter); - } driver_halt(pdev); } -} static struct pci_device_id skystar2_pci_tbl[] = { {0x000013d0, 0x00002103, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000}, diff -Nru a/drivers/media/dvb/bt8xx/Kconfig b/drivers/media/dvb/bt8xx/Kconfig --- a/drivers/media/dvb/bt8xx/Kconfig 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/bt8xx/Kconfig 2005-01-28 14:11:40 -08:00 @@ -3,6 +3,8 @@ depends on DVB_CORE && PCI && VIDEO_BT848 select DVB_MT352 select DVB_SP887X + select DVB_NXT6000 + select DVB_CX24110 help Support for PCI cards based on the Bt8xx PCI bridge. Examples are the Nebula cards, the Pinnacle PCTV cards and Twinhan DST cards. @@ -10,9 +12,6 @@ Since these cards have no MPEG decoder onboard, they transmit only compressed MPEG data over the PCI bus, so you need an external software decoder to watch TV on your computer. - - If you have a Twinhan card, don't forget to select - "Twinhan DST based DVB-S/-T frontend". Say Y if you own such a device and want to use it. diff -Nru a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c 2005-01-28 14:11:40 -08:00 @@ -181,6 +181,70 @@ .pll_set = thomson_dtt7579_pll_set, }; +static int cx24108_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) +{ + u32 freq = params->frequency; + + int i, a, n, pump; + u32 band, pll; + + + u32 osci[]={950000,1019000,1075000,1178000,1296000,1432000, + 1576000,1718000,1856000,2036000,2150000}; + u32 bandsel[]={0,0x00020000,0x00040000,0x00100800,0x00101000, + 0x00102000,0x00104000,0x00108000,0x00110000, + 0x00120000,0x00140000}; + +#define XTAL 1011100 /* Hz, really 1.0111 MHz and a /10 prescaler */ + printk("cx24108 debug: entering SetTunerFreq, freq=%d\n",freq); + + /* This is really the bit driving the tuner chip cx24108 */ + + if(freq<950000) freq=950000; /* kHz */ + if(freq>2150000) freq=2150000; /* satellite IF is 950..2150MHz */ + + /* decide which VCO to use for the input frequency */ + for(i=1;(ibt->dev->dev); } -struct sp887x_config microtune_mt7202dtf_config = { +static struct sp887x_config microtune_mt7202dtf_config = { .demod_address = 0x70, .pll_set = microtune_mt7202dtf_pll_set, @@ -387,6 +451,13 @@ break; } break; + + case BTTV_PINNACLESAT: + card->fe = cx24110_attach(&pctvsat_config, card->i2c_adapter); + if (card->fe != NULL) { + break; + } + break; } if (card->fe == NULL) { @@ -510,7 +581,14 @@ switch(sub->core->type) { -/* case BTTV_PINNACLESAT: UNDEFINED HARDWARE */ + case BTTV_PINNACLESAT: + card->gpio_mode = 0x0400c060; + /* should be: BT878_A_GAIN=0,BT878_A_PWRDN,BT878_DA_DPM,BT878_DA_SBR, + BT878_DA_IOM=1,BT878_DA_APP to enable serial highspeed mode. */ + card->op_sync_orin = 0; + card->irq_err_ignore = 0; + break; + #ifdef BTTV_DVICO_DVBT_LITE case BTTV_DVICO_DVBT_LITE: #endif diff -Nru a/drivers/media/dvb/bt8xx/dvb-bt8xx.h b/drivers/media/dvb/bt8xx/dvb-bt8xx.h --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.h 2005-01-28 14:11:41 -08:00 @@ -22,6 +22,9 @@ * */ +#ifndef DVB_BT8XX_H +#define DVB_BT8XX_H + #include #include "dvbdev.h" #include "dvb_net.h" @@ -30,6 +33,7 @@ #include "sp887x.h" #include "dst.h" #include "nxt6000.h" +#include "cx24110.h" struct dvb_bt8xx_card { struct semaphore lock; @@ -50,3 +54,5 @@ struct dvb_frontend* fe; }; + +#endif /* DVB_BT8XX_H */ diff -Nru a/drivers/media/dvb/dibusb/Kconfig b/drivers/media/dvb/dibusb/Kconfig --- a/drivers/media/dvb/dibusb/Kconfig 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/dibusb/Kconfig 2005-01-28 14:11:40 -08:00 @@ -1,12 +1,13 @@ config DVB_DIBUSB - tristate "DiBcom USB DVB-T devices (see help for device list)" + tristate "DiBcom USB DVB-T devices (see help for a complete device list)" depends on DVB_CORE && USB select FW_LOADER select DVB_DIB3000MB select DVB_DIB3000MC + select DVB_MT352 help Support for USB 1.1 and 2.0 DVB-T devices based on reference designs made by - DiBcom (). + DiBcom (http://www.dibcom.fr) and C&E. Devices supported by this driver: @@ -14,12 +15,14 @@ TwinhanDTV Magic Box (VP7041e) KWorld V-Stream XPERT DTV - DVB-T USB Hama DVB-T USB-Box - DiBcom reference device (non-public) + DiBcom reference devices (non-public) Ultima Electronic/Artec T1 USB TVBOX Compro Videomate DVB-U2000 - DVB-T USB Grandtec DVB-T USB Avermedia AverTV DVBT USB - Yakumo DVB-T mobile USB2.0 + Artec T1 USB1.1 and USB2.0 boxes + Yakumo/Typhoon DVB-T USB2.0 + Hanftek UMT-010 USB2.0 The VP7041 seems to be identical to "CTS Portable" (Chinese Television System). @@ -27,7 +30,7 @@ These devices can be understood as budget ones, they "only" deliver (a part of) the MPEG2 transport stream. - A firmware is needed to get the device working. See + A firmware is needed to get the device working. See Documentation/dvb/README.dibusb details. Say Y if you own such a device and want to use it. You should build it as @@ -46,6 +49,7 @@ 0x0574:0x2235 (Artec T1 USB1.1, cold) 0x04b4:0x8613 (Artec T1 USB2.0, cold) 0x0574:0x1002 (Artec T1 USB2.0, warm) + 0x0574:0x2131 (aged DiBcom USB1.1 test device) Say Y if your device has one of the mentioned IDs. diff -Nru a/drivers/media/dvb/dibusb/Makefile b/drivers/media/dvb/dibusb/Makefile --- a/drivers/media/dvb/dibusb/Makefile 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/dibusb/Makefile 2005-01-28 14:11:40 -08:00 @@ -1,3 +1,11 @@ +dvb-dibusb-objs = dvb-dibusb-core.o \ + dvb-dibusb-dvb.o \ + dvb-dibusb-fe-i2c.o \ + dvb-dibusb-firmware.o \ + dvb-dibusb-remote.o \ + dvb-dibusb-usb.o \ + dvb-dibusb-pid.o + obj-$(CONFIG_DVB_DIBUSB) += dvb-dibusb.o EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb-core.c b/drivers/media/dvb/dibusb/dvb-dibusb-core.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/media/dvb/dibusb/dvb-dibusb-core.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,480 @@ +/* + * Driver for mobile USB Budget DVB-T devices based on reference + * design made by DiBcom (http://www.dibcom.fr/) + * + * dvb-dibusb-core.c + * + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) + * + * based on GPL code from DiBcom, which has + * Copyright (C) 2004 Amaury Demol for DiBcom (ademol@dibcom.fr) + * + * Remote control code added by David Matthews (dm@prolingua.co.uk) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, version 2. + * + * Acknowledgements + * + * Amaury Demol (ademol@dibcom.fr) from DiBcom for providing specs and driver + * sources, on which this driver (and the dib3000mb/mc/p frontends) are based. + * + * see Documentation/dvb/README.dibusb for more information + */ +#include "dvb-dibusb.h" + +#include + +/* debug */ +int dvb_dibusb_debug; +module_param_named(debug, dvb_dibusb_debug, int, 0644); + +#ifdef CONFIG_DVB_DIBCOM_DEBUG +#define DBSTATUS "" +#else +#define DBSTATUS " (debugging is not enabled)" +#endif +MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=alotmore,8=ts,16=err,32=rc (|-able))." DBSTATUS); +#undef DBSTATUS + +static int pid_parse; +module_param(pid_parse, int, 0644); +MODULE_PARM_DESC(pid_parse, "enable pid parsing (filtering) when running at USB2.0"); + +static int rc_query_interval; +module_param(rc_query_interval, int, 0644); +MODULE_PARM_DESC(rc_query_interval, "interval in msecs for remote control query (default: 100; min: 40)"); + +/* Vendor IDs */ +#define USB_VID_ANCHOR 0x0547 +#define USB_VID_AVERMEDIA 0x14aa +#define USB_VID_COMPRO 0x185b +#define USB_VID_COMPRO_UNK 0x145f +#define USB_VID_CYPRESS 0x04b4 +#define USB_VID_DIBCOM 0x10b8 +#define USB_VID_EMPIA 0xeb1a +#define USB_VID_GRANDTEC 0x5032 +#define USB_VID_HYPER_PALTEK 0x1025 +#define USB_VID_HANFTEK 0x15f4 +#define USB_VID_IMC_NETWORKS 0x13d3 +#define USB_VID_TWINHAN 0x1822 +#define USB_VID_ULTIMA_ELECTRONIC 0x05d8 + +/* Product IDs */ +#define USB_PID_AVERMEDIA_DVBT_USB_COLD 0x0001 +#define USB_PID_AVERMEDIA_DVBT_USB_WARM 0x0002 +#define USB_PID_COMPRO_DVBU2000_COLD 0xd000 +#define USB_PID_COMPRO_DVBU2000_WARM 0xd001 +#define USB_PID_COMPRO_DVBU2000_UNK_COLD 0x010c +#define USB_PID_COMPRO_DVBU2000_UNK_WARM 0x010d +#define USB_PID_DIBCOM_MOD3000_COLD 0x0bb8 +#define USB_PID_DIBCOM_MOD3000_WARM 0x0bb9 +#define USB_PID_DIBCOM_MOD3001_COLD 0x0bc6 +#define USB_PID_DIBCOM_MOD3001_WARM 0x0bc7 +#define USB_PID_DIBCOM_ANCHOR_2135_COLD 0x2131 +#define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 +#define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 +#define USB_PID_KWORLD_VSTREAM_COLD 0x17de +#define USB_PID_KWORLD_VSTREAM_WARM 0x17df +#define USB_PID_TWINHAN_VP7041_COLD 0x3201 +#define USB_PID_TWINHAN_VP7041_WARM 0x3202 +#define USB_PID_ULTIMA_TVBOX_COLD 0x8105 +#define USB_PID_ULTIMA_TVBOX_WARM 0x8106 +#define USB_PID_ULTIMA_TVBOX_AN2235_COLD 0x8107 +#define USB_PID_ULTIMA_TVBOX_AN2235_WARM 0x8108 +#define USB_PID_ULTIMA_TVBOX_ANCHOR_COLD 0x2235 +#define USB_PID_ULTIMA_TVBOX_USB2_COLD 0x8109 +#define USB_PID_ULTIMA_TVBOX_USB2_FX_COLD 0x8613 +#define USB_PID_ULTIMA_TVBOX_USB2_FX_WARM 0x1002 +#define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e +#define USB_PID_UNK_HYPER_PALTEK_WARM 0x005f +#define USB_PID_HANFTEK_UMT_010_COLD 0x0001 +#define USB_PID_HANFTEK_UMT_010_WARM 0x0025 +#define USB_PID_YAKUMO_DTT200U_COLD 0x0201 +#define USB_PID_YAKUMO_DTT200U_WARM 0x0301 + +/* USB Driver stuff + * table of devices that this driver is working with + * + * ATTENTION: Never ever change the order of this table, the particular + * devices depend on this order + * + * Each entry is used as a reference in the device_struct. Currently this is + * the only non-redundant way of assigning USB ids to actual devices I'm aware + * of, because there is only one place in the code where the assignment of + * vendor and product id is done, here. + */ +static struct usb_device_id dib_table [] = { +/* 00 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_DVBT_USB_COLD)}, +/* 01 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_DVBT_USB_WARM)}, +/* 02 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_YAKUMO_DTT200U_COLD) }, + +/* the following device is actually not supported, but when loading the + * correct firmware (ie. its usb ids will change) everything works fine then + */ +/* 03 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_YAKUMO_DTT200U_WARM) }, + +/* 04 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_COLD) }, +/* 05 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_WARM) }, +/* 06 */ { USB_DEVICE(USB_VID_COMPRO_UNK, USB_PID_COMPRO_DVBU2000_UNK_COLD) }, +/* 07 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_COLD) }, +/* 08 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_WARM) }, +/* 09 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_COLD) }, +/* 10 */ { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_WARM) }, +/* 11 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_COLD) }, +/* 12 */ { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_WARM) }, +/* 13 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_COLD) }, +/* 14 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_WARM) }, +/* 15 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_COLD) }, +/* 16 */ { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_WARM) }, +/* 17 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_COLD) }, +/* 18 */ { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_WARM) }, +/* 19 */ { USB_DEVICE(USB_VID_IMC_NETWORKS, USB_PID_TWINHAN_VP7041_COLD) }, +/* 20 */ { USB_DEVICE(USB_VID_IMC_NETWORKS, USB_PID_TWINHAN_VP7041_WARM) }, +/* 21 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_COLD) }, +/* 22 */ { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_WARM) }, +/* 23 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_COLD) }, +/* 24 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_WARM) }, +/* 25 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_COLD) }, +/* 26 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_WARM) }, +/* 27 */ { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) }, + +/* 28 */ { USB_DEVICE(USB_VID_HANFTEK, USB_PID_HANFTEK_UMT_010_COLD) }, +/* 29 */ { USB_DEVICE(USB_VID_HANFTEK, USB_PID_HANFTEK_UMT_010_WARM) }, + +/* + * activate the following define when you have one of the devices and want to + * build it from build-2.6 in dvb-kernel + */ +// #define CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES +#ifdef CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES +/* 30 */ { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) }, +/* 31 */ { USB_DEVICE(USB_VID_CYPRESS, USB_PID_ULTIMA_TVBOX_USB2_FX_COLD) }, +/* 32 */ { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_USB2_FX_WARM) }, +/* 33 */ { USB_DEVICE(USB_VID_ANCHOR, USB_PID_DIBCOM_ANCHOR_2135_COLD) }, +#endif + { } /* Terminating entry */ +}; + +MODULE_DEVICE_TABLE (usb, dib_table); + +static struct dibusb_usb_controller dibusb_usb_ctrl[] = { + { .name = "Cypress AN2135", .cpu_cs_register = 0x7f92 }, + { .name = "Cypress AN2235", .cpu_cs_register = 0x7f92 }, + { .name = "Cypress FX2", .cpu_cs_register = 0xe600 }, +}; + +struct dibusb_tuner dibusb_tuner[] = { + { DIBUSB_TUNER_CABLE_THOMSON, + 0x61 + }, + { DIBUSB_TUNER_COFDM_PANASONIC_ENV57H1XD5, + 0x60 + }, + { DIBUSB_TUNER_CABLE_LG_TDTP_E102P, + 0x61 + }, + { DIBUSB_TUNER_COFDM_PANASONIC_ENV77H11D5, + 0x60 + }, +}; + +static struct dibusb_demod dibusb_demod[] = { + { DIBUSB_DIB3000MB, + 16, + { 0x8, 0 }, + }, + { DIBUSB_DIB3000MC, + 32, + { 0x9, 0xa, 0xb, 0xc }, + }, + { DIBUSB_MT352, + 254, + { 0xf, 0 }, + }, +}; + +static struct dibusb_device_class dibusb_device_classes[] = { + { .id = DIBUSB1_1, .usb_ctrl = &dibusb_usb_ctrl[0], + .firmware = "dvb-dibusb-5.0.0.11.fw", + .pipe_cmd = 0x01, .pipe_data = 0x02, + .urb_count = 3, .urb_buffer_size = 4096, + DIBUSB_RC_NEC_PROTOCOL, + &dibusb_demod[DIBUSB_DIB3000MB], + &dibusb_tuner[DIBUSB_TUNER_CABLE_THOMSON], + }, + { DIBUSB1_1_AN2235, &dibusb_usb_ctrl[1], + "dvb-dibusb-an2235-1.fw", + 0x01, 0x02, + 3, 4096, + DIBUSB_RC_NEC_PROTOCOL, + &dibusb_demod[DIBUSB_DIB3000MB], + &dibusb_tuner[DIBUSB_TUNER_CABLE_THOMSON], + }, + { DIBUSB2_0,&dibusb_usb_ctrl[2], + "dvb-dibusb-6.0.0.5.fw", + 0x01, 0x06, + 3, 188*210, + DIBUSB_RC_NEC_PROTOCOL, + &dibusb_demod[DIBUSB_DIB3000MC], + &dibusb_tuner[DIBUSB_TUNER_COFDM_PANASONIC_ENV57H1XD5], + }, + { UMT2_0, &dibusb_usb_ctrl[2], + "dvb-dibusb-umt-1.fw", + 0x01, 0x02, + 15, 188*21, + DIBUSB_RC_NO, + &dibusb_demod[DIBUSB_MT352], +// &dibusb_tuner[DIBUSB_TUNER_COFDM_PANASONIC_ENV77H11D5], + &dibusb_tuner[DIBUSB_TUNER_CABLE_LG_TDTP_E102P], + }, +}; + +static struct dibusb_usb_device dibusb_devices[] = { + { "TwinhanDTV USB1.1 / Magic Box / HAMA USB1.1 DVB-T device", + &dibusb_device_classes[DIBUSB1_1], + { &dib_table[19], &dib_table[21], NULL}, + { &dib_table[20], &dib_table[22], NULL}, + }, + { "KWorld V-Stream XPERT DTV - DVB-T USB1.1", + &dibusb_device_classes[DIBUSB1_1], + { &dib_table[11], NULL }, + { &dib_table[12], NULL }, + }, + { "Grandtec USB1.1 DVB-T", + &dibusb_device_classes[DIBUSB1_1], + { &dib_table[13], &dib_table[15], NULL }, + { &dib_table[14], &dib_table[16], NULL }, + }, + { "DiBcom USB1.1 DVB-T reference design (MOD3000)", + &dibusb_device_classes[DIBUSB1_1], + { &dib_table[7], NULL }, + { &dib_table[8], NULL }, + }, + { "Artec T1 USB1.1 TVBOX with AN2135", + &dibusb_device_classes[DIBUSB1_1], + { &dib_table[23], NULL }, + { &dib_table[24], NULL }, + }, + { "Artec T1 USB1.1 TVBOX with AN2235", + &dibusb_device_classes[DIBUSB1_1_AN2235], + { &dib_table[25], NULL }, + { &dib_table[26], NULL }, + }, + { "Avermedia AverTV DVBT USB1.1", + &dibusb_device_classes[DIBUSB1_1], + { &dib_table[0], NULL }, + { &dib_table[1], NULL }, + }, + { "Compro Videomate DVB-U2000 - DVB-T USB1.1 (please confirm to linux-dvb)", + &dibusb_device_classes[DIBUSB1_1], + { &dib_table[4], &dib_table[6], NULL}, + { &dib_table[5], NULL }, + }, + { "Unkown USB1.1 DVB-T device ???? please report the name to the author", + &dibusb_device_classes[DIBUSB1_1], + { &dib_table[17], NULL }, + { &dib_table[18], NULL }, + }, + { "DiBcom USB2.0 DVB-T reference design (MOD3000P)", + &dibusb_device_classes[DIBUSB2_0], + { &dib_table[9], NULL }, + { &dib_table[10], NULL }, + }, + { "Artec T1 USB2.0 TVBOX (please report the warm ID)", + &dibusb_device_classes[DIBUSB2_0], + { &dib_table[27], NULL }, + { NULL }, + }, + { "AVermedia/Yakumo/Hama/Typhoon DVB-T USB2.0", + &dibusb_device_classes[UMT2_0], + { &dib_table[2], NULL }, + { NULL }, + }, + { "Hanftek UMT-010 DVB-T USB2.0", + &dibusb_device_classes[UMT2_0], + { &dib_table[28], NULL }, + { &dib_table[29], NULL }, + }, +#ifdef CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES + { "Artec T1 USB1.1 TVBOX with AN2235 (misdesigned)", + &dibusb_device_classes[DIBUSB1_1_AN2235], + { &dib_table[30], NULL }, + { NULL }, + }, + { "Artec T1 USB2.0 TVBOX with FX2 IDs (misdesigned, please report the warm ID)", + &dibusb_device_classes[DIBUSB2_0], + { &dib_table[31], NULL }, + { &dib_table[32], NULL }, /* undefined, it could be that the device will get another USB ID in warm state */ + }, + { "DiBcom USB1.1 DVB-T reference design (MOD3000) with AN2135 default IDs", + &dibusb_device_classes[DIBUSB1_1], + { &dib_table[33], NULL }, + { NULL }, + }, +#endif +}; + +static int dibusb_exit(struct usb_dibusb *dib) +{ + deb_info("init_state before exiting everything: %x\n",dib->init_state); + dibusb_remote_exit(dib); + dibusb_fe_exit(dib); + dibusb_i2c_exit(dib); + dibusb_pid_list_exit(dib); + dibusb_dvb_exit(dib); + dibusb_urb_exit(dib); + deb_info("init_state should be zero now: %x\n",dib->init_state); + dib->init_state = DIBUSB_STATE_INIT; + kfree(dib); + return 0; +} + +static int dibusb_init(struct usb_dibusb *dib) +{ + int ret = 0; + sema_init(&dib->usb_sem, 1); + sema_init(&dib->i2c_sem, 1); + + dib->init_state = DIBUSB_STATE_INIT; + + if ((ret = dibusb_urb_init(dib)) || + (ret = dibusb_dvb_init(dib)) || + (ret = dibusb_pid_list_init(dib)) || + (ret = dibusb_i2c_init(dib))) { + dibusb_exit(dib); + return ret; + } + + if ((ret = dibusb_fe_init(dib))) + err("could not initialize a frontend."); + + if ((ret = dibusb_remote_init(dib))) + err("could not initialize remote control."); + + return 0; +} + +static struct dibusb_usb_device * dibusb_find_device (struct usb_device *udev,int *cold) +{ + int i,j; + *cold = -1; + for (i = 0; i < sizeof(dibusb_devices)/sizeof(struct dibusb_usb_device); i++) { + for (j = 0; j < DIBUSB_ID_MAX_NUM && dibusb_devices[i].cold_ids[j] != NULL; j++) { + deb_info("check for cold %x %x\n",dibusb_devices[i].cold_ids[j]->idVendor, dibusb_devices[i].cold_ids[j]->idProduct); + if (dibusb_devices[i].cold_ids[j]->idVendor == udev->descriptor.idVendor && + dibusb_devices[i].cold_ids[j]->idProduct == udev->descriptor.idProduct) { + *cold = 1; + return &dibusb_devices[i]; + } + } + + for (j = 0; j < DIBUSB_ID_MAX_NUM && dibusb_devices[i].warm_ids[j] != NULL; j++) { + deb_info("check for warm %x %x\n",dibusb_devices[i].warm_ids[j]->idVendor, dibusb_devices[i].warm_ids[j]->idProduct); + if (dibusb_devices[i].warm_ids[j]->idVendor == udev->descriptor.idVendor && + dibusb_devices[i].warm_ids[j]->idProduct == udev->descriptor.idProduct) { + *cold = 0; + return &dibusb_devices[i]; + } + } + } + return NULL; +} + +/* + * USB + */ +static int dibusb_probe(struct usb_interface *intf, + const struct usb_device_id *id) +{ + struct usb_device *udev = interface_to_usbdev(intf); + struct usb_dibusb *dib = NULL; + struct dibusb_usb_device *dibdev = NULL; + + int ret = -ENOMEM,cold=0; + + if ((dibdev = dibusb_find_device(udev,&cold)) == NULL) { + err("something went very wrong, " + "unknown product ID: %.4x",udev->descriptor.idProduct); + return -ENODEV; + } + + if (cold == 1) { + info("found a '%s' in cold state, will try to load a firmware",dibdev->name); + ret = dibusb_loadfirmware(udev,dibdev); + } else { + info("found a '%s' in warm state.",dibdev->name); + dib = kmalloc(sizeof(struct usb_dibusb),GFP_KERNEL); + if (dib == NULL) { + err("no memory"); + return ret; + } + memset(dib,0,sizeof(struct usb_dibusb)); + + dib->udev = udev; + dib->dibdev = dibdev; + + /* store parameters to structures */ + dib->rc_query_interval = rc_query_interval; + dib->pid_parse = pid_parse; + + usb_set_intfdata(intf, dib); + + ret = dibusb_init(dib); + } + + if (ret == 0) + info("%s successfully initialized and connected.",dibdev->name); + else + info("%s error while loading driver (%d)",dibdev->name,ret); + return ret; +} + +static void dibusb_disconnect(struct usb_interface *intf) +{ + struct usb_dibusb *dib = usb_get_intfdata(intf); + const char *name = DRIVER_DESC; + + usb_set_intfdata(intf,NULL); + if (dib != NULL && dib->dibdev != NULL) { + name = dib->dibdev->name; + dibusb_exit(dib); + } + info("%s successfully deinitialized and disconnected.",name); + +} + +/* usb specific object needed to register this driver with the usb subsystem */ +struct usb_driver dibusb_driver = { + .owner = THIS_MODULE, + .name = DRIVER_DESC, + .probe = dibusb_probe, + .disconnect = dibusb_disconnect, + .id_table = dib_table, +}; + +/* module stuff */ +static int __init usb_dibusb_init(void) +{ + int result; + if ((result = usb_register(&dibusb_driver))) { + err("usb_register failed. Error number %d",result); + return result; + } + + return 0; +} + +static void __exit usb_dibusb_exit(void) +{ + /* deregister this driver from the USB subsystem */ + usb_deregister(&dibusb_driver); +} + +module_init (usb_dibusb_init); +module_exit (usb_dibusb_exit); + +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_LICENSE("GPL"); diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c b/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,205 @@ +/* + * dvb-dibusb-dvb.c is part of the driver for mobile USB Budget DVB-T devices + * based on reference design made by DiBcom (http://www.dibcom.fr/) + * + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) + * + * see dvb-dibusb-core.c for more copyright details. + * + * This file contains functions for initializing and handling the + * linux-dvb API. + */ +#include "dvb-dibusb.h" + +#include +#include + +static u32 urb_compl_count; + +/* + * MPEG2 TS DVB stuff + */ +void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs) +{ + struct usb_dibusb *dib = urb->context; + int ret; + + deb_ts("urb complete feedcount: %d, status: %d, length: %d\n",dib->feedcount,urb->status, + urb->actual_length); + + urb_compl_count++; + if (urb_compl_count % 500 == 0) + deb_info("%d urbs completed so far.\n",urb_compl_count); + + switch (urb->status) { + case 0: /* success */ + case -ETIMEDOUT: /* NAK */ + break; + case -ECONNRESET: /* unlink */ + case -ENOENT: + case -ESHUTDOWN: + return; + default: /* error */ + warn("urb completition error %d.", urb->status); + } + + if (dib->feedcount > 0) { + deb_ts("URB return len: %d\n",urb->actual_length); + if (urb->actual_length % 188) + deb_ts("TS Packets: %d, %d\n", urb->actual_length/188,urb->actual_length % 188); + + /* Francois recommends to drop not full-filled packets, even if they may + * contain valid TS packets, at least for USB1.1 + * + * if (urb->actual_length == dib->dibdev->parm->default_size && dib->dvb_is_ready) */ + if (dib->init_state & DIBUSB_STATE_DVB) + dvb_dmx_swfilter(&dib->demux, (u8*) urb->transfer_buffer,urb->actual_length); + else + deb_ts("URB dropped because of the " + "actual_length or !dvb_is_ready (%d).\n",dib->init_state & DIBUSB_STATE_DVB); + } else + deb_ts("URB dropped because of feedcount.\n"); + + ret = usb_submit_urb(urb,GFP_ATOMIC); + deb_ts("urb resubmitted, (%d)\n",ret); +} + +static int dibusb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) +{ + struct usb_dibusb *dib = dvbdmxfeed->demux->priv; + int newfeedcount; + + if (dib == NULL) + return -ENODEV; + + newfeedcount = dib->feedcount + (onoff ? 1 : -1); + + /* + * stop feed before setting a new pid if there will be no pid anymore + */ +// if ((dib->dibdev->parm->firmware_bug && dib->feedcount) || + if (newfeedcount == 0) { + deb_ts("stop feeding\n"); + if (dib->xfer_ops.fifo_ctrl != NULL) { + if (dib->xfer_ops.fifo_ctrl(dib->fe,0)) { + err("error while inhibiting fifo."); + return -ENODEV; + } + } + } + + dib->feedcount = newfeedcount; + + /* get a free pid from the list and activate it on the device + * specific pid_filter + */ + if (dib->pid_parse) + dibusb_ctrl_pid(dib,dvbdmxfeed,onoff); + + /* + * start the feed, either if there is the firmware bug or + * if this was the first pid to set and there is still a pid for + * reception. + */ + +// if ((dib->dibdev->parm->firmware_bug) + if (dib->feedcount == onoff && dib->feedcount > 0) { + + deb_ts("controlling pid parser\n"); + if (dib->xfer_ops.pid_parse != NULL) { + if (dib->xfer_ops.pid_parse(dib->fe,dib->pid_parse) < 0) { + err("could not handle pid_parser"); + } + } + + deb_ts("start feeding\n"); + if (dib->xfer_ops.fifo_ctrl != NULL) { + if (dib->xfer_ops.fifo_ctrl(dib->fe,1)) { + err("error while enabling fifo."); + return -ENODEV; + } + } + dibusb_streaming(dib,1); + } + return 0; +} + +static int dibusb_start_feed(struct dvb_demux_feed *dvbdmxfeed) +{ + deb_ts("start pid: 0x%04x, feedtype: %d\n", dvbdmxfeed->pid,dvbdmxfeed->type); + return dibusb_ctrl_feed(dvbdmxfeed,1); +} + +static int dibusb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) +{ + deb_ts("stop pid: 0x%04x, feedtype: %d\n", dvbdmxfeed->pid, dvbdmxfeed->type); + return dibusb_ctrl_feed(dvbdmxfeed,0); +} + +int dibusb_dvb_init(struct usb_dibusb *dib) +{ + int ret; + + urb_compl_count = 0; + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,4) + if ((ret = dvb_register_adapter(&dib->adapter, DRIVER_DESC)) < 0) { +#else + if ((ret = dvb_register_adapter(&dib->adapter, DRIVER_DESC , + THIS_MODULE)) < 0) { +#endif + deb_info("dvb_register_adapter failed: error %d", ret); + goto err; + } + dib->adapter->priv = dib; + +/* i2c is done in dibusb_i2c_init */ + + dib->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING; + + dib->demux.priv = (void *)dib; + /* get pidcount from demod */ + dib->demux.feednum = dib->demux.filternum = 255; + dib->demux.start_feed = dibusb_start_feed; + dib->demux.stop_feed = dibusb_stop_feed; + dib->demux.write_to_decoder = NULL; + if ((ret = dvb_dmx_init(&dib->demux)) < 0) { + err("dvb_dmx_init failed: error %d",ret); + goto err_dmx; + } + + dib->dmxdev.filternum = dib->demux.filternum; + dib->dmxdev.demux = &dib->demux.dmx; + dib->dmxdev.capabilities = 0; + if ((ret = dvb_dmxdev_init(&dib->dmxdev, dib->adapter)) < 0) { + err("dvb_dmxdev_init failed: error %d",ret); + goto err_dmx_dev; + } + + dvb_net_init(dib->adapter, &dib->dvb_net, &dib->demux.dmx); + + goto success; +err_dmx_dev: + dvb_dmx_release(&dib->demux); +err_dmx: + dvb_unregister_adapter(dib->adapter); +err: + return ret; +success: + dib->init_state |= DIBUSB_STATE_DVB; + return 0; +} + +int dibusb_dvb_exit(struct usb_dibusb *dib) +{ + if (dib->init_state & DIBUSB_STATE_DVB) { + dib->init_state &= ~DIBUSB_STATE_DVB; + deb_info("unregistering DVB part\n"); + dvb_net_release(&dib->dvb_net); + dib->demux.dmx.close(&dib->demux.dmx); + dvb_dmxdev_release(&dib->dmxdev); + dvb_dmx_release(&dib->demux); + dvb_unregister_adapter(dib->adapter); + } + return 0; +} diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c b/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,598 @@ +/* + * dvb-dibusb-fe-i2c.c is part of the driver for mobile USB Budget DVB-T devices + * based on reference design made by DiBcom (http://www.dibcom.fr/) + * + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) + * + * see dvb-dibusb-core.c for more copyright details. + * + * This file contains functions for attaching, initializing of an appropriate + * demodulator/frontend. I2C-stuff is also located here. + * + */ +#include "dvb-dibusb.h" + +#include + +int dibusb_i2c_msg(struct usb_dibusb *dib, u8 addr, + u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) +{ + u8 sndbuf[wlen+4]; /* lead(1) devaddr,direction(1) addr(2) data(wlen) (len(2) (when reading)) */ + /* write only ? */ + int wo = (rbuf == NULL || rlen == 0), + len = 2 + wlen + (wo ? 0 : 2); + + sndbuf[0] = wo ? DIBUSB_REQ_I2C_WRITE : DIBUSB_REQ_I2C_READ; + sndbuf[1] = (addr << 1) | (wo ? 0 : 1); + + memcpy(&sndbuf[2],wbuf,wlen); + + if (!wo) { + sndbuf[wlen+2] = (rlen >> 8) & 0xff; + sndbuf[wlen+3] = rlen & 0xff; + } + + return dibusb_readwrite_usb(dib,sndbuf,len,rbuf,rlen); +} + +/* + * I2C master xfer function + */ +static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num) +{ + struct usb_dibusb *dib = i2c_get_adapdata(adap); + int i; + + if (down_interruptible(&dib->i2c_sem) < 0) + return -EAGAIN; + + if (num > 2) + warn("more than 2 i2c messages at a time is not handled yet. TODO."); + + for (i = 0; i < num; i++) { + /* write/read request */ + if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) { + if (dibusb_i2c_msg(dib, msg[i].addr, msg[i].buf,msg[i].len, + msg[i+1].buf,msg[i+1].len) < 0) + break; + i++; + } else + if (dibusb_i2c_msg(dib, msg[i].addr, msg[i].buf,msg[i].len,NULL,0) < 0) + break; + } + + up(&dib->i2c_sem); + return i; +} + +static u32 dibusb_i2c_func(struct i2c_adapter *adapter) +{ + return I2C_FUNC_I2C; +} + +static struct i2c_algorithm dibusb_algo = { + .name = "DiBcom USB i2c algorithm", + .id = I2C_ALGO_BIT, + .master_xfer = dibusb_i2c_xfer, + .functionality = dibusb_i2c_func, +}; + +static int dibusb_general_demod_init(struct dvb_frontend *fe); +static u8 dibusb_general_pll_addr(struct dvb_frontend *fe); +static int dibusb_general_pll_init(struct dvb_frontend *fe, u8 pll_buf[5]); +static int dibusb_general_pll_set(struct dvb_frontend *fe, + struct dvb_frontend_parameters* params, u8 pll_buf[5]); + +static struct mt352_config mt352_hanftek_umt_010_config = { + .demod_address = 0x1e, + .demod_init = dibusb_general_demod_init, + .pll_set = dibusb_general_pll_set, +}; + +static int dibusb_tuner_quirk(struct usb_dibusb *dib) +{ + switch (dib->dibdev->dev_cl->id) { + case DIBUSB1_1: /* some these device have the ENV77H11D5 and some the THOMSON CABLE */ + case DIBUSB1_1_AN2235: { /* actually its this device, but in warm state they are indistinguishable */ + struct dibusb_tuner *t; + u8 b[2] = { 0,0 } ,b2[1]; + struct i2c_msg msg[2] = { + { .flags = 0, .buf = b, .len = 2 }, + { .flags = I2C_M_RD, .buf = b2, .len = 1}, + }; + + t = &dibusb_tuner[DIBUSB_TUNER_COFDM_PANASONIC_ENV77H11D5]; + + msg[0].addr = msg[1].addr = t->pll_addr; + + if (dib->xfer_ops.tuner_pass_ctrl != NULL) + dib->xfer_ops.tuner_pass_ctrl(dib->fe,1,t->pll_addr); + dibusb_i2c_xfer(&dib->i2c_adap,msg,2); + if (dib->xfer_ops.tuner_pass_ctrl != NULL) + dib->xfer_ops.tuner_pass_ctrl(dib->fe,0,t->pll_addr); + + if (b2[0] == 0xfe) + info("this device has the Thomson Cable onboard. Which is default."); + else { + dib->tuner = t; + info("this device has the Panasonic ENV77H11D5 onboard."); + } + break; + } + default: + break; + } + return 0; +} + +/* there is a ugly pid_filter in the firmware of the umt devices, it is accessible + * by i2c address 0x8. Don't know how to deactivate it and how many rows it has. + */ +static int dibusb_umt_pid_control(struct dvb_frontend *fe, int index, int pid, int onoff) +{ + struct usb_dibusb *dib = fe->dvb->priv; + u8 b[3]; + b[0] = index; + if (onoff) { + b[1] = (pid >> 8) & 0xff; + b[2] = pid & 0xff; + } else { + b[1] = 0; + b[2] = 0; + } + dibusb_i2c_msg(dib, 0x8, b, 3, NULL,0); + dibusb_set_streaming_mode(dib,0); + dibusb_set_streaming_mode(dib,1); + return 0; +} + +int dibusb_fe_init(struct usb_dibusb* dib) +{ + struct dib3000_config demod_cfg; + int i; + + if (dib->init_state & DIBUSB_STATE_I2C) { + for (i = 0; i < sizeof(dib->dibdev->dev_cl->demod->i2c_addrs) / sizeof(unsigned char) && + dib->dibdev->dev_cl->demod->i2c_addrs[i] != 0; i++) { + + demod_cfg.demod_address = dib->dibdev->dev_cl->demod->i2c_addrs[i]; + demod_cfg.pll_addr = dibusb_general_pll_addr; + demod_cfg.pll_set = dibusb_general_pll_set; + demod_cfg.pll_init = dibusb_general_pll_init; + + switch (dib->dibdev->dev_cl->demod->id) { + case DIBUSB_DIB3000MB: + dib->fe = dib3000mb_attach(&demod_cfg,&dib->i2c_adap,&dib->xfer_ops); + break; + case DIBUSB_DIB3000MC: + dib->fe = dib3000mc_attach(&demod_cfg,&dib->i2c_adap,&dib->xfer_ops); + break; + case DIBUSB_MT352: + mt352_hanftek_umt_010_config.demod_address = dib->dibdev->dev_cl->demod->i2c_addrs[i]; + dib->fe = mt352_attach(&mt352_hanftek_umt_010_config, &dib->i2c_adap); + dib->xfer_ops.pid_ctrl = dibusb_umt_pid_control; + break; + } + if (dib->fe != NULL) { + info("found demodulator at i2c address 0x%x",dib->dibdev->dev_cl->demod->i2c_addrs[i]); + break; + } + } + if (dib->fe->ops->sleep != NULL) + dib->fe_sleep = dib->fe->ops->sleep; + dib->fe->ops->sleep = dibusb_hw_sleep; + + if (dib->fe->ops->init != NULL ) + dib->fe_init = dib->fe->ops->init; + dib->fe->ops->init = dibusb_hw_wakeup; + + /* setting the default tuner */ + dib->tuner = dib->dibdev->dev_cl->tuner; + + /* check which tuner is mounted on this device, in case this is unsure */ + dibusb_tuner_quirk(dib); + } + if (dib->fe == NULL) { + err("A frontend driver was not found for device '%s'.", + dib->dibdev->name); + return -ENODEV; + } else { + if (dvb_register_frontend(dib->adapter, dib->fe)) { + err("Frontend registration failed."); + if (dib->fe->ops->release) + dib->fe->ops->release(dib->fe); + dib->fe = NULL; + return -ENODEV; + } + } + return 0; +} + +int dibusb_fe_exit(struct usb_dibusb *dib) +{ + if (dib->fe != NULL) + dvb_unregister_frontend(dib->fe); + return 0; +} + +int dibusb_i2c_init(struct usb_dibusb *dib) +{ + int ret = 0; + + dib->adapter->priv = dib; + + strncpy(dib->i2c_adap.name,dib->dibdev->name,I2C_NAME_SIZE); +#ifdef I2C_ADAP_CLASS_TV_DIGITAL + dib->i2c_adap.class = I2C_ADAP_CLASS_TV_DIGITAL, +#else + dib->i2c_adap.class = I2C_CLASS_TV_DIGITAL, +#endif + dib->i2c_adap.algo = &dibusb_algo; + dib->i2c_adap.algo_data = NULL; + dib->i2c_adap.id = I2C_ALGO_BIT; + + i2c_set_adapdata(&dib->i2c_adap, dib); + + if ((ret = i2c_add_adapter(&dib->i2c_adap)) < 0) + err("could not add i2c adapter"); + + dib->init_state |= DIBUSB_STATE_I2C; + + return ret; +} + +int dibusb_i2c_exit(struct usb_dibusb *dib) +{ + if (dib->init_state & DIBUSB_STATE_I2C) + i2c_del_adapter(&dib->i2c_adap); + dib->init_state &= ~DIBUSB_STATE_I2C; + return 0; +} + + +/* pll stuff, maybe removed soon (thx to Gerd/Andrew in advance) */ +static int thomson_cable_eu_pll_set(struct dvb_frontend_parameters *fep, u8 pllbuf[4]) +{ + u32 tfreq = (fep->frequency + 36125000) / 62500; + int vu,p0,p1,p2; + + if (fep->frequency > 403250000) + vu = 1, p2 = 1, p1 = 0, p0 = 1; + else if (fep->frequency > 115750000) + vu = 0, p2 = 1, p1 = 1, p0 = 0; + else if (fep->frequency > 44250000) + vu = 0, p2 = 0, p1 = 1, p0 = 1; + else + return -EINVAL; + + pllbuf[0] = (tfreq >> 8) & 0x7f; + pllbuf[1] = tfreq & 0xff; + pllbuf[2] = 0x8e; + pllbuf[3] = (vu << 7) | (p2 << 2) | (p1 << 1) | p0; + return 0; +} + +static int panasonic_cofdm_env57h1xd5_pll_set(struct dvb_frontend_parameters *fep, u8 pllbuf[4]) +{ + u32 freq = fep->frequency; + u32 tfreq = ((freq + 36125000)*6 + 500000) / 1000000; + u8 TA, T210, R210, ctrl1, cp210, p4321; + if (freq > 858000000) { + err("frequency cannot be larger than 858 MHz."); + return -EINVAL; + } + + // contol data 1 : 1 | T/A=1 | T2,T1,T0 = 0,0,0 | R2,R1,R0 = 0,1,0 + TA = 1; + T210 = 0; + R210 = 0x2; + ctrl1 = (1 << 7) | (TA << 6) | (T210 << 3) | R210; + +// ******** CHARGE PUMP CONFIG vs RF FREQUENCIES ***************** + if (freq < 470000000) + cp210 = 2; // VHF Low and High band ch E12 to E4 to E12 + else if (freq < 526000000) + cp210 = 4; // UHF band Ch E21 to E27 + else // if (freq < 862000000) + cp210 = 5; // UHF band ch E28 to E69 + +//********************* BW select ******************************* + if (freq < 153000000) + p4321 = 1; // BW selected for VHF low + else if (freq < 470000000) + p4321 = 2; // BW selected for VHF high E5 to E12 + else // if (freq < 862000000) + p4321 = 4; // BW selection for UHF E21 to E69 + + pllbuf[0] = (tfreq >> 8) & 0xff; + pllbuf[1] = (tfreq >> 0) & 0xff; + pllbuf[2] = 0xff & ctrl1; + pllbuf[3] = (cp210 << 5) | (p4321); + + return 0; +} + +/* + * 7 6 5 4 3 2 1 0 + * Address Byte 1 1 0 0 0 MA1 MA0 R/~W=0 + * + * Program divider byte 1 0 n14 n13 n12 n11 n10 n9 n8 + * Program divider byte 2 n7 n6 n5 n4 n3 n2 n1 n0 + * + * Control byte 1 1 T/A=1 T2 T1 T0 R2 R1 R0 + * 1 T/A=0 0 0 ATC AL2 AL1 AL0 + * + * Control byte 2 CP2 CP1 CP0 BS5 BS4 BS3 BS2 BS1 + * + * MA0/1 = programmable address bits + * R/~W = read/write bit (0 for writing) + * N14-0 = programmable LO frequency + * + * T/A = test AGC bit (0 = next 6 bits AGC setting, + * 1 = next 6 bits test and reference divider ratio settings) + * T2-0 = test bits + * R2-0 = reference divider ratio and programmable frequency step + * ATC = AGC current setting and time constant + * ATC = 0: AGC current = 220nA, AGC time constant = 2s + * ATC = 1: AGC current = 9uA, AGC time constant = 50ms + * AL2-0 = AGC take-over point bits + * CP2-0 = charge pump current + * BS5-1 = PMOS ports control bits; + * BSn = 0 corresponding port is off, high-impedance state (at power-on) + * BSn = 1 corresponding port is on + */ + + +static int panasonic_cofdm_env77h11d5_tda6650_init(struct dvb_frontend *fe, u8 pllbuf[4]) +{ + pllbuf[0] = 0x0b; + pllbuf[1] = 0xf5; + pllbuf[2] = 0x85; + pllbuf[3] = 0xab; + return 0; +} + +static int panasonic_cofdm_env77h11d5_tda6650_set (struct dvb_frontend_parameters *fep,u8 pllbuf[4]) +{ + int tuner_frequency = 0; + u8 band, cp, filter; + + // determine charge pump + tuner_frequency = fep->frequency + 36166000; + if (tuner_frequency < 87000000) + return -EINVAL; + else if (tuner_frequency < 130000000) + cp = 3; + else if (tuner_frequency < 160000000) + cp = 5; + else if (tuner_frequency < 200000000) + cp = 6; + else if (tuner_frequency < 290000000) + cp = 3; + else if (tuner_frequency < 420000000) + cp = 5; + else if (tuner_frequency < 480000000) + cp = 6; + else if (tuner_frequency < 620000000) + cp = 3; + else if (tuner_frequency < 830000000) + cp = 5; + else if (tuner_frequency < 895000000) + cp = 7; + else + return -EINVAL; + + // determine band + if (fep->frequency < 49000000) + return -EINVAL; + else if (fep->frequency < 161000000) + band = 1; + else if (fep->frequency < 444000000) + band = 2; + else if (fep->frequency < 861000000) + band = 4; + else + return -EINVAL; + + // setup PLL filter + switch (fep->u.ofdm.bandwidth) { + case BANDWIDTH_6_MHZ: + case BANDWIDTH_7_MHZ: + filter = 0; + break; + case BANDWIDTH_8_MHZ: + filter = 1; + break; + default: + return -EINVAL; + } + + // calculate divisor + // ((36166000+((1000000/6)/2)) + Finput)/(1000000/6) + tuner_frequency = (((fep->frequency / 1000) * 6) + 217496) / 1000; + + // setup tuner buffer + pllbuf[0] = (tuner_frequency >> 8) & 0x7f; + pllbuf[1] = tuner_frequency & 0xff; + pllbuf[2] = 0xca; + pllbuf[3] = (cp << 5) | (filter << 3) | band; + return 0; +} + +/* + * 7 6 5 4 3 2 1 0 + * Address Byte 1 1 0 0 0 MA1 MA0 R/~W=0 + * + * Program divider byte 1 0 n14 n13 n12 n11 n10 n9 n8 + * Program divider byte 2 n7 n6 n5 n4 n3 n2 n1 n0 + * + * Control byte 1 CP T2 T1 T0 RSA RSB OS + * + * Band Switch byte X X X P4 P3 P2 P1 P0 + * + * Auxiliary byte ATC AL2 AL1 AL0 0 0 0 0 + * + * Address: MA1 MA0 Address + * 0 0 c0 + * 0 1 c2 (always valid) + * 1 0 c4 + * 1 1 c6 + * + * + * + */ + +static int lg_tdtp_e102p_tua6034(struct dvb_frontend_parameters* fep, u8 pllbuf[4]) +{ + u32 div; + u8 p3210, p4; + +#define TUNER_MUL 62500 + + div = (fep->frequency + 36125000 + TUNER_MUL / 2) / TUNER_MUL; + + if (fep->frequency < 174500000) + p3210 = 1; // not supported by the tdtp_e102p + else if (fep->frequency < 230000000) // VHF + p3210 = 2; + else + p3210 = 4; + + if (fep->u.ofdm.bandwidth == BANDWIDTH_7_MHZ) + p4 = 0; + else + p4 = 1; + + pllbuf[0] = (div >> 8) & 0x7f; + pllbuf[1] = div & 0xff; + pllbuf[2] = 0xce; + pllbuf[3] = (p4 << 4) | p3210; + + return 0; +} + +static int lg_tdtp_e102p_mt352_demod_init(struct dvb_frontend *fe) +{ + static u8 mt352_clock_config[] = { 0x89, 0xb0, 0x2d }; + static u8 mt352_reset[] = { 0x50, 0x80 }; + static u8 mt352_mclk_ratio[] = { 0x8b, 0x00 }; + static u8 mt352_adc_ctl_1_cfg[] = { 0x8E, 0x40 }; + static u8 mt352_agc_cfg[] = { 0x67, 0x14, 0x22 }; + static u8 mt352_sec_agc_cfg[] = { 0x69, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x40, 0x40 }; + + static u8 mt352_unk [] = { 0xb5, 0x7a }; + + static u8 mt352_acq_ctl[] = { 0x53, 0x5f }; + static u8 mt352_input_freq_1[] = { 0x56, 0xf1, 0x05 }; + +// static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 }; + + mt352_write(fe, mt352_clock_config, sizeof(mt352_clock_config)); + udelay(2000); + mt352_write(fe, mt352_reset, sizeof(mt352_reset)); + mt352_write(fe, mt352_mclk_ratio, sizeof(mt352_mclk_ratio)); + + mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg)); + mt352_write(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg)); + + mt352_write(fe, mt352_sec_agc_cfg, sizeof(mt352_sec_agc_cfg)); + + mt352_write(fe, mt352_unk, sizeof(mt352_unk)); + + mt352_write(fe, mt352_acq_ctl, sizeof(mt352_acq_ctl)); + mt352_write(fe, mt352_input_freq_1, sizeof(mt352_input_freq_1)); + +// mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg)); + + return 0; +} + +static int dibusb_general_demod_init(struct dvb_frontend *fe) +{ + struct usb_dibusb* dib = (struct usb_dibusb*) fe->dvb->priv; + switch (dib->dibdev->dev_cl->id) { + case UMT2_0: + return lg_tdtp_e102p_mt352_demod_init(fe); + default: /* other device classes do not have device specific demod inits */ + break; + } + return 0; +} + +static u8 dibusb_general_pll_addr(struct dvb_frontend *fe) +{ + struct usb_dibusb* dib = (struct usb_dibusb*) fe->dvb->priv; + return dib->tuner->pll_addr; +} + +static int dibusb_pll_i2c_helper(struct usb_dibusb *dib, u8 pll_buf[5], u8 buf[4]) +{ + if (pll_buf == NULL) { + struct i2c_msg msg = { + .addr = dib->tuner->pll_addr, + .flags = 0, + .buf = buf, + .len = sizeof(buf) + }; + if (i2c_transfer (&dib->i2c_adap, &msg, 1) != 1) + return -EIO; + msleep(1); + } else { + pll_buf[0] = dib->tuner->pll_addr << 1; + memcpy(&pll_buf[1],buf,4); + } + + return 0; +} + +static int dibusb_general_pll_init(struct dvb_frontend *fe, + u8 pll_buf[5]) +{ + struct usb_dibusb* dib = (struct usb_dibusb*) fe->dvb->priv; + u8 buf[4]; + int ret=0; + switch (dib->tuner->id) { + case DIBUSB_TUNER_COFDM_PANASONIC_ENV77H11D5: + ret = panasonic_cofdm_env77h11d5_tda6650_init(fe,buf); + break; + default: + break; + } + + if (ret) + return ret; + + return dibusb_pll_i2c_helper(dib,pll_buf,buf); +} + +static int dibusb_general_pll_set(struct dvb_frontend *fe, + struct dvb_frontend_parameters *fep, u8 pll_buf[5]) +{ + struct usb_dibusb* dib = (struct usb_dibusb*) fe->dvb->priv; + u8 buf[4]; + int ret=0; + + switch (dib->tuner->id) { + case DIBUSB_TUNER_CABLE_THOMSON: + ret = thomson_cable_eu_pll_set(fep, buf); + break; + case DIBUSB_TUNER_COFDM_PANASONIC_ENV57H1XD5: + ret = panasonic_cofdm_env57h1xd5_pll_set(fep, buf); + break; + case DIBUSB_TUNER_CABLE_LG_TDTP_E102P: + ret = lg_tdtp_e102p_tua6034(fep, buf); + break; + case DIBUSB_TUNER_COFDM_PANASONIC_ENV77H11D5: + ret = panasonic_cofdm_env77h11d5_tda6650_set(fep,buf); + break; + default: + warn("no pll programming routine found for tuner %d.\n",dib->tuner->id); + ret = -ENODEV; + break; + } + + if (ret) + return ret; + + return dibusb_pll_i2c_helper(dib,pll_buf,buf); +} diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c b/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/media/dvb/dibusb/dvb-dibusb-firmware.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,85 @@ +/* + * dvb-dibusb-firmware.c is part of the driver for mobile USB Budget DVB-T devices + * based on reference design made by DiBcom (http://www.dibcom.fr/) + * + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) + * + * see dvb-dibusb-core.c for more copyright details. + * + * This file contains functions for downloading the firmware to the device. + */ +#include "dvb-dibusb.h" + +#include +#include + +/* + * load a firmware packet to the device + */ +static int dibusb_writemem(struct usb_device *udev,u16 addr,u8 *data, u8 len) +{ + return usb_control_msg(udev, usb_sndctrlpipe(udev,0), + 0xa0, USB_TYPE_VENDOR, addr, 0x00, data, len, 5*HZ); +} + +int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_usb_device *dibdev) +{ + const struct firmware *fw = NULL; + u16 addr; + u8 *b,*p; + int ret = 0,i; + + if ((ret = request_firmware(&fw, dibdev->dev_cl->firmware, &udev->dev)) != 0) { + err("did not find a valid firmware file. (%s) " + "Please see linux/Documentation/dvb/ for more details on firmware-problems.", + dibdev->dev_cl->firmware); + return ret; + } + + p = kmalloc(fw->size,GFP_KERNEL); + if (p != NULL) { + u8 reset; + /* + * you cannot use the fw->data as buffer for + * usb_control_msg, a new buffer has to be + * created + */ + memcpy(p,fw->data,fw->size); + + /* stop the CPU */ + reset = 1; + if ((ret = dibusb_writemem(udev,dibdev->dev_cl->usb_ctrl->cpu_cs_register,&reset,1)) != 1) + err("could not stop the USB controller CPU."); + for(i = 0; p[i+3] == 0 && i < fw->size; ) { + b = (u8 *) &p[i]; + addr = *((u16 *) &b[1]); + + ret = dibusb_writemem(udev,addr,&b[4],b[0]); + + if (ret != b[0]) { + err("error while transferring firmware " + "(transferred size: %d, block size: %d)", + ret,b[0]); + ret = -EINVAL; + break; + } + i += 5 + b[0]; + } + /* length in ret */ + if (ret > 0) + ret = 0; + /* restart the CPU */ + reset = 0; + if (ret || dibusb_writemem(udev,dibdev->dev_cl->usb_ctrl->cpu_cs_register,&reset,1) != 1) { + err("could not restart the USB controller CPU."); + ret = -EINVAL; + } + + kfree(p); + } else { + ret = -ENOMEM; + } + release_firmware(fw); + + return ret; +} diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb-pid.c b/drivers/media/dvb/dibusb/dvb-dibusb-pid.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/media/dvb/dibusb/dvb-dibusb-pid.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,80 @@ +/* + * dvb-dibusb-pid.c is part of the driver for mobile USB Budget DVB-T devices + * based on reference design made by DiBcom (http://www.dibcom.fr/) + * + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) + * + * see dvb-dibusb-core.c for more copyright details. + * + * This file contains functions for initializing and handling the internal + * pid-list. This pid-list mirrors the information currently stored in the + * devices pid-list. + */ +#include "dvb-dibusb.h" + +int dibusb_pid_list_init(struct usb_dibusb *dib) +{ + int i; + dib->pid_list = kmalloc(sizeof(struct dibusb_pid) * dib->dibdev->dev_cl->demod->pid_filter_count,GFP_KERNEL); + if (dib->pid_list == NULL) + return -ENOMEM; + + deb_xfer("initializing %d pids for the pid_list.\n",dib->dibdev->dev_cl->demod->pid_filter_count); + + dib->pid_list_lock = SPIN_LOCK_UNLOCKED; + memset(dib->pid_list,0,dib->dibdev->dev_cl->demod->pid_filter_count*(sizeof(struct dibusb_pid))); + for (i=0; i < dib->dibdev->dev_cl->demod->pid_filter_count; i++) { + dib->pid_list[i].index = i; + dib->pid_list[i].pid = 0; + dib->pid_list[i].active = 0; + } + + dib->init_state |= DIBUSB_STATE_PIDLIST; + return 0; +} + +void dibusb_pid_list_exit(struct usb_dibusb *dib) +{ + if (dib->init_state & DIBUSB_STATE_PIDLIST) + kfree(dib->pid_list); + dib->init_state &= ~DIBUSB_STATE_PIDLIST; +} + +/* fetch a pid from pid_list and set it on or off */ +int dibusb_ctrl_pid(struct usb_dibusb *dib, struct dvb_demux_feed *dvbdmxfeed , int onoff) +{ + int i,ret = -1; + unsigned long flags; + u16 pid = dvbdmxfeed->pid; + + if (onoff) { + spin_lock_irqsave(&dib->pid_list_lock,flags); + for (i=0; i < dib->dibdev->dev_cl->demod->pid_filter_count; i++) + if (!dib->pid_list[i].active) { + dib->pid_list[i].pid = pid; + dib->pid_list[i].active = 1; + ret = i; + break; + } + dvbdmxfeed->priv = &dib->pid_list[ret]; + spin_unlock_irqrestore(&dib->pid_list_lock,flags); + + if (dib->xfer_ops.pid_ctrl != NULL) + dib->xfer_ops.pid_ctrl(dib->fe,dib->pid_list[ret].index,dib->pid_list[ret].pid,1); + } else { + struct dibusb_pid *dpid = dvbdmxfeed->priv; + + if (dib->xfer_ops.pid_ctrl != NULL) + dib->xfer_ops.pid_ctrl(dib->fe,dpid->index,0,0); + + dpid->pid = 0; + dpid->active = 0; + ret = dpid->index; + } + + /* a free pid from the list */ + deb_info("setting pid: %5d %04x at index %d '%s'\n",pid,pid,ret,onoff ? "on" : "off"); + + return ret; +} + diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb-remote.c b/drivers/media/dvb/dibusb/dvb-dibusb-remote.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/media/dvb/dibusb/dvb-dibusb-remote.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,197 @@ +/* + * dvb-dibusb-remote.c is part of the driver for mobile USB Budget DVB-T devices + * based on reference design made by DiBcom (http://www.dibcom.fr/) + * + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) + * + * see dvb-dibusb-core.c for more copyright details. + * + * This file contains functions for handling the event device on the software + * side and the remote control on the hardware side. + */ +#include "dvb-dibusb.h" + +/* Table to map raw key codes to key events. This should not be hard-wired + into the kernel. */ +static const struct { u8 c0, c1, c2; uint32_t key; } rc_keys [] = +{ + /* Key codes for the little Artec T1/Twinhan/HAMA/ remote. */ + { 0x00, 0xff, 0x16, KEY_POWER }, + { 0x00, 0xff, 0x10, KEY_MUTE }, + { 0x00, 0xff, 0x03, KEY_1 }, + { 0x00, 0xff, 0x01, KEY_2 }, + { 0x00, 0xff, 0x06, KEY_3 }, + { 0x00, 0xff, 0x09, KEY_4 }, + { 0x00, 0xff, 0x1d, KEY_5 }, + { 0x00, 0xff, 0x1f, KEY_6 }, + { 0x00, 0xff, 0x0d, KEY_7 }, + { 0x00, 0xff, 0x19, KEY_8 }, + { 0x00, 0xff, 0x1b, KEY_9 }, + { 0x00, 0xff, 0x15, KEY_0 }, + { 0x00, 0xff, 0x05, KEY_CHANNELUP }, + { 0x00, 0xff, 0x02, KEY_CHANNELDOWN }, + { 0x00, 0xff, 0x1e, KEY_VOLUMEUP }, + { 0x00, 0xff, 0x0a, KEY_VOLUMEDOWN }, + { 0x00, 0xff, 0x11, KEY_RECORD }, + { 0x00, 0xff, 0x17, KEY_FAVORITES }, /* Heart symbol - Channel list. */ + { 0x00, 0xff, 0x14, KEY_PLAY }, + { 0x00, 0xff, 0x1a, KEY_STOP }, + { 0x00, 0xff, 0x40, KEY_REWIND }, + { 0x00, 0xff, 0x12, KEY_FASTFORWARD }, + { 0x00, 0xff, 0x0e, KEY_PREVIOUS }, /* Recall - Previous channel. */ + { 0x00, 0xff, 0x4c, KEY_PAUSE }, + { 0x00, 0xff, 0x4d, KEY_SCREEN }, /* Full screen mode. */ + { 0x00, 0xff, 0x54, KEY_AUDIO }, /* MTS - Switch to secondary audio. */ + /* additional keys TwinHan VisionPlus, the Artec seemingly not have */ + { 0x00, 0xff, 0x0c, KEY_CANCEL }, /* Cancel */ + { 0x00, 0xff, 0x1c, KEY_EPG }, /* EPG */ + { 0x00, 0xff, 0x00, KEY_TAB }, /* Tab */ + { 0x00, 0xff, 0x48, KEY_INFO }, /* Preview */ + { 0x00, 0xff, 0x04, KEY_LIST }, /* RecordList */ + { 0x00, 0xff, 0x0f, KEY_TEXT }, /* Teletext */ + /* Key codes for the KWorld/ADSTech/JetWay remote. */ + { 0x86, 0x6b, 0x12, KEY_POWER }, + { 0x86, 0x6b, 0x0f, KEY_SELECT }, /* source */ + { 0x86, 0x6b, 0x0c, KEY_UNKNOWN }, /* scan */ + { 0x86, 0x6b, 0x0b, KEY_EPG }, + { 0x86, 0x6b, 0x10, KEY_MUTE }, + { 0x86, 0x6b, 0x01, KEY_1 }, + { 0x86, 0x6b, 0x02, KEY_2 }, + { 0x86, 0x6b, 0x03, KEY_3 }, + { 0x86, 0x6b, 0x04, KEY_4 }, + { 0x86, 0x6b, 0x05, KEY_5 }, + { 0x86, 0x6b, 0x06, KEY_6 }, + { 0x86, 0x6b, 0x07, KEY_7 }, + { 0x86, 0x6b, 0x08, KEY_8 }, + { 0x86, 0x6b, 0x09, KEY_9 }, + { 0x86, 0x6b, 0x0a, KEY_0 }, + { 0x86, 0x6b, 0x18, KEY_ZOOM }, + { 0x86, 0x6b, 0x1c, KEY_UNKNOWN }, /* preview */ + { 0x86, 0x6b, 0x13, KEY_UNKNOWN }, /* snap */ + { 0x86, 0x6b, 0x00, KEY_UNDO }, + { 0x86, 0x6b, 0x1d, KEY_RECORD }, + { 0x86, 0x6b, 0x0d, KEY_STOP }, + { 0x86, 0x6b, 0x0e, KEY_PAUSE }, + { 0x86, 0x6b, 0x16, KEY_PLAY }, + { 0x86, 0x6b, 0x11, KEY_BACK }, + { 0x86, 0x6b, 0x19, KEY_FORWARD }, + { 0x86, 0x6b, 0x14, KEY_UNKNOWN }, /* pip */ + { 0x86, 0x6b, 0x15, KEY_ESC }, + { 0x86, 0x6b, 0x1a, KEY_UP }, + { 0x86, 0x6b, 0x1e, KEY_DOWN }, + { 0x86, 0x6b, 0x1f, KEY_LEFT }, + { 0x86, 0x6b, 0x1b, KEY_RIGHT }, +}; + +/* + * Read the remote control and feed the appropriate event. + * NEC protocol is used for remote controls + */ +static int dibusb_read_remote_control(struct usb_dibusb *dib) +{ + u8 b[1] = { DIBUSB_REQ_POLL_REMOTE }, rb[5]; + int ret; + int i; + if ((ret = dibusb_readwrite_usb(dib,b,1,rb,5))) + return ret; + + switch (rb[0]) { + case DIBUSB_RC_NEC_KEY_PRESSED: + /* rb[1-3] is the actual key, rb[4] is a checksum */ + deb_rc("raw key code 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", + rb[1], rb[2], rb[3], rb[4]); + + if ((0xff - rb[3]) != rb[4]) { + deb_rc("remote control checksum failed.\n"); + break; + } + + /* See if we can match the raw key code. */ + for (i = 0; i < sizeof(rc_keys)/sizeof(rc_keys[0]); i++) { + if (rc_keys[i].c0 == rb[1] && + rc_keys[i].c1 == rb[2] && + rc_keys[i].c2 == rb[3]) { + dib->rc_input_event = rc_keys[i].key; + deb_rc("Translated key 0x%04x\n", dib->rc_input_event); + /* Signal down and up events for this key. */ + input_report_key(&dib->rc_input_dev, dib->rc_input_event, 1); + input_report_key(&dib->rc_input_dev, dib->rc_input_event, 0); + input_sync(&dib->rc_input_dev); + break; + } + } + break; + case DIBUSB_RC_NEC_EMPTY: /* No (more) remote control keys. */ + break; + case DIBUSB_RC_NEC_KEY_REPEATED: + /* rb[1]..rb[4] are always zero.*/ + /* Repeats often seem to occur so for the moment just ignore this. */ + deb_rc("Key repeat\n"); + break; + default: + break; + } + return 0; +} + +/* Remote-control poll function - called every dib->rc_query_interval ms to see + whether the remote control has received anything. */ +static void dibusb_remote_query(void *data) +{ + struct usb_dibusb *dib = (struct usb_dibusb *) data; + /* TODO: need a lock here. We can simply skip checking for the remote control + if we're busy. */ + dibusb_read_remote_control(dib); + schedule_delayed_work(&dib->rc_query_work, + msecs_to_jiffies(dib->rc_query_interval)); +} + +int dibusb_remote_init(struct usb_dibusb *dib) +{ + int i; + + if (dib->dibdev->dev_cl->remote_type == DIBUSB_RC_NO) + return 0; + + /* Initialise the remote-control structures.*/ + init_input_dev(&dib->rc_input_dev); + + dib->rc_input_dev.evbit[0] = BIT(EV_KEY); + dib->rc_input_dev.keycodesize = sizeof(unsigned char); + dib->rc_input_dev.keycodemax = KEY_MAX; + dib->rc_input_dev.name = DRIVER_DESC " remote control"; + + for (i=0; irc_input_dev.keybit); + + input_register_device(&dib->rc_input_dev); + + dib->rc_input_event = KEY_MAX; + + INIT_WORK(&dib->rc_query_work, dibusb_remote_query, dib); + + /* Start the remote-control polling. */ + if (dib->rc_query_interval < 40) + dib->rc_query_interval = 100; /* default */ + + info("schedule remote query interval to %d msecs.",dib->rc_query_interval); + schedule_delayed_work(&dib->rc_query_work,msecs_to_jiffies(dib->rc_query_interval)); + + dib->init_state |= DIBUSB_STATE_REMOTE; + + return 0; +} + +int dibusb_remote_exit(struct usb_dibusb *dib) +{ + if (dib->dibdev->dev_cl->remote_type == DIBUSB_RC_NO) + return 0; + + if (dib->init_state & DIBUSB_STATE_REMOTE) { + cancel_delayed_work(&dib->rc_query_work); + flush_scheduled_work(); + input_unregister_device(&dib->rc_input_dev); + } + dib->init_state &= ~DIBUSB_STATE_REMOTE; + return 0; +} diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb-usb.c b/drivers/media/dvb/dibusb/dvb-dibusb-usb.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/media/dvb/dibusb/dvb-dibusb-usb.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,263 @@ +/* + * dvb-dibusb-usb.c is part of the driver for mobile USB Budget DVB-T devices + * based on reference design made by DiBcom (http://www.dibcom.fr/) + * + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) + * + * see dvb-dibusb-core.c for more copyright details. + * + * This file contains functions for initializing and handling the + * usb specific stuff. + */ +#include "dvb-dibusb.h" + +#include +#include + +int dibusb_readwrite_usb(struct usb_dibusb *dib, u8 *wbuf, u16 wlen, u8 *rbuf, + u16 rlen) +{ + int actlen,ret = -ENOMEM; + + if (wbuf == NULL || wlen == 0) + return -EINVAL; + + if ((ret = down_interruptible(&dib->usb_sem))) + return ret; + + if (dib->feedcount && + wbuf[0] == DIBUSB_REQ_I2C_WRITE && + dib->dibdev->dev_cl->id == DIBUSB1_1) + deb_err("BUG: writing to i2c, while TS-streaming destroys the stream." + "(%x reg: %x %x)\n", wbuf[0],wbuf[2],wbuf[3]); + + debug_dump(wbuf,wlen); + + ret = usb_bulk_msg(dib->udev,usb_sndbulkpipe(dib->udev, + dib->dibdev->dev_cl->pipe_cmd), wbuf,wlen,&actlen, + DIBUSB_I2C_TIMEOUT); + + if (ret) + err("bulk message failed: %d (%d/%d)",ret,wlen,actlen); + else + ret = actlen != wlen ? -1 : 0; + + /* an answer is expected, and no error before */ + if (!ret && rbuf && rlen) { + ret = usb_bulk_msg(dib->udev,usb_rcvbulkpipe(dib->udev, + dib->dibdev->dev_cl->pipe_cmd),rbuf,rlen,&actlen, + DIBUSB_I2C_TIMEOUT); + + if (ret) + err("recv bulk message failed: %d",ret); + else { + deb_alot("rlen: %d\n",rlen); + debug_dump(rbuf,actlen); + } + } + + up(&dib->usb_sem); + return ret; +} + +/* + * Cypress controls + */ + +#if 0 +/* + * #if 0'ing the following functions as they are not in use _now_, + * but probably will be sometime. + */ + +/* + * do not use this, just a workaround for a bug, + * which will hopefully never occur :). + */ +int dibusb_interrupt_read_loop(struct usb_dibusb *dib) +{ + u8 b[1] = { DIBUSB_REQ_INTR_READ }; + return dibusb_write_usb(dib,b,1); +} + +#endif +static int dibusb_write_usb(struct usb_dibusb *dib, u8 *buf, u16 len) +{ + return dibusb_readwrite_usb(dib,buf,len,NULL,0); +} + +/* + * ioctl for the firmware + */ +static int dibusb_ioctl_cmd(struct usb_dibusb *dib, u8 cmd, u8 *param, int plen) +{ + u8 b[34]; + int size = plen > 32 ? 32 : plen; + memset(b,0,34); + b[0] = DIBUSB_REQ_SET_IOCTL; + b[1] = cmd; + + if (size > 0) + memcpy(&b[2],param,size); + + return dibusb_write_usb(dib,b,34); //2+size); +} + +/* + * ioctl for power control + */ +int dibusb_hw_wakeup(struct dvb_frontend *fe) +{ + struct usb_dibusb *dib = (struct usb_dibusb *) fe->dvb->priv; + u8 b[1] = { DIBUSB_IOCTL_POWER_WAKEUP }; + deb_info("dibusb-device is getting up.\n"); + dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1); + + if (dib->fe_init) + return dib->fe_init(fe); + + return 0; +} + +int dibusb_hw_sleep(struct dvb_frontend *fe) +{ + struct usb_dibusb *dib = (struct usb_dibusb *) fe->dvb->priv; + u8 b[1] = { DIBUSB_IOCTL_POWER_SLEEP }; + deb_info("dibusb-device is going to bed.\n"); + dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1); + + if (dib->fe_sleep) + return dib->fe_sleep(fe); + + return 0; +} + +int dibusb_set_streaming_mode(struct usb_dibusb *dib,u8 mode) +{ + u8 b[2] = { DIBUSB_REQ_SET_STREAMING_MODE, mode }; + return dibusb_readwrite_usb(dib,b,2,NULL,0); +} + +int dibusb_streaming(struct usb_dibusb *dib,int onoff) +{ + switch (dib->dibdev->dev_cl->id) { + case DIBUSB2_0: + if (onoff) + return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_ENABLE_STREAM,NULL,0); + else + return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_DISABLE_STREAM,NULL,0); + break; + case UMT2_0: + return dibusb_set_streaming_mode(dib,onoff); + break; + default: + break; + } + return 0; +} + +int dibusb_urb_init(struct usb_dibusb *dib) +{ + int ret,i,bufsize,def_pid_parse = 1; + + /* + * when reloading the driver w/o replugging the device + * a timeout occures, this helps + */ + usb_clear_halt(dib->udev,usb_sndbulkpipe(dib->udev,dib->dibdev->dev_cl->pipe_cmd)); + usb_clear_halt(dib->udev,usb_rcvbulkpipe(dib->udev,dib->dibdev->dev_cl->pipe_cmd)); + usb_clear_halt(dib->udev,usb_rcvbulkpipe(dib->udev,dib->dibdev->dev_cl->pipe_data)); + + /* allocate the array for the data transfer URBs */ + dib->urb_list = kmalloc(dib->dibdev->dev_cl->urb_count*sizeof(struct urb *),GFP_KERNEL); + if (dib->urb_list == NULL) + return -ENOMEM; + memset(dib->urb_list,0,dib->dibdev->dev_cl->urb_count*sizeof(struct urb *)); + + dib->init_state |= DIBUSB_STATE_URB_LIST; + + bufsize = dib->dibdev->dev_cl->urb_count*dib->dibdev->dev_cl->urb_buffer_size; + deb_info("allocate %d bytes as buffersize for all URBs\n",bufsize); + /* allocate the actual buffer for the URBs */ + if ((dib->buffer = pci_alloc_consistent(NULL,bufsize,&dib->dma_handle)) == NULL) { + deb_info("not enough memory.\n"); + return -ENOMEM; + } + deb_info("allocation complete\n"); + memset(dib->buffer,0,bufsize); + + dib->init_state |= DIBUSB_STATE_URB_BUF; + + /* allocate and submit the URBs */ + for (i = 0; i < dib->dibdev->dev_cl->urb_count; i++) { + if (!(dib->urb_list[i] = usb_alloc_urb(0,GFP_ATOMIC))) { + return -ENOMEM; + } + deb_info("submitting URB no. %d\n",i); + + usb_fill_bulk_urb( dib->urb_list[i], dib->udev, + usb_rcvbulkpipe(dib->udev,dib->dibdev->dev_cl->pipe_data), + &dib->buffer[i*dib->dibdev->dev_cl->urb_buffer_size], + dib->dibdev->dev_cl->urb_buffer_size, + dibusb_urb_complete, dib); + + dib->urb_list[i]->transfer_flags = 0; + + if ((ret = usb_submit_urb(dib->urb_list[i],GFP_ATOMIC))) { + err("could not submit buffer urb no. %d\n",i); + return ret; + } + dib->init_state |= DIBUSB_STATE_URB_SUBMIT; + } + + /* dib->pid_parse here contains the value of the module parameter */ + /* decide if pid parsing can be deactivated: + * is possible (by speed) and wanted (by user) + */ + switch (dib->dibdev->dev_cl->id) { + case DIBUSB2_0: + if (dib->udev->speed == USB_SPEED_HIGH && !dib->pid_parse) { + def_pid_parse = 0; + info("running at HIGH speed, will deliver the complete TS."); + } else + info("will use pid_parsing."); + break; + default: + break; + } + /* from here on it contains the device and user decision */ + dib->pid_parse = def_pid_parse; + + return 0; +} + +int dibusb_urb_exit(struct usb_dibusb *dib) +{ + int i; + if (dib->init_state & DIBUSB_STATE_URB_LIST) { + for (i = 0; i < dib->dibdev->dev_cl->urb_count; i++) { + if (dib->urb_list[i] != NULL) { + deb_info("killing URB no. %d.\n",i); + + /* stop the URBs */ + usb_kill_urb(dib->urb_list[i]); + + deb_info("freeing URB no. %d.\n",i); + /* free the URBs */ + usb_free_urb(dib->urb_list[i]); + } + } + /* free the urb array */ + kfree(dib->urb_list); + dib->init_state &= ~DIBUSB_STATE_URB_SUBMIT; + dib->init_state &= ~DIBUSB_STATE_URB_LIST; + } + + if (dib->init_state & DIBUSB_STATE_URB_BUF) + pci_free_consistent(NULL, + dib->dibdev->dev_cl->urb_buffer_size*dib->dibdev->dev_cl->urb_count, + dib->buffer,dib->dma_handle); + + dib->init_state &= ~DIBUSB_STATE_URB_BUF; + return 0; +} diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb.c b/drivers/media/dvb/dibusb/dvb-dibusb.c --- a/drivers/media/dvb/dibusb/dvb-dibusb.c 2005-01-28 14:11:40 -08:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,1032 +0,0 @@ -/* - * Driver for mobile USB Budget DVB-T devices based on reference - * design made by DiBcom (http://www.dibcom.fr/) - * - * dvb-dibusb.c - * - * Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de) - * - * based on GPL code from DiBcom, which has - * Copyright (C) 2004 Amaury Demol for DiBcom (ademol@dibcom.fr) - * - * Remote control code added by David Matthews (dm@prolingua.co.uk) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * - * Acknowledgements - * - * Amaury Demol (ademol@dibcom.fr) from DiBcom for providing specs and driver - * sources, on which this driver (and the dib3000mb/mc/p frontends) are based. - * - * see Documentation/dvb/README.dibusb for more information - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dmxdev.h" -#include "dvb_demux.h" -#include "dvb_filter.h" -#include "dvb_net.h" -#include "dvb_frontend.h" -#include "dib3000.h" - -#include "dvb-dibusb.h" - - -/* debug */ -#ifdef CONFIG_DVB_DIBCOM_DEBUG -#define dprintk(level,args...) \ - do { if ((debug & level)) { printk(args); } } while (0) - -#define debug_dump(b,l) if (debug) {\ - int i; deb_xfer("%s: %d > ",__FUNCTION__,l); \ - for (i = 0; i < l; i++) deb_xfer("%02x ", b[i]); \ - deb_xfer("\n");\ -} - -static int debug; -module_param(debug, int, 0x644); -MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=alotmore,8=ts,16=err,32=rc (|-able))."); -#else -#define dprintk(args...) -#define debug_dump(b,l) -#endif - -#define deb_info(args...) dprintk(0x01,args) -#define deb_xfer(args...) dprintk(0x02,args) -#define deb_alot(args...) dprintk(0x04,args) -#define deb_ts(args...) dprintk(0x08,args) -#define deb_err(args...) dprintk(0x10,args) -#define deb_rc(args...) dprintk(0x20,args) - -static int pid_parse; -module_param(pid_parse, int, 0x644); -MODULE_PARM_DESC(pid_parse, "enable pid parsing (filtering) when running at USB2.0"); - -/* Version information */ -#define DRIVER_VERSION "0.1" -#define DRIVER_DESC "Driver for DiBcom based USB Budget DVB-T device" -#define DRIVER_AUTHOR "Patrick Boettcher, patrick.boettcher@desy.de" - -static int dibusb_readwrite_usb(struct usb_dibusb *dib, - u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) -{ - int actlen,ret = -ENOMEM; - - if (wbuf == NULL || wlen == 0) - return -EINVAL; - - if ((ret = down_interruptible(&dib->usb_sem))) - return ret; - - if (dib->feedcount && - wbuf[0] == DIBUSB_REQ_I2C_WRITE && - dib->dibdev->parm->type == DIBUSB1_1) - deb_err("BUG: writing to i2c, while TS-streaming destroys the stream." - "(%x reg: %x %x)\n", wbuf[0],wbuf[2],wbuf[3]); - - debug_dump(wbuf,wlen); - - ret = usb_bulk_msg(dib->udev,usb_sndbulkpipe(dib->udev, - dib->dibdev->parm->cmd_pipe), wbuf,wlen,&actlen, - DIBUSB_I2C_TIMEOUT); - - if (ret) - err("bulk message failed: %d (%d/%d)",ret,wlen,actlen); - else - ret = actlen != wlen ? -1 : 0; - - /* an answer is expected, and no error before */ - if (!ret && rbuf && rlen) { - ret = usb_bulk_msg(dib->udev,usb_rcvbulkpipe(dib->udev, - dib->dibdev->parm->result_pipe),rbuf,rlen,&actlen, - DIBUSB_I2C_TIMEOUT); - - if (ret) - err("recv bulk message failed: %d",ret); - else { - deb_alot("rlen: %d\n",rlen); - debug_dump(rbuf,actlen); - } - } - - up(&dib->usb_sem); - return ret; -} - -static int dibusb_i2c_msg(struct usb_dibusb *dib, u8 addr, - u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) -{ - u8 sndbuf[wlen+4]; /* lead(1) devaddr,direction(1) addr(2) data(wlen) (len(2) (when reading)) */ - /* write only ? */ - int wo = (rbuf == NULL || rlen == 0), - len = 2 + wlen + (wo ? 0 : 2); - - deb_alot("wo: %d, wlen: %d, len: %d\n",wo,wlen,len); - - sndbuf[0] = wo ? DIBUSB_REQ_I2C_WRITE : DIBUSB_REQ_I2C_READ; - sndbuf[1] = (addr & 0xfe) | (wo ? 0 : 1); - - memcpy(&sndbuf[2],wbuf,wlen); - - if (!wo) { - sndbuf[wlen+2] = (rlen >> 8) & 0xff; - sndbuf[wlen+3] = rlen & 0xff; - } - - return dibusb_readwrite_usb(dib,sndbuf,len,rbuf,rlen); -} - -/* - * DVB stuff - */ -static void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs) -{ - struct usb_dibusb *dib = urb->context; - - deb_ts("urb complete feedcount: %d, status: %d\n",dib->feedcount,urb->status); - - if (dib->feedcount > 0 && urb->status == 0) { - deb_ts("URB return len: %d\n",urb->actual_length); - if (urb->actual_length % 188) - deb_ts("TS Packets: %d, %d\n", urb->actual_length/188,urb->actual_length % 188); - - /* Francois recommends to drop not full-filled packets, even if they may - * contain valid TS packets - */ - if (urb->actual_length == dib->dibdev->parm->default_size && dib->dvb_is_ready) - dvb_dmx_swfilter_packets(&dib->demux, (u8*) urb->transfer_buffer,urb->actual_length/188); - else - deb_ts("URB dropped because of the " - "actual_length or !dvb_is_ready (%d).\n",dib->dvb_is_ready); - } else - deb_ts("URB dropped because of feedcount or status.\n"); - - usb_submit_urb(urb,GFP_KERNEL); -} - -static int dibusb_ctrl_feed(struct usb_dibusb *dib, int pid, int onoff) -{ - if (dib->dibdev->parm->firmware_bug && dib->feedcount) { - deb_ts("stop feeding\n"); - if (dib->xfer_ops.fifo_ctrl != NULL) { - if (dib->xfer_ops.fifo_ctrl(dib->fe,0)) { - err("error while inhibiting fifo."); - return -ENODEV; - } - } else { - err("fifo_ctrl is not set."); - return -ENODEV; - } - } - - dib->feedcount += onoff ? 1 : -1; - - if (dib->pid_parse) { - if (dib->xfer_ops.pid_ctrl != NULL) { - if (dib->xfer_ops.pid_ctrl(dib->fe,pid,onoff) < 0) { - err("no free pid in list."); - return -ENODEV; - } - } else { - err("no pid ctrl callback."); - return -ENODEV; - } - } - /* - * start the feed, either if there is the firmware bug or - * if this was the first pid to set. - */ - if (dib->dibdev->parm->firmware_bug || dib->feedcount == onoff) { - - deb_ts("controlling pid parser\n"); - if (dib->xfer_ops.pid_parse != NULL) { - if (dib->xfer_ops.pid_parse(dib->fe,dib->pid_parse) < 0) { - err("could not handle pid_parser"); - } - } - - deb_ts("start feeding\n"); - if (dib->xfer_ops.fifo_ctrl != NULL) { - if (dib->xfer_ops.fifo_ctrl(dib->fe,1)) { - err("error while enabling fifo."); - return -ENODEV; - } - } else { - err("fifo_ctrl is not set."); - return -ENODEV; -} - } - return 0; -} - -static int dibusb_start_feed(struct dvb_demux_feed *dvbdmxfeed) -{ - struct usb_dibusb *dib = dvbdmxfeed->demux->priv; - deb_ts("pid: 0x%04x, feedtype: %d\n", dvbdmxfeed->pid,dvbdmxfeed->type); - dvbdmxfeed->priv = dib; - return dibusb_ctrl_feed(dib,dvbdmxfeed->pid,1); -} - -static int dibusb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) -{ - struct usb_dibusb *dib = (struct usb_dibusb *) dvbdmxfeed->priv; - if (dib == NULL) { - err("dib in dmxfeed->priv was NULL"); - return -EINVAL; -} - deb_ts("dvbdmxfeed pid: 0x%04x, feedtype: %d\n", - dvbdmxfeed->pid, dvbdmxfeed->type); - return dibusb_ctrl_feed(dib,dvbdmxfeed->pid,0); -} - -/* Table to map raw key codes to key events. This should not be hard-wired - into the kernel. */ -static const struct { u8 c0, c1, c2; uint32_t key; } rc_keys [] = -{ - /* Key codes for the little Artec T1/Twinhan/HAMA/ remote. */ - { 0x00, 0xff, 0x16, KEY_POWER }, - { 0x00, 0xff, 0x10, KEY_MUTE }, - { 0x00, 0xff, 0x03, KEY_1 }, - { 0x00, 0xff, 0x01, KEY_2 }, - { 0x00, 0xff, 0x06, KEY_3 }, - { 0x00, 0xff, 0x09, KEY_4 }, - { 0x00, 0xff, 0x1d, KEY_5 }, - { 0x00, 0xff, 0x1f, KEY_6 }, - { 0x00, 0xff, 0x0d, KEY_7 }, - { 0x00, 0xff, 0x19, KEY_8 }, - { 0x00, 0xff, 0x1b, KEY_9 }, - { 0x00, 0xff, 0x15, KEY_0 }, - { 0x00, 0xff, 0x05, KEY_CHANNELUP }, - { 0x00, 0xff, 0x02, KEY_CHANNELDOWN }, - { 0x00, 0xff, 0x1e, KEY_VOLUMEUP }, - { 0x00, 0xff, 0x0a, KEY_VOLUMEDOWN }, - { 0x00, 0xff, 0x11, KEY_RECORD }, - { 0x00, 0xff, 0x17, KEY_FAVORITES }, /* Heart symbol - Channel list. */ - { 0x00, 0xff, 0x14, KEY_PLAY }, - { 0x00, 0xff, 0x1a, KEY_STOP }, - { 0x00, 0xff, 0x40, KEY_REWIND }, - { 0x00, 0xff, 0x12, KEY_FASTFORWARD }, - { 0x00, 0xff, 0x0e, KEY_PREVIOUS }, /* Recall - Previous channel. */ - { 0x00, 0xff, 0x4c, KEY_PAUSE }, - { 0x00, 0xff, 0x4d, KEY_SCREEN }, /* Full screen mode. */ - { 0x00, 0xff, 0x54, KEY_AUDIO }, /* MTS - Switch to secondary audio. */ - /* additional keys TwinHan VisionPlus, the Artec seemingly not have */ - { 0x00, 0xff, 0x0c, KEY_CANCEL }, /* Cancel */ - { 0x00, 0xff, 0x1c, KEY_EPG }, /* EPG */ - { 0x00, 0xff, 0x00, KEY_TAB }, /* Tab */ - { 0x00, 0xff, 0x48, KEY_INFO }, /* Preview */ - { 0x00, 0xff, 0x04, KEY_LIST }, /* RecordList */ - { 0x00, 0xff, 0x0f, KEY_TEXT }, /* Teletext */ - /* Key codes for the KWorld/ADSTech/JetWay remote. */ - { 0x86, 0x6b, 0x12, KEY_POWER }, - { 0x86, 0x6b, 0x0f, KEY_SELECT }, /* source */ - { 0x86, 0x6b, 0x0c, KEY_UNKNOWN }, /* scan */ - { 0x86, 0x6b, 0x0b, KEY_EPG }, - { 0x86, 0x6b, 0x10, KEY_MUTE }, - { 0x86, 0x6b, 0x01, KEY_1 }, - { 0x86, 0x6b, 0x02, KEY_2 }, - { 0x86, 0x6b, 0x03, KEY_3 }, - { 0x86, 0x6b, 0x04, KEY_4 }, - { 0x86, 0x6b, 0x05, KEY_5 }, - { 0x86, 0x6b, 0x06, KEY_6 }, - { 0x86, 0x6b, 0x07, KEY_7 }, - { 0x86, 0x6b, 0x08, KEY_8 }, - { 0x86, 0x6b, 0x09, KEY_9 }, - { 0x86, 0x6b, 0x0a, KEY_0 }, - { 0x86, 0x6b, 0x18, KEY_ZOOM }, - { 0x86, 0x6b, 0x1c, KEY_UNKNOWN }, /* preview */ - { 0x86, 0x6b, 0x13, KEY_UNKNOWN }, /* snap */ - { 0x86, 0x6b, 0x00, KEY_UNDO }, - { 0x86, 0x6b, 0x1d, KEY_RECORD }, - { 0x86, 0x6b, 0x0d, KEY_STOP }, - { 0x86, 0x6b, 0x0e, KEY_PAUSE }, - { 0x86, 0x6b, 0x16, KEY_PLAY }, - { 0x86, 0x6b, 0x11, KEY_BACK }, - { 0x86, 0x6b, 0x19, KEY_FORWARD }, - { 0x86, 0x6b, 0x14, KEY_UNKNOWN }, /* pip */ - { 0x86, 0x6b, 0x15, KEY_ESC }, - { 0x86, 0x6b, 0x1a, KEY_UP }, - { 0x86, 0x6b, 0x1e, KEY_DOWN }, - { 0x86, 0x6b, 0x1f, KEY_LEFT }, - { 0x86, 0x6b, 0x1b, KEY_RIGHT }, -}; - -/* - * Read the remote control and feed the appropriate event. - * NEC protocol is used for remote controls - */ -static int dibusb_read_remote_control(struct usb_dibusb *dib) -{ - u8 b[1] = { DIBUSB_REQ_POLL_REMOTE }, rb[5]; - int ret; - int i; - if ((ret = dibusb_readwrite_usb(dib,b,1,rb,5))) - return ret; - - switch (rb[0]) { - case DIBUSB_RC_NEC_KEY_PRESSED: - /* rb[1-3] is the actual key, rb[4] is a checksum */ - deb_rc("raw key code 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", - rb[1], rb[2], rb[3], rb[4]); - - if ((0xff - rb[3]) != rb[4]) { - deb_rc("remote control checksum failed.\n"); - break; - } - - /* See if we can match the raw key code. */ - for (i = 0; i < sizeof(rc_keys)/sizeof(rc_keys[0]); i++) { - if (rc_keys[i].c0 == rb[1] && - rc_keys[i].c1 == rb[2] && - rc_keys[i].c2 == rb[3]) { - dib->rc_input_event = rc_keys[i].key; - deb_rc("Translated key 0x%04x\n", dib->rc_input_event); - /* Signal down and up events for this key. */ - input_report_key(&dib->rc_input_dev, dib->rc_input_event, 1); - input_report_key(&dib->rc_input_dev, dib->rc_input_event, 0); - input_sync(&dib->rc_input_dev); - break; - } - } - break; - case DIBUSB_RC_NEC_EMPTY: /* No (more) remote control keys. */ - break; - case DIBUSB_RC_NEC_KEY_REPEATED: - /* rb[1]..rb[4] are always zero.*/ - /* Repeats often seem to occur so for the moment just ignore this. */ - deb_rc("Key repeat\n"); - break; - default: - break; - } - - return 0; -} - -#define RC_QUERY_INTERVAL (100) /* milliseconds */ - -/* Remote-control poll function - called every RC_QUERY_INTERVAL ms to see - whether the remote control has received anything. */ -static void dibusb_query_rc (void *data) -{ - struct usb_dibusb *dib = (struct usb_dibusb *) data; - /* TODO: need a lock here. We can simply skip checking for the remote control - if we're busy. */ - dibusb_read_remote_control(dib); - schedule_delayed_work(&dib->rc_query_work, - msecs_to_jiffies(RC_QUERY_INTERVAL)); -} - -/* - * Cypress controls - */ - -#if 0 -/* - * #if 0'ing the following functions as they are not in use _now_, - * but probably will be sometime. - */ - -/* - * do not use this, just a workaround for a bug, - * which will hopefully never occur :). - */ -static int dibusb_interrupt_read_loop(struct usb_dibusb *dib) -{ - u8 b[1] = { DIBUSB_REQ_INTR_READ }; - return dibusb_write_usb(dib,b,1); -} - -/* - * ioctl for power control - */ -static int dibusb_hw_sleep(struct usb_dibusb *dib) -{ - u8 b[1] = { DIBUSB_IOCTL_POWER_SLEEP }; - return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1); -} - -#endif -static int dibusb_write_usb(struct usb_dibusb *dib, u8 *buf, u16 len) -{ - return dibusb_readwrite_usb(dib,buf,len,NULL,0); -} - -/* - * ioctl for the firmware - */ -static int dibusb_ioctl_cmd(struct usb_dibusb *dib, u8 cmd, u8 *param, int plen) -{ - u8 b[34]; - int size = plen > 32 ? 32 : plen; - b[0] = DIBUSB_REQ_SET_IOCTL; - b[1] = cmd; - memcpy(&b[2],param,size); - - return dibusb_write_usb(dib,b,2+size); -} - -static int dibusb_hw_wakeup(struct usb_dibusb *dib) -{ - u8 b[1] = { DIBUSB_IOCTL_POWER_WAKEUP }; - return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1); -} - -/* - * I2C - */ -static int dibusb_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num) -{ - struct usb_dibusb *dib = i2c_get_adapdata(adap); - int i; - - if (down_interruptible(&dib->i2c_sem) < 0) - return -EAGAIN; - - for (i = 0; i < num; i++) { - /* write/read request */ - if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) { - if (dibusb_i2c_msg(dib, msg[i].addr, msg[i].buf,msg[i].len, - msg[i+1].buf,msg[i+1].len) < 0) - break; - i++; - } else - if (dibusb_i2c_msg(dib, msg[i].addr, msg[i].buf,msg[i].len,NULL,0) < 0) - break; - } - - up(&dib->i2c_sem); - return i; -} - -static u32 dibusb_i2c_func(struct i2c_adapter *adapter) -{ - return I2C_FUNC_I2C; -} - -static int thomson_cable_eu_pll_set(struct dvb_frontend* fe, struct - dvb_frontend_parameters* params); - -static struct dib3000_config thomson_cable_eu_config = { - .demod_address = 0x10, - .pll_addr = 194, - .pll_set = thomson_cable_eu_pll_set, -}; - -static int thomson_cable_eu_pll_set(struct dvb_frontend* fe, struct - dvb_frontend_parameters* params) -{ - struct usb_dibusb* dib = (struct usb_dibusb*) fe->dvb->priv; - u8 buf[4]; - struct i2c_msg msg = { - .addr = thomson_cable_eu_config.pll_addr, - .flags = 0, - .buf = buf, - .len = sizeof(buf) - }; - u32 tfreq = (params->frequency + 36125000) / 62500; - int vu,p0,p1,p2; - - if (params->frequency > 403250000) - vu = 1, p2 = 1, p1 = 0, p0 = 1; - else if (params->frequency > 115750000) - vu = 0, p2 = 1, p1 = 1, p0 = 0; - else if (params->frequency > 44250000) - vu = 0, p2 = 0, p1 = 1, p0 = 1; - else - return -EINVAL; - - buf[0] = (tfreq >> 8) & 0x7f; - buf[1] = tfreq & 0xff; - buf[2] = 0x8e; - buf[3] = (vu << 7) | (p2 << 2) | (p1 << 1) | p0; - - if (i2c_transfer (&dib->i2c_adap, &msg, 1) != 1) - return -EIO; - - msleep(1); - return 0; -} - -static int panasonic_cofdm_env57h1xd5_pll_set(struct dvb_frontend *fe, struct - dvb_frontend_parameters *params); - -static struct dib3000_config panasonic_cofdm_env57h1xd5 = { - .demod_address = 0x18, - .pll_addr = 192, - .pll_set = panasonic_cofdm_env57h1xd5_pll_set, -}; - -static int panasonic_cofdm_env57h1xd5_pll_set(struct dvb_frontend *fe, struct - dvb_frontend_parameters *params) -{ - struct usb_dibusb* dib = (struct usb_dibusb*) fe->dvb->priv; - u8 buf[4]; - u32 freq = params->frequency; - u32 tfreq = (freq + 36125000) / 1000000 * 6 + 1; - u8 TA, T210, R210, ctrl1, cp210, p4321; - struct i2c_msg msg = { - .addr = panasonic_cofdm_env57h1xd5.pll_addr, - .flags = 0, - .buf = buf, - .len = sizeof(buf) - }; - - if (freq > 858000000) { - err("frequency cannot be larger than 858 MHz."); - return -EINVAL; - } - - // contol data 1 : 1 | T/A=1 | T2,T1,T0 = 0,0,0 | R2,R1,R0 = 0,1,0 - TA = 1; - T210 = 0; - R210 = 0x2; - ctrl1 = (1 << 7) | (TA << 6) | (T210 << 3) | R210; - -// ******** CHARGE PUMP CONFIG vs RF FREQUENCIES ***************** - if (freq < 470000000) - cp210 = 2; // VHF Low and High band ch E12 to E4 to E12 - else if (freq < 526000000) - cp210 = 4; // UHF band Ch E21 to E27 - else // if (freq < 862000000) - cp210 = 5; // UHF band ch E28 to E69 - -//********************* BW select ******************************* - if (freq < 153000000) - p4321 = 1; // BW selected for VHF low - else if (freq < 470000000) - p4321 = 2; // BW selected for VHF high E5 to E12 - else // if (freq < 862000000) - p4321 = 4; // BW selection for UHF E21 to E69 - - buf[0] = (tfreq >> 8) & 0xff; - buf[1] = (tfreq >> 0) & 0xff; - buf[2] = 0xff & ctrl1; - buf[3] = (cp210 << 5) | (p4321); - - if (i2c_transfer (&dib->i2c_adap, &msg, 1) != 1) - return -EIO; - - msleep(1); - return 0; -} - -static struct i2c_algorithm dibusb_algo = { - .name = "DiBcom USB i2c algorithm", - .id = I2C_ALGO_BIT, - .master_xfer = dibusb_i2c_xfer, - .functionality = dibusb_i2c_func, -}; - -static void frontend_init(struct usb_dibusb* dib) -{ - switch (dib->dibdev->parm->type) { - case DIBUSB1_1: - case DIBUSB1_1_AN2235: - dib->fe = dib3000mb_attach(&thomson_cable_eu_config, &dib->i2c_adap,&dib->xfer_ops); - break; - case DIBUSB2_0: - dib->fe = dib3000mc_attach(&panasonic_cofdm_env57h1xd5,&dib->i2c_adap, &dib->xfer_ops); - break; - } - - if (dib->fe == NULL) { - printk("dvb-dibusb: A frontend driver was not found for device %04x/%04x\n", - le16_to_cpu(dib->udev->descriptor.idVendor), - le16_to_cpu(dib->udev->descriptor.idProduct)); - } else { - if (dvb_register_frontend(dib->adapter, dib->fe)) { - printk("dvb-dibusb: Frontend registration failed!\n"); - if (dib->fe->ops->release) - dib->fe->ops->release(dib->fe); - dib->fe = NULL; - } - } -} - -static int dibusb_dvb_init(struct usb_dibusb *dib) -{ - int ret; - -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,4) - if ((ret = dvb_register_adapter(&dib->adapter, DRIVER_DESC)) < 0) { -#else - if ((ret = dvb_register_adapter(&dib->adapter, DRIVER_DESC , - THIS_MODULE)) < 0) { -#endif - deb_info("dvb_register_adapter failed: error %d", ret); - goto err; - } - dib->adapter->priv = dib; - - strncpy(dib->i2c_adap.name,dib->dibdev->name,I2C_NAME_SIZE); -#ifdef I2C_ADAP_CLASS_TV_DIGITAL - dib->i2c_adap.class = I2C_ADAP_CLASS_TV_DIGITAL, -#else - dib->i2c_adap.class = I2C_CLASS_TV_DIGITAL, -#endif - dib->i2c_adap.algo = &dibusb_algo; - dib->i2c_adap.algo_data = NULL; - dib->i2c_adap.id = I2C_ALGO_BIT; - - i2c_set_adapdata(&dib->i2c_adap, dib); - - if ((i2c_add_adapter(&dib->i2c_adap) < 0)) { - err("could not add i2c adapter"); - goto err_i2c; - } - - dib->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING; - - dib->demux.priv = (void *)dib; - /* get pidcount from demod */ - dib->demux.feednum = dib->demux.filternum = 16; - dib->demux.start_feed = dibusb_start_feed; - dib->demux.stop_feed = dibusb_stop_feed; - dib->demux.write_to_decoder = NULL; - if ((ret = dvb_dmx_init(&dib->demux)) < 0) { - err("dvb_dmx_init failed: error %d",ret); - goto err_dmx; - } - - dib->dmxdev.filternum = dib->demux.filternum; - dib->dmxdev.demux = &dib->demux.dmx; - dib->dmxdev.capabilities = 0; - if ((ret = dvb_dmxdev_init(&dib->dmxdev, dib->adapter)) < 0) { - err("dvb_dmxdev_init failed: error %d",ret); - goto err_dmx_dev; - } - - dvb_net_init(dib->adapter, &dib->dvb_net, &dib->demux.dmx); - - frontend_init(dib); - - /* Start the remote-control polling. */ - schedule_delayed_work(&dib->rc_query_work, msecs_to_jiffies(RC_QUERY_INTERVAL)); - - goto success; -err_dmx_dev: - dvb_dmx_release(&dib->demux); -err_dmx: - i2c_del_adapter(&dib->i2c_adap); -err_i2c: - dvb_unregister_adapter(dib->adapter); -err: - return ret; -success: - dib->dvb_is_ready = 1; - return 0; -} - -static int dibusb_dvb_exit(struct usb_dibusb *dib) -{ - cancel_delayed_work(&dib->rc_query_work); - flush_scheduled_work(); - input_unregister_device(&dib->rc_input_dev); - - dib->dvb_is_ready = 0; - deb_info("unregistering DVB part\n"); - dvb_net_release(&dib->dvb_net); - dib->demux.dmx.close(&dib->demux.dmx); - dvb_dmxdev_release(&dib->dmxdev); - dvb_dmx_release(&dib->demux); - if (dib->fe != NULL) dvb_unregister_frontend(dib->fe); - i2c_del_adapter(&dib->i2c_adap); - dvb_unregister_adapter(dib->adapter); - - return 0; -} - -static int dibusb_exit(struct usb_dibusb *dib) -{ - int i; - if (dib->urb_list != NULL) { - for (i = 0; i < dib->dibdev->parm->num_urbs; i++) { - if (dib->urb_list[i] != NULL) { - deb_info("killing URB no. %d.\n",i); - - /* stop the URBs */ -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,7) - usb_unlink_urb(dib->urb_list[i]); -#else - usb_kill_urb(dib->urb_list[i]); -#endif - - deb_info("freeing URB no. %d.\n",i); - /* free the URBs */ - usb_free_urb(dib->urb_list[i]); - } - } - /* free the urb array */ - kfree(dib->urb_list); - } - - pci_free_consistent(NULL, - dib->dibdev->parm->urb_buf_size*dib->dibdev->parm->num_urbs,dib->buffer, - dib->dma_handle); - return 0; -} - -static int dibusb_init(struct usb_dibusb *dib) -{ - int ret,i,bufsize; - sema_init(&dib->usb_sem, 1); - sema_init(&dib->i2c_sem, 1); - - /* - * when reloading the driver w/o replugging the device - * a timeout occures, this helps - */ - usb_clear_halt(dib->udev,usb_sndbulkpipe(dib->udev,dib->dibdev->parm->cmd_pipe)); - usb_clear_halt(dib->udev,usb_rcvbulkpipe(dib->udev,dib->dibdev->parm->result_pipe)); - usb_clear_halt(dib->udev,usb_rcvbulkpipe(dib->udev,dib->dibdev->parm->data_pipe)); - - /* allocate the array for the data transfer URBs */ - dib->urb_list = kmalloc(dib->dibdev->parm->num_urbs*sizeof(struct urb *),GFP_KERNEL); - if (dib->urb_list == NULL) - return -ENOMEM; - memset(dib->urb_list,0,dib->dibdev->parm->num_urbs*sizeof(struct urb *)); - - bufsize = dib->dibdev->parm->num_urbs*dib->dibdev->parm->urb_buf_size; - deb_info("allocate %d bytes as buffersize for all URBs\n",bufsize); - /* allocate the actual buffer for the URBs */ - if ((dib->buffer = pci_alloc_consistent(NULL,bufsize,&dib->dma_handle)) == NULL) { - deb_info("not enough memory.\n"); - dibusb_exit(dib); - return -ENOMEM; - } - deb_info("allocation complete\n"); - memset(dib->buffer,0,bufsize); - - /* allocate and submit the URBs */ - for (i = 0; i < dib->dibdev->parm->num_urbs; i++) { - if (!(dib->urb_list[i] = usb_alloc_urb(0,GFP_KERNEL))) { - dibusb_exit(dib); - return -ENOMEM; - } - deb_info("submitting URB no. %d\n",i); - - usb_fill_bulk_urb( dib->urb_list[i], dib->udev, - usb_rcvbulkpipe(dib->udev,dib->dibdev->parm->data_pipe), - &dib->buffer[i*dib->dibdev->parm->urb_buf_size], - dib->dibdev->parm->urb_buf_size, - dibusb_urb_complete, dib); - - dib->urb_list[i]->transfer_flags = 0; -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,7) - dib->urb_list[i]->timeout = 0; -#endif - - if ((ret = usb_submit_urb(dib->urb_list[i],GFP_KERNEL))) { - err("could not submit buffer urb no. %d\n",i); - dibusb_exit(dib); - return ret; - } - } - - dib->dvb_is_ready = 0; - - /* Initialise the remote-control structures.*/ - init_input_dev(&dib->rc_input_dev); - - dib->rc_input_dev.evbit[0] = BIT(EV_KEY); - dib->rc_input_dev.keycodesize = sizeof(unsigned char); - dib->rc_input_dev.keycodemax = KEY_MAX; - dib->rc_input_dev.name = DRIVER_DESC " remote control"; - - for (i=0; irc_input_dev.keybit); - - input_register_device(&dib->rc_input_dev); - - dib->rc_input_event = KEY_MAX; - - INIT_WORK(&dib->rc_query_work, dibusb_query_rc, dib); - - dibusb_hw_wakeup(dib); - - if ((ret = dibusb_dvb_init(dib))) { - dibusb_exit(dib); - return ret; - } - return 0; -} - -/* - * load a firmware packet to the device - */ -static int dibusb_writemem(struct usb_device *udev,u16 addr,u8 *data, u8 len) -{ - return usb_control_msg(udev, usb_sndctrlpipe(udev,0), - 0xa0, USB_TYPE_VENDOR, addr, 0x00, data, len, 5*HZ); -} - -static int dibusb_loadfirmware(struct usb_device *udev, - struct dibusb_device *dibdev) -{ - const struct firmware *fw = NULL; - const char **fws; - u16 addr; - u8 *b,*p; - int ret = 0,i; - - fws = dibdev->parm->fw_filenames; - - for (i = 0; i < sizeof(fws)/sizeof(const char*); i++) { - if ((ret = request_firmware(&fw, fws[i], &udev->dev)) == 0) { - info("using firmware file (%s).",fws[i]); - break; - } - deb_info("tried to find '%s' firmware - unsuccessful. (%d)\n", - fws[i],ret); - } - - if (fw == NULL) { - err("did not find a valid firmware file. " - "Please see linux/Documentation/dvb/ for more details on firmware-problems."); - return -EINVAL; - } - p = kmalloc(fw->size,GFP_KERNEL); - if (p != NULL) { - u8 reset; - /* - * you cannot use the fw->data as buffer for - * usb_control_msg, a new buffer has to be - * created - */ - memcpy(p,fw->data,fw->size); - - /* stop the CPU */ - reset = 1; - if ((ret = dibusb_writemem(udev,dibdev->parm->usb_cpu_csreg,&reset,1)) != 1) - err("could not stop the USB controller CPU."); - for(i = 0; p[i+3] == 0 && i < fw->size; ) { - b = (u8 *) &p[i]; - addr = *((u16 *) &b[1]); - - ret = dibusb_writemem(udev,addr,&b[4],b[0]); - - if (ret != b[0]) { - err("error while transferring firmware " - "(transferred size: %d, block size: %d)", - ret,b[0]); - ret = -EINVAL; - break; - } - i += 5 + b[0]; - } - /* length in ret */ - if (ret > 0) - ret = 0; - /* restart the CPU */ - reset = 0; - if (ret || dibusb_writemem(udev,dibdev->parm->usb_cpu_csreg,&reset,1) != 1) { - err("could not restart the USB controller CPU."); - ret = -EINVAL; - } - - kfree(p); - } else { - ret = -ENOMEM; - } - release_firmware(fw); - - return ret; -} - -/* - * USB - */ -static int dibusb_probe(struct usb_interface *intf, - const struct usb_device_id *id) -{ - struct usb_device *udev = interface_to_usbdev(intf); - struct usb_dibusb *dib = NULL; - struct dibusb_device *dibdev = NULL; - - int ret = -ENOMEM,i,cold=0; - - for (i = 0; i < DIBUSB_SUPPORTED_DEVICES; i++) - if (dibusb_devices[i].cold_product_id == le16_to_cpu(udev->descriptor.idProduct) || - dibusb_devices[i].warm_product_id == le16_to_cpu(udev->descriptor.idProduct)) { - dibdev = &dibusb_devices[i]; - - cold = dibdev->cold_product_id == le16_to_cpu(udev->descriptor.idProduct); - - if (cold) - info("found a '%s' in cold state, will try to load a firmware",dibdev->name); - else - info("found a '%s' in warm state.",dibdev->name); - } - - if (dibdev == NULL) { - err("something went very wrong, " - "unknown product ID: %.4x",le16_to_cpu(udev->descriptor.idProduct)); - return -ENODEV; - } - - if (cold) - ret = dibusb_loadfirmware(udev,dibdev); - else { - dib = kmalloc(sizeof(struct usb_dibusb),GFP_KERNEL); - if (dib == NULL) { - err("no memory"); - return ret; - } - memset(dib,0,sizeof(struct usb_dibusb)); - - dib->pid_parse = 1; - switch (udev->speed) { - case USB_SPEED_LOW: - err("cannot handle USB speed because it is to sLOW."); - break; - case USB_SPEED_FULL: - info("running at FULL speed, will use pid parsing."); - break; - case USB_SPEED_HIGH: - if (!pid_parse) { - dib->pid_parse = 0; - info("running at HIGH speed, will deliver the complete TS."); - } else - info("running at HIGH speed, will use pid_parsing anyway."); - break; - case USB_SPEED_UNKNOWN: /* fall through */ - default: - err("cannot handle USB speed because it is unkown."); - break; - } - - dib->udev = udev; - dib->dibdev = dibdev; - - usb_set_intfdata(intf, dib); - - ret = dibusb_init(dib); - } - - if (ret == 0) - info("%s successfully initialized and connected.",dibdev->name); - else - info("%s error while loading driver (%d)",dibdev->name,ret); - return ret; -} - -static void dibusb_disconnect(struct usb_interface *intf) -{ - struct usb_dibusb *dib = usb_get_intfdata(intf); - const char *name = DRIVER_DESC; - - usb_set_intfdata(intf,NULL); - if (dib != NULL) { - name = dib->dibdev->name; - dibusb_dvb_exit(dib); - dibusb_exit(dib); - kfree(dib); - } - info("%s successfully deinitialized and disconnected.",name); - -} - -/* usb specific object needed to register this driver with the usb subsystem */ -static struct usb_driver dibusb_driver = { - .owner = THIS_MODULE, - .name = "dvb_dibusb", - .probe = dibusb_probe, - .disconnect = dibusb_disconnect, - .id_table = dibusb_table, -}; - -/* module stuff */ -static int __init usb_dibusb_init(void) -{ - int result; - if ((result = usb_register(&dibusb_driver))) { - err("usb_register failed. Error number %d",result); - return result; - } - - return 0; -} - -static void __exit usb_dibusb_exit(void) -{ - /* deregister this driver from the USB subsystem */ - usb_deregister(&dibusb_driver); -} - -module_init (usb_dibusb_init); -module_exit (usb_dibusb_exit); - -MODULE_AUTHOR(DRIVER_AUTHOR); -MODULE_DESCRIPTION(DRIVER_DESC); -MODULE_LICENSE("GPL"); diff -Nru a/drivers/media/dvb/dibusb/dvb-dibusb.h b/drivers/media/dvb/dibusb/dvb-dibusb.h --- a/drivers/media/dvb/dibusb/dvb-dibusb.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/dibusb/dvb-dibusb.h 2005-01-28 14:11:40 -08:00 @@ -1,293 +1,165 @@ /* * dvb-dibusb.h * - * Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de) + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, version 2. * - * for more information see dvb-dibusb.c . + * for more information see dvb-dibusb-core.c . */ - #ifndef __DVB_DIBUSB_H__ #define __DVB_DIBUSB_H__ +#include +#include +#include + +#include "dvb_frontend.h" +#include "dvb_demux.h" +#include "dvb_net.h" +#include "dmxdev.h" + #include "dib3000.h" +#include "mt352.h" + +/* debug */ +#ifdef CONFIG_DVB_DIBCOM_DEBUG +#define dprintk(level,args...) \ + do { if ((dvb_dibusb_debug & level)) { printk(args); } } while (0) + +#define debug_dump(b,l) {\ + int i; \ + for (i = 0; i < l; i++) deb_xfer("%02x ", b[i]); \ + deb_xfer("\n");\ +} + +#else +#define dprintk(args...) +#define debug_dump(b,l) +#endif + +extern int dvb_dibusb_debug; + +/* Version information */ +#define DRIVER_VERSION "0.3" +#define DRIVER_DESC "Driver for DiBcom based USB Budget DVB-T device" +#define DRIVER_AUTHOR "Patrick Boettcher, patrick.boettcher@desy.de" + +#define deb_info(args...) dprintk(0x01,args) +#define deb_xfer(args...) dprintk(0x02,args) +#define deb_alot(args...) dprintk(0x04,args) +#define deb_ts(args...) dprintk(0x08,args) +#define deb_err(args...) dprintk(0x10,args) +#define deb_rc(args...) dprintk(0x20,args) + +/* generic log methods - taken from usb.h */ +#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , __FILE__ , ## arg) +#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , __FILE__ , ## arg) +#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , __FILE__ , ## arg) + +struct dibusb_usb_controller { + const char *name; /* name of the usb controller */ + u16 cpu_cs_register; /* needs to be restarted, when the firmware has been downloaded. */ +}; typedef enum { DIBUSB1_1 = 0, - DIBUSB2_0, DIBUSB1_1_AN2235, -} dibusb_type; + DIBUSB2_0, + UMT2_0, +} dibusb_class_t; -static const char * dibusb_fw_filenames1_1[] = { - "dvb-dibusb-5.0.0.11.fw" -}; +typedef enum { + DIBUSB_TUNER_CABLE_THOMSON = 0, + DIBUSB_TUNER_COFDM_PANASONIC_ENV57H1XD5, + DIBUSB_TUNER_CABLE_LG_TDTP_E102P, + DIBUSB_TUNER_COFDM_PANASONIC_ENV77H11D5, +} dibusb_tuner_t; -static const char * dibusb_fw_filenames1_1_an2235[] = { - "dvb-dibusb-an2235-1.fw" -}; +typedef enum { + DIBUSB_DIB3000MB = 0, + DIBUSB_DIB3000MC, + DIBUSB_MT352, +} dibusb_demodulator_t; -static const char * dibusb_fw_filenames2_0[] = { - "dvb-dibusb-6.0.0.5.fw" -}; +typedef enum { + DIBUSB_RC_NO = 0, + DIBUSB_RC_NEC_PROTOCOL = 1, +} dibusb_remote_t; -struct dibusb_device_parameter { - dibusb_type type; - u8 demod_addr; - const char **fw_filenames; - const char *usb_controller; - u16 usb_cpu_csreg; - - int num_urbs; - int urb_buf_size; - int default_size; - int firmware_bug; - - int cmd_pipe; - int result_pipe; - int data_pipe; -}; +struct dibusb_tuner { + dibusb_tuner_t id; -static struct dibusb_device_parameter dibusb_dev_parm[3] = { - { .type = DIBUSB1_1, - .demod_addr = 0x10, - .fw_filenames = dibusb_fw_filenames1_1, - .usb_controller = "Cypress AN2135", - .usb_cpu_csreg = 0x7f92, - - .num_urbs = 3, - .urb_buf_size = 4096, - .default_size = 188*21, - .firmware_bug = 1, - - .cmd_pipe = 0x01, - .result_pipe = 0x81, - .data_pipe = 0x82, - }, - { .type = DIBUSB2_0, - .demod_addr = 0x18, - .fw_filenames = dibusb_fw_filenames2_0, - .usb_controller = "Cypress FX2", - .usb_cpu_csreg = 0xe600, - - .num_urbs = 3, - .urb_buf_size = 40960, - .default_size = 188*210, - .firmware_bug = 0, - - .cmd_pipe = 0x01, - .result_pipe = 0x81, - .data_pipe = 0x86, - }, - { .type = DIBUSB1_1_AN2235, - .demod_addr = 0x10, - .fw_filenames = dibusb_fw_filenames1_1_an2235, - .usb_controller = "Cypress CY7C64613 (AN2235)", - .usb_cpu_csreg = 0x7f92, - - .num_urbs = 3, - .urb_buf_size = 4096, - .default_size = 188*21, - .firmware_bug = 1, - - .cmd_pipe = 0x01, - .result_pipe = 0x81, - .data_pipe = 0x82, - } + u8 pll_addr; /* tuner i2c address */ }; +extern struct dibusb_tuner dibusb_tuner[]; -struct dibusb_device { - const char *name; - u16 cold_product_id; - u16 warm_product_id; - struct dibusb_device_parameter *parm; -}; +#define DIBUSB_POSSIBLE_I2C_ADDR_NUM 4 +struct dibusb_demod { + dibusb_demodulator_t id; -/* Vendor IDs */ -#define USB_VID_ANCHOR 0x0547 -#define USB_VID_AVERMEDIA 0x14aa -#define USB_VID_COMPRO 0x185b -#define USB_VID_COMPRO_UNK 0x145f -#define USB_VID_CYPRESS 0x04b4 -#define USB_VID_DIBCOM 0x10b8 -#define USB_VID_EMPIA 0xeb1a -#define USB_VID_GRANDTEC 0x5032 -#define USB_VID_HYPER_PALTEK 0x1025 -#define USB_VID_IMC_NETWORKS 0x13d3 -#define USB_VID_TWINHAN 0x1822 -#define USB_VID_ULTIMA_ELECTRONIC 0x05d8 - -/* Product IDs */ -#define USB_PID_AVERMEDIA_DVBT_USB_COLD 0x0001 -#define USB_PID_AVERMEDIA_DVBT_USB_WARM 0x0002 -#define USB_PID_COMPRO_DVBU2000_COLD 0xd000 -#define USB_PID_COMPRO_DVBU2000_WARM 0xd001 -#define USB_PID_COMPRO_DVBU2000_UNK_COLD 0x010c -#define USB_PID_COMPRO_DVBU2000_UNK_WARM 0x010d -#define USB_PID_DIBCOM_MOD3000_COLD 0x0bb8 -#define USB_PID_DIBCOM_MOD3000_WARM 0x0bb9 -#define USB_PID_DIBCOM_MOD3001_COLD 0x0bc6 -#define USB_PID_DIBCOM_MOD3001_WARM 0x0bc7 -#define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 -#define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 -#define USB_PID_KWORLD_VSTREAM_COLD 0x17de -#define USB_PID_KWORLD_VSTREAM_WARM 0x17df -#define USB_PID_TWINHAN_VP7041_COLD 0x3201 -#define USB_PID_TWINHAN_VP7041_WARM 0x3202 -#define USB_PID_ULTIMA_TVBOX_COLD 0x8105 -#define USB_PID_ULTIMA_TVBOX_WARM 0x8106 -#define USB_PID_ULTIMA_TVBOX_AN2235_COLD 0x8107 -#define USB_PID_ULTIMA_TVBOX_AN2235_WARM 0x8108 -#define USB_PID_ULTIMA_TVBOX_ANCHOR_COLD 0x2235 -#define USB_PID_ULTIMA_TVBOX_USB2_COLD 0x8109 -#define USB_PID_ULTIMA_TVBOX_USB2_FX_COLD 0x8613 -#define USB_PID_ULTIMA_TVBOX_USB2_FX_WARM 0x1002 -#define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e -#define USB_PID_UNK_HYPER_PALTEK_WARM 0x005f -#define USB_PID_YAKUMO_DTT200U_COLD 0x0201 -#define USB_PID_YAKUMO_DTT200U_WARM 0x0301 - -#define DIBUSB_SUPPORTED_DEVICES 15 - -/* USB Driver stuff */ -static struct dibusb_device dibusb_devices[DIBUSB_SUPPORTED_DEVICES] = { - { .name = "TwinhanDTV USB1.1 / Magic Box / HAMA USB1.1 DVB-T device", - .cold_product_id = USB_PID_TWINHAN_VP7041_COLD, - .warm_product_id = USB_PID_TWINHAN_VP7041_WARM, - .parm = &dibusb_dev_parm[0], - }, - { .name = "KWorld V-Stream XPERT DTV - DVB-T USB1.1", - .cold_product_id = USB_PID_KWORLD_VSTREAM_COLD, - .warm_product_id = USB_PID_KWORLD_VSTREAM_WARM, - .parm = &dibusb_dev_parm[0], - }, - { .name = "Grandtec USB1.1 DVB-T/DiBcom USB1.1 DVB-T reference design (MOD3000)", - .cold_product_id = USB_PID_DIBCOM_MOD3000_COLD, - .warm_product_id = USB_PID_DIBCOM_MOD3000_WARM, - .parm = &dibusb_dev_parm[0], - }, - { .name = "Artec T1 USB1.1 TVBOX with AN2135", - .cold_product_id = USB_PID_ULTIMA_TVBOX_COLD, - .warm_product_id = USB_PID_ULTIMA_TVBOX_WARM, - .parm = &dibusb_dev_parm[0], - }, - { .name = "Artec T1 USB1.1 TVBOX with AN2235", - .cold_product_id = USB_PID_ULTIMA_TVBOX_AN2235_COLD, - .warm_product_id = USB_PID_ULTIMA_TVBOX_AN2235_WARM, - .parm = &dibusb_dev_parm[2], - }, - { .name = "Artec T1 USB1.1 TVBOX with AN2235 (misdesigned)", - .cold_product_id = USB_PID_ULTIMA_TVBOX_ANCHOR_COLD, - .warm_product_id = 0, /* undefined, this design becomes USB_PID_DIBCOM_MOD3000_WARM in warm state */ - .parm = &dibusb_dev_parm[2], - }, - { .name = "Artec T1 USB2.0 TVBOX (please report the warm ID)", - .cold_product_id = USB_PID_ULTIMA_TVBOX_USB2_COLD, - .warm_product_id = 0, /* don't know, it is most likely that the device will get another USB ID in warm state */ - .parm = &dibusb_dev_parm[1], - }, - { .name = "Artec T1 USB2.0 TVBOX with FX2 IDs (misdesigned, please report the warm ID)", - .cold_product_id = USB_PID_ULTIMA_TVBOX_USB2_FX_COLD, - .warm_product_id = USB_PID_ULTIMA_TVBOX_USB2_FX_WARM, /* undefined, it could be that the device will get another USB ID in warm state */ - .parm = &dibusb_dev_parm[1], - }, - { .name = "Compro Videomate DVB-U2000 - DVB-T USB1.1", - .cold_product_id = USB_PID_COMPRO_DVBU2000_COLD, - .warm_product_id = USB_PID_COMPRO_DVBU2000_WARM, - .parm = &dibusb_dev_parm[0], - }, - { .name = "Compro Videomate DVB-U2000 - DVB-T USB1.1 (really ?? please report the name!)", - .cold_product_id = USB_PID_COMPRO_DVBU2000_UNK_COLD, - .warm_product_id = USB_PID_COMPRO_DVBU2000_UNK_WARM, - .parm = &dibusb_dev_parm[0], - }, - { .name = "Unkown USB1.1 DVB-T device ???? please report the name to the author", - .cold_product_id = USB_PID_UNK_HYPER_PALTEK_COLD, - .warm_product_id = USB_PID_UNK_HYPER_PALTEK_WARM, - .parm = &dibusb_dev_parm[0], - }, - { .name = "DiBcom USB2.0 DVB-T reference design (MOD3000P)", - .cold_product_id = USB_PID_DIBCOM_MOD3001_COLD, - .warm_product_id = USB_PID_DIBCOM_MOD3001_WARM, - .parm = &dibusb_dev_parm[1], - }, - { .name = "Grandtec DVB-T USB1.1", - .cold_product_id = USB_PID_GRANDTEC_DVBT_USB_COLD, - .warm_product_id = USB_PID_GRANDTEC_DVBT_USB_WARM, - .parm = &dibusb_dev_parm[0], - }, - { .name = "Avermedia AverTV DVBT USB1.1", - .cold_product_id = USB_PID_AVERMEDIA_DVBT_USB_COLD, - .warm_product_id = USB_PID_AVERMEDIA_DVBT_USB_WARM, - .parm = &dibusb_dev_parm[0], - }, - { .name = "Yakumo DVB-T mobile USB2.0", - .cold_product_id = USB_PID_YAKUMO_DTT200U_COLD, - .warm_product_id = USB_PID_YAKUMO_DTT200U_WARM, - .parm = &dibusb_dev_parm[1], - } + int pid_filter_count; /* counter of the internal pid_filter */ + u8 i2c_addrs[DIBUSB_POSSIBLE_I2C_ADDR_NUM]; /* list of possible i2c addresses of the demod */ }; -/* USB Driver stuff */ -/* table of devices that work with this driver */ -static struct usb_device_id dibusb_table [] = { - { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_DVBT_USB_COLD)}, - { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_DVBT_USB_WARM)}, - { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_COLD) }, - { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_WARM) }, - { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_COLD) }, - { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3000_WARM) }, - { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_COLD) }, - { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_MOD3001_WARM) }, - { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_COLD) }, - { USB_DEVICE(USB_VID_EMPIA, USB_PID_KWORLD_VSTREAM_WARM) }, - { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_COLD) }, - { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_GRANDTEC_DVBT_USB_WARM) }, - { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_COLD) }, - { USB_DEVICE(USB_VID_GRANDTEC, USB_PID_DIBCOM_MOD3000_WARM) }, - { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_COLD) }, - { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_WARM) }, - { USB_DEVICE(USB_VID_IMC_NETWORKS, USB_PID_TWINHAN_VP7041_COLD) }, - { USB_DEVICE(USB_VID_IMC_NETWORKS, USB_PID_TWINHAN_VP7041_WARM) }, - { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_COLD) }, - { USB_DEVICE(USB_VID_TWINHAN, USB_PID_TWINHAN_VP7041_WARM) }, - { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_COLD) }, - { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_WARM) }, - { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_COLD) }, - { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_AN2235_WARM) }, - { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_YAKUMO_DTT200U_COLD) }, - { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_YAKUMO_DTT200U_WARM) }, - { USB_DEVICE(USB_PID_COMPRO_DVBU2000_UNK_COLD, USB_VID_COMPRO_UNK) }, - { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC, USB_PID_ULTIMA_TVBOX_USB2_COLD) }, +#define DIBUSB_MAX_TUNER_NUM 2 +struct dibusb_device_class { + dibusb_class_t id; + + const struct dibusb_usb_controller *usb_ctrl; /* usb controller */ + const char *firmware; /* valid firmware filenames */ + + int pipe_cmd; /* command pipe (read/write) */ + int pipe_data; /* data pipe */ + + int urb_count; /* number of data URBs to be submitted */ + int urb_buffer_size; /* the size of the buffer for each URB */ -/* - * activate the following define when you have one of the devices and want to - * build it from build-2.6 in dvb-kernel - */ -// #define CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES -#ifdef CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES - { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_ANCHOR_COLD) }, - { USB_DEVICE(USB_VID_CYPRESS, USB_PID_ULTIMA_TVBOX_USB2_FX_COLD) }, - { USB_DEVICE(USB_VID_ANCHOR, USB_PID_ULTIMA_TVBOX_USB2_FX_WARM) }, -#endif - { } /* Terminating entry */ + dibusb_remote_t remote_type; /* does this device have a ir-receiver */ + + struct dibusb_demod *demod; /* which demodulator is mount */ + struct dibusb_tuner *tuner; /* which tuner can be found here */ }; -MODULE_DEVICE_TABLE (usb, dibusb_table); +#define DIBUSB_ID_MAX_NUM 15 +struct dibusb_usb_device { + const char *name; /* real name of the box */ + struct dibusb_device_class *dev_cl; /* which dibusb_device_class is this device part of */ + + struct usb_device_id *cold_ids[DIBUSB_ID_MAX_NUM]; /* list of USB ids when this device is at pre firmware state */ + struct usb_device_id *warm_ids[DIBUSB_ID_MAX_NUM]; /* list of USB ids when this device is at post firmware state */ +}; -#define DIBUSB_I2C_TIMEOUT HZ*5 +/* a PID for the pid_filter list, when in use */ +struct dibusb_pid +{ + int index; + u16 pid; + int active; +}; struct usb_dibusb { /* usb */ struct usb_device * udev; - struct dibusb_device * dibdev; + struct dibusb_usb_device * dibdev; + +#define DIBUSB_STATE_INIT 0x000 +#define DIBUSB_STATE_URB_LIST 0x001 +#define DIBUSB_STATE_URB_BUF 0x002 +#define DIBUSB_STATE_URB_SUBMIT 0x004 +#define DIBUSB_STATE_DVB 0x008 +#define DIBUSB_STATE_I2C 0x010 +#define DIBUSB_STATE_REMOTE 0x020 +#define DIBUSB_STATE_PIDLIST 0x040 + int init_state; int feedcount; - int pid_parse; - struct dib3000_xfer_ops xfer_ops; + struct dib_fe_xfer_ops xfer_ops; + + struct dibusb_tuner *tuner; struct urb **urb_list; u8 *buffer; @@ -295,49 +167,141 @@ /* I2C */ struct i2c_adapter i2c_adap; - struct i2c_client i2c_client; /* locking */ struct semaphore usb_sem; struct semaphore i2c_sem; + /* pid filtering */ + spinlock_t pid_list_lock; + struct dibusb_pid *pid_list; + /* dvb */ - int dvb_is_ready; struct dvb_adapter *adapter; struct dmxdev dmxdev; struct dvb_demux demux; struct dvb_net dvb_net; struct dvb_frontend* fe; + int (*fe_sleep) (struct dvb_frontend *); + int (*fe_init) (struct dvb_frontend *); + /* remote control */ struct input_dev rc_input_dev; struct work_struct rc_query_work; int rc_input_event; + + /* module parameters */ + int pid_parse; + int rc_query_interval; }; +/* commonly used functions in the separated files */ -/* types of first byte of each buffer */ +/* dvb-dibusb-firmware.c */ +int dibusb_loadfirmware(struct usb_device *udev, struct dibusb_usb_device *dibdev); + +/* dvb-dibusb-remote.c */ +int dibusb_remote_exit(struct usb_dibusb *dib); +int dibusb_remote_init(struct usb_dibusb *dib); + +/* dvb-dibusb-fe-i2c.c */ +int dibusb_i2c_msg(struct usb_dibusb *dib, u8 addr, + u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen); +int dibusb_fe_init(struct usb_dibusb* dib); +int dibusb_fe_exit(struct usb_dibusb *dib); +int dibusb_i2c_init(struct usb_dibusb *dib); +int dibusb_i2c_exit(struct usb_dibusb *dib); + +/* dvb-dibusb-dvb.c */ +void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs); +int dibusb_dvb_init(struct usb_dibusb *dib); +int dibusb_dvb_exit(struct usb_dibusb *dib); + +/* dvb-dibusb-usb.c */ +int dibusb_readwrite_usb(struct usb_dibusb *dib, u8 *wbuf, u16 wlen, u8 *rbuf, + u16 rlen); + +int dibusb_hw_wakeup(struct dvb_frontend *); +int dibusb_hw_sleep(struct dvb_frontend *); +int dibusb_set_streaming_mode(struct usb_dibusb *,u8); +int dibusb_streaming(struct usb_dibusb *,int); + +int dibusb_urb_init(struct usb_dibusb *); +int dibusb_urb_exit(struct usb_dibusb *); + +/* dvb-dibusb-pid.c */ +int dibusb_pid_list_init(struct usb_dibusb *dib); +void dibusb_pid_list_exit(struct usb_dibusb *dib); +int dibusb_ctrl_pid(struct usb_dibusb *dib, struct dvb_demux_feed *dvbdmxfeed , int onoff); + +/* i2c and transfer stuff */ +#define DIBUSB_I2C_TIMEOUT HZ*5 + +/* + * protocol of all dibusb related devices + */ + +/* + * bulk msg to/from endpoint 0x01 + * + * general structure: + * request_byte parameter_bytes + */ #define DIBUSB_REQ_START_READ 0x00 #define DIBUSB_REQ_START_DEMOD 0x01 + +/* + * i2c read + * bulk write: 0x02 ((7bit i2c_addr << 1) & 0x01) register_bytes length_word + * bulk read: byte_buffer (length_word bytes) + */ #define DIBUSB_REQ_I2C_READ 0x02 + +/* + * i2c write + * bulk write: 0x03 (7bit i2c_addr << 1) register_bytes value_bytes + */ #define DIBUSB_REQ_I2C_WRITE 0x03 -/* prefix for reading the current RC key */ +/* + * polling the value of the remote control + * bulk write: 0x04 + * bulk read: byte_buffer (5 bytes) + * + * first byte of byte_buffer shows the status (0x00, 0x01, 0x02) + */ #define DIBUSB_REQ_POLL_REMOTE 0x04 #define DIBUSB_RC_NEC_EMPTY 0x00 #define DIBUSB_RC_NEC_KEY_PRESSED 0x01 #define DIBUSB_RC_NEC_KEY_REPEATED 0x02 -/* 0x05 0xXX */ +/* streaming mode: + * bulk write: 0x05 mode_byte + * + * mode_byte is mostly 0x00 + */ #define DIBUSB_REQ_SET_STREAMING_MODE 0x05 /* interrupt the internal read loop, when blocking */ #define DIBUSB_REQ_INTR_READ 0x06 -/* IO control - * 0x07 +/* io control + * 0x07 cmd_byte param_bytes + * + * param_bytes can be up to 32 bytes + * + * cmd_byte function parameter name + * 0x00 power mode + * 0x00 sleep + * 0x01 wakeup + * + * 0x01 enable streaming + * 0x02 disable streaming + * + * */ #define DIBUSB_REQ_SET_IOCTL 0x07 @@ -347,5 +311,9 @@ #define DIBUSB_IOCTL_CMD_POWER_MODE 0x00 #define DIBUSB_IOCTL_POWER_SLEEP 0x00 #define DIBUSB_IOCTL_POWER_WAKEUP 0x01 + +/* modify streaming of the FX2 */ +#define DIBUSB_IOCTL_CMD_ENABLE_STREAM 0x01 +#define DIBUSB_IOCTL_CMD_DISABLE_STREAM 0x02 #endif diff -Nru a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c --- a/drivers/media/dvb/dvb-core/dvb_demux.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/dvb-core/dvb_demux.c 2005-01-28 14:11:40 -08:00 @@ -247,7 +247,22 @@ } /* -** Losless Section Demux 1.4 by Emard +** Losless Section Demux 1.4.1 by Emard +** Valsecchi Patrick: +** - middle of section A (no PUSI) +** - end of section A and start of section B +** (with PUSI pointing to the start of the second section) +** +** In this case, without feed->pusi_seen you'll receive a garbage section +** consisting of the end of section A. Basically because tsfeedp +** is incemented and the use=0 condition is not raised +** when the second packet arrives. +** +** Fix: +** when demux is started, let feed->pusi_seen = 0 to +** prevent initial feeding of garbage from the end of +** previous section. When you for the first time see PUSI=1 +** then set feed->pusi_seen = 1 */ static int dvb_dmx_swfilter_section_copy_dump(struct dvb_demux_feed *feed, const u8 *buf, u8 len) { @@ -293,7 +308,12 @@ sec->seclen = seclen; sec->crc_val = ~0; /* dump [secbuf .. secbuf+seclen) */ + if(feed->pusi_seen) dvb_dmx_swfilter_section_feed(feed); +#ifdef DVB_DEMUX_SECTION_LOSS_LOG + else + printk("dvb_demux.c pusi not seen, discarding section data\n"); +#endif sec->secbufp += seclen; /* secbufp and secbuf moving together is */ sec->secbuf += seclen; /* redundand but saves pointer arithmetic */ } @@ -305,7 +325,7 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed, const u8 *buf) { u8 p, count; - int ccok; + int ccok, dc_i = 0; u8 cc; count = payload(buf); @@ -316,31 +336,41 @@ p = 188-count; /* payload start */ cc = buf[3] & 0x0f; - ccok = ((feed->cc+1) & 0x0f) == cc ? 1 : 0; + ccok = ((feed->cc + 1) & 0x0f) == cc; feed->cc = cc; - if(ccok == 0) - { + + if (buf[3] & 0x20) { + /* adaption field present, check for discontinuity_indicator */ + if ((buf[4] > 0) && (buf[5] & 0x80)) + dc_i = 1; + } + + if (!ccok || dc_i) { #ifdef DVB_DEMUX_SECTION_LOSS_LOG printk("dvb_demux.c discontinuity detected %d bytes lost\n", count); /* those bytes under sume circumstances will again be reported ** in the following dvb_dmx_swfilter_section_new */ #endif + /* Discontinuity detected. Reset pusi_seen = 0 to + ** stop feeding of suspicious data until next PUSI=1 arrives + */ + feed->pusi_seen = 0; dvb_dmx_swfilter_section_new(feed); return 0; } - if(buf[1] & 0x40) - { + if (buf[1] & 0x40) { // PUSI=1 (is set), section boundary is here - if(count > 1 && buf[p] < count) - { + if (count > 1 && buf[p] < count) { const u8 *before = buf+p+1; u8 before_len = buf[p]; const u8 *after = before+before_len; u8 after_len = count-1-before_len; dvb_dmx_swfilter_section_copy_dump(feed, before, before_len); + /* before start of new section, set pusi_seen = 1 */ + feed->pusi_seen = 1; dvb_dmx_swfilter_section_new(feed); dvb_dmx_swfilter_section_copy_dump(feed, after, after_len); } @@ -349,9 +379,7 @@ if(count > 0) printk("dvb_demux.c PUSI=1 but %d bytes lost\n", count); #endif - } - else - { + } else { // PUSI=0 (is not set), no section boundary const u8 *entire = buf+p; u8 entire_len = count; @@ -784,10 +812,8 @@ } #ifndef NOBUFS - if (feed->buffer) { vfree(feed->buffer); feed->buffer=0; - } #endif feed->state = DMX_STATE_FREE; @@ -1055,10 +1081,8 @@ return -EINVAL; } #ifndef NOBUFS - if (dvbdmxfeed->buffer) { vfree(dvbdmxfeed->buffer); dvbdmxfeed->buffer=0; - } #endif dvbdmxfeed->state=DMX_STATE_FREE; @@ -1269,9 +1293,7 @@ struct dmx_demux *dmx = &dvbdemux->dmx; dmx_unregister_demux(dmx); - if (dvbdemux->filter) vfree(dvbdemux->filter); - if (dvbdemux->feed) vfree(dvbdemux->feed); return 0; } diff -Nru a/drivers/media/dvb/dvb-core/dvb_demux.h b/drivers/media/dvb/dvb-core/dvb_demux.h --- a/drivers/media/dvb/dvb-core/dvb_demux.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/dvb-core/dvb_demux.h 2005-01-28 14:11:41 -08:00 @@ -93,6 +93,7 @@ enum dmx_ts_pes pes_type; int cc; + int pusi_seen; /* prevents feeding of garbage from previous section */ u16 peslen; diff -Nru a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c --- a/drivers/media/dvb/dvb-core/dvb_frontend.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c 2005-01-28 14:11:40 -08:00 @@ -89,9 +89,36 @@ static DECLARE_MUTEX(frontend_mutex); +struct dvb_frontend_private { + + struct dvb_device *dvbdev; + struct dvb_frontend_parameters parameters; + struct dvb_fe_events events; + struct semaphore sem; + struct list_head list_head; + wait_queue_head_t wait_queue; + pid_t thread_pid; + unsigned long release_jiffies; + int state; + int bending; + int lnb_drift; + int inversion; + int auto_step; + int auto_sub_step; + int started_auto_step; + int min_delay; + int max_drift; + int step_size; + int exit; + int wakeup; + fe_status_t status; +}; + + static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status) { - struct dvb_fe_events *events = &fe->events; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; + struct dvb_fe_events *events = &fepriv->events; struct dvb_frontend_event *e; int wp; @@ -109,7 +136,7 @@ e = &events->events[events->eventw]; - memcpy (&e->parameters, &fe->parameters, + memcpy (&e->parameters, &fepriv->parameters, sizeof (struct dvb_frontend_parameters)); if (status & FE_HAS_LOCK) @@ -128,7 +155,8 @@ static int dvb_frontend_get_event(struct dvb_frontend *fe, struct dvb_frontend_event *event, int flags) { - struct dvb_fe_events *events = &fe->events; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; + struct dvb_fe_events *events = &fepriv->events; dprintk ("%s\n", __FUNCTION__); @@ -143,12 +171,12 @@ if (flags & O_NONBLOCK) return -EWOULDBLOCK; - up(&fe->sem); + up(&fepriv->sem); ret = wait_event_interruptible (events->wait_queue, events->eventw != events->eventr); - if (down_interruptible (&fe->sem)) + if (down_interruptible (&fepriv->sem)) return -ERESTARTSYS; if (ret < 0) @@ -206,27 +234,28 @@ { int autoinversion; int ready = 0; - int original_inversion = fe->parameters.inversion; - u32 original_frequency = fe->parameters.frequency; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; + int original_inversion = fepriv->parameters.inversion; + u32 original_frequency = fepriv->parameters.frequency; /* are we using autoinversion? */ autoinversion = ((!(fe->ops->info.caps & FE_CAN_INVERSION_AUTO)) && - (fe->parameters.inversion == INVERSION_AUTO)); + (fepriv->parameters.inversion == INVERSION_AUTO)); /* setup parameters correctly */ while(!ready) { /* calculate the lnb_drift */ - fe->lnb_drift = fe->auto_step * fe->step_size; + fepriv->lnb_drift = fepriv->auto_step * fepriv->step_size; /* wrap the auto_step if we've exceeded the maximum drift */ - if (fe->lnb_drift > fe->max_drift) { - fe->auto_step = 0; - fe->auto_sub_step = 0; - fe->lnb_drift = 0; + if (fepriv->lnb_drift > fepriv->max_drift) { + fepriv->auto_step = 0; + fepriv->auto_sub_step = 0; + fepriv->lnb_drift = 0; } /* perform inversion and +/- zigzag */ - switch(fe->auto_sub_step) { + switch(fepriv->auto_sub_step) { case 0: /* try with the current inversion and current drift setting */ ready = 1; @@ -235,68 +264,70 @@ case 1: if (!autoinversion) break; - fe->inversion = (fe->inversion == INVERSION_OFF) ? INVERSION_ON : INVERSION_OFF; + fepriv->inversion = (fepriv->inversion == INVERSION_OFF) ? INVERSION_ON : INVERSION_OFF; ready = 1; break; case 2: - if (fe->lnb_drift == 0) break; + if (fepriv->lnb_drift == 0) break; - fe->lnb_drift = -fe->lnb_drift; + fepriv->lnb_drift = -fepriv->lnb_drift; ready = 1; break; case 3: - if (fe->lnb_drift == 0) break; + if (fepriv->lnb_drift == 0) break; if (!autoinversion) break; - fe->inversion = (fe->inversion == INVERSION_OFF) ? INVERSION_ON : INVERSION_OFF; - fe->lnb_drift = -fe->lnb_drift; + fepriv->inversion = (fepriv->inversion == INVERSION_OFF) ? INVERSION_ON : INVERSION_OFF; + fepriv->lnb_drift = -fepriv->lnb_drift; ready = 1; break; default: - fe->auto_step++; - fe->auto_sub_step = -1; /* it'll be incremented to 0 in a moment */ + fepriv->auto_step++; + fepriv->auto_sub_step = -1; /* it'll be incremented to 0 in a moment */ break; } - if (!ready) fe->auto_sub_step++; + if (!ready) fepriv->auto_sub_step++; } /* if this attempt would hit where we started, indicate a complete * iteration has occurred */ - if ((fe->auto_step == fe->started_auto_step) && - (fe->auto_sub_step == 0) && check_wrapped) { + if ((fepriv->auto_step == fepriv->started_auto_step) && + (fepriv->auto_sub_step == 0) && check_wrapped) { return 1; } dprintk("%s: drift:%i inversion:%i auto_step:%i " "auto_sub_step:%i started_auto_step:%i\n", - __FUNCTION__, fe->lnb_drift, fe->inversion, - fe->auto_step, fe->auto_sub_step, fe->started_auto_step); + __FUNCTION__, fepriv->lnb_drift, fepriv->inversion, + fepriv->auto_step, fepriv->auto_sub_step, fepriv->started_auto_step); /* set the frontend itself */ - fe->parameters.frequency += fe->lnb_drift; + fepriv->parameters.frequency += fepriv->lnb_drift; if (autoinversion) - fe->parameters.inversion = fe->inversion; + fepriv->parameters.inversion = fepriv->inversion; if (fe->ops->set_frontend) - fe->ops->set_frontend(fe, &fe->parameters); + fe->ops->set_frontend(fe, &fepriv->parameters); - fe->parameters.frequency = original_frequency; - fe->parameters.inversion = original_inversion; + fepriv->parameters.frequency = original_frequency; + fepriv->parameters.inversion = original_inversion; - fe->auto_sub_step++; + fepriv->auto_sub_step++; return 0; } static int dvb_frontend_is_exiting(struct dvb_frontend *fe) { - if (fe->exit) + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; + + if (fepriv->exit) return 1; - if (fe->dvbdev->writers == 1) - if (jiffies - fe->release_jiffies > dvb_shutdown_timeout * HZ) + if (fepriv->dvbdev->writers == 1) + if (jiffies - fepriv->release_jiffies > dvb_shutdown_timeout * HZ) return 1; return 0; @@ -304,8 +335,10 @@ static int dvb_frontend_should_wakeup(struct dvb_frontend *fe) { - if (fe->wakeup) { - fe->wakeup = 0; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; + + if (fepriv->wakeup) { + fepriv->wakeup = 0; return 1; } return dvb_frontend_is_exiting(fe); @@ -313,8 +346,10 @@ static void dvb_frontend_wakeup(struct dvb_frontend *fe) { - fe->wakeup = 1; - wake_up_interruptible(&fe->wait_queue); + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; + + fepriv->wakeup = 1; + wake_up_interruptible(&fepriv->wait_queue); } /* @@ -323,6 +358,7 @@ static int dvb_frontend_thread (void *data) { struct dvb_frontend *fe = (struct dvb_frontend *) data; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; unsigned long timeout; char name [15]; int quality = 0, delay = 3*HZ; @@ -338,14 +374,14 @@ sigfillset (¤t->blocked); unlock_kernel (); - fe->status = 0; + fepriv->status = 0; dvb_frontend_init (fe); - fe->wakeup = 0; + fepriv->wakeup = 0; while (1) { - up (&fe->sem); /* is locked when we enter the thread... */ + up(&fepriv->sem); /* is locked when we enter the thread... */ - timeout = wait_event_interruptible_timeout(fe->wait_queue, + timeout = wait_event_interruptible_timeout(fepriv->wait_queue, dvb_frontend_should_wakeup(fe), delay); if (0 != dvb_frontend_is_exiting (fe)) { @@ -356,44 +392,43 @@ if (current->flags & PF_FREEZE) refrigerator(PF_FREEZE); - if (down_interruptible (&fe->sem)) + if (down_interruptible(&fepriv->sem)) break; /* if we've got no parameters, just keep idling */ - if (fe->state & FESTATE_IDLE) { + if (fepriv->state & FESTATE_IDLE) { delay = 3*HZ; quality = 0; continue; } -retune: /* get the frontend status */ - if (fe->state & FESTATE_RETUNE) { + if (fepriv->state & FESTATE_RETUNE) { s = 0; } else { if (fe->ops->read_status) fe->ops->read_status(fe, &s); - if (s != fe->status) { + if (s != fepriv->status) { dvb_frontend_add_event (fe, s); - fe->status = s; + fepriv->status = s; } } /* if we're not tuned, and we have a lock, move to the TUNED state */ - if ((fe->state & FESTATE_WAITFORLOCK) && (s & FE_HAS_LOCK)) { - update_delay(&quality, &delay, fe->min_delay, s & FE_HAS_LOCK); - fe->state = FESTATE_TUNED; + if ((fepriv->state & FESTATE_WAITFORLOCK) && (s & FE_HAS_LOCK)) { + update_delay(&quality, &delay, fepriv->min_delay, s & FE_HAS_LOCK); + fepriv->state = FESTATE_TUNED; /* if we're tuned, then we have determined the correct inversion */ if ((!(fe->ops->info.caps & FE_CAN_INVERSION_AUTO)) && - (fe->parameters.inversion == INVERSION_AUTO)) { - fe->parameters.inversion = fe->inversion; + (fepriv->parameters.inversion == INVERSION_AUTO)) { + fepriv->parameters.inversion = fepriv->inversion; } continue; } /* if we are tuned already, check we're still locked */ - if (fe->state & FESTATE_TUNED) { - update_delay(&quality, &delay, fe->min_delay, s & FE_HAS_LOCK); + if (fepriv->state & FESTATE_TUNED) { + update_delay(&quality, &delay, fepriv->min_delay, s & FE_HAS_LOCK); /* we're tuned, and the lock is still good... */ if (s & FE_HAS_LOCK) @@ -401,49 +436,49 @@ else { /* if we _WERE_ tuned, but now don't have a lock, * need to zigzag */ - fe->state = FESTATE_ZIGZAG_FAST; - fe->started_auto_step = fe->auto_step; + fepriv->state = FESTATE_ZIGZAG_FAST; + fepriv->started_auto_step = fepriv->auto_step; check_wrapped = 0; } } /* don't actually do anything if we're in the LOSTLOCK state, * the frontend is set to FE_CAN_RECOVER, and the max_drift is 0 */ - if ((fe->state & FESTATE_LOSTLOCK) && - (fe->ops->info.caps & FE_CAN_RECOVER) && (fe->max_drift == 0)) { - update_delay(&quality, &delay, fe->min_delay, s & FE_HAS_LOCK); + if ((fepriv->state & FESTATE_LOSTLOCK) && + (fe->ops->info.caps & FE_CAN_RECOVER) && (fepriv->max_drift == 0)) { + update_delay(&quality, &delay, fepriv->min_delay, s & FE_HAS_LOCK); continue; } /* don't do anything if we're in the DISEQC state, since this * might be someone with a motorized dish controlled by DISEQC. * If its actually a re-tune, there will be a SET_FRONTEND soon enough. */ - if (fe->state & FESTATE_DISEQC) { - update_delay(&quality, &delay, fe->min_delay, s & FE_HAS_LOCK); + if (fepriv->state & FESTATE_DISEQC) { + update_delay(&quality, &delay, fepriv->min_delay, s & FE_HAS_LOCK); continue; } /* if we're in the RETUNE state, set everything up for a brand * new scan, keeping the current inversion setting, as the next * tune is _very_ likely to require the same */ - if (fe->state & FESTATE_RETUNE) { - fe->lnb_drift = 0; - fe->auto_step = 0; - fe->auto_sub_step = 0; - fe->started_auto_step = 0; + if (fepriv->state & FESTATE_RETUNE) { + fepriv->lnb_drift = 0; + fepriv->auto_step = 0; + fepriv->auto_sub_step = 0; + fepriv->started_auto_step = 0; check_wrapped = 0; } /* fast zigzag. */ - if ((fe->state & FESTATE_SEARCHING_FAST) || (fe->state & FESTATE_RETUNE)) { - delay = fe->min_delay; + if ((fepriv->state & FESTATE_SEARCHING_FAST) || (fepriv->state & FESTATE_RETUNE)) { + delay = fepriv->min_delay; /* peform a tune */ if (dvb_frontend_autotune(fe, check_wrapped)) { /* OK, if we've run out of trials at the fast speed. * Drop back to slow for the _next_ attempt */ - fe->state = FESTATE_SEARCHING_SLOW; - fe->started_auto_step = fe->auto_step; + fepriv->state = FESTATE_SEARCHING_SLOW; + fepriv->started_auto_step = fepriv->auto_step; continue; } check_wrapped = 1; @@ -452,15 +487,14 @@ * This ensures we cannot return from an * FE_SET_FRONTEND ioctl before the first frontend tune * occurs */ - if (fe->state & FESTATE_RETUNE) { - fe->state = FESTATE_TUNING_FAST; - goto retune; + if (fepriv->state & FESTATE_RETUNE) { + fepriv->state = FESTATE_TUNING_FAST; } } /* slow zigzag */ - if (fe->state & FESTATE_SEARCHING_SLOW) { - update_delay(&quality, &delay, fe->min_delay, s & FE_HAS_LOCK); + if (fepriv->state & FESTATE_SEARCHING_SLOW) { + update_delay(&quality, &delay, fepriv->min_delay, s & FE_HAS_LOCK); /* Note: don't bother checking for wrapping; we stay in this * state until we get a lock */ @@ -476,7 +510,7 @@ fe->ops->sleep(fe); } - fe->thread_pid = 0; + fepriv->thread_pid = 0; mb(); dvb_frontend_wakeup(fe); @@ -486,21 +520,22 @@ static void dvb_frontend_stop(struct dvb_frontend *fe) { unsigned long ret; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; dprintk ("%s\n", __FUNCTION__); - fe->exit = 1; + fepriv->exit = 1; mb(); - if (!fe->thread_pid) + if (!fepriv->thread_pid) return; /* check if the thread is really alive */ - if (kill_proc(fe->thread_pid, 0, 1) == -ESRCH) { + if (kill_proc(fepriv->thread_pid, 0, 1) == -ESRCH) { printk("dvb_frontend_stop: thread PID %d already died\n", - fe->thread_pid); + fepriv->thread_pid); /* make sure the mutex was not held by the thread */ - init_MUTEX (&fe->sem); + init_MUTEX (&fepriv->sem); return; } @@ -508,27 +543,28 @@ dvb_frontend_wakeup(fe); /* wait until the frontend thread has exited */ - ret = wait_event_interruptible(fe->wait_queue,0 == fe->thread_pid); + ret = wait_event_interruptible(fepriv->wait_queue,0 == fepriv->thread_pid); if (-ERESTARTSYS != ret) { - fe->state = FESTATE_IDLE; + fepriv->state = FESTATE_IDLE; return; } - fe->state = FESTATE_IDLE; + fepriv->state = FESTATE_IDLE; /* paranoia check in case a signal arrived */ - if (fe->thread_pid) + if (fepriv->thread_pid) printk("dvb_frontend_stop: warning: thread PID %d won't exit\n", - fe->thread_pid); + fepriv->thread_pid); } static int dvb_frontend_start(struct dvb_frontend *fe) { int ret; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; dprintk ("%s\n", __FUNCTION__); - if (fe->thread_pid) { - if (!fe->exit) + if (fepriv->thread_pid) { + if (!fepriv->exit) return 0; else dvb_frontend_stop (fe); @@ -536,21 +572,22 @@ if (signal_pending(current)) return -EINTR; - if (down_interruptible (&fe->sem)) + if (down_interruptible (&fepriv->sem)) return -EINTR; - fe->state = FESTATE_IDLE; - fe->exit = 0; - fe->thread_pid = 0; + fepriv->state = FESTATE_IDLE; + fepriv->exit = 0; + fepriv->thread_pid = 0; mb(); ret = kernel_thread (dvb_frontend_thread, fe, 0); + if (ret < 0) { printk("dvb_frontend_start: failed to start kernel_thread (%d)\n", ret); - up(&fe->sem); + up(&fepriv->sem); return ret; } - fe->thread_pid = ret; + fepriv->thread_pid = ret; return 0; } @@ -561,11 +598,12 @@ { struct dvb_device *dvbdev = file->private_data; struct dvb_frontend *fe = dvbdev->priv; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; int err = -EOPNOTSUPP; dprintk ("%s\n", __FUNCTION__); - if (!fe || fe->exit) + if (!fe || fepriv->exit) return -ENODEV; if ((file->f_flags & O_ACCMODE) == O_RDONLY && @@ -573,7 +611,7 @@ cmd == FE_DISEQC_RECV_SLAVE_REPLY)) return -EPERM; - if (down_interruptible (&fe->sem)) + if (down_interruptible (&fepriv->sem)) return -ERESTARTSYS; switch (cmd) { @@ -617,48 +655,48 @@ case FE_DISEQC_RESET_OVERLOAD: if (fe->ops->diseqc_reset_overload) { err = fe->ops->diseqc_reset_overload(fe); - fe->state = FESTATE_DISEQC; - fe->status = 0; + fepriv->state = FESTATE_DISEQC; + fepriv->status = 0; } break; case FE_DISEQC_SEND_MASTER_CMD: if (fe->ops->diseqc_send_master_cmd) { err = fe->ops->diseqc_send_master_cmd(fe, (struct dvb_diseqc_master_cmd*) parg); - fe->state = FESTATE_DISEQC; - fe->status = 0; + fepriv->state = FESTATE_DISEQC; + fepriv->status = 0; } break; case FE_DISEQC_SEND_BURST: if (fe->ops->diseqc_send_burst) { err = fe->ops->diseqc_send_burst(fe, (fe_sec_mini_cmd_t) parg); - fe->state = FESTATE_DISEQC; - fe->status = 0; + fepriv->state = FESTATE_DISEQC; + fepriv->status = 0; } break; case FE_SET_TONE: if (fe->ops->set_tone) { err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg); - fe->state = FESTATE_DISEQC; - fe->status = 0; + fepriv->state = FESTATE_DISEQC; + fepriv->status = 0; } break; case FE_SET_VOLTAGE: if (fe->ops->set_voltage) { err = fe->ops->set_voltage(fe, (fe_sec_voltage_t) parg); - fe->state = FESTATE_DISEQC; - fe->status = 0; + fepriv->state = FESTATE_DISEQC; + fepriv->status = 0; } break; case FE_DISHNETWORK_SEND_LEGACY_CMD: if (fe->ops->dishnetwork_send_legacy_command) { err = fe->ops->dishnetwork_send_legacy_command(fe, (unsigned int) parg); - fe->state = FESTATE_DISEQC; - fe->status = 0; + fepriv->state = FESTATE_DISEQC; + fepriv->status = 0; } break; @@ -668,14 +706,14 @@ break; case FE_ENABLE_HIGH_LNB_VOLTAGE: - if (fe->ops->enable_high_lnb_voltage); + if (fe->ops->enable_high_lnb_voltage) err = fe->ops->enable_high_lnb_voltage(fe, (int) parg); break; case FE_SET_FRONTEND: { struct dvb_frontend_tune_settings fetunesettings; - memcpy (&fe->parameters, parg, + memcpy (&fepriv->parameters, parg, sizeof (struct dvb_frontend_parameters)); memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings)); @@ -684,41 +722,41 @@ /* force auto frequency inversion if requested */ if (dvb_force_auto_inversion) { - fe->parameters.inversion = INVERSION_AUTO; + fepriv->parameters.inversion = INVERSION_AUTO; fetunesettings.parameters.inversion = INVERSION_AUTO; } if (fe->ops->info.type == FE_OFDM) { /* without hierachical coding code_rate_LP is irrelevant, * so we tolerate the otherwise invalid FEC_NONE setting */ - if (fe->parameters.u.ofdm.hierarchy_information == HIERARCHY_NONE && - fe->parameters.u.ofdm.code_rate_LP == FEC_NONE) - fe->parameters.u.ofdm.code_rate_LP = FEC_AUTO; + if (fepriv->parameters.u.ofdm.hierarchy_information == HIERARCHY_NONE && + fepriv->parameters.u.ofdm.code_rate_LP == FEC_NONE) + fepriv->parameters.u.ofdm.code_rate_LP = FEC_AUTO; } /* get frontend-specific tuning settings */ if (fe->ops->get_tune_settings && (fe->ops->get_tune_settings(fe, &fetunesettings) == 0)) { - fe->min_delay = (fetunesettings.min_delay_ms * HZ) / 1000; - fe->max_drift = fetunesettings.max_drift; - fe->step_size = fetunesettings.step_size; + fepriv->min_delay = (fetunesettings.min_delay_ms * HZ) / 1000; + fepriv->max_drift = fetunesettings.max_drift; + fepriv->step_size = fetunesettings.step_size; } else { /* default values */ switch(fe->ops->info.type) { case FE_QPSK: - fe->min_delay = HZ/20; - fe->step_size = fe->parameters.u.qpsk.symbol_rate / 16000; - fe->max_drift = fe->parameters.u.qpsk.symbol_rate / 2000; + fepriv->min_delay = HZ/20; + fepriv->step_size = fepriv->parameters.u.qpsk.symbol_rate / 16000; + fepriv->max_drift = fepriv->parameters.u.qpsk.symbol_rate / 2000; break; case FE_QAM: - fe->min_delay = HZ/20; - fe->step_size = 0; /* no zigzag */ - fe->max_drift = 0; + fepriv->min_delay = HZ/20; + fepriv->step_size = 0; /* no zigzag */ + fepriv->max_drift = 0; break; case FE_OFDM: - fe->min_delay = HZ/20; - fe->step_size = fe->ops->info.frequency_stepsize * 2; - fe->max_drift = (fe->ops->info.frequency_stepsize * 2) + 1; + fepriv->min_delay = HZ/20; + fepriv->step_size = fe->ops->info.frequency_stepsize * 2; + fepriv->max_drift = (fe->ops->info.frequency_stepsize * 2) + 1; break; case FE_ATSC: printk("dvb-core: FE_ATSC not handled yet.\n"); @@ -726,12 +764,12 @@ } } if (dvb_override_tune_delay > 0) - fe->min_delay = (dvb_override_tune_delay * HZ) / 1000; + fepriv->min_delay = (dvb_override_tune_delay * HZ) / 1000; - fe->state = FESTATE_RETUNE; + fepriv->state = FESTATE_RETUNE; dvb_frontend_wakeup(fe); dvb_frontend_add_event (fe, 0); - fe->status = 0; + fepriv->status = 0; err = 0; break; } @@ -742,13 +780,13 @@ case FE_GET_FRONTEND: if (fe->ops->get_frontend) { - memcpy (parg, &fe->parameters, sizeof (struct dvb_frontend_parameters)); + memcpy (parg, &fepriv->parameters, sizeof (struct dvb_frontend_parameters)); err = fe->ops->get_frontend(fe, (struct dvb_frontend_parameters*) parg); } break; }; - up (&fe->sem); + up (&fepriv->sem); return err; } @@ -757,12 +795,13 @@ { struct dvb_device *dvbdev = file->private_data; struct dvb_frontend *fe = dvbdev->priv; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; dprintk ("%s\n", __FUNCTION__); - poll_wait (file, &fe->events.wait_queue, wait); + poll_wait (file, &fepriv->events.wait_queue, wait); - if (fe->events.eventw != fe->events.eventr) + if (fepriv->events.eventw != fepriv->events.eventr) return (POLLIN | POLLRDNORM | POLLPRI); return 0; @@ -773,6 +812,7 @@ { struct dvb_device *dvbdev = file->private_data; struct dvb_frontend *fe = dvbdev->priv; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; int ret; dprintk ("%s\n", __FUNCTION__); @@ -786,7 +826,7 @@ dvb_generic_release (inode, file); /* empty event queue */ - fe->events.eventr = fe->events.eventw = 0; + fepriv->events.eventr = fepriv->events.eventw = 0; } return ret; @@ -797,11 +837,12 @@ { struct dvb_device *dvbdev = file->private_data; struct dvb_frontend *fe = dvbdev->priv; + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; dprintk ("%s\n", __FUNCTION__); if ((file->f_flags & O_ACCMODE) != O_RDONLY) - fe->release_jiffies = jiffies; + fepriv->release_jiffies = jiffies; return dvb_generic_release (inode, file); } @@ -818,6 +859,7 @@ int dvb_register_frontend(struct dvb_adapter* dvb, struct dvb_frontend* fe) { + struct dvb_frontend_private *fepriv; static const struct dvb_device dvbdev_template = { .users = ~0, .writers = 1, @@ -831,20 +873,26 @@ if (down_interruptible (&frontend_mutex)) return -ERESTARTSYS; - init_MUTEX (&fe->sem); - init_waitqueue_head (&fe->wait_queue); - init_waitqueue_head (&fe->events.wait_queue); - init_MUTEX (&fe->events.sem); - fe->events.eventw = fe->events.eventr = 0; - fe->events.overflow = 0; + fe->frontend_priv = kmalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL); + if (fe->frontend_priv == NULL) { + up(&frontend_mutex); + return -ENOMEM; + } + fepriv = (struct dvb_frontend_private*) fe->frontend_priv; + memset(fe->frontend_priv, 0, sizeof(struct dvb_frontend_private)); + + init_MUTEX (&fepriv->sem); + init_waitqueue_head (&fepriv->wait_queue); + init_waitqueue_head (&fepriv->events.wait_queue); + init_MUTEX (&fepriv->events.sem); fe->dvb = dvb; - fe->inversion = INVERSION_OFF; + fepriv->inversion = INVERSION_OFF; printk ("DVB: registering frontend %i (%s)...\n", fe->dvb->num, fe->ops->info.name); - dvb_register_device (fe->dvb, &fe->dvbdev, &dvbdev_template, + dvb_register_device (fe->dvb, &fepriv->dvbdev, &dvbdev_template, fe, DVB_DEVICE_FRONTEND); up (&frontend_mutex); @@ -854,15 +902,18 @@ int dvb_unregister_frontend(struct dvb_frontend* fe) { + struct dvb_frontend_private *fepriv = (struct dvb_frontend_private*) fe->frontend_priv; dprintk ("%s\n", __FUNCTION__); down (&frontend_mutex); - dvb_unregister_device (fe->dvbdev); + dvb_unregister_device (fepriv->dvbdev); dvb_frontend_stop (fe); if (fe->ops->release) fe->ops->release(fe); else printk("dvb_frontend: Demodulator (%s) does not have a release callback!\n", fe->ops->info.name); + if (fe->frontend_priv) + kfree(fe->frontend_priv); up (&frontend_mutex); return 0; } diff -Nru a/drivers/media/dvb/dvb-core/dvb_frontend.h b/drivers/media/dvb/dvb-core/dvb_frontend.h --- a/drivers/media/dvb/dvb-core/dvb_frontend.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/dvb-core/dvb_frontend.h 2005-01-28 14:11:41 -08:00 @@ -115,28 +115,7 @@ struct dvb_frontend_ops* ops; struct dvb_adapter *dvb; void* demodulator_priv; - - struct dvb_device *dvbdev; - struct dvb_frontend_parameters parameters; - struct dvb_fe_events events; - struct semaphore sem; - struct list_head list_head; - wait_queue_head_t wait_queue; - pid_t thread_pid; - unsigned long release_jiffies; - int state; - int bending; - int lnb_drift; - int inversion; - int auto_step; - int auto_sub_step; - int started_auto_step; - int min_delay; - int max_drift; - int step_size; - int exit; - int wakeup; - fe_status_t status; + void* frontend_priv; }; extern int dvb_register_frontend(struct dvb_adapter* dvb, diff -Nru a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c --- a/drivers/media/dvb/dvb-core/dvb_net.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/dvb-core/dvb_net.c 2005-01-28 14:11:40 -08:00 @@ -123,7 +123,6 @@ struct dvb_net_priv { int in_use; struct net_device_stats stats; - char name[6]; u16 pid; struct dvb_net *host; struct dmx_demux *demux; @@ -1165,12 +1164,17 @@ if ((if_num = get_if(dvbnet)) < 0) return -EINVAL; - net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb", - dvb_net_setup); + net = alloc_netdev(sizeof(struct dvb_net_priv), "dvb", dvb_net_setup); if (!net) return -ENOMEM; - sprintf(net->name, "dvb%d_%d", dvbnet->dvbdev->adapter->num, if_num); + if (dvbnet->dvbdev->id) + snprintf(net->name, IFNAMSIZ, "dvb%d%u%d", + dvbnet->dvbdev->adapter->num, dvbnet->dvbdev->id, if_num); + else + /* compatibility fix to keep dvb0_0 format */ + snprintf(net->name, IFNAMSIZ, "dvb%d_%d", + dvbnet->dvbdev->adapter->num, if_num); net->addr_len = 6; memcpy(net->dev_addr, dvbnet->dvbdev->adapter->proposed_mac, 6); @@ -1196,6 +1200,7 @@ free_netdev(net); return result; } + printk("dvb_net: created network interface %s\n", net->name); return if_num; } @@ -1214,6 +1219,7 @@ dvb_net_stop(net); flush_scheduled_work(); + printk("dvb_net: removed network interface %s\n", net->name); unregister_netdev(net); dvbnet->state[num]=0; dvbnet->device[num] = NULL; diff -Nru a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig --- a/drivers/media/dvb/frontends/Kconfig 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/Kconfig 2005-01-28 14:11:40 -08:00 @@ -46,6 +46,7 @@ config DVB_SP8870 tristate "Spase sp8870 based" depends on DVB_CORE + select FW_LOADER help A DVB-T tuner module. Say Y when you want to support this frontend. @@ -56,6 +57,7 @@ config DVB_SP887X tristate "Spase sp887x based" depends on DVB_CORE + select FW_LOADER help A DVB-T tuner module. Say Y when you want to support this frontend. @@ -84,6 +86,7 @@ config DVB_TDA1004X tristate "Philips TDA10045H/TDA10046H based" depends on DVB_CORE + select FW_LOADER help A DVB-T tuner module. Say Y when you want to support this frontend. @@ -144,5 +147,14 @@ depends on DVB_CORE help A DVB-C tuner module. Say Y when you want to support this frontend. + +comment "ATSC (North American/Korean Terresterial DTV) frontends" + depends on DVB_CORE + +config DVB_NXT2002 + tristate "Nxt2002 based" + depends on DVB_CORE + help + An ATSC 8VSB tuner module. Say Y when you want to support this frontend. endmenu diff -Nru a/drivers/media/dvb/frontends/Makefile b/drivers/media/dvb/frontends/Makefile --- a/drivers/media/dvb/frontends/Makefile 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/Makefile 2005-01-28 14:11:40 -08:00 @@ -24,3 +24,5 @@ obj-$(CONFIG_DVB_TDA80XX) += tda80xx.o obj-$(CONFIG_DVB_TDA10021) += tda10021.o obj-$(CONFIG_DVB_STV0297) += stv0297.o +obj-$(CONFIG_DVB_NXT2002) += nxt2002.o + diff -Nru a/drivers/media/dvb/frontends/dib3000-common.c b/drivers/media/dvb/frontends/dib3000-common.c --- a/drivers/media/dvb/frontends/dib3000-common.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/dib3000-common.c 2005-01-28 14:11:40 -08:00 @@ -2,7 +2,7 @@ #ifdef CONFIG_DVB_DIBCOM_DEBUG static int debug; -module_param(debug, int, 0x644); +module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "set debugging level (1=info,2=i2c,4=srch (|-able))."); #endif #define deb_info(args...) dprintk(0x01,args) @@ -42,65 +42,6 @@ return i2c_transfer(state->i2c,msg, 1) != 1 ? -EREMOTEIO : 0; } -int dib3000_init_pid_list(struct dib3000_state *state, int num) -{ - int i; - if (state != NULL) { - state->pid_list = kmalloc(sizeof(struct dib3000_pid) * num,GFP_KERNEL); - if (state->pid_list == NULL) - return -ENOMEM; - - deb_info("initializing %d pids for the pid_list.\n",num); - spin_lock_init(&state->pid_list_lock); - memset(state->pid_list,0,num*(sizeof(struct dib3000_pid))); - for (i=0; i < num; i++) { - state->pid_list[i].pid = 0; - state->pid_list[i].active = 0; - } - state->feedcount = 0; - } else - return -EINVAL; - - return 0; -} - -void dib3000_dealloc_pid_list(struct dib3000_state *state) -{ - if (state != NULL && state->pid_list != NULL) - kfree(state->pid_list); -} - -/* fetch a pid from pid_list */ -int dib3000_get_pid_index(struct dib3000_pid pid_list[], int num_pids, int pid, - spinlock_t *pid_list_lock,int onoff) -{ - int i,ret = -1; - unsigned long flags; - - spin_lock_irqsave(pid_list_lock,flags); - for (i=0; i < num_pids; i++) - if (onoff) { - if (!pid_list[i].active) { - pid_list[i].pid = pid; - pid_list[i].active = 1; - ret = i; - break; - } - } else { - if (pid_list[i].active && pid_list[i].pid == pid) { - pid_list[i].pid = 0; - pid_list[i].active = 0; - ret = i; - break; - } - } - - deb_info("setting pid: %5d %04x at index %d '%s'\n",pid,pid,ret,onoff ? "on" : "off"); - - spin_unlock_irqrestore(pid_list_lock,flags); - return ret; -} - int dib3000_search_status(u16 irq,u16 lock) { if (irq & 0x02) { @@ -139,7 +80,4 @@ EXPORT_SYMBOL(dib3000_read_reg); EXPORT_SYMBOL(dib3000_write_reg); -EXPORT_SYMBOL(dib3000_init_pid_list); -EXPORT_SYMBOL(dib3000_dealloc_pid_list); -EXPORT_SYMBOL(dib3000_get_pid_index); EXPORT_SYMBOL(dib3000_search_status); diff -Nru a/drivers/media/dvb/frontends/dib3000-common.h b/drivers/media/dvb/frontends/dib3000-common.h --- a/drivers/media/dvb/frontends/dib3000-common.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/dib3000-common.h 2005-01-28 14:11:40 -08:00 @@ -4,7 +4,7 @@ * * DiBcom (http://www.dibcom.fr/) * - * Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de) + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) * * based on GPL code from DibCom, which has * @@ -29,19 +29,10 @@ #include "dvb_frontend.h" #include "dib3000.h" -/* info and err, taken from usb.h, if there is anything available like by default, - * please change ! - */ -#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , __FILE__ , ## arg) -#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , __FILE__ , ## arg) -#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , __FILE__ , ## arg) - -/* a PID for the pid_filter list, when in use */ -struct dib3000_pid -{ - u16 pid; - int active; -}; +/* info and err, taken from usb.h, if there is anything available like by default. */ +#define err(format, arg...) printk(KERN_ERR "dib3000mX: " format "\n" , ## arg) +#define info(format, arg...) printk(KERN_INFO "dib3000mX: " format "\n" , ## arg) +#define warn(format, arg...) printk(KERN_WARNING "dib3000mX: " format "\n" , ## arg) /* frontend state */ struct dib3000_state { @@ -52,25 +43,18 @@ /* configuration settings */ struct dib3000_config config; - spinlock_t pid_list_lock; - struct dib3000_pid *pid_list; - - int feedcount; - struct dvb_frontend frontend; int timing_offset; int timing_offset_comp_done; + + fe_bandwidth_t last_tuned_bw; + u32 last_tuned_freq; }; /* commonly used methods by the dib3000mb/mc/p frontend */ extern int dib3000_read_reg(struct dib3000_state *state, u16 reg); extern int dib3000_write_reg(struct dib3000_state *state, u16 reg, u16 val); -extern int dib3000_init_pid_list(struct dib3000_state *state, int num); -extern void dib3000_dealloc_pid_list(struct dib3000_state *state); -extern int dib3000_get_pid_index(struct dib3000_pid pid_list[], int num_pids, - int pid, spinlock_t *pid_list_lock,int onoff); - extern int dib3000_search_status(u16 irq,u16 lock); /* handy shortcuts */ @@ -81,7 +65,7 @@ #define wr_foreach(a,v) { int i; \ if (sizeof(a) != sizeof(v)) \ - err("sizeof: %zd %zd is different",sizeof(a),sizeof(v));\ + err("sizeof: %d %d is different",sizeof(a),sizeof(v));\ for (i=0; i < sizeof(a)/sizeof(u16); i++) \ wr(a[i],v[i]); \ } @@ -136,8 +120,8 @@ #define DIB3000_DDS_INVERSION_OFF ( 0) #define DIB3000_DDS_INVERSION_ON ( 1) -#define DIB3000_TUNER_WRITE_ENABLE(a) (0xffff & (a << 7)) -#define DIB3000_TUNER_WRITE_DISABLE(a) (0xffff & ((a << 7) | (1 << 7))) +#define DIB3000_TUNER_WRITE_ENABLE(a) (0xffff & (a << 8)) +#define DIB3000_TUNER_WRITE_DISABLE(a) (0xffff & ((a << 8) | (1 << 7))) /* for auto search */ extern u16 dib3000_seq[2][2][2]; diff -Nru a/drivers/media/dvb/frontends/dib3000.h b/drivers/media/dvb/frontends/dib3000.h --- a/drivers/media/dvb/frontends/dib3000.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/frontends/dib3000.h 2005-01-28 14:11:41 -08:00 @@ -2,7 +2,7 @@ * public header file of the frontend drivers for mobile DVB-T demodulators * DiBcom 3000-MB and DiBcom 3000-MC/P (http://www.dibcom.fr/) * - * Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de) + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) * * based on GPL code from DibCom, which has * @@ -31,25 +31,24 @@ /* the demodulator's i2c address */ u8 demod_address; - /* The i2c address of the PLL */ - u8 pll_addr; - - /* PLL maintenance */ - int (*pll_init)(struct dvb_frontend *fe); - int (*pll_set)(struct dvb_frontend *fe, struct dvb_frontend_parameters* params); + /* PLL maintenance and the i2c address of the PLL */ + u8 (*pll_addr)(struct dvb_frontend *fe); + int (*pll_init)(struct dvb_frontend *fe, u8 pll_buf[5]); + int (*pll_set)(struct dvb_frontend *fe, struct dvb_frontend_parameters* params, u8 pll_buf[5]); }; -struct dib3000_xfer_ops +struct dib_fe_xfer_ops { /* pid and transfer handling is done in the demodulator */ int (*pid_parse)(struct dvb_frontend *fe, int onoff); int (*fifo_ctrl)(struct dvb_frontend *fe, int onoff); - int (*pid_ctrl)(struct dvb_frontend *fe, int pid, int onoff); + int (*pid_ctrl)(struct dvb_frontend *fe, int index, int pid, int onoff); + int (*tuner_pass_ctrl)(struct dvb_frontend *fe, int onoff, u8 pll_ctrl); }; extern struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, - struct i2c_adapter* i2c, struct dib3000_xfer_ops *xfer_ops); + struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops); extern struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, - struct i2c_adapter* i2c, struct dib3000_xfer_ops *xfer_ops); + struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops); #endif // DIB3000_H diff -Nru a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c --- a/drivers/media/dvb/frontends/dib3000mb.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/dib3000mb.c 2005-01-28 14:11:40 -08:00 @@ -2,7 +2,7 @@ * Frontend driver for mobile DVB-T demodulator DiBcom 3000-MB * DiBcom (http://www.dibcom.fr/) * - * Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de) + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) * * based on GPL code from DibCom, which has * @@ -29,7 +29,6 @@ #include #include -#include "dvb_frontend.h" #include "dib3000-common.h" #include "dib3000mb_priv.h" #include "dib3000.h" @@ -41,7 +40,7 @@ #ifdef CONFIG_DVB_DIBCOM_DEBUG static int debug; -module_param(debug, int, 0x644); +module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe (|-able))."); #endif #define deb_info(args...) dprintk(0x01,args) @@ -49,6 +48,8 @@ #define deb_setf(args...) dprintk(0x04,args) #define deb_getf(args...) dprintk(0x08,args) +static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr); + static int dib3000mb_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *fep); @@ -61,11 +62,9 @@ int search_state,seq; if (tuner) { - wr(DIB3000MB_REG_TUNER, - DIB3000_TUNER_WRITE_ENABLE(state->config.pll_addr)); - state->config.pll_set(fe, fep); - wr(DIB3000MB_REG_TUNER, - DIB3000_TUNER_WRITE_DISABLE(state->config.pll_addr)); + dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); + state->config.pll_set(fe, fep, NULL); + dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe)); deb_setf("bandwidth: "); switch (ofdm->bandwidth) { @@ -390,11 +389,9 @@ wr(DIB3000MB_REG_DATA_IN_DIVERSITY,DIB3000MB_DATA_DIVERSITY_IN_OFF); if (state->config.pll_init) { - wr(DIB3000MB_REG_TUNER, - DIB3000_TUNER_WRITE_ENABLE(state->config.pll_addr)); - state->config.pll_init(fe); - wr(DIB3000MB_REG_TUNER, - DIB3000_TUNER_WRITE_DISABLE(state->config.pll_addr)); + dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); + state->config.pll_init(fe,NULL); + dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe)); } return 0; @@ -414,6 +411,7 @@ return 0; dds_val = ((rd(DIB3000MB_REG_DDS_VALUE_MSB) & 0xff) << 16) + rd(DIB3000MB_REG_DDS_VALUE_LSB); + deb_getf("DDS_VAL: %x %x %x",dds_val, rd(DIB3000MB_REG_DDS_VALUE_MSB), rd(DIB3000MB_REG_DDS_VALUE_LSB)); if (dds_val < threshold) inv_test1 = 0; else if (dds_val == threshold) @@ -422,6 +420,7 @@ inv_test1 = 2; dds_val = ((rd(DIB3000MB_REG_DDS_FREQ_MSB) & 0xff) << 16) + rd(DIB3000MB_REG_DDS_FREQ_LSB); + deb_getf("DDS_FREQ: %x %x %x",dds_val, rd(DIB3000MB_REG_DDS_FREQ_MSB), rd(DIB3000MB_REG_DDS_FREQ_LSB)); if (dds_val < threshold) inv_test2 = 0; else if (dds_val == threshold) @@ -714,18 +713,11 @@ } /* pid filter and transfer stuff */ -static int dib3000mb_pid_control(struct dvb_frontend *fe,int pid,int onoff) +static int dib3000mb_pid_control(struct dvb_frontend *fe,int index, int pid,int onoff) { struct dib3000_state *state = fe->demodulator_priv; - int index = dib3000_get_pid_index(state->pid_list, DIB3000MB_NUM_PIDS, pid, &state->pid_list_lock,onoff); pid = (onoff ? pid | DIB3000_ACTIVATE_PID_FILTERING : 0); - - if (index >= 0) { wr(index+DIB3000MB_REG_FIRST_PID,pid); - } else { - err("no more pids for filtering."); - return -ENOMEM; - } return 0; } @@ -749,10 +741,21 @@ return 0; } +static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr) +{ + struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; + if (onoff) { + wr(DIB3000MB_REG_TUNER, DIB3000_TUNER_WRITE_ENABLE(pll_addr)); + } else { + wr(DIB3000MB_REG_TUNER, DIB3000_TUNER_WRITE_DISABLE(pll_addr)); + } + return 0; +} + static struct dvb_frontend_ops dib3000mb_ops; struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, - struct i2c_adapter* i2c, struct dib3000_xfer_ops *xfer_ops) + struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops) { struct dib3000_state* state = NULL; @@ -773,9 +776,6 @@ if (rd(DIB3000_REG_DEVICE_ID) != DIB3000MB_DEVICE_ID) goto error; - if (dib3000_init_pid_list(state,DIB3000MB_NUM_PIDS)) - goto error; - /* create dvb_frontend */ state->frontend.ops = &state->ops; state->frontend.demodulator_priv = state; @@ -784,6 +784,7 @@ xfer_ops->pid_parse = dib3000mb_pid_parse; xfer_ops->fifo_ctrl = dib3000mb_fifo_control; xfer_ops->pid_ctrl = dib3000mb_pid_control; + xfer_ops->tuner_pass_ctrl = dib3000mb_tuner_pass_ctrl; return &state->frontend; @@ -807,6 +808,7 @@ FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | + FE_CAN_RECOVER | FE_CAN_HIERARCHY_AUTO, }, diff -Nru a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c --- a/drivers/media/dvb/frontends/dib3000mc.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/dib3000mc.c 2005-01-28 14:11:40 -08:00 @@ -2,9 +2,9 @@ * Frontend driver for mobile DVB-T demodulator DiBcom 3000-MC/P * DiBcom (http://www.dibcom.fr/) * - * Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de) + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) * - * based on GPL code from DibCom, which has + * based on GPL code from DiBCom, which has * * Copyright (C) 2004 Amaury Demol for DiBcom (ademol@dibcom.fr) * @@ -28,7 +28,6 @@ #include #include -#include "dvb_frontend.h" #include "dib3000-common.h" #include "dib3000mc_priv.h" #include "dib3000.h" @@ -40,14 +39,16 @@ #ifdef CONFIG_DVB_DIBCOM_DEBUG static int debug; -module_param(debug, int, 0x644); -MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe (|-able))."); +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe,16=stat (|-able))."); #endif #define deb_info(args...) dprintk(0x01,args) #define deb_xfer(args...) dprintk(0x02,args) #define deb_setf(args...) dprintk(0x04,args) #define deb_getf(args...) dprintk(0x08,args) +#define deb_stat(args...) dprintk(0x10,args) +static int dib3000mc_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr); static int dib3000mc_set_impulse_noise(struct dib3000_state * state, int mode, fe_transmit_mode_t transmission_mode, fe_bandwidth_t bandwidth) @@ -185,46 +186,33 @@ return 0; } -static int dib3000mc_get_frontend(struct dvb_frontend* fe, - struct dvb_frontend_parameters *fep); +static int dib3000mc_set_adp_cfg(struct dib3000_state *state, fe_modulation_t con) +{ + switch (con) { + case QAM_64: + wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[2]); + break; + case QAM_16: + wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[1]); + break; + case QPSK: + wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[0]); + break; + case QAM_AUTO: + break; + default: + warn("unkown constellation."); + break; + } + return 0; +} -static int dib3000mc_set_frontend(struct dvb_frontend* fe, - struct dvb_frontend_parameters *fep, int tuner) +static int dib3000mc_set_general_cfg(struct dib3000_state *state, struct dvb_frontend_parameters *fep, int *auto_val) { - struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; fe_code_rate_t fe_cr = FEC_NONE; - int search_state, seq; - u16 val; u8 fft=0, guard=0, qam=0, alpha=0, sel_hp=0, cr=0, hrch=0; - - if (tuner) { - wr(DIB3000MC_REG_TUNER, - DIB3000_TUNER_WRITE_ENABLE(state->config.pll_addr)); - state->config.pll_set(fe, fep); - wr(DIB3000MC_REG_TUNER, - DIB3000_TUNER_WRITE_DISABLE(state->config.pll_addr)); - } - - dib3000mc_set_timing(state,0,ofdm->transmission_mode,ofdm->bandwidth); - dib3000mc_init_auto_scan(state, ofdm->bandwidth, 0); - - wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_AGC); - wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_OFF); - -/* Default cfg isi offset adp */ - wr_foreach(dib3000mc_reg_offset,dib3000mc_offset[0]); - - wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT | DIB3000MC_ISI_INHIBIT); - wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[1]); - wr(DIB3000MC_REG_UNK_133,DIB3000MC_UNK_133); - - wr_foreach(dib3000mc_reg_bandwidth_general,dib3000mc_bandwidth_general); - if (ofdm->bandwidth == BANDWIDTH_8_MHZ) { - wr_foreach(dib3000mc_reg_bw,dib3000mc_bw[3]); - } else { - wr_foreach(dib3000mc_reg_bw,dib3000mc_bw[0]); - } + int seq; switch (ofdm->transmission_mode) { case TRANSMISSION_MODE_2K: fft = DIB3000_TRANSMISSION_MODE_2K; break; @@ -282,8 +270,7 @@ case INVERSION_OFF: wr(DIB3000MC_REG_SET_DDS_FREQ_MSB,DIB3000MC_DDS_FREQ_MSB_INV_OFF); break; - case INVERSION_AUTO: - break; + case INVERSION_AUTO: /* fall through */ case INVERSION_ON: wr(DIB3000MC_REG_SET_DDS_FREQ_MSB,DIB3000MC_DDS_FREQ_MSB_INV_ON); break; @@ -298,168 +285,12 @@ deb_setf("seq? %d\n", seq); wr(DIB3000MC_REG_SEQ_TPS,DIB3000MC_SEQ_TPS(seq,1)); - - dib3000mc_set_impulse_noise(state,0,ofdm->constellation,ofdm->bandwidth); - - val = rd(DIB3000MC_REG_DEMOD_PARM); - wr(DIB3000MC_REG_DEMOD_PARM,val|DIB3000MC_DEMOD_RST_DEMOD_ON); - wr(DIB3000MC_REG_DEMOD_PARM,val); - - msleep(70); - - wr_foreach(dib3000mc_reg_agc_bandwidth, dib3000mc_agc_bandwidth); - - /* something has to be auto searched */ - if (ofdm->constellation == QAM_AUTO || + *auto_val = ofdm->constellation == QAM_AUTO || ofdm->hierarchy_information == HIERARCHY_AUTO || ofdm->guard_interval == GUARD_INTERVAL_AUTO || ofdm->transmission_mode == TRANSMISSION_MODE_AUTO || fe_cr == FEC_AUTO || - fep->inversion == INVERSION_AUTO - ) { - int as_count=0; - - deb_setf("autosearch enabled.\n"); - - val = rd(DIB3000MC_REG_DEMOD_PARM); - wr(DIB3000MC_REG_DEMOD_PARM,val | DIB3000MC_DEMOD_RST_AUTO_SRCH_ON); - wr(DIB3000MC_REG_DEMOD_PARM,val); - - while ((search_state = dib3000_search_status( - rd(DIB3000MC_REG_AS_IRQ),1)) < 0 && as_count++ < 100) - msleep(10); - - deb_info("search_state after autosearch %d after %d checks\n",search_state,as_count); - - if (search_state == 1) { - struct dvb_frontend_parameters feps; - feps.u.ofdm.bandwidth = ofdm->bandwidth; /* bw is not auto searched */; - if (dib3000mc_get_frontend(fe, &feps) == 0) { - deb_setf("reading tuning data from frontend succeeded.\n"); - return dib3000mc_set_frontend(fe, &feps, 0); - } - } - } else { - wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT|DIB3000MC_ISI_ACTIVATE); - wr_foreach(dib3000mc_reg_adp_cfg,dib3000mc_adp_cfg[qam]); - /* set_offset_cfg */ - wr_foreach(dib3000mc_reg_offset, - dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]); - -// dib3000mc_set_timing(1,ofdm->transmission_mode,ofdm->bandwidth); - -// wr(DIB3000MC_REG_LOCK_MASK,DIB3000MC_ACTIVATE_LOCK_MASK); /* activates some locks if needed */ - -/* set_or(DIB3000MC_REG_DEMOD_PARM,DIB3000MC_DEMOD_RST_AUTO_SRCH_ON); - set_or(DIB3000MC_REG_DEMOD_PARM,DIB3000MC_DEMOD_RST_AUTO_SRCH_OFF); - wr(DIB3000MC_REG_RESTART_VIT,DIB3000MC_RESTART_VIT_ON); - wr(DIB3000MC_REG_RESTART_VIT,DIB3000MC_RESTART_VIT_OFF);*/ - } - - return 0; -} - - -static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) -{ - struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; - - state->timing_offset = 0; - state->timing_offset_comp_done = 0; - - wr(DIB3000MC_REG_ELEC_OUT,DIB3000MC_ELEC_OUT_DIV_OUT_ON); - wr(DIB3000MC_REG_OUTMODE,DIB3000MC_OM_PAR_CONT_CLK); - wr(DIB3000MC_REG_RST_I2C_ADDR, - DIB3000MC_DEMOD_ADDR(state->config.demod_address) | - DIB3000MC_DEMOD_ADDR_ON); - - wr(DIB3000MC_REG_RST_I2C_ADDR, - DIB3000MC_DEMOD_ADDR(state->config.demod_address)); - - wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_CONFIG); - wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_OFF); - - wr(DIB3000MC_REG_CLK_CFG_1,DIB3000MC_CLK_CFG_1_POWER_UP); - wr(DIB3000MC_REG_CLK_CFG_2,DIB3000MC_CLK_CFG_2_PUP_MOBILE); - wr(DIB3000MC_REG_CLK_CFG_3,DIB3000MC_CLK_CFG_3_POWER_UP); - wr(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_INIT); - - wr(DIB3000MC_REG_RST_UNC,DIB3000MC_RST_UNC_OFF); - wr(DIB3000MC_REG_UNK_19,DIB3000MC_UNK_19); - - wr(33,5); - wr(36,81); - wr(DIB3000MC_REG_UNK_88,DIB3000MC_UNK_88); - - wr(DIB3000MC_REG_UNK_99,DIB3000MC_UNK_99); - wr(DIB3000MC_REG_UNK_111,DIB3000MC_UNK_111_PH_N_MODE_0); /* phase noise algo off */ - - /* mobile mode - portable reception */ - wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]); - -/* TUNER_PANASONIC_ENV57H12D5: */ - wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); - wr_foreach(dib3000mc_reg_agc_bandwidth_general,dib3000mc_agc_bandwidth_general); - wr_foreach(dib3000mc_reg_agc,dib3000mc_agc_tuner[1]); - - wr(DIB3000MC_REG_UNK_110,DIB3000MC_UNK_110); - wr(26,0x6680); - wr(DIB3000MC_REG_UNK_1,DIB3000MC_UNK_1); - wr(DIB3000MC_REG_UNK_2,DIB3000MC_UNK_2); - wr(DIB3000MC_REG_UNK_3,DIB3000MC_UNK_3); - wr(DIB3000MC_REG_SEQ_TPS,DIB3000MC_SEQ_TPS_DEFAULT); - - wr_foreach(dib3000mc_reg_bandwidth_general,dib3000mc_bandwidth_general); - wr_foreach(dib3000mc_reg_bandwidth,dib3000mc_bandwidth_8mhz); - - wr(DIB3000MC_REG_UNK_4,DIB3000MC_UNK_4); - - wr(DIB3000MC_REG_SET_DDS_FREQ_MSB,DIB3000MC_DDS_FREQ_MSB_INV_OFF); - wr(DIB3000MC_REG_SET_DDS_FREQ_LSB,DIB3000MC_DDS_FREQ_LSB); - - dib3000mc_set_timing(state,0,TRANSMISSION_MODE_2K,BANDWIDTH_8_MHZ); -// wr_foreach(dib3000mc_reg_timing_freq,dib3000mc_timing_freq[3]); - - wr(DIB3000MC_REG_UNK_120,DIB3000MC_UNK_120); - wr(DIB3000MC_REG_UNK_134,DIB3000MC_UNK_134); - wr(DIB3000MC_REG_FEC_CFG,DIB3000MC_FEC_CFG); - - dib3000mc_set_impulse_noise(state,0,TRANSMISSION_MODE_8K,BANDWIDTH_8_MHZ); - -/* output mode control, just the MPEG2_SLAVE */ - set_or(DIB3000MC_REG_OUTMODE,DIB3000MC_OM_SLAVE); - wr(DIB3000MC_REG_SMO_MODE,DIB3000MC_SMO_MODE_SLAVE); - wr(DIB3000MC_REG_FIFO_THRESHOLD,DIB3000MC_FIFO_THRESHOLD_SLAVE); - wr(DIB3000MC_REG_ELEC_OUT,DIB3000MC_ELEC_OUT_SLAVE); - -/* MPEG2_PARALLEL_CONTINUOUS_CLOCK - wr(DIB3000MC_REG_OUTMODE, - DIB3000MC_SET_OUTMODE(DIB3000MC_OM_PAR_CONT_CLK, - rd(DIB3000MC_REG_OUTMODE))); - - wr(DIB3000MC_REG_SMO_MODE, - DIB3000MC_SMO_MODE_DEFAULT | - DIB3000MC_SMO_MODE_188); - - wr(DIB3000MC_REG_FIFO_THRESHOLD,DIB3000MC_FIFO_THRESHOLD_DEFAULT); - wr(DIB3000MC_REG_ELEC_OUT,DIB3000MC_ELEC_OUT_DIV_OUT_ON); -*/ -/* diversity */ - wr(DIB3000MC_REG_DIVERSITY1,DIB3000MC_DIVERSITY1_DEFAULT); - wr(DIB3000MC_REG_DIVERSITY2,DIB3000MC_DIVERSITY2_DEFAULT); - - wr(DIB3000MC_REG_DIVERSITY3,DIB3000MC_DIVERSITY3_IN_OFF); - - set_or(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_DIV_IN_OFF); - - -/* if (state->config->pll_init) { - wr(DIB3000MC_REG_TUNER, - DIB3000_TUNER_WRITE_ENABLE(state->config->pll_addr)); - state->config->pll_init(fe); - wr(DIB3000MC_REG_TUNER, - DIB3000_TUNER_WRITE_DISABLE(state->config->pll_addr)); - }*/ + fep->inversion == INVERSION_AUTO; return 0; } @@ -476,7 +307,8 @@ if (!(rd(DIB3000MC_REG_LOCK_507) & DIB3000MC_LOCK_507)) return 0; - dds_val = ((rd(DIB3000MC_REG_DDS_FREQ_MSB) & 0xff) << 16) + rd(DIB3000MC_REG_DDS_FREQ_LSB); + dds_val = (rd(DIB3000MC_REG_DDS_FREQ_MSB) << 16) + rd(DIB3000MC_REG_DDS_FREQ_LSB); + deb_getf("DDS_FREQ: %6x\n",dds_val); if (dds_val < threshold) inv_test1 = 0; else if (dds_val == threshold) @@ -484,7 +316,8 @@ else inv_test1 = 2; - dds_val = ((rd(DIB3000MC_REG_SET_DDS_FREQ_MSB) & 0xff) << 16) + rd(DIB3000MC_REG_SET_DDS_FREQ_LSB); + dds_val = (rd(DIB3000MC_REG_SET_DDS_FREQ_MSB) << 16) + rd(DIB3000MC_REG_SET_DDS_FREQ_LSB); + deb_getf("DDS_SET_FREQ: %6x\n",dds_val); if (dds_val < threshold) inv_test2 = 0; else if (dds_val == threshold) @@ -499,6 +332,9 @@ deb_getf("inversion %d %d, %d\n", inv_test2, inv_test1, fep->inversion); + fep->frequency = state->last_tuned_freq; + fep->u.ofdm.bandwidth= state->last_tuned_bw; + tps_val = rd(DIB3000MC_REG_TUNING_PARM); switch (DIB3000MC_TP_QAM(tps_val)) { @@ -614,9 +450,213 @@ err("unexpected transmission mode return by TPS (%d)", tps_val); break; } + deb_getf("\n"); + + return 0; +} + +static int dib3000mc_set_frontend(struct dvb_frontend* fe, + struct dvb_frontend_parameters *fep, int tuner) +{ + struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; + struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; + int search_state,auto_val; + u16 val; + + if (tuner) { /* initial call from dvb */ + dib3000mc_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); + state->config.pll_set(fe,fep,NULL); + dib3000mc_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe)); + + state->last_tuned_freq = fep->frequency; + // if (!scanboost) { + dib3000mc_set_timing(state,0,ofdm->transmission_mode,ofdm->bandwidth); + dib3000mc_init_auto_scan(state, ofdm->bandwidth, 0); + state->last_tuned_bw = ofdm->bandwidth; + + wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); + wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_AGC); + wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_OFF); + + /* Default cfg isi offset adp */ + wr_foreach(dib3000mc_reg_offset,dib3000mc_offset[0]); + + wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT | DIB3000MC_ISI_INHIBIT); + dib3000mc_set_adp_cfg(state,ofdm->constellation); + wr(DIB3000MC_REG_UNK_133,DIB3000MC_UNK_133); + + wr_foreach(dib3000mc_reg_bandwidth_general,dib3000mc_bandwidth_general); + /* power smoothing */ + if (ofdm->bandwidth != BANDWIDTH_8_MHZ) { + wr_foreach(dib3000mc_reg_bw,dib3000mc_bw[0]); + } else { + wr_foreach(dib3000mc_reg_bw,dib3000mc_bw[3]); + } + auto_val = 0; + dib3000mc_set_general_cfg(state,fep,&auto_val); + dib3000mc_set_impulse_noise(state,0,ofdm->constellation,ofdm->bandwidth); + + val = rd(DIB3000MC_REG_DEMOD_PARM); + wr(DIB3000MC_REG_DEMOD_PARM,val|DIB3000MC_DEMOD_RST_DEMOD_ON); + wr(DIB3000MC_REG_DEMOD_PARM,val); + // } + msleep(70); + + /* something has to be auto searched */ + if (auto_val) { + int as_count=0; + + deb_setf("autosearch enabled.\n"); + + val = rd(DIB3000MC_REG_DEMOD_PARM); + wr(DIB3000MC_REG_DEMOD_PARM,val | DIB3000MC_DEMOD_RST_AUTO_SRCH_ON); + wr(DIB3000MC_REG_DEMOD_PARM,val); + + while ((search_state = dib3000_search_status( + rd(DIB3000MC_REG_AS_IRQ),1)) < 0 && as_count++ < 100) + msleep(10); + + deb_info("search_state after autosearch %d after %d checks\n",search_state,as_count); + + if (search_state == 1) { + struct dvb_frontend_parameters feps; + if (dib3000mc_get_frontend(fe, &feps) == 0) { + deb_setf("reading tuning data from frontend succeeded.\n"); + return dib3000mc_set_frontend(fe, &feps, 0); + } + } + } else { + dib3000mc_set_impulse_noise(state,0,ofdm->transmission_mode,ofdm->bandwidth); + wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT|DIB3000MC_ISI_ACTIVATE); + dib3000mc_set_adp_cfg(state,ofdm->constellation); + + /* set_offset_cfg */ + wr_foreach(dib3000mc_reg_offset, + dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]); + } + } else { /* second call, after autosearch (fka: set_WithKnownParams) */ +// dib3000mc_set_timing(state,1,ofdm->transmission_mode,ofdm->bandwidth); + + auto_val = 0; + dib3000mc_set_general_cfg(state,fep,&auto_val); + if (auto_val) + deb_info("auto_val is true, even though an auto search was already performed.\n"); + + dib3000mc_set_impulse_noise(state,0,ofdm->constellation,ofdm->bandwidth); + + val = rd(DIB3000MC_REG_DEMOD_PARM); + wr(DIB3000MC_REG_DEMOD_PARM,val | DIB3000MC_DEMOD_RST_AUTO_SRCH_ON); + wr(DIB3000MC_REG_DEMOD_PARM,val); + + msleep(30); + + wr(DIB3000MC_REG_ISI,DIB3000MC_ISI_DEFAULT|DIB3000MC_ISI_ACTIVATE); + dib3000mc_set_adp_cfg(state,ofdm->constellation); + wr_foreach(dib3000mc_reg_offset, + dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]); + + + } return 0; } +static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) +{ + struct dib3000_state *state; + + deb_info("init start\n"); + + state = fe->demodulator_priv; + state->timing_offset = 0; + state->timing_offset_comp_done = 0; + + wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_CONFIG); + wr(DIB3000MC_REG_RESTART,DIB3000MC_RESTART_OFF); + wr(DIB3000MC_REG_CLK_CFG_1,DIB3000MC_CLK_CFG_1_POWER_UP); + wr(DIB3000MC_REG_CLK_CFG_2,DIB3000MC_CLK_CFG_2_PUP_MOBILE); + wr(DIB3000MC_REG_CLK_CFG_3,DIB3000MC_CLK_CFG_3_POWER_UP); + wr(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_INIT); + + wr(DIB3000MC_REG_RST_UNC,DIB3000MC_RST_UNC_OFF); + wr(DIB3000MC_REG_UNK_19,DIB3000MC_UNK_19); + + wr(33,5); + wr(36,81); + wr(DIB3000MC_REG_UNK_88,DIB3000MC_UNK_88); + + wr(DIB3000MC_REG_UNK_99,DIB3000MC_UNK_99); + wr(DIB3000MC_REG_UNK_111,DIB3000MC_UNK_111_PH_N_MODE_0); /* phase noise algo off */ + + /* mobile mode - portable reception */ + wr_foreach(dib3000mc_reg_mobile_mode,dib3000mc_mobile_mode[1]); + +/* TUNER_PANASONIC_ENV57H12D5: */ + wr_foreach(dib3000mc_reg_agc_bandwidth,dib3000mc_agc_bandwidth); + wr_foreach(dib3000mc_reg_agc_bandwidth_general,dib3000mc_agc_bandwidth_general); + wr_foreach(dib3000mc_reg_agc,dib3000mc_agc_tuner[1]); + + wr(DIB3000MC_REG_UNK_110,DIB3000MC_UNK_110); + wr(26,0x6680); + wr(DIB3000MC_REG_UNK_1,DIB3000MC_UNK_1); + wr(DIB3000MC_REG_UNK_2,DIB3000MC_UNK_2); + wr(DIB3000MC_REG_UNK_3,DIB3000MC_UNK_3); + wr(DIB3000MC_REG_SEQ_TPS,DIB3000MC_SEQ_TPS_DEFAULT); + + wr_foreach(dib3000mc_reg_bandwidth,dib3000mc_bandwidth_8mhz); + wr_foreach(dib3000mc_reg_bandwidth_general,dib3000mc_bandwidth_general); + + wr(DIB3000MC_REG_UNK_4,DIB3000MC_UNK_4); + + wr(DIB3000MC_REG_SET_DDS_FREQ_MSB,DIB3000MC_DDS_FREQ_MSB_INV_OFF); + wr(DIB3000MC_REG_SET_DDS_FREQ_LSB,DIB3000MC_DDS_FREQ_LSB); + + dib3000mc_set_timing(state,0,TRANSMISSION_MODE_8K,BANDWIDTH_8_MHZ); +// wr_foreach(dib3000mc_reg_timing_freq,dib3000mc_timing_freq[3]); + + wr(DIB3000MC_REG_UNK_120,DIB3000MC_UNK_120); + wr(DIB3000MC_REG_UNK_134,DIB3000MC_UNK_134); + wr(DIB3000MC_REG_FEC_CFG,DIB3000MC_FEC_CFG); + + wr(DIB3000MC_REG_DIVERSITY3,DIB3000MC_DIVERSITY3_IN_OFF); + + dib3000mc_set_impulse_noise(state,0,TRANSMISSION_MODE_8K,BANDWIDTH_8_MHZ); + +/* output mode control, just the MPEG2_SLAVE */ +// set_or(DIB3000MC_REG_OUTMODE,DIB3000MC_OM_SLAVE); + wr(DIB3000MC_REG_OUTMODE,DIB3000MC_OM_SLAVE); + wr(DIB3000MC_REG_SMO_MODE,DIB3000MC_SMO_MODE_SLAVE); + wr(DIB3000MC_REG_FIFO_THRESHOLD,DIB3000MC_FIFO_THRESHOLD_SLAVE); + wr(DIB3000MC_REG_ELEC_OUT,DIB3000MC_ELEC_OUT_SLAVE); + +/* MPEG2_PARALLEL_CONTINUOUS_CLOCK + wr(DIB3000MC_REG_OUTMODE, + DIB3000MC_SET_OUTMODE(DIB3000MC_OM_PAR_CONT_CLK, + rd(DIB3000MC_REG_OUTMODE))); + + wr(DIB3000MC_REG_SMO_MODE, + DIB3000MC_SMO_MODE_DEFAULT | + DIB3000MC_SMO_MODE_188); + + wr(DIB3000MC_REG_FIFO_THRESHOLD,DIB3000MC_FIFO_THRESHOLD_DEFAULT); + wr(DIB3000MC_REG_ELEC_OUT,DIB3000MC_ELEC_OUT_DIV_OUT_ON); +*/ + +/* diversity */ + wr(DIB3000MC_REG_DIVERSITY1,DIB3000MC_DIVERSITY1_DEFAULT); + wr(DIB3000MC_REG_DIVERSITY2,DIB3000MC_DIVERSITY2_DEFAULT); + + set_and(DIB3000MC_REG_DIVERSITY3,DIB3000MC_DIVERSITY3_IN_OFF); + + set_or(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_DIV_IN_OFF); + +/* if (state->config->pll_init) { + dib3000mc_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); + state->config->pll_init(fe,NULL); + dib3000mc_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe)); + }*/ + deb_info("init end\n"); + return 0; +} static int dib3000mc_read_status(struct dvb_frontend* fe, fe_status_t *stat) { struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; @@ -627,12 +667,12 @@ *stat |= FE_HAS_SIGNAL; if (DIB3000MC_CARRIER_LOCK(lock)) *stat |= FE_HAS_CARRIER; - if (DIB3000MC_TPS_LOCK(lock)) /* VIT_LOCK ? */ + if (DIB3000MC_TPS_LOCK(lock)) *stat |= FE_HAS_VITERBI; if (DIB3000MC_MPEG_SYNC_LOCK(lock)) *stat |= (FE_HAS_SYNC | FE_HAS_LOCK); - deb_info("actual status is %2x\n",*stat); + deb_stat("actual status is %2x fifo_level: %x,244: %x, 206: %x, 207: %x, 1040: %x\n",*stat,rd(510),rd(244),rd(206),rd(207),rd(1040)); return 0; } @@ -659,7 +699,7 @@ u16 val = rd(DIB3000MC_REG_SIGNAL_NOISE_LSB); *strength = (((val >> 6) & 0xff) << 8) + (val & 0x3f); - deb_info("signal: mantisse = %d, exponent = %d\n",(*strength >> 8) & 0xff, *strength & 0xff); + deb_stat("signal: mantisse = %d, exponent = %d\n",(*strength >> 8) & 0xff, *strength & 0xff); return 0; } @@ -667,9 +707,8 @@ static int dib3000mc_read_snr(struct dvb_frontend* fe, u16 *snr) { struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; - - u16 val = rd(DIB3000MC_REG_SIGNAL_NOISE_MSB), - val2 = rd(DIB3000MC_REG_SIGNAL_NOISE_LSB); + u16 val = rd(DIB3000MC_REG_SIGNAL_NOISE_LSB), + val2 = rd(DIB3000MC_REG_SIGNAL_NOISE_MSB); u16 sig,noise; sig = (((val >> 6) & 0xff) << 8) + (val & 0x3f); @@ -679,9 +718,9 @@ else *snr = (u16) sig/noise; - deb_info("signal: mantisse = %d, exponent = %d\n",(sig >> 8) & 0xff, sig & 0xff); - deb_info("noise: mantisse = %d, exponent = %d\n",(noise >> 8) & 0xff, noise & 0xff); - deb_info("snr: %d\n",*snr); + deb_stat("signal: mantisse = %d, exponent = %d\n",(sig >> 8) & 0xff, sig & 0xff); + deb_stat("noise: mantisse = %d, exponent = %d\n",(noise >> 8) & 0xff, noise & 0xff); + deb_stat("snr: %d\n",*snr); return 0; } @@ -698,7 +737,7 @@ static int dib3000mc_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune) { - tune->min_delay_ms = 800; + tune->min_delay_ms = 2000; tune->step_size = 166667; tune->max_drift = 166667 * 2; @@ -718,23 +757,15 @@ static void dib3000mc_release(struct dvb_frontend* fe) { struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; - dib3000_dealloc_pid_list(state); kfree(state); } /* pid filter and transfer stuff */ -static int dib3000mc_pid_control(struct dvb_frontend *fe,int pid,int onoff) +static int dib3000mc_pid_control(struct dvb_frontend *fe,int index, int pid,int onoff) { struct dib3000_state *state = fe->demodulator_priv; - int index = dib3000_get_pid_index(state->pid_list, DIB3000MC_NUM_PIDS, pid, &state->pid_list_lock,onoff); pid = (onoff ? pid | DIB3000_ACTIVATE_PID_FILTERING : 0); - - if (index >= 0) { wr(index+DIB3000MC_REG_FIRST_PID,pid); - } else { - err("no more pids for filtering."); - return -ENOMEM; - } return 0; } @@ -742,10 +773,14 @@ { struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; u16 tmp = rd(DIB3000MC_REG_SMO_MODE); - deb_xfer("%s fifo",onoff ? "enabling" : "disabling"); + + deb_xfer("%s fifo\n",onoff ? "enabling" : "disabling"); + if (onoff) { + deb_xfer("%d %x\n",tmp & DIB3000MC_SMO_MODE_FIFO_UNFLUSH,tmp & DIB3000MC_SMO_MODE_FIFO_UNFLUSH); wr(DIB3000MC_REG_SMO_MODE,tmp & DIB3000MC_SMO_MODE_FIFO_UNFLUSH); } else { + deb_xfer("%d %x\n",tmp | DIB3000MC_SMO_MODE_FIFO_FLUSH,tmp | DIB3000MC_SMO_MODE_FIFO_FLUSH); wr(DIB3000MC_REG_SMO_MODE,tmp | DIB3000MC_SMO_MODE_FIFO_FLUSH); } return 0; @@ -755,19 +790,57 @@ { struct dib3000_state *state = fe->demodulator_priv; u16 tmp = rd(DIB3000MC_REG_SMO_MODE); - deb_xfer("%s pid parsing",onoff ? "enabling" : "disabling"); + + deb_xfer("%s pid parsing\n",onoff ? "enabling" : "disabling"); + if (onoff) { + deb_xfer("%d %x\n",tmp | DIB3000MC_SMO_MODE_PID_PARSE,tmp | DIB3000MC_SMO_MODE_PID_PARSE); wr(DIB3000MC_REG_SMO_MODE,tmp | DIB3000MC_SMO_MODE_PID_PARSE); } else { + deb_xfer("%d %x\n",tmp & DIB3000MC_SMO_MODE_NO_PID_PARSE,tmp & DIB3000MC_SMO_MODE_NO_PID_PARSE); wr(DIB3000MC_REG_SMO_MODE,tmp & DIB3000MC_SMO_MODE_NO_PID_PARSE); } return 0; } +static int dib3000mc_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr) +{ + struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; + if (onoff) { + wr(DIB3000MC_REG_TUNER, DIB3000_TUNER_WRITE_ENABLE(pll_addr)); + } else { + wr(DIB3000MC_REG_TUNER, DIB3000_TUNER_WRITE_DISABLE(pll_addr)); + } + return 0; +} + +static int dib3000mc_demod_init(struct dib3000_state *state) +{ + u16 default_addr = 0x0a; + /* first init */ + if (state->config.demod_address != default_addr) { + deb_info("initializing the demod the first time. Setting demod addr to 0x%x\n",default_addr); + wr(DIB3000MC_REG_ELEC_OUT,DIB3000MC_ELEC_OUT_DIV_OUT_ON); + wr(DIB3000MC_REG_OUTMODE,DIB3000MC_OM_PAR_CONT_CLK); + + wr(DIB3000MC_REG_RST_I2C_ADDR, + DIB3000MC_DEMOD_ADDR(default_addr) | + DIB3000MC_DEMOD_ADDR_ON); + + state->config.demod_address = default_addr; + + wr(DIB3000MC_REG_RST_I2C_ADDR, + DIB3000MC_DEMOD_ADDR(default_addr)); + } else + deb_info("demod is already initialized. Demod addr: 0x%x\n",state->config.demod_address); + return 0; +} + + static struct dvb_frontend_ops dib3000mc_ops; struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, - struct i2c_adapter* i2c, struct dib3000_xfer_ops *xfer_ops) + struct i2c_adapter* i2c, struct dib_fe_xfer_ops *xfer_ops) { struct dib3000_state* state = NULL; u16 devid; @@ -790,19 +863,15 @@ if (devid != DIB3000MC_DEVICE_ID && devid != DIB3000P_DEVICE_ID) goto error; - switch (devid) { case DIB3000MC_DEVICE_ID: - info("Found a DiBcom 3000-MC."); + info("Found a DiBcom 3000-MC, interesting..."); break; case DIB3000P_DEVICE_ID: info("Found a DiBcom 3000-P."); break; } - if (dib3000_init_pid_list(state,DIB3000MC_NUM_PIDS)) - goto error; - /* create dvb_frontend */ state->frontend.ops = &state->ops; state->frontend.demodulator_priv = state; @@ -811,6 +880,9 @@ xfer_ops->pid_parse = dib3000mc_pid_parse; xfer_ops->fifo_ctrl = dib3000mc_fifo_control; xfer_ops->pid_ctrl = dib3000mc_pid_control; + xfer_ops->tuner_pass_ctrl = dib3000mc_tuner_pass_ctrl; + + dib3000mc_demod_init(state); return &state->frontend; @@ -834,6 +906,7 @@ FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | + FE_CAN_RECOVER | FE_CAN_HIERARCHY_AUTO, }, diff -Nru a/drivers/media/dvb/frontends/dib3000mc_priv.h b/drivers/media/dvb/frontends/dib3000mc_priv.h --- a/drivers/media/dvb/frontends/dib3000mc_priv.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/dib3000mc_priv.h 2005-01-28 14:11:40 -08:00 @@ -13,31 +13,6 @@ #ifndef __DIB3000MC_PRIV_H__ #define __DIB3000MC_PRIV_H__ -/* info and err, taken from usb.h, if there is anything available like by default, - * please change ! - */ -#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , __FILE__ , ## arg) -#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , __FILE__ , ## arg) -#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , __FILE__ , ## arg) - -// defines the phase noise algorithm to be used (O:Inhib, 1:CPE on) -#define DEF_PHASE_NOISE_MODE 0 - -// define Mobille algorithms -#define DEF_MOBILE_MODE Auto_Reception - -// defines the tuner type -#define DEF_TUNER_TYPE TUNER_PANASONIC_ENV57H13D5 - -// defines the impule noise algorithm to be used -#define DEF_IMPULSE_NOISE_MODE 0 - -// defines the MPEG2 data output format -#define DEF_MPEG2_OUTPUT_188 0 - -// defines the MPEG2 data output format -#define DEF_OUTPUT_MODE MPEG2_PARALLEL_CONTINUOUS_CLOCK - /* * Demodulator parameters * reg: 0 1 1 1 11 11 111 @@ -115,7 +90,7 @@ { 0x1c, 0xfba5, 0x60, 0x9c25, 0x1e3, 0x0cb7, 0x1, 0xb0d0 }; static u16 dib3000mc_bandwidth_8mhz[] = - { 0x19, 0x5c30, 0x54, 0x88a0, 0x1a6, 0xab20, 0x1, 0xb0b0 }; + { 0x19, 0x5c30, 0x54, 0x88a0, 0x1a6, 0xab20, 0x1, 0xb0d0 }; static u16 dib3000mc_reg_bandwidth_general[] = { 12,13,14,15 }; static u16 dib3000mc_bandwidth_general[] = { 0x0000, 0x03e8, 0x0000, 0x03f2 }; @@ -173,11 +148,11 @@ static u16 dib3000mc_reg_imp_noise_ctl[] = { 34,35 }; static u16 dib3000mc_imp_noise_ctl[][2] = { - { 0x1294, 0xfff8 }, /* mode 0 */ - { 0x1294, 0xfff8 }, /* mode 1 */ - { 0x1294, 0xfff8 }, /* mode 2 */ - { 0x1294, 0xfff8 }, /* mode 3 */ - { 0x1294, 0xfff8 }, /* mode 4 */ + { 0x1294, 0x1ff8 }, /* mode 0 */ + { 0x1294, 0x1ff8 }, /* mode 1 */ + { 0x1294, 0x1ff8 }, /* mode 2 */ + { 0x1294, 0x1ff8 }, /* mode 3 */ + { 0x1294, 0x1ff8 }, /* mode 4 */ }; /* AGC registers */ @@ -314,12 +289,26 @@ #define DIB3000MC_REG_FEC_CFG ( 195) #define DIB3000MC_FEC_CFG ( 0x10) +/* + * reg 206, output mode + * 1111 1111 + * |||| |||| + * |||| |||+- unk + * |||| ||+-- unk + * |||| |+--- unk (on by default) + * |||| +---- fifo_ctrl (1 = inhibit (flushed), 0 = active (unflushed)) + * |||+------ pid_parse (1 = enabled, 0 = disabled) + * ||+------- outp_188 (1 = TS packet size 188, 0 = packet size 204) + * |+-------- unk + * +--------- unk + */ + #define DIB3000MC_REG_SMO_MODE ( 206) #define DIB3000MC_SMO_MODE_DEFAULT (1 << 2) #define DIB3000MC_SMO_MODE_FIFO_FLUSH (1 << 3) -#define DIB3000MC_SMO_MODE_FIFO_UNFLUSH ~DIB3000MC_SMO_MODE_FIFO_FLUSH +#define DIB3000MC_SMO_MODE_FIFO_UNFLUSH (0xfff7) #define DIB3000MC_SMO_MODE_PID_PARSE (1 << 4) -#define DIB3000MC_SMO_MODE_NO_PID_PARSE ~DIB3000MC_SMO_MODE_PID_PARSE +#define DIB3000MC_SMO_MODE_NO_PID_PARSE (0xffef) #define DIB3000MC_SMO_MODE_188 (1 << 5) #define DIB3000MC_SMO_MODE_SLAVE (DIB3000MC_SMO_MODE_DEFAULT | \ DIB3000MC_SMO_MODE_188 | DIB3000MC_SMO_MODE_PID_PARSE | (1<<1)) @@ -392,7 +381,7 @@ #define DIB3000MC_REG_RST_I2C_ADDR ( 1024) #define DIB3000MC_DEMOD_ADDR_ON ( 1) -#define DIB3000MC_DEMOD_ADDR(a) ((a << 3) & 0x03F0) +#define DIB3000MC_DEMOD_ADDR(a) ((a << 4) & 0x03F0) #define DIB3000MC_REG_RESTART ( 1027) #define DIB3000MC_RESTART_OFF (0x0000) diff -Nru a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c --- a/drivers/media/dvb/frontends/mt352.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/mt352.c 2005-01-28 14:11:40 -08:00 @@ -58,16 +58,26 @@ if (debug) printk(KERN_DEBUG "mt352: " args); \ } while (0) -int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen) +static int mt352_single_write(struct dvb_frontend *fe, u8 reg, u8 val) { struct mt352_state* state = (struct mt352_state*) fe->demodulator_priv; + u8 buf[2] = { reg, val }; struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, - .buf = ibuf, .len = ilen }; + .buf = buf, .len = 2 }; int err = i2c_transfer(state->i2c, &msg, 1); if (err != 1) { - dprintk("mt352_write() failed (err = %d)!\n", err); + dprintk("mt352_write() to reg %x failed (err = %d)!\n", reg, err); return err; } + return 0; +} + +int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen) +{ + int err,i; + for (i=0; i < ilen-1; i++) + if ((err = mt352_single_write(fe,ibuf[0]+i,ibuf[i+1]))) + return err; return 0; } @@ -92,9 +102,10 @@ return b1[0]; } - - - +u8 mt352_read(struct dvb_frontend *fe, u8 reg) +{ + return mt352_read_register(fe->demodulator_priv,reg); +} @@ -556,3 +567,4 @@ EXPORT_SYMBOL(mt352_attach); EXPORT_SYMBOL(mt352_write); +EXPORT_SYMBOL(mt352_read); diff -Nru a/drivers/media/dvb/frontends/mt352.h b/drivers/media/dvb/frontends/mt352.h --- a/drivers/media/dvb/frontends/mt352.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/frontends/mt352.h 2005-01-28 14:11:41 -08:00 @@ -54,5 +54,6 @@ struct i2c_adapter* i2c); extern int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen); +extern u8 mt352_read(struct dvb_frontend *fe, u8 reg); #endif // MT352_H diff -Nru a/drivers/media/dvb/frontends/nxt2002.c b/drivers/media/dvb/frontends/nxt2002.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/media/dvb/frontends/nxt2002.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,670 @@ +/* + Support for B2C2/BBTI Technisat Air2PC - ATSC + + Copyright (C) 2004 Taylor Jacob + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/* + * This driver needs external firmware. Please use the command + * "/Documentation/dvb/get_dvb_firmware nxt2002" to + * download/extract it, and then copy it to /usr/lib/hotplug/firmware. + */ +#define NXT2002_DEFAULT_FIRMWARE "dvb-fe-nxt2002.fw" +#define CRC_CCIT_MASK 0x1021 + +#include +#include +#include +#include +#include + +#include "dvb_frontend.h" +#include "nxt2002.h" + +struct nxt2002_state { + + struct i2c_adapter* i2c; + struct dvb_frontend_ops ops; + const struct nxt2002_config* config; + struct dvb_frontend frontend; + + /* demodulator private data */ + u8 initialised:1; +}; + +static int debug; +#define dprintk(args...) \ + do { \ + if (debug) printk(KERN_DEBUG "nxt2002: " args); \ + } while (0) + +static int i2c_writebytes (struct nxt2002_state* state, u8 reg, u8 *buf, u8 len) +{ + /* probbably a much better way or doing this */ + u8 buf2 [256],x; + int err; + struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf2, .len = len + 1 }; + + buf2[0] = reg; + for (x = 0 ; x < len ; x++) + buf2[x+1] = buf[x]; + + if ((err = i2c_transfer (state->i2c, &msg, 1)) != 1) { + printk ("%s: i2c write error (addr %02x, err == %i)\n", + __FUNCTION__, state->config->demod_address, err); + return -EREMOTEIO; + } + + return 0; +} + +static u8 i2c_readbytes (struct nxt2002_state* state, u8 reg, u8* buf, u8 len) +{ + u8 reg2 [] = { reg }; + + struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = reg2, .len = 1 }, + { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = buf, .len = len } }; + + int err; + + if ((err = i2c_transfer (state->i2c, msg, 2)) != 2) { + printk ("%s: i2c read error (addr %02x, err == %i)\n", + __FUNCTION__, state->config->demod_address, err); + return -EREMOTEIO; + } + + return 0; +} + +static u16 nxt2002_crc(u16 crc, u8 c) +{ + + u8 i; + u16 input = (u16) c & 0xFF; + + input<<=8; + for(i=0 ;i<8 ;i++) { + if((crc ^ input) & 0x8000) + crc=(crc<<1)^CRC_CCIT_MASK; + else + crc<<=1; + input<<=1; + } + return crc; +} + +static int nxt2002_writereg_multibyte (struct nxt2002_state* state, u8 reg, u8* data, u8 len) +{ + u8 buf; + dprintk("%s\n", __FUNCTION__); + + /* set multi register length */ + i2c_writebytes(state,0x34,&len,1); + + /* set mutli register register */ + i2c_writebytes(state,0x35,®,1); + + /* send the actual data */ + i2c_writebytes(state,0x36,data,len); + + /* toggle the multireg write bit*/ + buf = 0x02; + i2c_writebytes(state,0x21,&buf,1); + + i2c_readbytes(state,0x21,&buf,1); + + if ((buf & 0x02) == 0) + return 0; + + dprintk("Error writing multireg register %02X\n",reg); + + return 0; +} + +static int nxt2002_readreg_multibyte (struct nxt2002_state* state, u8 reg, u8* data, u8 len) +{ + u8 len2; + dprintk("%s\n", __FUNCTION__); + + /* set multi register length */ + len2 = len & 0x80; + i2c_writebytes(state,0x34,&len2,1); + + /* set mutli register register */ + i2c_writebytes(state,0x35,®,1); + + /* send the actual data */ + i2c_readbytes(state,reg,data,len); + + return 0; +} + +static void nxt2002_microcontroller_stop (struct nxt2002_state* state) +{ + u8 buf[2],counter = 0; + dprintk("%s\n", __FUNCTION__); + + buf[0] = 0x80; + i2c_writebytes(state,0x22,buf,1); + + while (counter < 20) { + i2c_readbytes(state,0x31,buf,1); + if (buf[0] & 0x40) + return; + msleep(10); + counter++; + } + + dprintk("Timeout waiting for micro to stop.. This is ok after firmware upload\n"); + return; +} + +static void nxt2002_microcontroller_start (struct nxt2002_state* state) +{ + u8 buf; + dprintk("%s\n", __FUNCTION__); + + buf = 0x00; + i2c_writebytes(state,0x22,&buf,1); +} + +static int nxt2002_writetuner (struct nxt2002_state* state, u8* data) +{ + u8 buf,count = 0; + + dprintk("Tuner Bytes: %02X %02X %02X %02X\n",data[0],data[1],data[2],data[3]); + + dprintk("%s\n", __FUNCTION__); + /* stop the micro first */ + nxt2002_microcontroller_stop(state); + + /* set the i2c transfer speed to the tuner */ + buf = 0x03; + i2c_writebytes(state,0x20,&buf,1); + + /* setup to transfer 4 bytes via i2c */ + buf = 0x04; + i2c_writebytes(state,0x34,&buf,1); + + /* write actual tuner bytes */ + i2c_writebytes(state,0x36,data,4); + + /* set tuner i2c address */ + buf = 0xC2; + i2c_writebytes(state,0x35,&buf,1); + + /* write UC Opmode to begin transfer */ + buf = 0x80; + i2c_writebytes(state,0x21,&buf,1); + + while (count < 20) { + i2c_readbytes(state,0x21,&buf,1); + if ((buf & 0x80)== 0x00) + return 0; + msleep(100); + count++; + } + + printk("nxt2002: timeout error writing tuner\n"); + return 0; +} + +static void nxt2002_agc_reset(struct nxt2002_state* state) +{ + u8 buf; + dprintk("%s\n", __FUNCTION__); + + buf = 0x08; + i2c_writebytes(state,0x08,&buf,1); + + buf = 0x00; + i2c_writebytes(state,0x08,&buf,1); + + return; +} + +static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware *fw) +{ + + struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; + u8 buf[256],written = 0,chunkpos = 0; + u16 rambase,position,crc = 0; + + dprintk("%s\n", __FUNCTION__); + dprintk("Firmware is %d bytes\n",fw->size); + + /* Get the RAM base for this nxt2002 */ + i2c_readbytes(state,0x10,buf,1); + + + if (buf[0] & 0x10) + rambase = 0x1000; + else + rambase = 0x0000; + + dprintk("rambase on this nxt2002 is %04X\n",rambase); + + /* Hold the micro in reset while loading firmware */ + buf[0] = 0x80; + i2c_writebytes(state,0x2B,buf,1); + + + for (position = 0; position < fw->size ; position++) { + if (written == 0) { + crc = 0; + chunkpos = 0x28; + buf[0] = ((rambase + position) >> 8); + buf[1] = (rambase + position) & 0xFF; + buf[2] = 0x81; + /* write starting address */ + i2c_writebytes(state,0x29,buf,3); + } + written++; + chunkpos++; + + if ((written % 4) == 0) + i2c_writebytes(state,chunkpos,&fw->data[position-3],4); + + crc = nxt2002_crc(crc,fw->data[position]); + + + if ((written == 255) || (position+1 == fw->size)) { + /* write remaining bytes of firmware */ + i2c_writebytes(state, chunkpos+4-(written %4), + &fw->data[position-(written %4) + 1], + written %4); + buf[0] = crc << 8; + buf[1] = crc & 0xFF; + + /* write crc */ + i2c_writebytes(state,0x2C,buf,2); + + /* do a read to stop things */ + i2c_readbytes(state,0x2A,buf,1); + + /* set transfer mode to complete */ + buf[0] = 0x80; + i2c_writebytes(state,0x2B,buf,1); + + written = 0; + } + } + + printk ("done.\n"); + return 0; +}; + + +static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, + struct dvb_frontend_parameters *p) +{ + struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; + u32 freq = 0; + u16 tunerfreq = 0; + u8 buf[4]; + + freq = 44000 + ( p->frequency / 1000 ); + + dprintk("freq = %d p->frequency = %d\n",freq,p->frequency); + + tunerfreq = freq * 24/4000; + + buf[0] = (tunerfreq >> 8) & 0x7F; + buf[1] = (tunerfreq & 0xFF); + + if (p->frequency <= 214000000) { + buf[2] = 0x84 + (0x06 << 3); + buf[3] = (p->frequency <= 172000000) ? 0x01 : 0x02; + } else if (p->frequency <= 721000000) { + buf[2] = 0x84 + (0x07 << 3); + buf[3] = (p->frequency <= 467000000) ? 0x02 : 0x08; + } else if (p->frequency <= 841000000) { + buf[2] = 0x84 + (0x0E << 3); + buf[3] = 0x08; + } else { + buf[2] = 0x84 + (0x0F << 3); + buf[3] = 0x02; + } + + /* write frequency information */ + nxt2002_writetuner(state,buf); + + /* reset the agc now that tuning has been completed */ + nxt2002_agc_reset(state); + + /* set target power level */ + buf[0] = 0x70; + i2c_writebytes(state,0x42,buf,1); + + /* configure sdm */ + buf[0] = 0x87; + i2c_writebytes(state,0x57,buf,1); + + /* write sdm1 input */ + buf[0] = 0x10; + buf[1] = 0x00; + nxt2002_writereg_multibyte(state,0x58,buf,2); + + /* write sdmx input */ + buf[0] = 0x60; + buf[1] = 0x00; + nxt2002_writereg_multibyte(state,0x5C,buf,2); + + /* write adc power lpf fc */ + buf[0] = 0x05; + i2c_writebytes(state,0x43,buf,1); + + /* write adc power lpf fc */ + buf[0] = 0x05; + i2c_writebytes(state,0x43,buf,1); + + /* write accumulator2 input */ + buf[0] = 0x80; + buf[1] = 0x00; + nxt2002_writereg_multibyte(state,0x4B,buf,2); + + /* write kg1 */ + buf[0] = 0x00; + i2c_writebytes(state,0x4D,buf,1); + + /* write sdm12 lpf fc */ + buf[0] = 0x44; + i2c_writebytes(state,0x55,buf,1); + + /* write agc control reg */ + buf[0] = 0x04; + i2c_writebytes(state,0x41,buf,1); + + /* write agc ucgp0 */ + buf[0] = 0x00; + i2c_writebytes(state,0x30,buf,1); + + /* write agc control reg */ + buf[0] = 0x00; + i2c_writebytes(state,0x41,buf,1); + + /* write accumulator2 input */ + buf[0] = 0x80; + buf[1] = 0x00; + nxt2002_writereg_multibyte(state,0x49,buf,2); + nxt2002_writereg_multibyte(state,0x4B,buf,2); + + /* write agc control reg */ + buf[0] = 0x04; + i2c_writebytes(state,0x41,buf,1); + + nxt2002_microcontroller_start(state); + + /* adjacent channel detection should be done here, but I don't + have any stations with this need so I cannot test it */ + + return 0; +} + +static int nxt2002_read_status(struct dvb_frontend* fe, fe_status_t* status) +{ + struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; + u8 lock; + i2c_readbytes(state,0x31,&lock,1); + + *status = 0; + if (lock & 0x20) { + *status |= FE_HAS_SIGNAL; + *status |= FE_HAS_CARRIER; + *status |= FE_HAS_VITERBI; + *status |= FE_HAS_SYNC; + *status |= FE_HAS_LOCK; + } + return 0; +} + +static int nxt2002_read_ber(struct dvb_frontend* fe, u32* ber) +{ + struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; + u8 b[3]; + + nxt2002_readreg_multibyte(state,0xE6,b,3); + + *ber = ((b[0] << 8) + b[1]) * 8; + + return 0; +} + +static int nxt2002_read_signal_strength(struct dvb_frontend* fe, u16* strength) +{ + struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; + u8 b[2]; + u16 temp = 0; + + /* setup to read cluster variance */ + b[0] = 0x00; + i2c_writebytes(state,0xA1,b,1); + + /* get multreg val */ + nxt2002_readreg_multibyte(state,0xA6,b,2); + + temp = (b[0] << 8) | b[1]; + *strength = ((0x7FFF - temp) & 0x0FFF) * 16; + + return 0; +} + +static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr) +{ + + struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; + u8 b[2]; + u16 temp = 0, temp2; + u32 snrdb = 0; + + /* setup to read cluster variance */ + b[0] = 0x00; + i2c_writebytes(state,0xA1,b,1); + + /* get multreg val from 0xA6 */ + nxt2002_readreg_multibyte(state,0xA6,b,2); + + temp = (b[0] << 8) | b[1]; + temp2 = 0x7FFF - temp; + + /* snr will be in db */ + if (temp2 > 0x7F00) + snrdb = 1000*24 + ( 1000*(30-24) * ( temp2 - 0x7F00 ) / ( 0x7FFF - 0x7F00 ) ); + else if (temp2 > 0x7EC0) + snrdb = 1000*18 + ( 1000*(24-18) * ( temp2 - 0x7EC0 ) / ( 0x7F00 - 0x7EC0 ) ); + else if (temp2 > 0x7C00) + snrdb = 1000*12 + ( 1000*(18-12) * ( temp2 - 0x7C00 ) / ( 0x7EC0 - 0x7C00 ) ); + else + snrdb = 1000*0 + ( 1000*(12-0) * ( temp2 - 0 ) / ( 0x7C00 - 0 ) ); + + /* the value reported back from the frontend will be FFFF=32db 0000=0db */ + + *snr = snrdb * (0xFFFF/32000); + + return 0; +} + +static int nxt2002_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) +{ + struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; + u8 b[3]; + + nxt2002_readreg_multibyte(state,0xE6,b,3); + + *ucblocks = b[2]; + + return 0; +} + +static int nxt2002_sleep(struct dvb_frontend* fe) +{ + return 0; +} + +static int nxt2002_init(struct dvb_frontend* fe) +{ + struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; + const struct firmware *fw; + int ret; + u8 buf[2]; + + if (!state->initialised) { + /* request the firmware, this will block until someone uploads it */ + printk("nxt2002: Waiting for firmware upload...\n"); + ret = state->config->request_firmware(fe, &fw, NXT2002_DEFAULT_FIRMWARE); + printk("nxt2002: Waiting for firmware upload(2)...\n"); + if (ret) { + printk("nxt2002: no firmware upload (timeout or file not found?)\n"); + return ret; + } + + ret = nxt2002_load_firmware(fe, fw); + if (ret) { + printk("nxt2002: writing firmware to device failed\n"); + release_firmware(fw); + return ret; + } + + /* Put the micro into reset */ + nxt2002_microcontroller_stop(state); + + /* ensure transfer is complete */ + buf[0]=0; + i2c_writebytes(state,0x2B,buf,1); + + /* Put the micro into reset for real this time */ + nxt2002_microcontroller_stop(state); + + /* soft reset everything (agc,frontend,eq,fec)*/ + buf[0] = 0x0F; + i2c_writebytes(state,0x08,buf,1); + buf[0] = 0x00; + i2c_writebytes(state,0x08,buf,1); + + /* write agc sdm configure */ + buf[0] = 0xF1; + i2c_writebytes(state,0x57,buf,1); + + /* write mod output format */ + buf[0] = 0x20; + i2c_writebytes(state,0x09,buf,1); + + /* write fec mpeg mode */ + buf[0] = 0x7E; + buf[1] = 0x00; + i2c_writebytes(state,0xE9,buf,2); + + /* write mux selection */ + buf[0] = 0x00; + i2c_writebytes(state,0xCC,buf,1); + + state->initialised = 1; + } + + return 0; +} + +static int nxt2002_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) +{ + fesettings->min_delay_ms = 500; + fesettings->step_size = 0; + fesettings->max_drift = 0; + return 0; +} + +static void nxt2002_release(struct dvb_frontend* fe) +{ + struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; + kfree(state); +} + +static struct dvb_frontend_ops nxt2002_ops; + +struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config, + struct i2c_adapter* i2c) +{ + struct nxt2002_state* state = NULL; + u8 buf [] = {0,0,0,0,0}; + + /* allocate memory for the internal state */ + state = (struct nxt2002_state*) kmalloc(sizeof(struct nxt2002_state), GFP_KERNEL); + if (state == NULL) goto error; + + /* setup the state */ + state->config = config; + state->i2c = i2c; + memcpy(&state->ops, &nxt2002_ops, sizeof(struct dvb_frontend_ops)); + state->initialised = 0; + + /* Check the first 5 registers to ensure this a revision we can handle */ + + i2c_readbytes(state, 0x00, buf, 5); + if (buf[0] != 0x04) goto error; /* device id */ + if (buf[1] != 0x02) goto error; /* fab id */ + if (buf[2] != 0x11) goto error; /* month */ + if (buf[3] != 0x20) goto error; /* year msb */ + if (buf[4] != 0x00) goto error; /* year lsb */ + + /* create dvb_frontend */ + state->frontend.ops = &state->ops; + state->frontend.demodulator_priv = state; + return &state->frontend; + +error: + if (state) kfree(state); + return NULL; +} + +static struct dvb_frontend_ops nxt2002_ops = { + + .info = { + .name = "Nextwave nxt2002 VSB/QAM frontend", + .type = FE_ATSC, + .frequency_min = 54000000, + .frequency_max = 803000000, + /* stepsize is just a guess */ + .frequency_stepsize = 166666, + .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | + FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | + FE_CAN_8VSB + }, + + .release = nxt2002_release, + + .init = nxt2002_init, + .sleep = nxt2002_sleep, + + .set_frontend = nxt2002_setup_frontend_parameters, + .get_tune_settings = nxt2002_get_tune_settings, + + .read_status = nxt2002_read_status, + .read_ber = nxt2002_read_ber, + .read_signal_strength = nxt2002_read_signal_strength, + .read_snr = nxt2002_read_snr, + .read_ucblocks = nxt2002_read_ucblocks, + +}; + +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); + +MODULE_DESCRIPTION("NXT2002 ATSC (8VSB & ITU J83 AnnexB FEC QAM64/256) demodulator driver"); +MODULE_AUTHOR("Taylor Jacob"); +MODULE_LICENSE("GPL"); + +EXPORT_SYMBOL(nxt2002_attach); diff -Nru a/drivers/media/dvb/frontends/nxt2002.h b/drivers/media/dvb/frontends/nxt2002.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/media/dvb/frontends/nxt2002.h 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,23 @@ +/* + Driver for the Nxt2002 demodulator +*/ + +#ifndef NXT2002_H +#define NXT2002_H + +#include +#include + +struct nxt2002_config +{ + /* the demodulator's i2c address */ + u8 demod_address; + + /* request firmware for device */ + int (*request_firmware)(struct dvb_frontend* fe, const struct firmware **fw, char* name); +}; + +extern struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config, + struct i2c_adapter* i2c); + +#endif // NXT2002_H diff -Nru a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c --- a/drivers/media/dvb/frontends/stv0297.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/stv0297.c 2005-01-28 14:11:40 -08:00 @@ -38,10 +38,7 @@ struct dvb_frontend frontend; - int freq_off; - unsigned long base_freq; - u8 pwm; }; @@ -162,8 +159,10 @@ int ret; u8 b0[] = { reg }; u8 b1[] = { 0 }; - struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 }, - { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; + struct i2c_msg msg[] = { {.addr = state->config->demod_address,.flags = 0,.buf = b0,.len = + 1}, + {.addr = state->config->demod_address,.flags = I2C_M_RD,.buf = b1,.len = 1} + }; // this device needs a STOP between the register and data if ((ret = i2c_transfer (state->i2c, &msg[0], 1)) != 1) { @@ -193,8 +192,10 @@ static int stv0297_readregs (struct stv0297_state* state, u8 reg1, u8 *b, u8 len) { int ret; - struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = ®1, .len = 1 }, - { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b, .len = len } }; + struct i2c_msg msg[] = { {.addr = state->config->demod_address,.flags = 0,.buf = + ®1,.len = 1}, + {.addr = state->config->demod_address,.flags = I2C_M_RD,.buf = b,.len = len} + }; // this device needs a STOP between the register and data if ((ret = i2c_transfer (state->i2c, &msg[0], 1)) != 1) { @@ -209,6 +210,21 @@ return 0; } +static u32 stv0297_get_symbolrate(struct stv0297_state *state) +{ + u64 tmp; + + tmp = stv0297_readreg(state, 0x55); + tmp |= stv0297_readreg(state, 0x56) << 8; + tmp |= stv0297_readreg(state, 0x57) << 16; + tmp |= stv0297_readreg(state, 0x58) << 24; + + tmp *= STV0297_CLOCK_KHZ; + tmp >>= 32; + + return (u32) tmp; +} + static void stv0297_set_symbolrate(struct stv0297_state *state, u32 srate) { long tmp; @@ -259,39 +275,40 @@ stv0297_writereg_mask(state, 0x69, 0x0F, (tmp >> 24) & 0x0f); } +/* static long stv0297_get_carrieroffset(struct stv0297_state* state) { - s32 raw; - long tmp; + s64 tmp; stv0297_writereg(state,0x6B, 0x00); - raw = stv0297_readreg(state,0x66); - raw |= (stv0297_readreg(state,0x67) << 8); - raw |= (stv0297_readreg(state,0x68) << 16); - raw |= (stv0297_readreg(state,0x69) & 0x0F) << 24; + tmp = stv0297_readreg(state, 0x66); + tmp |= (stv0297_readreg(state, 0x67) << 8); + tmp |= (stv0297_readreg(state, 0x68) << 16); + tmp |= (stv0297_readreg(state, 0x69) & 0x0F) << 24; - tmp = raw; - tmp /= 26844L; + tmp *= stv0297_get_symbolrate(state); + tmp >>= 28; - return tmp; + return (s32) tmp; } +*/ static void stv0297_set_initialdemodfreq(struct stv0297_state* state, long freq) { -/* - s64 tmp; + s32 tmp; - if (freq > 10000) freq -= STV0297_CLOCK_KHZ; + if (freq > 10000) + freq -= STV0297_CLOCK_KHZ; - tmp = freq << 16; - do_div(tmp, STV0297_CLOCK_KHZ); - if (tmp > 0xffff) tmp = 0xffff; // check this calculation + tmp = (STV0297_CLOCK_KHZ * 1000) / (1 << 16); + tmp = (freq * 1000) / tmp; + if (tmp > 0xffff) + tmp = 0xffff; stv0297_writereg_mask(state, 0x25, 0x80, 0x80); stv0297_writereg(state, 0x21, tmp >> 8); stv0297_writereg(state, 0x20, tmp); -*/ } static int stv0297_set_qam(struct stv0297_state* state, fe_modulation_t modulation) @@ -413,6 +430,15 @@ return 0; } +static int stv0297_sleep(struct dvb_frontend *fe) +{ + struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; + + stv0297_writereg_mask(state, 0x80, 1, 1); + + return 0; +} + static int stv0297_read_status(struct dvb_frontend* fe, fe_status_t* status) { struct stv0297_state* state = (struct stv0297_state*) fe->demodulator_priv; @@ -484,6 +510,7 @@ int carrieroffset; unsigned long starttime; unsigned long timeout; + fe_spectral_inversion_t inversion; switch(p->u.qam.modulation) { case QAM_16: @@ -508,8 +535,11 @@ } // determine inversion dependant parameters + inversion = p->inversion; + if (state->config->invert) + inversion = (inversion == INVERSION_ON) ? INVERSION_OFF : INVERSION_ON; carrieroffset = -330; - switch(p->inversion) { + switch (inversion) { case INVERSION_OFF: break; @@ -522,13 +552,14 @@ return -EINVAL; } + stv0297_init(fe); state->config->pll_set(fe, p); /* clear software interrupts */ stv0297_writereg(state, 0x82, 0x0); /* set initial demodulation frequency */ - stv0297_set_initialdemodfreq(state, state->freq_off + 7250); + stv0297_set_initialdemodfreq(state, 7250); /* setup AGC */ stv0297_writereg_mask(state, 0x43, 0x10, 0x00); @@ -588,7 +619,7 @@ stv0297_set_symbolrate(state, p->u.qam.symbol_rate/1000); stv0297_set_sweeprate(state, sweeprate, p->u.qam.symbol_rate / 1000); stv0297_set_carrieroffset(state, carrieroffset); - stv0297_set_inversion(state, p->inversion); + stv0297_set_inversion(state, inversion); /* kick off lock */ stv0297_writereg_mask(state, 0x88, 0x08, 0x08); @@ -664,7 +695,6 @@ /* success!! */ stv0297_writereg_mask(state, 0x5a, 0x40, 0x00); - state->freq_off = stv0297_get_carrieroffset(state); state->base_freq = p->frequency; return 0; @@ -681,10 +711,12 @@ reg_00 = stv0297_readreg(state, 0x00); reg_83 = stv0297_readreg(state, 0x83); - p->frequency = state->base_freq + state->freq_off; + p->frequency = state->base_freq; p->inversion = (reg_83 & 0x08) ? INVERSION_ON : INVERSION_OFF; - p->u.qam.symbol_rate = 0; - p->u.qam.fec_inner = 0; + if (state->config->invert) + p->inversion = (p->inversion == INVERSION_ON) ? INVERSION_OFF : INVERSION_ON; + p->u.qam.symbol_rate = stv0297_get_symbolrate(state) * 1000; + p->u.qam.fec_inner = FEC_NONE; switch((reg_00 >> 4) & 0x7) { case 0: @@ -729,7 +761,6 @@ state->config = config; state->i2c = i2c; memcpy(&state->ops, &stv0297_ops, sizeof(struct dvb_frontend_ops)); - state->freq_off = 0; state->base_freq = 0; state->pwm = pwm; @@ -764,6 +795,7 @@ .release = stv0297_release, .init = stv0297_init, + .sleep = stv0297_sleep, .set_frontend = stv0297_set_frontend, .get_frontend = stv0297_get_frontend, diff -Nru a/drivers/media/dvb/frontends/stv0297.h b/drivers/media/dvb/frontends/stv0297.h --- a/drivers/media/dvb/frontends/stv0297.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/stv0297.h 2005-01-28 14:11:40 -08:00 @@ -29,6 +29,9 @@ /* the demodulator's i2c address */ u8 demod_address; + /* does the "inversion" need inverted? */ + u8 invert:1; + /* PLL maintenance */ int (*pll_init)(struct dvb_frontend* fe); int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); diff -Nru a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c --- a/drivers/media/dvb/frontends/tda10021.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/frontends/tda10021.c 2005-01-28 14:11:41 -08:00 @@ -4,7 +4,7 @@ Copyright (C) 1999 Convergence Integrated Media GmbH Copyright (C) 2004 Markus Schulz - Suppport for TDA10021 + Support for TDA10021 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru a/drivers/media/dvb/frontends/tda10021.h b/drivers/media/dvb/frontends/tda10021.h --- a/drivers/media/dvb/frontends/tda10021.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/frontends/tda10021.h 2005-01-28 14:11:40 -08:00 @@ -4,7 +4,7 @@ Copyright (C) 1999 Convergence Integrated Media GmbH Copyright (C) 2004 Markus Schulz - Suppport for TDA10021 + Support for TDA10021 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru a/drivers/media/dvb/frontends/tda80xx.c b/drivers/media/dvb/frontends/tda80xx.c --- a/drivers/media/dvb/frontends/tda80xx.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/frontends/tda80xx.c 2005-01-28 14:11:41 -08:00 @@ -27,10 +27,10 @@ #include #include #include +#include #include #include #include -#include #include #include "dvb_frontend.h" diff -Nru a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c --- a/drivers/media/dvb/ttpci/av7110.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/ttpci/av7110.c 2005-01-28 14:11:41 -08:00 @@ -67,6 +67,12 @@ #include "av7110_ca.h" #include "av7110_ipack.h" +#define TS_WIDTH 376 +#define TS_HEIGHT 512 +#define TS_BUFLEN (TS_WIDTH*TS_HEIGHT) +#define TS_MAX_PACKETS (TS_BUFLEN/TS_SIZE) + + int av7110_debug; static int vidmode=CVBS_RGB_OUT; @@ -75,6 +81,7 @@ static int hw_sections; static int rgb_on; static int volume = 255; +static int budgetpatch = 0; module_param_named(debug, av7110_debug, int, 0644); MODULE_PARM_DESC(debug, "debug level (bitmask, default 0)"); @@ -91,6 +98,8 @@ " signal on SCART pin 16 to switch SCART video mode from CVBS to RGB"); module_param(volume, int, 0444); MODULE_PARM_DESC(volume, "initial volume: default 255 (range 0-255)"); +module_param(budgetpatch, int, 0444); +MODULE_PARM_DESC(budgetpatch, "use budget-patch hardware modification: default 0 (0 no, 1 autodetect, 2 always)"); static void restart_feeds(struct av7110 *av7110); @@ -349,27 +358,42 @@ #endif } +#define DEBI_READ 0 +#define DEBI_WRITE 1 +static inline void start_debi_dma(struct av7110 *av7110, int dir, + unsigned long addr, unsigned int len) +{ + dprintk(8, "%c %08lx %u\n", dir == DEBI_READ ? 'R' : 'W', addr, len); + if (saa7146_wait_for_debi_done(av7110->dev, 0)) { + printk(KERN_ERR "%s: saa7146_wait_for_debi_done timed out\n", __FUNCTION__); + return; + } + + SAA7146_ISR_CLEAR(av7110->dev, MASK_19); /* for good measure */ + SAA7146_IER_ENABLE(av7110->dev, MASK_19); + if (len < 5) + len = 5; /* we want a real DEBI DMA */ + if (dir == DEBI_WRITE) + iwdebi(av7110, DEBISWAB, addr, 0, (len + 3) & ~3); + else + irdebi(av7110, DEBISWAB, addr, 0, len); +} + static void debiirq (unsigned long data) { struct av7110 *av7110 = (struct av7110*) data; int type=av7110->debitype; int handle=(type>>8)&0x1f; - -// dprintk(4, "%p\n",av7110); + unsigned int xfer = 0; print_time("debi"); - SAA7146_IER_DISABLE(av7110->dev, MASK_19); - SAA7146_ISR_CLEAR(av7110->dev, MASK_19); + dprintk(4, "type 0x%04x\n", type); if (type==-1) { printk("DEBI irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n", jiffies, saa7146_read(av7110->dev, PSR), saa7146_read(av7110->dev, SSR)); - spin_lock(&av7110->debilock); - ARM_ClearMailBox(av7110); - ARM_ClearIrq(av7110); - spin_unlock(&av7110->debilock); - return; + goto debi_done; } av7110->debitype=-1; @@ -379,22 +403,16 @@ dvb_dmx_swfilter_packets(&av7110->demux, (const u8 *)av7110->debi_virt, av7110->debilen/188); - spin_lock(&av7110->debilock); - iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2); - ARM_ClearMailBox(av7110); - spin_unlock(&av7110->debilock); - return; + xfer = RX_BUFF; + break; case DATA_PES_RECORD: if (av7110->demux.recording) av7110_record_cb(&av7110->p2t[handle], (u8 *)av7110->debi_virt, av7110->debilen); - spin_lock(&av7110->debilock); - iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2); - ARM_ClearMailBox(av7110); - spin_unlock(&av7110->debilock); - return; + xfer = RX_BUFF; + break; case DATA_IPMPE: case DATA_FSECTION: @@ -404,11 +422,8 @@ av7110->debilen, NULL, 0, av7110->handle2filter[handle], DMX_OK, av7110); - spin_lock(&av7110->debilock); - iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2); - ARM_ClearMailBox(av7110); - spin_unlock(&av7110->debilock); - return; + xfer = RX_BUFF; + break; case DATA_CI_GET: { @@ -425,11 +440,8 @@ ci_get_data(&av7110->ci_rbuffer, av7110->debi_virt, av7110->debilen); - spin_lock(&av7110->debilock); - iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2); - ARM_ClearMailBox(av7110); - spin_unlock(&av7110->debilock); - return; + xfer = RX_BUFF; + break; } case DATA_COMMON_INTERFACE: @@ -449,37 +461,35 @@ printk("\n"); } #endif - spin_lock(&av7110->debilock); - iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2); - ARM_ClearMailBox(av7110); - spin_unlock(&av7110->debilock); - return; + xfer = RX_BUFF; + break; case DATA_DEBUG_MESSAGE: ((s8*)av7110->debi_virt)[Reserved_SIZE-1]=0; printk("%s\n", (s8 *)av7110->debi_virt); - spin_lock(&av7110->debilock); - iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2); - ARM_ClearMailBox(av7110); - spin_unlock(&av7110->debilock); - return; + xfer = RX_BUFF; + break; case DATA_CI_PUT: + dprintk(4, "debi DATA_CI_PUT\n"); case DATA_MPEG_PLAY: + dprintk(4, "debi DATA_MPEG_PLAY\n"); case DATA_BMP_LOAD: - spin_lock(&av7110->debilock); - iwdebi(av7110, DEBINOSWAP, TX_BUFF, 0, 2); - ARM_ClearMailBox(av7110); - spin_unlock(&av7110->debilock); - return; + dprintk(4, "debi DATA_BMP_LOAD\n"); + xfer = TX_BUFF; + break; default: break; } +debi_done: spin_lock(&av7110->debilock); + if (xfer) + iwdebi(av7110, DEBINOSWAP, xfer, 0, 2); ARM_ClearMailBox(av7110); spin_unlock(&av7110->debilock); } +/* irq from av7110 firmware writing the mailbox register in the DPRAM */ static void gpioirq (unsigned long data) { struct av7110 *av7110 = (struct av7110*) data; @@ -487,27 +497,29 @@ int len; if (av7110->debitype !=-1) + /* we shouldn't get any irq while a debi xfer is running */ printk("dvb-ttpci: GPIO0 irq oops @ %ld, psr:0x%08x, ssr:0x%08x\n", jiffies, saa7146_read(av7110->dev, PSR), saa7146_read(av7110->dev, SSR)); - spin_lock(&av7110->debilock); + if (saa7146_wait_for_debi_done(av7110->dev, 0)) { + printk(KERN_ERR "%s: saa7146_wait_for_debi_done timed out\n", __FUNCTION__); + BUG(); /* maybe we should try resetting the debi? */ + } + spin_lock(&av7110->debilock); ARM_ClearIrq(av7110); - SAA7146_IER_DISABLE(av7110->dev, MASK_19); - SAA7146_ISR_CLEAR(av7110->dev, MASK_19); - + /* see what the av7110 wants */ av7110->debitype = irdebi(av7110, DEBINOSWAP, IRQ_STATE, 0, 2); av7110->debilen = irdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, 0, 2); rxbuf=irdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2); txbuf=irdebi(av7110, DEBINOSWAP, TX_BUFF, 0, 2); len = (av7110->debilen + 3) & ~3; -// dprintk(8, "GPIO0 irq %d %d\n", av7110->debitype, av7110->debilen); print_time("gpio"); + dprintk(8, "GPIO0 irq 0x%04x %d\n", av7110->debitype, av7110->debilen); -// dprintk(8, "GPIO0 irq %02x\n", av7110->debitype&0xff); switch (av7110->debitype&0xff) { case DATA_TS_PLAY: @@ -579,16 +591,12 @@ dvb_ringbuffer_read(cibuf,av7110->debi_virt,len,0); - wake_up(&cibuf->queue); iwdebi(av7110, DEBINOSWAP, TX_LEN, len, 2); iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, len, 2); - saa7146_wait_for_debi_done(av7110->dev, 0); - saa7146_write(av7110->dev, IER, - saa7146_read(av7110->dev, IER) | MASK_19 ); - if (len < 5) - len = 5; /* we want a real DEBI DMA */ - iwdebi(av7110, DEBISWAB, DPRAM_BASE+txbuf, 0, (len+3)&~3); + dprintk(8, "DMA: CI\n"); + start_debi_dma(av7110, DEBI_WRITE, DPRAM_BASE + txbuf, len); spin_unlock(&av7110->debilock); + wake_up(&cibuf->queue); return; } @@ -620,22 +628,21 @@ dprintk(8, "GPIO0 PES_PLAY len=%04x\n", len); iwdebi(av7110, DEBINOSWAP, TX_LEN, len, 2); iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, len, 2); - saa7146_wait_for_debi_done(av7110->dev, 0); - saa7146_write(av7110->dev, IER, - saa7146_read(av7110->dev, IER) | MASK_19 ); - - iwdebi(av7110, DEBISWAB, DPRAM_BASE+txbuf, 0, (len+3)&~3); + dprintk(8, "DMA: MPEG_PLAY\n"); + start_debi_dma(av7110, DEBI_WRITE, DPRAM_BASE + txbuf, len); spin_unlock(&av7110->debilock); return; case DATA_BMP_LOAD: len=av7110->debilen; + dprintk(8, "gpio DATA_BMP_LOAD len %d\n", len); if (!len) { av7110->bmp_state=BMP_LOADED; iwdebi(av7110, DEBINOSWAP, IRQ_STATE_EXT, 0, 2); iwdebi(av7110, DEBINOSWAP, TX_LEN, 0, 2); iwdebi(av7110, DEBINOSWAP, TX_BUFF, 0, 2); wake_up(&av7110->bmpq); + dprintk(8, "gpio DATA_BMP_LOAD done\n"); break; } if (len>av7110->bmplen) @@ -647,12 +654,8 @@ memcpy(av7110->debi_virt, av7110->bmpbuf+av7110->bmpp, len); av7110->bmpp+=len; av7110->bmplen-=len; - saa7146_wait_for_debi_done(av7110->dev, 0); - saa7146_write(av7110->dev, IER, - saa7146_read(av7110->dev, IER) | MASK_19 ); - if (len < 5) - len = 5; /* we want a real DEBI DMA */ - iwdebi(av7110, DEBISWAB, DPRAM_BASE+txbuf, 0, (len+3)&~3); + dprintk(8, "gpio DATA_BMP_LOAD DMA len %d\n", len); + start_debi_dma(av7110, DEBI_WRITE, DPRAM_BASE+txbuf, len); spin_unlock(&av7110->debilock); return; @@ -669,22 +672,17 @@ case DATA_TS_RECORD: case DATA_PES_RECORD: - saa7146_wait_for_debi_done(av7110->dev, 0); - saa7146_write(av7110->dev, IER, - saa7146_read(av7110->dev, IER) | MASK_19); - irdebi(av7110, DEBISWAB, DPRAM_BASE+rxbuf, 0, len); + dprintk(8, "DMA: TS_REC etc.\n"); + start_debi_dma(av7110, DEBI_READ, DPRAM_BASE+rxbuf, len); spin_unlock(&av7110->debilock); return; case DATA_DEBUG_MESSAGE: - saa7146_wait_for_debi_done(av7110->dev, 0); if (!len || len>0xff) { iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2); break; } - saa7146_write(av7110->dev, IER, - saa7146_read(av7110->dev, IER) | MASK_19); - irdebi(av7110, DEBISWAB, Reserved, 0, len); + start_debi_dma(av7110, DEBI_READ, Reserved, len); spin_unlock(&av7110->debilock); return; @@ -699,8 +697,8 @@ av7110->debitype, av7110->debilen); break; } - ARM_ClearMailBox(av7110); av7110->debitype=-1; + ARM_ClearMailBox(av7110); spin_unlock(&av7110->debilock); } @@ -1145,11 +1143,107 @@ return 0; } +/* simplified code from budget-core.c */ +static int stop_ts_capture(struct av7110 *budget) +{ + dprintk(2, "budget: %p\n", budget); + + if (--budget->feeding1) + return budget->feeding1; + saa7146_write(budget->dev, MC1, MASK_20); /* DMA3 off */ + SAA7146_IER_DISABLE(budget->dev, MASK_10); + SAA7146_ISR_CLEAR(budget->dev, MASK_10); + return 0; +} + +static int start_ts_capture(struct av7110 *budget) +{ + dprintk(2, "budget: %p\n", budget); + + if (budget->feeding1) + return ++budget->feeding1; + memset(budget->grabbing, 0x00, TS_HEIGHT * TS_WIDTH); + budget->tsf = 0xff; + budget->ttbp = 0; + SAA7146_IER_ENABLE(budget->dev, MASK_10); /* VPE */ + saa7146_write(budget->dev, MC1, (MASK_04 | MASK_20)); /* DMA3 on */ + return ++budget->feeding1; +} + +static int budget_start_feed(struct dvb_demux_feed *feed) +{ + struct dvb_demux *demux = feed->demux; + struct av7110 *budget = (struct av7110 *) demux->priv; + int status; + + dprintk(2, "av7110: %p\n", budget); + + spin_lock(&budget->feedlock1); + feed->pusi_seen = 0; /* have a clean section start */ + status = start_ts_capture(budget); + spin_unlock(&budget->feedlock1); + return status; +} + +static int budget_stop_feed(struct dvb_demux_feed *feed) +{ + struct dvb_demux *demux = feed->demux; + struct av7110 *budget = (struct av7110 *) demux->priv; + int status; + + dprintk(2, "budget: %p\n", budget); + + spin_lock(&budget->feedlock1); + status = stop_ts_capture(budget); + spin_unlock(&budget->feedlock1); + return status; +} + +static void vpeirq(unsigned long data) +{ + struct av7110 *budget = (struct av7110 *) data; + u8 *mem = (u8 *) (budget->grabbing); + u32 olddma = budget->ttbp; + u32 newdma = saa7146_read(budget->dev, PCI_VDP3); + + if (!budgetpatch) { + printk("av7110.c: vpeirq() called while budgetpatch disabled!" + " check saa7146 IER register\n"); + BUG(); + } + /* nearest lower position divisible by 188 */ + newdma -= newdma % 188; + + if (newdma >= TS_BUFLEN) + return; + + budget->ttbp = newdma; + + if (!budget->feeding1 || (newdma == olddma)) + return; + +#if 0 + /* track rps1 activity */ + printk("vpeirq: %02x Event Counter 1 0x%04x\n", + mem[olddma], + saa7146_read(budget->dev, EC1R) & 0x3fff); +#endif + + if (newdma > olddma) + /* no wraparound, dump olddma..newdma */ + dvb_dmx_swfilter_packets(&budget->demux1, mem + olddma, (newdma - olddma) / 188); + else { + /* wraparound, dump olddma..buflen and 0..newdma */ + dvb_dmx_swfilter_packets(&budget->demux1, mem + olddma, (TS_BUFLEN - olddma) / 188); + dvb_dmx_swfilter_packets(&budget->demux1, mem, newdma / 188); + } +} static int av7110_register(struct av7110 *av7110) { int ret, i; struct dvb_demux *dvbdemux=&av7110->demux; + struct dvb_demux *dvbdemux1 = &av7110->demux1; dprintk(4, "%p\n", av7110); @@ -1209,6 +1303,32 @@ dvb_net_init(av7110->dvb_adapter, &av7110->dvb_net, &dvbdemux->dmx); + if (budgetpatch) { + /* initialize software demux1 without its own frontend + * demux1 hardware is connected to frontend0 of demux0 + */ + dvbdemux1->priv = (void *) av7110; + + dvbdemux1->filternum = 256; + dvbdemux1->feednum = 256; + dvbdemux1->start_feed = budget_start_feed; + dvbdemux1->stop_feed = budget_stop_feed; + dvbdemux1->write_to_decoder = NULL; + + dvbdemux1->dmx.capabilities = (DMX_TS_FILTERING | DMX_SECTION_FILTERING | + DMX_MEMORY_BASED_FILTERING); + + dvb_dmx_init(&av7110->demux1); + + av7110->dmxdev1.filternum = 256; + av7110->dmxdev1.demux = &dvbdemux1->dmx; + av7110->dmxdev1.capabilities = 0; + + dvb_dmxdev_init(&av7110->dmxdev1, av7110->dvb_adapter); + + dvb_net_init(av7110->dvb_adapter, &av7110->dvb_net1, &dvbdemux1->dmx); + printk("dvb-ttpci: additional demux1 for budget-patch registered\n"); + } return 0; } @@ -1216,12 +1336,20 @@ static void dvb_unregister(struct av7110 *av7110) { struct dvb_demux *dvbdemux=&av7110->demux; + struct dvb_demux *dvbdemux1 = &av7110->demux1; dprintk(4, "%p\n", av7110); if (!av7110->registered) return; + if (budgetpatch) { + dvb_net_release(&av7110->dvb_net1); + dvbdemux->dmx.close(&dvbdemux1->dmx); + dvb_dmxdev_release(&av7110->dmxdev1); + dvb_dmx_release(&av7110->demux1); + } + dvb_net_release(&av7110->dvb_net); dvbdemux->dmx.close(&dvbdemux->dmx); @@ -1700,6 +1828,7 @@ static struct stv0297_config nexusca_stv0297_config = { .demod_address = 0x1C, + .invert = 1, .pll_set = nexusca_stv0297_pll_set, }; @@ -1899,12 +2028,22 @@ av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110)); break; + case 0x0006: /* Fujitsu-Siemens DVB-S rev 1.6 */ + /* Grundig 29504-451 */ + av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap); + if (av7110->fe) { + av7110->fe->ops->diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; + av7110->fe->ops->diseqc_send_burst = av7110_diseqc_send_burst; + av7110->fe->ops->set_tone = av7110_set_tone; + } + break; + case 0x000A: // Hauppauge/TT Nexus-CA rev1.X av7110->fe = stv0297_attach(&nexusca_stv0297_config, &av7110->i2c_adap, 0x7b); if (av7110->fe) { /* set TDA9819 into DVB mode */ - saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTHI); // TDA9198 pin9(STD) + saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD) saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF) /* tuner on this needs a slower i2c bus speed */ @@ -1940,13 +2079,169 @@ } } +/* Budgetpatch note: + * Original hardware design by Roberto Deza: + * There is a DVB_Wiki at + * http://212.227.36.83/linuxtv/wiki/index.php/Main_Page + * where is described this 'DVB TT Budget Patch', on Card Modding: + * http://212.227.36.83/linuxtv/wiki/index.php/DVB_TT_Budget_Patch + * On the short description there is also a link to a external file, + * with more details: + * http://perso.wanadoo.es/jesussolano/Ttf_tsc1.zip + * + * New software triggering design by Emard that works on + * original Roberto Deza's hardware: + * + * rps1 code for budgetpatch will copy internal HS event to GPIO3 pin. + * GPIO3 is in budget-patch hardware connectd to port B VSYNC + * HS is an internal event of 7146, accessible with RPS + * and temporarily raised high every n lines + * (n in defined in the RPS_THRESH1 counter threshold) + * I think HS is raised high on the beginning of the n-th line + * and remains high until this n-th line that triggered + * it is completely received. When the receiption of n-th line + * ends, HS is lowered. + * + * To transmit data over DMA, 7146 needs changing state at + * port B VSYNC pin. Any changing of port B VSYNC will + * cause some DMA data transfer, with more or less packets loss. + * It depends on the phase and frequency of VSYNC and + * the way of 7146 is instructed to trigger on port B (defined + * in DD1_INIT register, 3rd nibble from the right valid + * numbers are 0-7, see datasheet) + * + * The correct triggering can minimize packet loss, + * dvbtraffic should give this stable bandwidths: + * 22k transponder = 33814 kbit/s + * 27.5k transponder = 38045 kbit/s + * by experiment it is found that the best results + * (stable bandwidths and almost no packet loss) + * are obtained using DD1_INIT triggering number 2 + * (Va at rising edge of VS Fa = HS x VS-failing forced toggle) + * and a VSYNC phase that occurs in the middle of DMA transfer + * (about byte 188*512=96256 in the DMA window). + * + * Phase of HS is still not clear to me how to control, + * It just happens to be so. It can be seen if one enables + * RPS_IRQ and print Event Counter 1 in vpeirq(). Every + * time RPS_INTERRUPT is called, the Event Counter 1 will + * increment. That's how the 7146 is programmed to do event + * counting in this budget-patch.c + * I *think* HPS setting has something to do with the phase + * of HS but I cant be 100% sure in that. + * + * hardware debug note: a working budget card (including budget patch) + * with vpeirq() interrupt setup in mode "0x90" (every 64K) will + * generate 3 interrupts per 25-Hz DMA frame of 2*188*512 bytes + * and that means 3*25=75 Hz of interrupt freqency, as seen by + * watch cat /proc/interrupts + * + * If this frequency is 3x lower (and data received in the DMA + * buffer don't start with 0x47, but in the middle of packets, + * whose lengths appear to be like 188 292 188 104 etc. + * this means VSYNC line is not connected in the hardware. + * (check soldering pcb and pins) + * The same behaviour of missing VSYNC can be duplicated on budget + * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. + */ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *pci_ext) { struct av7110 *av7110 = NULL; + int length = TS_WIDTH * TS_HEIGHT; int ret = 0; + int count = 0; dprintk(4, "dev: %p\n", dev); + /* Set RPS_IRQ to 1 to track rps1 activity. + * Enabling this won't send any interrupt to PC CPU. + */ +#define RPS_IRQ 0 + + if (budgetpatch == 1) { + budgetpatch = 0; + /* autodetect the presence of budget patch + * this only works if saa7146 has been recently + * reset with with MASK_31 to MC1 + * + * will wait for VBI_B event (vertical blank at port B) + * and will reset GPIO3 after VBI_B is detected. + * (GPIO3 should be raised high by CPU to + * test if GPIO3 will generate vertical blank signal + * in budget patch GPIO3 is connected to VSYNC_B + */ + + /* RESET SAA7146 */ + saa7146_write(dev, MC1, MASK_31); + /* autodetection success seems to be time-dependend after reset */ + + /* Fix VSYNC level */ + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); + /* set vsync_b triggering */ + saa7146_write(dev, DD1_STREAM_B, 0); + /* port B VSYNC at rising edge */ + saa7146_write(dev, DD1_INIT, 0x00000200); + saa7146_write(dev, BRS_CTRL, 0x00000000); // VBI + saa7146_write(dev, MC2, + 1 * (MASK_08 | MASK_24) | // BRS control + 0 * (MASK_09 | MASK_25) | // a + 1 * (MASK_10 | MASK_26) | // b + 0 * (MASK_06 | MASK_22) | // HPS_CTRL1 + 0 * (MASK_05 | MASK_21) | // HPS_CTRL2 + 0 * (MASK_01 | MASK_15) // DEBI + ); + + /* start writing RPS1 code from beginning */ + count = 0; + /* Disable RPS1 */ + saa7146_write(dev, MC1, MASK_29); + /* RPS1 timeout disable */ + saa7146_write(dev, RPS_TOV1, 0); + WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_VBI_B)); + WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); + WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); + WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTLO<<24)); +#if RPS_IRQ + /* issue RPS1 interrupt to increment counter */ + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); +#endif + WRITE_RPS1(cpu_to_le32(CMD_STOP)); + /* Jump to begin of RPS program as safety measure (p37) */ + WRITE_RPS1(cpu_to_le32(CMD_JUMP)); + WRITE_RPS1(cpu_to_le32(dev->d_rps1.dma_handle)); + +#if RPS_IRQ + /* set event counter 1 source as RPS1 interrupt (0x03) (rE4 p53) + * use 0x03 to track RPS1 interrupts - increase by 1 every gpio3 is toggled + * use 0x15 to track VPE interrupts - increase by 1 every vpeirq() is called + */ + saa7146_write(dev, EC1SSR, (0x03<<2) | 3 ); + /* set event counter 1 treshold to maximum allowed value (rEC p55) */ + saa7146_write(dev, ECT1R, 0x3fff ); +#endif + /* Set RPS1 Address register to point to RPS code (r108 p42) */ + saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); + /* Enable RPS1, (rFC p33) */ + saa7146_write(dev, MC1, (MASK_13 | MASK_29 )); + + mdelay(10); + /* now send VSYNC_B to rps1 by rising GPIO3 */ + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); + mdelay(10); + /* if rps1 responded by lowering the GPIO3, + * then we have budgetpatch hardware + */ + if ((saa7146_read(dev, GPIO_CTRL) & 0x10000000) == 0) { + budgetpatch = 1; + printk("dvb-ttpci: BUDGET-PATCH DETECTED.\n"); + } + /* Disable RPS1 */ + saa7146_write(dev, MC1, ( MASK_29 )); +#if RPS_IRQ + printk("dvb-ttpci: Event Counter 1 0x%04x\n", saa7146_read(dev, EC1R) & 0x3fff ); +#endif + } + /* prepare the av7110 device struct */ if (!(av7110 = kmalloc (sizeof (struct av7110), GFP_KERNEL))) { dprintk(1, "out of memory\n"); @@ -1980,6 +2275,7 @@ saa7146_i2c_adapter_prepare(dev, &av7110->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120); /* 275 kHz */ if (i2c_add_adapter(&av7110->i2c_adap) < 0) { +err_no_mem: dvb_unregister_adapter (av7110->dvb_adapter); kfree(av7110); return -ENOMEM; @@ -1987,6 +2283,86 @@ ttpci_eeprom_parse_mac(&av7110->i2c_adap, av7110->dvb_adapter->proposed_mac); + if (budgetpatch) { + spin_lock_init(&av7110->feedlock1); + av7110->grabbing = saa7146_vmalloc_build_pgtable( + dev->pci, length, &av7110->pt); + if (!av7110->grabbing) + goto err_no_mem; + saa7146_write(dev, PCI_BT_V1, 0x1c1f101f); + saa7146_write(dev, BCS_CTRL, 0x80400040); + /* set dd1 stream a & b */ + saa7146_write(dev, DD1_STREAM_B, 0x00000000); + saa7146_write(dev, DD1_INIT, 0x03000200); + saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26)); + saa7146_write(dev, BRS_CTRL, 0x60000000); + saa7146_write(dev, BASE_ODD3, 0); + saa7146_write(dev, BASE_EVEN3, 0); + saa7146_write(dev, PROT_ADDR3, TS_WIDTH * TS_HEIGHT); + saa7146_write(dev, BASE_PAGE3, av7110->pt.dma | ME1 | 0x90); + + saa7146_write(dev, PITCH3, TS_WIDTH); + saa7146_write(dev, NUM_LINE_BYTE3, (TS_HEIGHT << 16) | TS_WIDTH); + + /* upload all */ + saa7146_write(dev, MC2, 0x077c077c); + saa7146_write(dev, GPIO_CTRL, 0x000000); +#if RPS_IRQ + /* set event counter 1 source as RPS1 interrupt (0x03) (rE4 p53) + * use 0x03 to track RPS1 interrupts - increase by 1 every gpio3 is toggled + * use 0x15 to track VPE interrupts - increase by 1 every vpeirq() is called + */ + saa7146_write(dev, EC1SSR, (0x03<<2) | 3 ); + /* set event counter 1 treshold to maximum allowed value (rEC p55) */ + saa7146_write(dev, ECT1R, 0x3fff ); +#endif + /* Setup BUDGETPATCH MAIN RPS1 "program" (p35) */ + count = 0; + + /* Wait Source Line Counter Threshold (p36) */ + WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_HS)); + /* Set GPIO3=1 (p42) */ + WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); + WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); + WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTHI<<24)); +#if RPS_IRQ + /* issue RPS1 interrupt */ + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); +#endif + /* Wait reset Source Line Counter Threshold (p36) */ + WRITE_RPS1(cpu_to_le32(CMD_PAUSE | RPS_INV | EVT_HS)); + /* Set GPIO3=0 (p42) */ + WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); + WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); + WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTLO<<24)); +#if RPS_IRQ + /* issue RPS1 interrupt */ + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); +#endif + /* Jump to begin of RPS program (p37) */ + WRITE_RPS1(cpu_to_le32(CMD_JUMP)); + WRITE_RPS1(cpu_to_le32(dev->d_rps1.dma_handle)); + + /* Fix VSYNC level */ + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); + /* Set RPS1 Address register to point to RPS code (r108 p42) */ + saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); + /* Set Source Line Counter Threshold, using BRS (rCC p43) + * It generates HS event every TS_HEIGHT lines + * this is related to TS_WIDTH set in register + * NUM_LINE_BYTE3. If NUM_LINE_BYTE low 16 bits + * are set to TS_WIDTH bytes (TS_WIDTH=2*188), + * then RPS_THRESH1 should be set to trigger + * every TS_HEIGHT (512) lines. + */ + saa7146_write(dev, RPS_THRESH1, (TS_HEIGHT*1) | MASK_12 ); + + /* Enable RPS1 (rFC p33) */ + saa7146_write(dev, MC1, (MASK_13 | MASK_29)); + + /* end of budgetpatch register initialization */ + tasklet_init (&av7110->vpe_tasklet, vpeirq, (unsigned long) av7110); + } else { saa7146_write(dev, PCI_BT_V1, 0x1c00101f); saa7146_write(dev, BCS_CTRL, 0x80400040); @@ -1998,6 +2374,7 @@ /* upload all */ saa7146_write(dev, MC2, 0x077c077c); saa7146_write(dev, GPIO_CTRL, 0x000000); + } tasklet_init (&av7110->debi_tasklet, debiirq, (unsigned long) av7110); tasklet_init (&av7110->gpio_tasklet, gpioirq, (unsigned long) av7110); @@ -2109,10 +2486,21 @@ struct av7110 *av7110 = (struct av7110*)saa->ext_priv; dprintk(4, "%p\n", av7110); - if( 0 == av7110->device_initialized ) { + if (!av7110->device_initialized ) return 0; - } + if (budgetpatch) { + /* Disable RPS1 */ + saa7146_write(saa, MC1, MASK_29); + /* VSYNC LOW (inactive) */ + saa7146_setgpio(saa, 3, SAA7146_GPIO_OUTLO); + saa7146_write(saa, MC1, MASK_20); /* DMA3 off */ + SAA7146_IER_DISABLE(saa, MASK_10); + SAA7146_ISR_CLEAR(saa, MASK_10); + msleep(50); + tasklet_kill(&av7110->vpe_tasklet); + saa7146_pgtable_free(saa->pci, &av7110->pt); + } av7110_exit_v4l(av7110); av7110->arm_rmmod=1; @@ -2121,6 +2509,9 @@ while (av7110->arm_thread) msleep(1); + tasklet_kill(&av7110->debi_tasklet); + tasklet_kill(&av7110->gpio_tasklet); + dvb_unregister(av7110); SAA7146_IER_DISABLE(saa, MASK_19 | MASK_03); @@ -2153,13 +2544,43 @@ { struct av7110 *av7110 = dev->ext_priv; - if (*isr & MASK_19) + //print_time("av7110_irq"); + + /* Note: Don't try to handle the DEBI error irq (MASK_18), in + * intel mode the timeout is asserted all the time... + */ + + if (*isr & MASK_19) { + //printk("av7110_irq: DEBI\n"); + /* Note 1: The DEBI irq is level triggered: We must enable it + * only after we started a DMA xfer, and disable it here + * immediately, or it will be signalled all the time while + * DEBI is idle. + * Note 2: You would think that an irq which is masked is + * not signalled by the hardware. Not so for the SAA7146: + * An irq is signalled as long as the corresponding bit + * in the ISR is set, and disabling irqs just prevents the + * hardware from setting the ISR bit. This means a) that we + * must clear the ISR *after* disabling the irq (which is why + * we must do it here even though saa7146_core did it already), + * and b) that if we were to disable an edge triggered irq + * (like the gpio irqs sadly are) temporarily we would likely + * loose some. This sucks :-( + */ + SAA7146_IER_DISABLE(av7110->dev, MASK_19); + SAA7146_ISR_CLEAR(av7110->dev, MASK_19); tasklet_schedule (&av7110->debi_tasklet); + } - if (*isr & MASK_03) + if (*isr & MASK_03) { + //printk("av7110_irq: GPIO\n"); tasklet_schedule (&av7110->gpio_tasklet); } + if ((*isr & MASK_10) && budgetpatch) + tasklet_schedule(&av7110->vpe_tasklet); +} + static struct saa7146_extension av7110_extension; @@ -2173,8 +2594,9 @@ MAKE_AV7110_INFO(ttc_1_X, "Technotrend/Hauppauge WinTV Nexus-CA rev1.X"); MAKE_AV7110_INFO(ttc_2_X, "Technotrend/Hauppauge WinTV DVB-C rev2.X"); MAKE_AV7110_INFO(tts_2_X, "Technotrend/Hauppauge WinTV Nexus-S rev2.X"); -MAKE_AV7110_INFO(tts_1_3se, "Technotrend/Hauppauge WinTV Nexus-S rev1.3"); +MAKE_AV7110_INFO(tts_1_3se, "Technotrend/Hauppauge WinTV DVB-S rev1.3 SE"); MAKE_AV7110_INFO(fsc, "Fujitsu Siemens DVB-C"); +MAKE_AV7110_INFO(fss, "Fujitsu Siemens DVB-S rev1.6"); static struct pci_device_id pci_tbl[] = { MAKE_EXTENSION_PCI(tts_1_X, 0x13c2, 0x0000), @@ -2184,10 +2606,10 @@ MAKE_EXTENSION_PCI(tts_1_3se, 0x13c2, 0x1002), MAKE_EXTENSION_PCI(fsc, 0x110a, 0x0000), MAKE_EXTENSION_PCI(ttc_1_X, 0x13c2, 0x000a), + MAKE_EXTENSION_PCI(fss, 0x13c2, 0x0006), /* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0004), UNDEFINED CARD */ // Galaxis DVB PC-Sat-Carte /* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0005), UNDEFINED CARD */ // Technisat SkyStar1 -/* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0006), UNDEFINED CARD */ // TT/Hauppauge WinTV Nexus-S v???? /* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0008), UNDEFINED CARD */ // TT/Hauppauge WinTV DVB-T v???? /* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0009), UNDEFINED CARD */ // TT/Hauppauge WinTV Nexus-CA v???? @@ -2208,7 +2630,7 @@ .attach = av7110_attach, .detach = av7110_detach, - .irq_mask = MASK_19|MASK_03, + .irq_mask = MASK_19 | MASK_03 | MASK_10, .irq_func = av7110_irq, }; diff -Nru a/drivers/media/dvb/ttpci/av7110.h b/drivers/media/dvb/ttpci/av7110.h --- a/drivers/media/dvb/ttpci/av7110.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/ttpci/av7110.h 2005-01-28 14:11:40 -08:00 @@ -115,7 +115,7 @@ int bmpp; int bmplen; - int bmp_state; + volatile int bmp_state; #define BMP_NONE 0 #define BMP_LOADING 1 #define BMP_LOADINGS 2 @@ -157,6 +157,18 @@ struct dmx_frontend hw_frontend; struct dmx_frontend mem_frontend; + + /* for budget mode demux1 */ + struct dmxdev dmxdev1; + struct dvb_demux demux1; + struct dvb_net dvb_net1; + spinlock_t feedlock1; + int feeding1; + u8 tsf; + u32 ttbp; + unsigned char *grabbing; + struct saa7146_pgtable pt; + struct tasklet_struct vpe_tasklet; int fe_synced; struct semaphore pid_mutex; diff -Nru a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c --- a/drivers/media/dvb/ttpci/av7110_hw.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/ttpci/av7110_hw.c 2005-01-28 14:11:41 -08:00 @@ -153,8 +153,10 @@ base = DRAM_START_CODE; for (i = 0; i < blocks; i++) { - if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) + if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { + printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at block %d\n", i); return -1; + } dprintk(4, "writing DRAM block %d\n", i); mwdebi(av7110, DEBISWAB, bootblock, ((char*)data) + i * BOOT_MAX_SIZE, BOOT_MAX_SIZE); @@ -166,8 +168,10 @@ } if (rest > 0) { - if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) + if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { + printk(KERN_ERR "dvb-ttpci: load_dram(): timeout at last block\n"); return -1; + } if (rest > 4) mwdebi(av7110, DEBISWAB, bootblock, ((char*)data) + i * BOOT_MAX_SIZE, rest); @@ -179,12 +183,16 @@ iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, rest, 2); iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); } - if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) + if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BUFFER_EMPTY) < 0) { + printk(KERN_ERR "dvb-ttpci: load_dram(): timeout after last block\n"); return -1; + } iwdebi(av7110, DEBINOSWAP, BOOT_SIZE, 0, 2); iwdebi(av7110, DEBINOSWAP, BOOT_STATE, BOOTSTATE_BUFFER_FULL, 2); - if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BOOT_COMPLETE) < 0) + if (waitdebi(av7110, BOOT_STATE, BOOTSTATE_BOOT_COMPLETE) < 0) { + printk(KERN_ERR "dvb-ttpci: load_dram(): final handshake timeout\n"); return -1; + } return 0; } @@ -261,8 +269,11 @@ mdelay(1); dprintk(1, "load dram code\n"); - if (load_dram(av7110, (u32 *)av7110->bin_root, av7110->size_root) < 0) + if (load_dram(av7110, (u32 *)av7110->bin_root, av7110->size_root) < 0) { + printk(KERN_ERR "dvb-ttpci: av7110_bootarm(): " + "load_dram() failed\n"); return -1; + } saa7146_setgpio(dev, RESET_LINE, SAA7146_GPIO_OUTLO); mdelay(1); @@ -336,7 +347,7 @@ if (!av7110->arm_ready) { dprintk(1, "arm not ready.\n"); - return -1; + return -ENXIO; } start = jiffies; @@ -344,7 +355,7 @@ msleep(1); if (time_after(jiffies, start + ARM_WAIT_FREE)) { printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND idle\n", __FUNCTION__); - return -1; + return -ETIMEDOUT; } } @@ -356,7 +367,7 @@ msleep(1); if (time_after(jiffies, start + ARM_WAIT_SHAKE)) { printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); - return -1; + return -ETIMEDOUT; } } #endif @@ -375,6 +386,13 @@ flags[0] = OSDQOver; flags[1] = OSDQFull; break; + case COMTYPE_MISC: + if (FW_VERSION(av7110->arm_app) >= 0x261d) { + type = "MSG"; + flags[0] = GPMQOver; + flags[1] = GPMQBusy; + } + break; default: break; } @@ -419,18 +437,18 @@ if (time_after(jiffies, start + ARM_WAIT_FREE)) { printk(KERN_ERR "dvb-ttpci: %s(): timeout waiting for COMMAND to complete\n", __FUNCTION__); - return -1; + return -ETIMEDOUT; } } stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2); if (stat & GPMQOver) { printk(KERN_ERR "dvb-ttpci: %s(): GPMQOver\n", __FUNCTION__); - return -1; + return -ENOSPC; } else if (stat & OSDQOver) { printk(KERN_ERR "dvb-ttpci: %s(): OSDQOver\n", __FUNCTION__); - return -1; + return -ENOSPC; } #endif @@ -453,7 +471,8 @@ ret = __av7110_send_fw_cmd(av7110, buf, length); up(&av7110->dcomlock); if (ret) - printk("dvb-ttpci: %s(): av7110_send_fw_cmd error\n", __FUNCTION__); + printk(KERN_ERR "dvb-ttpci: %s(): av7110_send_fw_cmd error %d\n", + __FUNCTION__, ret); return ret; } @@ -477,7 +496,7 @@ ret = av7110_send_fw_cmd(av7110, buf, num + 2); if (ret) - printk("dvb-ttpci: av7110_fw_cmd error\n"); + printk(KERN_ERR "dvb-ttpci: av7110_fw_cmd error %d\n", ret); return ret; } @@ -499,7 +518,7 @@ ret = av7110_send_fw_cmd(av7110, cmd, 18); if (ret) - printk("dvb-ttpci: av7110_send_ci_cmd error\n"); + printk(KERN_ERR "dvb-ttpci: av7110_send_ci_cmd error %d\n", ret); return ret; } @@ -525,7 +544,7 @@ if ((err = __av7110_send_fw_cmd(av7110, request_buf, request_buf_len)) < 0) { up(&av7110->dcomlock); - printk("dvb-ttpci: av7110_fw_request error\n"); + printk(KERN_ERR "dvb-ttpci: av7110_fw_request error %d\n", err); return err; } @@ -579,7 +598,7 @@ int ret; ret = av7110_fw_request(av7110, &tag, 0, buf, length); if (ret) - printk("dvb-ttpci: av7110_fw_query error\n"); + printk(KERN_ERR "dvb-ttpci: av7110_fw_query error %d\n", ret); return ret; } @@ -626,7 +645,7 @@ int av7110_diseqc_send(struct av7110 *av7110, int len, u8 *msg, unsigned long burst) { - int i; + int i, ret; u16 buf[18] = { ((COMTYPE_AUDIODAC << 8) + SendDiSEqC), 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -646,8 +665,8 @@ for (i = 0; i < len; i++) buf[i + 4] = msg[i]; - if (av7110_send_fw_cmd(av7110, buf, 18)) - printk("dvb-ttpci: av7110_diseqc_send error\n"); + if ((ret = av7110_send_fw_cmd(av7110, buf, 18))) + printk(KERN_ERR "dvb-ttpci: av7110_diseqc_send error %d\n", ret); return 0; } @@ -741,7 +760,7 @@ ret = __av7110_send_fw_cmd(av7110, cbuf, 5); up(&av7110->dcomlock); if (ret) - printk("dvb-ttpci: WriteText error\n"); + printk(KERN_ERR "dvb-ttpci: WriteText error %d\n", ret); return ret; } @@ -808,7 +827,8 @@ ret = wait_event_interruptible_timeout(av7110->bmpq, av7110->bmp_state != BMP_LOADING, HZ); if (ret == -ERESTARTSYS || ret == 0) { - printk("dvb-ttpci: warning: timeout waiting in %s()\n", __FUNCTION__); + printk("dvb-ttpci: warning: timeout waiting in LoadBitmap: %d, %d\n", + ret, av7110->bmp_state); av7110->bmp_state = BMP_NONE; return -1; } @@ -850,6 +870,7 @@ } } av7110->bmplen += 1024; + dprintk(4, "av7110_fw_cmd: LoadBmp size %d\n", av7110->bmplen); return av7110_fw_cmd(av7110, COMTYPE_OSD, LoadBmp, 3, format, dx, dy); } @@ -861,11 +882,13 @@ BUG_ON (av7110->bmp_state == BMP_NONE); - ret = wait_event_interruptible_timeout(av7110->bmpq, av7110->bmp_state != BMP_LOADING, HZ); + ret = wait_event_interruptible_timeout(av7110->bmpq, + av7110->bmp_state != BMP_LOADING, 10*HZ); if (ret == -ERESTARTSYS || ret == 0) { - printk("dvb-ttpci: warning: timeout waiting in %s()\n", __FUNCTION__); + printk("dvb-ttpci: warning: timeout waiting in BlitBitmap: %d, %d\n", + ret, av7110->bmp_state); av7110->bmp_state = BMP_NONE; - return -1; + return (ret == 0) ? -ETIMEDOUT : ret; } BUG_ON (av7110->bmp_state != BMP_LOADED); @@ -943,6 +966,7 @@ { uint w, h, bpp, bpl, size, lpb, bnum, brest; int i; + int rc; w = x1 - x0 + 1; h = y1 - y0 + 1; @@ -958,15 +982,23 @@ brest = size - bnum * lpb * bpl; for (i = 0; i < bnum; i++) { - LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]], + rc = LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]], w, lpb, inc, data); - BlitBitmap(av7110, av7110->osdwin, x0, y0 + i * lpb, 0); + if (rc) + return rc; + rc = BlitBitmap(av7110, av7110->osdwin, x0, y0 + i * lpb, 0); + if (rc) + return rc; data += lpb * inc; } if (brest) { - LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]], + rc = LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]], w, brest / bpl, inc, data); - BlitBitmap(av7110, av7110->osdwin, x0, y0 + bnum * lpb, 0); + if (rc) + return rc; + rc = BlitBitmap(av7110, av7110->osdwin, x0, y0 + bnum * lpb, 0); + if (rc) + return rc; } ReleaseBitmap(av7110); return 0; @@ -1019,7 +1051,7 @@ goto out; } else { int i, len = dc->x0-dc->color+1; - u8 __user *colors = (u8 __user *)dc->data; + u8 __user *colors = (u8 *)dc->data; u8 r, g, b, blend; for (i = 0; iy1 = dc->y0; /* fall through */ case OSD_SetBlock: - OSDSetBlock(av7110, dc->x0, dc->y0, dc->x1, dc->y1, dc->color, dc->data); + ret = OSDSetBlock(av7110, dc->x0, dc->y0, dc->x1, dc->y1, dc->color, dc->data); goto out; case OSD_FillRow: DrawBlock(av7110, av7110->osdwin, dc->x0, dc->y0, diff -Nru a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c --- a/drivers/media/dvb/ttpci/av7110_v4l.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/ttpci/av7110_v4l.c 2005-01-28 14:11:40 -08:00 @@ -250,7 +250,7 @@ if (ves1820_writereg(dev, 0x09, 0x0f, 0x20)) dprintk(1, "setting band in demodulator failed.\n"); } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { - saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTHI); // TDA9198 pin9(STD) + saa7146_setgpio(dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD) saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF) } } @@ -591,7 +591,7 @@ if (ves1820_writereg(av7110->dev, 0x09, 0x0f, 0x20)) dprintk(1, "setting band in demodulator failed.\n"); } else if (av7110->analog_tuner_flags & ANALOG_TUNER_STV0297) { - saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTHI); // TDA9198 pin9(STD) + saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD) saa7146_setgpio(av7110->dev, 3, SAA7146_GPIO_OUTLO); // TDA9198 pin30(VIF) } diff -Nru a/drivers/media/dvb/ttpci/budget-core.c b/drivers/media/dvb/ttpci/budget-core.c --- a/drivers/media/dvb/ttpci/budget-core.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/ttpci/budget-core.c 2005-01-28 14:11:40 -08:00 @@ -89,11 +89,18 @@ * Pitch: 188, NumBytes3: 188, NumLines3: 1024 */ - if (budget->card->type == BUDGET_FS_ACTIVY) { + switch(budget->card->type) { + case BUDGET_FS_ACTIVY: saa7146_write(dev, DD1_INIT, 0x04000000); saa7146_write(dev, MC2, (MASK_09 | MASK_25)); saa7146_write(dev, BRS_CTRL, 0x00000000); - } else { + break; + case BUDGET_PATCH: + saa7146_write(dev, DD1_INIT, 0x00000200); + saa7146_write(dev, MC2, (MASK_10 | MASK_26)); + saa7146_write(dev, BRS_CTRL, 0x60000000); + break; + default: if (budget->video_port == BUDGET_VIDEO_PORTA) { saa7146_write(dev, DD1_INIT, 0x06000200); saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26)); @@ -122,9 +129,10 @@ } saa7146_write(dev, MC2, (MASK_04 | MASK_20)); - saa7146_write(dev, MC1, (MASK_04 | MASK_20)); // DMA3 on - SAA7146_IER_ENABLE(budget->dev, MASK_10); // VPE + SAA7146_ISR_CLEAR(budget->dev, MASK_10); /* VPE */ + SAA7146_IER_ENABLE(budget->dev, MASK_10); /* VPE */ + saa7146_write(dev, MC1, (MASK_04 | MASK_20)); /* DMA3 on */ return ++budget->feeding; } @@ -249,6 +257,7 @@ return -EINVAL; spin_lock(&budget->feedlock); + feed->pusi_seen = 0; /* have a clean section start */ status = start_ts_capture (budget); spin_unlock(&budget->feedlock); return status; diff -Nru a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c --- a/drivers/media/dvb/ttpci/budget-patch.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/ttpci/budget-patch.c 2005-01-28 14:11:40 -08:00 @@ -41,34 +41,127 @@ static struct saa7146_extension budget_extension; -MAKE_BUDGET_INFO(fs_1_3,"Siemens/Technotrend/Hauppauge PCI rev1.3+Budget_Patch", BUDGET_PATCH); +MAKE_BUDGET_INFO(ttbp, "TT-Budget/Patch DVB-S 1.x PCI", BUDGET_PATCH); +//MAKE_BUDGET_INFO(satel,"TT-Budget/Patch SATELCO PCI", BUDGET_TT_HW_DISEQC); static struct pci_device_id pci_tbl[] = { - MAKE_EXTENSION_PCI(fs_1_3,0x13c2, 0x0000), + MAKE_EXTENSION_PCI(ttbp,0x13c2, 0x0000), +// MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013), { .vendor = 0, } }; -static int budget_wdebi(struct budget_patch *budget, u32 config, int addr, u32 val, int count) +/* those lines are for budget-patch to be tried +** on a true budget card and observe the +** behaviour of VSYNC generated by rps1. +** this code was shamelessly copy/pasted from budget.c +*/ +static void gpio_Set22K (struct budget *budget, int state) +{ + struct saa7146_dev *dev=budget->dev; + dprintk(2, "budget: %p\n", budget); + saa7146_setgpio(dev, 3, (state ? SAA7146_GPIO_OUTHI : SAA7146_GPIO_OUTLO)); +} + +/* Diseqc functions only for TT Budget card */ +/* taken from the Skyvision DVB driver by + Ralph Metzler */ + +static void DiseqcSendBit (struct budget *budget, int data) +{ + struct saa7146_dev *dev=budget->dev; + dprintk(2, "budget: %p\n", budget); + + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); + udelay(data ? 500 : 1000); + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); + udelay(data ? 1000 : 500); +} + +static void DiseqcSendByte (struct budget *budget, int data) +{ + int i, par=1, d; + + dprintk(2, "budget: %p\n", budget); + + for (i=7; i>=0; i--) { + d = (data>>i)&1; + par ^= d; + DiseqcSendBit(budget, d); + } + + DiseqcSendBit(budget, par); +} + +static int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, unsigned long burst) { struct saa7146_dev *dev=budget->dev; + int i; dprintk(2, "budget: %p\n", budget); - if (count <= 0 || count > 4) - return -1; + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); + mdelay(16); + + for (i=0; idvb->priv; + + switch (tone) { + case SEC_TONE_ON: + gpio_Set22K (budget, 1); + break; + + case SEC_TONE_OFF: + gpio_Set22K (budget, 0); + break; + + default: + return -EINVAL; + } + + return 0; +} - saa7146_write(dev, DEBI_CONFIG, config); +static int budget_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd) +{ + struct budget* budget = (struct budget*) fe->dvb->priv; - saa7146_write(dev, DEBI_AD, val ); - saa7146_write(dev, DEBI_COMMAND, (count << 17) | (addr & 0xffff)); - saa7146_write(dev, MC2, (2 << 16) | 2); - mdelay(5); + SendDiSEqCMsg (budget, cmd->msg_len, cmd->msg, 0); return 0; } +static int budget_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t minicmd) +{ + struct budget* budget = (struct budget*) fe->dvb->priv; + + SendDiSEqCMsg (budget, 0, NULL, minicmd); + + return 0; +} static int budget_av7110_send_fw_cmd(struct budget_patch *budget, u16* buf, int length) { @@ -77,14 +170,17 @@ dprintk(2, "budget: %p\n", budget); for (i = 2; i < length; i++) - budget_wdebi(budget, DEBINOSWAP, COMMAND + 2*i, (u32) buf[i], 2); - + { + ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2*i, 2, (u32) buf[i], 0,0); + msleep(5); + } if (length) - budget_wdebi(budget, DEBINOSWAP, COMMAND + 2, (u32) buf[1], 2); + ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2, 2, (u32) buf[1], 0,0); else - budget_wdebi(budget, DEBINOSWAP, COMMAND + 2, 0, 2); - - budget_wdebi(budget, DEBINOSWAP, COMMAND, (u32) buf[0], 2); + ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2, 2, 0, 0,0); + msleep(5); + ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND, 2, (u32) buf[0], 0,0); + msleep(5); return 0; } @@ -319,6 +415,7 @@ { switch(budget->dev->pci->subsystem_device) { case 0x0000: // Hauppauge/TT WinTV DVB-S rev1.X + case 0x1013: // SATELCO Multimedia PCI // try the ALPS BSRV2 first of all budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); @@ -332,18 +429,18 @@ // try the ALPS BSRU6 now budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); if (budget->dvb_frontend) { - budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_patch_diseqc_send_master_cmd; - budget->dvb_frontend->ops->diseqc_send_burst = budget_patch_diseqc_send_burst; - budget->dvb_frontend->ops->set_tone = budget_patch_set_tone; + budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_diseqc_send_master_cmd; + budget->dvb_frontend->ops->diseqc_send_burst = budget_diseqc_send_burst; + budget->dvb_frontend->ops->set_tone = budget_set_tone; break; } // Try the grundig 29504-451 budget->dvb_frontend = tda8083_attach(&grundig_29504_451_config, &budget->i2c_adap); if (budget->dvb_frontend) { - budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_patch_diseqc_send_master_cmd; - budget->dvb_frontend->ops->diseqc_send_burst = budget_patch_diseqc_send_burst; - budget->dvb_frontend->ops->set_tone = budget_patch_set_tone; + budget->dvb_frontend->ops->diseqc_send_master_cmd = budget_diseqc_send_master_cmd; + budget->dvb_frontend->ops->diseqc_send_burst = budget_diseqc_send_burst; + budget->dvb_frontend->ops->set_tone = budget_set_tone; break; } break; @@ -365,23 +462,120 @@ } } +/* written by Emard */ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *info) { struct budget_patch *budget; int err; int count = 0; + int detected = 0; - if (!(budget = kmalloc (sizeof(struct budget_patch), GFP_KERNEL))) - return -ENOMEM; +#define PATCH_RESET 0 +#define RPS_IRQ 0 +#define HPS_SETUP 0 +#if PATCH_RESET + saa7146_write(dev, MC1, MASK_31); + msleep(40); +#endif +#if HPS_SETUP + // initialize registers. Better to have it like this + // than leaving something unconfigured + saa7146_write(dev, DD1_STREAM_B, 0); + // port B VSYNC at rising edge + saa7146_write(dev, DD1_INIT, 0x00000200); // have this in budget-core too! + saa7146_write(dev, BRS_CTRL, 0x00000000); // VBI + + // debi config + // saa7146_write(dev, DEBI_CONFIG, MASK_30|MASK_28|MASK_18); + + // zero all HPS registers + saa7146_write(dev, HPS_H_PRESCALE, 0); // r68 + saa7146_write(dev, HPS_H_SCALE, 0); // r6c + saa7146_write(dev, BCS_CTRL, 0); // r70 + saa7146_write(dev, HPS_V_SCALE, 0); // r60 + saa7146_write(dev, HPS_V_GAIN, 0); // r64 + saa7146_write(dev, CHROMA_KEY_RANGE, 0); // r74 + saa7146_write(dev, CLIP_FORMAT_CTRL, 0); // r78 + // Set HPS prescaler for port B input + saa7146_write(dev, HPS_CTRL, (1<<30) | (0<<29) | (1<<28) | (0<<12) ); + saa7146_write(dev, MC2, + 0 * (MASK_08 | MASK_24) | // BRS control + 0 * (MASK_09 | MASK_25) | // a + 0 * (MASK_10 | MASK_26) | // b + 1 * (MASK_06 | MASK_22) | // HPS_CTRL1 + 1 * (MASK_05 | MASK_21) | // HPS_CTRL2 + 0 * (MASK_01 | MASK_15) // DEBI + ); +#endif + // Disable RPS1 and RPS0 + saa7146_write(dev, MC1, ( MASK_29 | MASK_28)); + // RPS1 timeout disable + saa7146_write(dev, RPS_TOV1, 0); + + // code for autodetection + // will wait for VBI_B event (vertical blank at port B) + // and will reset GPIO3 after VBI_B is detected. + // (GPIO3 should be raised high by CPU to + // test if GPIO3 will generate vertical blank signal + // in budget patch GPIO3 is connected to VSYNC_B + count = 0; +#if 0 + WRITE_RPS1(cpu_to_le32(CMD_UPLOAD | + MASK_10 | MASK_09 | MASK_08 | MASK_06 | MASK_05 | MASK_04 | MASK_03 | MASK_02 )); +#endif + WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_VBI_B)); + WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); + WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); + WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTLO<<24)); +#if RPS_IRQ + // issue RPS1 interrupt to increment counter + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); + // at least a NOP is neede between two interrupts + WRITE_RPS1(cpu_to_le32(CMD_NOP)); + // interrupt again + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); +#endif + WRITE_RPS1(cpu_to_le32(CMD_STOP)); + +#if RPS_IRQ + // set event counter 1 source as RPS1 interrupt (0x03) (rE4 p53) + // use 0x03 to track RPS1 interrupts - increase by 1 every gpio3 is toggled + // use 0x15 to track VPE interrupts - increase by 1 every vpeirq() is called + saa7146_write(dev, EC1SSR, (0x03<<2) | 3 ); + // set event counter 1 treshold to maximum allowed value (rEC p55) + saa7146_write(dev, ECT1R, 0x3fff ); +#endif + // Fix VSYNC level + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); + // Set RPS1 Address register to point to RPS code (r108 p42) + saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); + // Enable RPS1, (rFC p33) + saa7146_write(dev, MC1, (MASK_13 | MASK_29 )); - dprintk(2, "budget: %p\n", budget); - if ((err = ttpci_budget_init (budget, dev, info, THIS_MODULE))) { - kfree (budget); - return err; - } + mdelay(50); + saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); + mdelay(150); + + + if( (saa7146_read(dev, GPIO_CTRL) & 0x10000000) == 0) + detected = 1; + +#if RPS_IRQ + printk("Event Counter 1 0x%04x\n", saa7146_read(dev, EC1R) & 0x3fff ); +#endif + // Disable RPS1 + saa7146_write(dev, MC1, ( MASK_29 )); + + if(detected == 0) + printk("budget-patch not detected or saa7146 in non-default state.\n" + "try enabling ressetting of 7146 with MASK_31 in MC1 register\n"); + + else + printk("BUDGET-PATCH DETECTED.\n"); + -/* +/* OLD (Original design by Roberto Deza): ** This code will setup the SAA7146_RPS1 to generate a square ** wave on GPIO3, changing when a field (TS_HEIGHT/2 "lines" of ** TS_WIDTH packets) has been acquired on SAA7146_D1B video port; @@ -393,24 +587,85 @@ ** which seems that can be done perfectly without this :-)). */ +/* New design (By Emard) +** this rps1 code will copy internal HS event to GPIO3 pin. +** GPIO3 is in budget-patch hardware connectd to port B VSYNC + +** HS is an internal event of 7146, accessible with RPS +** and temporarily raised high every n lines +** (n in defined in the RPS_THRESH1 counter threshold) +** I think HS is raised high on the beginning of the n-th line +** and remains high until this n-th line that triggered +** it is completely received. When the receiption of n-th line +** ends, HS is lowered. + +** To transmit data over DMA, 7146 needs changing state at +** port B VSYNC pin. Any changing of port B VSYNC will +** cause some DMA data transfer, with more or less packets loss. +** It depends on the phase and frequency of VSYNC and +** the way of 7146 is instructed to trigger on port B (defined +** in DD1_INIT register, 3rd nibble from the right valid +** numbers are 0-7, see datasheet) +** +** The correct triggering can minimize packet loss, +** dvbtraffic should give this stable bandwidths: +** 22k transponder = 33814 kbit/s +** 27.5k transponder = 38045 kbit/s +** by experiment it is found that the best results +** (stable bandwidths and almost no packet loss) +** are obtained using DD1_INIT triggering number 2 +** (Va at rising edge of VS Fa = HS x VS-failing forced toggle) +** and a VSYNC phase that occurs in the middle of DMA transfer +** (about byte 188*512=96256 in the DMA window). +** +** Phase of HS is still not clear to me how to control, +** It just happens to be so. It can be seen if one enables +** RPS_IRQ and print Event Counter 1 in vpeirq(). Every +** time RPS_INTERRUPT is called, the Event Counter 1 will +** increment. That's how the 7146 is programmed to do event +** counting in this budget-patch.c +** I *think* HPS setting has something to do with the phase +** of HS but I cant be 100% sure in that. + +** hardware debug note: a working budget card (including budget patch) +** with vpeirq() interrupt setup in mode "0x90" (every 64K) will +** generate 3 interrupts per 25-Hz DMA frame of 2*188*512 bytes +** and that means 3*25=75 Hz of interrupt freqency, as seen by +** watch cat /proc/interrupts +** +** If this frequency is 3x lower (and data received in the DMA +** buffer don't start with 0x47, but in the middle of packets, +** whose lengths appear to be like 188 292 188 104 etc. +** this means VSYNC line is not connected in the hardware. +** (check soldering pcb and pins) +** The same behaviour of missing VSYNC can be duplicated on budget +** cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. +*/ + // Setup RPS1 "program" (p35) + count = 0; + - // Wait reset Source Line Counter Threshold (p36) - WRITE_RPS1(cpu_to_le32(CMD_PAUSE | RPS_INV | EVT_HS)); // Wait Source Line Counter Threshold (p36) WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_HS)); // Set GPIO3=1 (p42) WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTHI<<24)); +#if RPS_IRQ + // issue RPS1 interrupt + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); +#endif // Wait reset Source Line Counter Threshold (p36) WRITE_RPS1(cpu_to_le32(CMD_PAUSE | RPS_INV | EVT_HS)); - // Wait Source Line Counter Threshold - WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_HS)); // Set GPIO3=0 (p42) WRITE_RPS1(cpu_to_le32(CMD_WR_REG_MASK | (GPIO_CTRL>>2))); WRITE_RPS1(cpu_to_le32(GPIO3_MSK)); WRITE_RPS1(cpu_to_le32(SAA7146_GPIO_OUTLO<<24)); +#if RPS_IRQ + // issue RPS1 interrupt + WRITE_RPS1(cpu_to_le32(CMD_INTERRUPT)); +#endif // Jump to begin of RPS program (p37) WRITE_RPS1(cpu_to_le32(CMD_JUMP)); WRITE_RPS1(cpu_to_le32(dev->d_rps1.dma_handle)); @@ -420,9 +675,30 @@ // Set RPS1 Address register to point to RPS code (r108 p42) saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); // Set Source Line Counter Threshold, using BRS (rCC p43) - saa7146_write(dev, RPS_THRESH1, ((TS_HEIGHT/2) | MASK_12)); + // It generates HS event every TS_HEIGHT lines + // this is related to TS_WIDTH set in register + // NUM_LINE_BYTE3 in budget-core.c. If NUM_LINE_BYTE + // low 16 bits are set to TS_WIDTH bytes (TS_WIDTH=2*188 + //,then RPS_THRESH1 + // should be set to trigger every TS_HEIGHT (512) lines. + // + saa7146_write(dev, RPS_THRESH1, (TS_HEIGHT*1) | MASK_12 ); + + // saa7146_write(dev, RPS_THRESH0, ((TS_HEIGHT/2)<<16) |MASK_28| (TS_HEIGHT/2) |MASK_12 ); // Enable RPS1 (rFC p33) saa7146_write(dev, MC1, (MASK_13 | MASK_29)); + + + if (!(budget = kmalloc (sizeof(struct budget_patch), GFP_KERNEL))) + return -ENOMEM; + + dprintk(2, "budget: %p\n", budget); + + if ((err = ttpci_budget_init (budget, dev, info, THIS_MODULE))) { + kfree (budget); + return err; + } + dev->ext_priv = budget; diff -Nru a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c --- a/drivers/media/dvb/ttpci/budget.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/dvb/ttpci/budget.c 2005-01-28 14:11:40 -08:00 @@ -414,7 +414,7 @@ { switch(budget->dev->pci->subsystem_device) { case 0x1003: // Hauppauge/TT Nova budget (stv0299/ALPS BSRU6(tsa5059) OR ves1893/ALPS BSRV2(sp5659)) - + case 0x1013: // try the ALPS BSRV2 first of all budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); if (budget->dvb_frontend) { @@ -522,14 +522,14 @@ MAKE_BUDGET_INFO(ttbs, "TT-Budget/WinTV-NOVA-S PCI", BUDGET_TT); MAKE_BUDGET_INFO(ttbc, "TT-Budget/WinTV-NOVA-C PCI", BUDGET_TT); MAKE_BUDGET_INFO(ttbt, "TT-Budget/WinTV-NOVA-T PCI", BUDGET_TT); -/* MAKE_BUDGET_INFO(satel, "SATELCO Multimedia PCI", BUDGET_TT_HW_DISEQC); UNDEFINED HARDWARE - mail linuxtv.org list */ +MAKE_BUDGET_INFO(satel, "SATELCO Multimedia PCI", BUDGET_TT_HW_DISEQC); MAKE_BUDGET_INFO(fsacs, "Fujitsu Siemens Activy Budget-S PCI", BUDGET_FS_ACTIVY); static struct pci_device_id pci_tbl[] = { MAKE_EXTENSION_PCI(ttbs, 0x13c2, 0x1003), MAKE_EXTENSION_PCI(ttbc, 0x13c2, 0x1004), MAKE_EXTENSION_PCI(ttbt, 0x13c2, 0x1005), -/* MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013), UNDEFINED HARDWARE */ + MAKE_EXTENSION_PCI(satel, 0x13c2, 0x1013), MAKE_EXTENSION_PCI(fsacs, 0x1131, 0x4f61), { .vendor = 0, diff -Nru a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2005-01-28 14:11:41 -08:00 @@ -756,7 +756,7 @@ if (!dec->iso_stream_count) { for (i = 0; i < ISO_BUF_COUNT; i++) - usb_unlink_urb(dec->iso_urb[i]); + usb_kill_urb(dec->iso_urb[i]); } up(&dec->iso_sem); @@ -821,7 +821,7 @@ "error %d\n", __FUNCTION__, i, result); while (i) { - usb_unlink_urb(dec->iso_urb[i - 1]); + usb_kill_urb(dec->iso_urb[i - 1]); i--; } @@ -1379,7 +1379,7 @@ dec->iso_stream_count = 0; for (i = 0; i < ISO_BUF_COUNT; i++) - usb_unlink_urb(dec->iso_urb[i]); + usb_kill_urb(dec->iso_urb[i]); ttusb_dec_free_iso_urbs(dec); } diff -Nru a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig --- a/drivers/media/video/Kconfig 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/Kconfig 2005-01-28 14:11:41 -08:00 @@ -16,6 +16,7 @@ select VIDEO_BUF select VIDEO_IR select VIDEO_TUNER + select VIDEO_TVEEPROM ---help--- Support for BT848 based frame grabber/overlay boards. This includes the Miro, Hauppauge and STB boards. Please read the material in diff -Nru a/drivers/media/video/Makefile b/drivers/media/video/Makefile --- a/drivers/media/video/Makefile 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/Makefile 2005-01-28 14:11:40 -08:00 @@ -48,6 +48,7 @@ obj-$(CONFIG_VIDEO_BUF) += video-buf.o obj-$(CONFIG_VIDEO_BUF_DVB) += video-buf-dvb.o obj-$(CONFIG_VIDEO_BTCX) += btcx-risc.o +obj-$(CONFIG_VIDEO_TVEEPROM) += tveeprom.o obj-$(CONFIG_VIDEO_M32R_AR_M64278) += arv.o diff -Nru a/drivers/media/video/arv.c b/drivers/media/video/arv.c --- a/drivers/media/video/arv.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/arv.c 2005-01-28 14:11:41 -08:00 @@ -627,7 +627,7 @@ */ static int ar_initialize(struct video_device *dev) { - struct ar_device *ar = (struct ar_device *)dev->priv; + struct ar_device *ar = dev->priv; unsigned long cr = 0; int i,found=0; diff -Nru a/drivers/media/video/btcx-risc.c b/drivers/media/video/btcx-risc.c --- a/drivers/media/video/btcx-risc.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/btcx-risc.c 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - $Id: btcx-risc.c,v 1.4 2004/11/07 13:17:14 kraxel Exp $ + $Id: btcx-risc.c,v 1.5 2004/12/10 12:33:39 kraxel Exp $ btcx-risc.c @@ -24,6 +24,7 @@ */ #include +#include #include #include #include diff -Nru a/drivers/media/video/bttv-cards.c b/drivers/media/video/bttv-cards.c --- a/drivers/media/video/bttv-cards.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/bttv-cards.c 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - $Id: bttv-cards.c,v 1.32 2004/11/07 13:17:14 kraxel Exp $ + $Id: bttv-cards.c,v 1.42 2005/01/13 17:22:33 kraxel Exp $ bttv-cards.c @@ -29,18 +29,19 @@ #include #include #include +#include #include #include #include #include -#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE) -# include -#endif +#include #include #include "bttvp.h" +#if 0 /* not working yet */ #include "bt832.h" +#endif /* fwd decl */ static void boot_msp34xx(struct bttv *btv, int pin); @@ -76,6 +77,9 @@ static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input); static void picolo_tetra_init(struct bttv *btv); +static void tibetCS16_muxsel(struct bttv *btv, unsigned int input); +static void tibetCS16_init(struct bttv *btv); + static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input); static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input); @@ -84,12 +88,13 @@ static int tea5757_write(struct bttv *btv, int value); static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256]); +static int __devinit pvr_boot(struct bttv *btv); /* config variables */ static unsigned int triton1=0; static unsigned int vsfx=0; static unsigned int latency = UNSET; -unsigned int no_overlay=-1; +static unsigned int no_overlay=-1; static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET }; @@ -283,12 +288,12 @@ // DVB cards (using pci function .1 for mpeg data xfer) { 0x01010071, BTTV_NEBULA_DIGITV, "Nebula Electronics DigiTV" }, - { 0x07611461, BTTV_AVDVBT_761, "AverMedia AverTV DVB-T" }, + { 0x07611461, BTTV_AVDVBT_761, "AverMedia AverTV DVB-T 761" }, { 0x001c11bd, BTTV_PINNACLESAT, "Pinnacle PCTV Sat" }, { 0x002611bd, BTTV_TWINHAN_DST, "Pinnacle PCTV SAT CI" }, { 0x00011822, BTTV_TWINHAN_DST, "Twinhan VisionPlus DVB-T" }, { 0xfc00270f, BTTV_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" }, - { 0x07711461, BTTV_AVDVBT_771, "AVermedia DVB-T 771" }, + { 0x07711461, BTTV_AVDVBT_771, "AVermedia AverTV DVB-T 771" }, { 0xdb1018ac, BTTV_DVICO_DVBT_LITE, "DVICO FusionHDTV DVB-T Lite" }, { 0, -1, NULL } @@ -2156,6 +2161,33 @@ .tuner_type = TUNER_PHILIPS_NTSC_M, .has_radio = 0, // .has_remote = 1, +},{ + /* Rick C */ + .name = "Super TV Tuner", + .video_inputs = 4, + .audio_inputs = 1, + .tuner = 0, + .svhs = 2, + .muxsel = { 2, 3, 1, 0}, + .tuner_type = TUNER_PHILIPS_NTSC, + .gpiomask = 0x008007, + .audiomux = { 0, 0x000001,0,0, 0}, + .needs_tvaudio = 1, + .has_radio = 1, +},{ + /* Chris Fanning */ + .name = "Tibet Systems 'Progress DVR' CS16", + .video_inputs = 16, + .audio_inputs = 0, + .tuner = -1, + .svhs = -1, + .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 }, + .pll = PLL_28, + .no_msp34xx = 1, + .no_tda9875 = 1, + .no_tda7432 = 1, + .tuner_type = -1, + .muxsel_hook = tibetCS16_muxsel, }}; static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards); @@ -2499,7 +2531,7 @@ /* ----------------------------------------------------------------------- */ -void bttv_reset_audio(struct bttv *btv) +static void bttv_reset_audio(struct bttv *btv) { /* * BT878A has a audio-reset register. @@ -2542,6 +2574,8 @@ btv->use_i2c_hw = 1; break; } + if (!bttv_tvcards[btv->c.type].has_dvb) + bttv_reset_audio(btv); } /* initialization part two -- after registering i2c bus */ @@ -2645,6 +2679,9 @@ case BTTV_LMLBT4: init_lmlbt4x(btv); break; + case BTTV_TIBET_CS16: + tibetCS16_init(btv); + break; } /* pll configuration */ @@ -2681,6 +2718,8 @@ } btv->pll.pll_current = -1; + bttv_reset_audio(btv); + /* tuner configuration (from card list / autodetect / insmod option) */ if (UNSET != bttv_tvcards[btv->c.type].tuner_type) if(UNSET == btv->tuner_type) @@ -2745,7 +2784,10 @@ if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb && bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0) tda9887 = 1; - if (tda9887) + if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) || + (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) || + (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) || + tda9887) request_module("tda9887"); if (btv->tuner_type != UNSET) request_module("tuner"); @@ -2753,67 +2795,6 @@ /* ----------------------------------------------------------------------- */ -/* some hauppauge specific stuff */ - -static struct HAUPPAUGE_TUNER -{ - int id; - char *name; -} -hauppauge_tuner[] __devinitdata = -{ - { TUNER_ABSENT, "" }, - { TUNER_ABSENT, "External" }, - { TUNER_ABSENT, "Unspecified" }, - { TUNER_PHILIPS_PAL, "Philips FI1216" }, - { TUNER_PHILIPS_SECAM, "Philips FI1216MF" }, - { TUNER_PHILIPS_NTSC, "Philips FI1236" }, - { TUNER_PHILIPS_PAL_I, "Philips FI1246" }, - { TUNER_PHILIPS_PAL_DK,"Philips FI1256" }, - { TUNER_PHILIPS_PAL, "Philips FI1216 MK2" }, - { TUNER_PHILIPS_SECAM, "Philips FI1216MF MK2" }, - { TUNER_PHILIPS_NTSC, "Philips FI1236 MK2" }, - { TUNER_PHILIPS_PAL_I, "Philips FI1246 MK2" }, - { TUNER_PHILIPS_PAL_DK,"Philips FI1256 MK2" }, - { TUNER_TEMIC_NTSC, "Temic 4032FY5" }, - { TUNER_TEMIC_PAL, "Temic 4002FH5" }, - { TUNER_TEMIC_PAL_I, "Temic 4062FY5" }, - { TUNER_PHILIPS_PAL, "Philips FR1216 MK2" }, - { TUNER_PHILIPS_SECAM, "Philips FR1216MF MK2" }, - { TUNER_PHILIPS_NTSC, "Philips FR1236 MK2" }, - { TUNER_PHILIPS_PAL_I, "Philips FR1246 MK2" }, - { TUNER_PHILIPS_PAL_DK,"Philips FR1256 MK2" }, - { TUNER_PHILIPS_PAL, "Philips FM1216" }, - { TUNER_PHILIPS_SECAM, "Philips FM1216MF" }, - { TUNER_PHILIPS_NTSC, "Philips FM1236" }, - { TUNER_PHILIPS_PAL_I, "Philips FM1246" }, - { TUNER_PHILIPS_PAL_DK,"Philips FM1256" }, - { TUNER_TEMIC_4036FY5_NTSC, "Temic 4036FY5" }, - { TUNER_ABSENT, "Samsung TCPN9082D" }, - { TUNER_ABSENT, "Samsung TCPM9092P" }, - { TUNER_TEMIC_4006FH5_PAL, "Temic 4006FH5" }, - { TUNER_ABSENT, "Samsung TCPN9085D" }, - { TUNER_ABSENT, "Samsung TCPB9085P" }, - { TUNER_ABSENT, "Samsung TCPL9091P" }, - { TUNER_TEMIC_4039FR5_NTSC, "Temic 4039FR5" }, - { TUNER_PHILIPS_FQ1216ME, "Philips FQ1216 ME" }, - { TUNER_TEMIC_4066FY5_PAL_I, "Temic 4066FY5" }, - { TUNER_PHILIPS_NTSC, "Philips TD1536" }, - { TUNER_PHILIPS_NTSC, "Philips TD1536D" }, - { TUNER_PHILIPS_NTSC, "Philips FMR1236" }, /* mono radio */ - { TUNER_ABSENT, "Philips FI1256MP" }, - { TUNER_ABSENT, "Samsung TCPQ9091P" }, - { TUNER_TEMIC_4006FN5_MULTI_PAL, "Temic 4006FN5" }, - { TUNER_TEMIC_4009FR5_PAL, "Temic 4009FR5" }, - { TUNER_TEMIC_4046FM5, "Temic 4046FM5" }, - { TUNER_TEMIC_4009FN5_MULTI_PAL_FM, "Temic 4009FN5" }, - { TUNER_ABSENT, "Philips TD1536D_FH_44"}, - { TUNER_LG_NTSC_FM, "LG TPI8NSR01F"}, - { TUNER_LG_PAL_FM, "LG TPI8PSB01D"}, - { TUNER_LG_PAL, "LG TPI8PSB11D"}, - { TUNER_LG_PAL_I_FM, "LG TAPC-I001D"}, - { TUNER_LG_PAL_I, "LG TAPC-I701D"} -}; static void modtec_eeprom(struct bttv *btv) { @@ -2837,31 +2818,11 @@ static void __devinit hauppauge_eeprom(struct bttv *btv) { - unsigned int blk2,tuner,radio,model; + struct tveeprom tv; - if (eeprom_data[0] != 0x84 || eeprom_data[2] != 0) - printk(KERN_WARNING "bttv%d: Hauppauge eeprom: invalid\n", - btv->c.nr); - - /* Block 2 starts after len+3 bytes header */ - blk2 = eeprom_data[1] + 3; - - /* decode + use some config infos */ - model = eeprom_data[12] << 8 | eeprom_data[11]; - tuner = eeprom_data[9]; - radio = eeprom_data[blk2-1] & 0x01; - - if (tuner < ARRAY_SIZE(hauppauge_tuner)) - btv->tuner_type = hauppauge_tuner[tuner].id; - if (radio) - btv->has_radio = 1; - - if (bttv_verbose) - printk(KERN_INFO "bttv%d: Hauppauge eeprom: model=%d, " - "tuner=%s (%d), radio=%s\n", - btv->c.nr, model, (tuner < ARRAY_SIZE(hauppauge_tuner) - ? hauppauge_tuner[tuner].name : "?"), - btv->tuner_type, radio ? "yes" : "no"); + tveeprom_hauppauge_analog(&tv, eeprom_data); + btv->tuner_type = tv.tuner_type; + btv->has_radio = tv.has_radio; } static int terratec_active_radio_upgrade(struct bttv *btv) @@ -2947,7 +2908,7 @@ return 0; } -int __devinit pvr_boot(struct bttv *btv) +static int __devinit pvr_boot(struct bttv *btv) { const struct firmware *fw_entry; int rc; @@ -3077,7 +3038,8 @@ TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/, TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL, TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM, - TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL}; + TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL, + TUNER_PHILIPS_FM1216ME_MK3 }; #if 0 int tuner_0_fm_table[] = { PHILIPS_FR1236_NTSC, PHILIPS_FR1216_PAL, @@ -3104,12 +3066,16 @@ btv->has_remote = (eeprom_data[0x42] & 0x01); if (tuner_make == 0 || tuner_make == 2) - if(tuner_format <=9) + if(tuner_format <=0x0a) tuner = tuner_0_table[tuner_format]; if (tuner_make == 1) if(tuner_format <=9) tuner = tuner_1_table[tuner_format]; + if (tuner_make == 4) + if(tuner_format == 0x09) + tuner = TUNER_LG_NTSC_NEW_TAPC; // TAPC-G702P + printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=", btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]); if(tuner) { @@ -3167,6 +3133,7 @@ static void __devinit boot_bt832(struct bttv *btv) { +#if 0 /* not working yet */ int resetbit=0; switch (btv->c.type) { @@ -3195,6 +3162,7 @@ // bt832 on pixelview changes from i2c 0x8a to 0x88 after // being reset as above. So we must follow by this: bttv_call_i2c_clients(btv, BT832_REATTACH, NULL); +#endif } /* ----------------------------------------------------------------------- */ @@ -3883,6 +3851,47 @@ mdelay(1); gpio_bits(0x480,0x080); mdelay(1); +} + +/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning] + * + * The CS16 (available on eBay cheap) is a PCI board with four Fusion + * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator + * chips, ten eight input analog multiplexors, a not chip and a few + * other components. + * + * 16 inputs on a secondary bracket are provided and can be selected + * from each of the four capture chips. Two of the eight input + * multiplexors are used to select from any of the 16 input signals. + * + * Unsupported hardware capabilities: + * . A video output monitor on the secondary bracket can be selected from + * one of the 878A chips. + * . Another passthrough but I haven't spent any time investigating it. + * . Digital I/O (logic level connected to GPIO) is available from an + * onboard header. + * + * The on chip input mux should always be set to 2. + * GPIO[16:19] - Video input selection + * GPIO[0:3] - Video output monitor select (only available from one 878A) + * GPIO[?:?] - Digital I/O. + * + * There is an ATMEL microcontroller with an 8031 core on board. I have not + * determined what function (if any) it provides. With the microcontroller + * and sync seperator chips a guess is that it might have to do with video + * switching and maybe some digital I/O. + */ +static void tibetCS16_muxsel(struct bttv *btv, unsigned int input) +{ + /* video mux */ + gpio_bits(0x0f0000, input << 16); +} + +static void tibetCS16_init(struct bttv *btv) +{ + /* enable gpio bits, mask obtained via btSpy */ + gpio_inout(0xffffff, 0x0f7fff); + gpio_write(0x0f7fff); } // The Grandtec X-Guard framegrabber card uses two Dual 4-channel diff -Nru a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c --- a/drivers/media/video/bttv-driver.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/bttv-driver.c 2005-01-28 14:11:41 -08:00 @@ -1,5 +1,5 @@ /* - $Id: bttv-driver.c,v 1.27 2004/11/07 14:44:59 kraxel Exp $ + $Id: bttv-driver.c,v 1.34 2005/01/07 13:11:19 kraxel Exp $ bttv - Bt848 frame grabber driver @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -105,6 +106,7 @@ module_param(whitecrush_upper, int, 0444); module_param(whitecrush_lower, int, 0444); module_param(vcr_hack, int, 0444); + module_param_array(radio, int, NULL, 0444); MODULE_PARM_DESC(radio,"The TV card supports radio, default is 0 (no)"); @@ -1063,7 +1065,7 @@ init_irqreg(btv); } -void bttv_reinit_bt848(struct bttv *btv) +static void bttv_reinit_bt848(struct bttv *btv) { unsigned long flags; @@ -1267,7 +1269,7 @@ btv->c.nr,outbits,data & outbits, data & ~outbits, comment); } -void bttv_field_count(struct bttv *btv) +static void bttv_field_count(struct bttv *btv) { int need_count = 0; @@ -1467,7 +1469,7 @@ "SMICROCODE", "GVBIFMT", "SVBIFMT" }; #define V4L1_IOCTLS ARRAY_SIZE(v4l1_ioctls) -int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) +static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg) { switch (cmd) { case BTTV_VERSION: @@ -2531,9 +2533,11 @@ V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OVERLAY | V4L2_CAP_VBI_CAPTURE | - V4L2_CAP_TUNER | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; + if (bttv_tvcards[btv->c.type].tuner != UNSET && + bttv_tvcards[btv->c.type].tuner != TUNER_ABSENT) + cap->capabilities |= V4L2_CAP_TUNER; return 0; } @@ -2988,6 +2992,9 @@ free_btres(btv,fh,RESOURCE_VBI); } + /* free stuff */ + videobuf_mmap_free(&fh->cap); + videobuf_mmap_free(&fh->vbi); v4l2_prio_close(&btv->prio,&fh->prio); file->private_data = NULL; kfree(fh); diff -Nru a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c --- a/drivers/media/video/bttv-i2c.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/bttv-i2c.c 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - $Id: bttv-i2c.c,v 1.13 2004/11/07 13:17:15 kraxel Exp $ + $Id: bttv-i2c.c,v 1.17 2004/12/14 15:33:30 kraxel Exp $ bttv-i2c.c -- all the i2c code is here @@ -26,6 +26,7 @@ */ #include +#include #include #include #include @@ -327,13 +328,6 @@ i2c_clients_command(&btv->c.i2c_adap, cmd, arg); } -void bttv_i2c_call(unsigned int card, unsigned int cmd, void *arg) -{ - if (card >= bttv_num) - return; - bttv_call_i2c_clients(&bttvs[card], cmd, arg); -} - static struct i2c_client bttv_i2c_client_template = { I2C_DEVNAME("bttv internal"), .id = -1, @@ -385,19 +379,8 @@ /* read EEPROM content */ void __devinit bttv_readee(struct bttv *btv, unsigned char *eedata, int addr) { - int i; - - if (bttv_I2CWrite(btv, addr, 0, -1, 0)<0) { - printk(KERN_WARNING "bttv: readee error\n"); - return; - } btv->i2c_client.addr = addr >> 1; - for (i=0; i<256; i+=16) { - if (16 != i2c_master_recv(&btv->i2c_client,eedata+i,16)) { - printk(KERN_WARNING "bttv: readee error\n"); - break; - } - } + tveeprom_read(&btv->i2c_client, eedata, 256); } static char *i2c_devs[128] = { diff -Nru a/drivers/media/video/bttv-if.c b/drivers/media/video/bttv-if.c --- a/drivers/media/video/bttv-if.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/bttv-if.c 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - $Id: bttv-if.c,v 1.3 2004/10/13 10:39:00 kraxel Exp $ + $Id: bttv-if.c,v 1.4 2004/11/17 18:47:47 kraxel Exp $ bttv-if.c -- old gpio interface to other kernel modules don't use in new code, will go away in 2.7 @@ -50,6 +50,8 @@ int bttv_get_cardinfo(unsigned int card, int *type, unsigned *cardid) { + printk("The bttv_* interface is obsolete and will go away,\n" + "please use the new, sysfs based interface instead.\n"); if (card >= bttv_num) { return -1; } @@ -67,7 +69,8 @@ int bttv_get_id(unsigned int card) { - printk("bttv_get_id is obsolete, use bttv_get_cardinfo instead\n"); + printk("The bttv_* interface is obsolete and will go away,\n" + "please use the new, sysfs based interface instead.\n"); if (card >= bttv_num) { return -1; } @@ -141,6 +144,13 @@ return NULL; } return &btv->gpioq; +} + +void bttv_i2c_call(unsigned int card, unsigned int cmd, void *arg) +{ + if (card >= bttv_num) + return; + bttv_call_i2c_clients(&bttvs[card], cmd, arg); } /* diff -Nru a/drivers/media/video/bttv-risc.c b/drivers/media/video/bttv-risc.c --- a/drivers/media/video/bttv-risc.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/bttv-risc.c 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - $Id: bttv-risc.c,v 1.9 2004/10/13 10:39:00 kraxel Exp $ + $Id: bttv-risc.c,v 1.10 2004/11/19 18:07:12 kraxel Exp $ bttv-risc.c -- interfaces to other kernel modules diff -Nru a/drivers/media/video/bttv-vbi.c b/drivers/media/video/bttv-vbi.c --- a/drivers/media/video/bttv-vbi.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/bttv-vbi.c 2005-01-28 14:11:41 -08:00 @@ -1,5 +1,5 @@ /* - $Id: bttv-vbi.c,v 1.7 2004/11/07 13:17:15 kraxel Exp $ + $Id: bttv-vbi.c,v 1.9 2005/01/13 17:22:33 kraxel Exp $ bttv - Bt848 frame grabber driver vbi interface @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -182,7 +183,7 @@ case 2: /* SECAM */ default: start0 = 7; - start1 = 319; + start1 = 320; } count0 = (f->fmt.vbi.start[0] + f->fmt.vbi.count[0]) - start0; diff -Nru a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h --- a/drivers/media/video/bttv.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/bttv.h 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - * $Id: bttv.h,v 1.10 2004/10/13 10:39:00 kraxel Exp $ + * $Id: bttv.h,v 1.14 2005/01/07 13:11:19 kraxel Exp $ * * bttv - Bt848 frame grabber driver * @@ -133,6 +133,7 @@ #define BTTV_MATRIX_VISIONSLC 0x7e #define BTTV_APAC_VIEWCOMP 0x7f #define BTTV_DVICO_DVBT_LITE 0x80 +#define BTTV_TIBET_CS16 0x83 /* i2c address list */ #define I2C_TSA5522 0xc2 @@ -149,7 +150,7 @@ #define I2C_VHX 0xc0 #define I2C_MSP3400 0x80 #define I2C_MSP3400_ALT 0x88 -#define I2C_TEA6300 0x80 +#define I2C_TEA6300 0x80 /* also used by 6320 */ #define I2C_DPL3518 0x84 #define I2C_TDA9887 0x86 diff -Nru a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h --- a/drivers/media/video/bttvp.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/bttvp.h 2005-01-28 14:11:41 -08:00 @@ -1,5 +1,5 @@ /* - $Id: bttvp.h,v 1.12 2004/10/25 11:26:36 kraxel Exp $ + $Id: bttvp.h,v 1.15 2004/12/14 15:33:30 kraxel Exp $ bttv - Bt848 frame grabber driver @@ -43,6 +43,7 @@ #include #include #include +#include #include #include "bt848.h" @@ -221,11 +222,6 @@ extern void bttv_gpio_tracking(struct bttv *btv, char *comment); extern int init_bttv_i2c(struct bttv *btv); extern int fini_bttv_i2c(struct bttv *btv); -extern int pvr_boot(struct bttv *btv); - -extern int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg); -extern void bttv_reinit_bt848(struct bttv *btv); -extern void bttv_field_count(struct bttv *btv); #define vprintk if (bttv_verbose) printk #define dprintk if (bttv_debug >= 1) printk diff -Nru a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c --- a/drivers/media/video/cx88/cx88-i2c.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/cx88/cx88-i2c.c 2005-01-28 14:11:40 -08:00 @@ -134,7 +134,7 @@ static struct i2c_adapter cx8800_i2c_adap_template = { I2C_DEVNAME("cx2388x"), .owner = THIS_MODULE, - .id = I2C_HW_B_BT848, + .id = I2C_HW_B_CX2388x, .client_register = attach_inform, .client_unregister = detach_inform, }; diff -Nru a/drivers/media/video/ir-kbd-gpio.c b/drivers/media/video/ir-kbd-gpio.c --- a/drivers/media/video/ir-kbd-gpio.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/ir-kbd-gpio.c 2005-01-28 14:11:41 -08:00 @@ -1,5 +1,5 @@ /* - * $Id: ir-kbd-gpio.c,v 1.10 2004/09/15 16:15:24 kraxel Exp $ + * $Id: ir-kbd-gpio.c,v 1.11 2004/10/25 11:26:36 kraxel Exp $ * * Copyright (c) 2003 Gerd Knorr * Copyright (c) 2003 Pavel Machek @@ -366,7 +366,7 @@ break; case BTTV_AVDVBT_761: - /* case BTTV_AVDVBT_771: */ + case BTTV_AVDVBT_771: ir_codes = ir_codes_avermedia_dvbt; ir->mask_keycode = 0x0f00c0; ir->mask_keydown = 0x000020; diff -Nru a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c --- a/drivers/media/video/ir-kbd-i2c.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/ir-kbd-i2c.c 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - * $Id: ir-kbd-i2c.c,v 1.8 2004/09/15 16:15:24 kraxel Exp $ + * $Id: ir-kbd-i2c.c,v 1.10 2004/12/09 12:51:35 kraxel Exp $ * * keyboard input driver for i2c IR remote controls * @@ -433,7 +433,7 @@ */ static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1}; - static const int probe_saa7134[] = { 0x7a, -1}; + static const int probe_saa7134[] = { 0x7a, -1 }; const int *probe = NULL; struct i2c_client c; char buf; int i,rc; diff -Nru a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c --- a/drivers/media/video/msp3400.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/msp3400.c 2005-01-28 14:11:41 -08:00 @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -379,7 +380,7 @@ int val = 0, bal = 0; if (!muted) { - val = (volume * 0x73 / 65535) << 8; + val = (volume * 0x7F / 65535) << 8; } if (val) { bal = (balance / 256) - 128; @@ -1202,7 +1203,7 @@ static int msp34xxg_init(struct i2c_client *client) { struct msp3400c *msp = i2c_get_clientdata(client); - int modus; + int modus,std; if (msp3400c_reset(client)) return -1; @@ -1216,12 +1217,18 @@ /* step-by-step initialisation, as described in the manual */ modus = msp34xx_modus(msp->norm); + std = msp34xx_standard(msp->norm); modus &= ~0x03; /* STATUS_CHANGE=0 */ modus |= 0x01; /* AUTOMATIC_SOUND_DETECTION=1 */ if (msp3400c_write(client, I2C_MSP3400C_DEM, 0x30/*MODUS*/, modus)) + return -1; + if (msp3400c_write(client, + I2C_MSP3400C_DEM, + 0x20/*stanard*/, + std)) return -1; /* write the dfps that may have an influence on diff -Nru a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c --- a/drivers/media/video/saa5246a.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/saa5246a.c 2005-01-28 14:11:40 -08:00 @@ -682,6 +682,54 @@ } /* + * Translates old vtx IOCTLs to new ones + * + * This keeps new kernel versions compatible with old userspace programs. + */ +static inline unsigned int vtx_fix_command(unsigned int cmd) +{ + switch (cmd) { + case VTXIOCGETINFO_OLD: + cmd = VTXIOCGETINFO; + break; + case VTXIOCCLRPAGE_OLD: + cmd = VTXIOCCLRPAGE; + break; + case VTXIOCCLRFOUND_OLD: + cmd = VTXIOCCLRFOUND; + break; + case VTXIOCPAGEREQ_OLD: + cmd = VTXIOCPAGEREQ; + break; + case VTXIOCGETSTAT_OLD: + cmd = VTXIOCGETSTAT; + break; + case VTXIOCGETPAGE_OLD: + cmd = VTXIOCGETPAGE; + break; + case VTXIOCSTOPDAU_OLD: + cmd = VTXIOCSTOPDAU; + break; + case VTXIOCPUTPAGE_OLD: + cmd = VTXIOCPUTPAGE; + break; + case VTXIOCSETDISP_OLD: + cmd = VTXIOCSETDISP; + break; + case VTXIOCPUTSTAT_OLD: + cmd = VTXIOCPUTSTAT; + break; + case VTXIOCCLRCACHE_OLD: + cmd = VTXIOCCLRCACHE; + break; + case VTXIOCSETVIRT_OLD: + cmd = VTXIOCSETVIRT; + break; + } + return cmd; +} + +/* * Handle the locking */ static int saa5246a_ioctl(struct inode *inode, struct file *file, @@ -691,6 +739,7 @@ struct saa5246a_device *t = vd->priv; int err; + cmd = vtx_fix_command(cmd); down(&t->lock); err = video_usercopy(inode, file, cmd, arg, do_saa5246a_ioctl); up(&t->lock); diff -Nru a/drivers/media/video/saa5246a.h b/drivers/media/video/saa5246a.h --- a/drivers/media/video/saa5246a.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/saa5246a.h 2005-01-28 14:11:41 -08:00 @@ -23,7 +23,7 @@ #define __SAA5246A_H__ #define MAJOR_VERSION 1 /* driver major version number */ -#define MINOR_VERSION 7 /* driver minor version number */ +#define MINOR_VERSION 8 /* driver minor version number */ #define IF_NAME "SAA5246A" diff -Nru a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c --- a/drivers/media/video/saa5249.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/saa5249.c 2005-01-28 14:11:41 -08:00 @@ -1,4 +1,7 @@ /* + * Modified in order to keep it compatible both with new and old videotext IOCTLs by + * Michael Geng + * * Cleaned up to use existing videodev interface and allow the idea * of multiple teletext decoders on the video4linux iface. Changed i2c * to cover addressing clashes on device busses. It's also rebuilt so @@ -58,7 +61,7 @@ #include #define VTX_VER_MAJ 1 -#define VTX_VER_MIN 7 +#define VTX_VER_MIN 8 @@ -578,6 +581,54 @@ } /* + * Translates old vtx IOCTLs to new ones + * + * This keeps new kernel versions compatible with old userspace programs. + */ +static inline unsigned int vtx_fix_command(unsigned int cmd) +{ + switch (cmd) { + case VTXIOCGETINFO_OLD: + cmd = VTXIOCGETINFO; + break; + case VTXIOCCLRPAGE_OLD: + cmd = VTXIOCCLRPAGE; + break; + case VTXIOCCLRFOUND_OLD: + cmd = VTXIOCCLRFOUND; + break; + case VTXIOCPAGEREQ_OLD: + cmd = VTXIOCPAGEREQ; + break; + case VTXIOCGETSTAT_OLD: + cmd = VTXIOCGETSTAT; + break; + case VTXIOCGETPAGE_OLD: + cmd = VTXIOCGETPAGE; + break; + case VTXIOCSTOPDAU_OLD: + cmd = VTXIOCSTOPDAU; + break; + case VTXIOCPUTPAGE_OLD: + cmd = VTXIOCPUTPAGE; + break; + case VTXIOCSETDISP_OLD: + cmd = VTXIOCSETDISP; + break; + case VTXIOCPUTSTAT_OLD: + cmd = VTXIOCPUTSTAT; + break; + case VTXIOCCLRCACHE_OLD: + cmd = VTXIOCCLRCACHE; + break; + case VTXIOCSETVIRT_OLD: + cmd = VTXIOCSETVIRT; + break; + } + return cmd; +} + +/* * Handle the locking */ @@ -588,6 +639,7 @@ struct saa5249_device *t=vd->priv; int err; + cmd = vtx_fix_command(cmd); down(&t->lock); err = video_usercopy(inode,file,cmd,arg,do_saa5249_ioctl); up(&t->lock); diff -Nru a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c --- a/drivers/media/video/saa7134/saa7134-core.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/saa7134/saa7134-core.c 2005-01-28 14:11:40 -08:00 @@ -21,6 +21,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include #include #include #include @@ -222,6 +223,57 @@ } #endif +/* ----------------------------------------------------------- */ +/* delayed request_module */ + +#ifdef CONFIG_MODULES + +static int need_empress; +static int need_dvb; + +static int pending_call(struct notifier_block *self, unsigned long state, + void *module) +{ + if (module != THIS_MODULE || state != MODULE_STATE_LIVE) + return NOTIFY_DONE; + + if (need_empress) + request_module("saa7134-empress"); + if (need_dvb) + request_module("saa7134-dvb"); + return NOTIFY_DONE; +} + +static int pending_registered; +static struct notifier_block pending_notifier = { + .notifier_call = pending_call, +}; + +static void request_module_depend(char *name, int *flag) +{ + switch (THIS_MODULE->state) { + case MODULE_STATE_COMING: + if (!pending_registered) { + register_module_notifier(&pending_notifier); + pending_registered = 1; + } + *flag = 1; + break; + case MODULE_STATE_LIVE: + request_module(name); + break; + default: + /* nothing */; + break; + } +} + +#else + +#define request_module_depend(name,flag) + +#endif /* CONFIG_MODULES */ + /* ------------------------------------------------------------------ */ /* nr of (saa7134-)pages for the given buffer size */ @@ -941,11 +993,11 @@ if (dev->tda9887_conf) request_module("tda9887"); if (card_is_empress(dev)) { - request_module("saa7134-empress"); request_module("saa6752hs"); + request_module_depend("saa7134-empress",&need_empress); } if (card_is_dvb(dev)) - request_module("saa7134-dvb"); + request_module_depend("saa7134-dvb",&need_dvb); v4l2_prio_init(&dev->prio); diff -Nru a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c --- a/drivers/media/video/tda9887.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/tda9887.c 2005-01-28 14:11:41 -08:00 @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -27,6 +28,7 @@ /* Addresses to scan */ static unsigned short normal_i2c[] = { + 0x84 >>1, 0x86 >>1, 0x96 >>1, I2C_CLIENT_END, @@ -374,8 +376,8 @@ return 0; } -static unsigned int port1 = 1; -static unsigned int port2 = 1; +static unsigned int port1 = UNSET; +static unsigned int port2 = UNSET; static unsigned int qss = UNSET; static unsigned int adjust = 0x10; module_param(port1, int, 0644); @@ -385,10 +387,19 @@ static int tda9887_set_insmod(struct tda9887 *t, char *buf) { - if (port1) - buf[1] |= cOutputPort1Inactive; - if (port2) - buf[1] |= cOutputPort2Inactive; + if (UNSET != port1) { + if (port1) + buf[1] |= cOutputPort1Inactive; + else + buf[1] &= ~cOutputPort1Inactive; + } + if (UNSET != port2) { + if (port2) + buf[1] |= cOutputPort2Inactive; + else + buf[1] &= ~cOutputPort2Inactive; + } + if (UNSET != qss) { if (qss) buf[1] |= cQSS; @@ -403,10 +414,15 @@ static int tda9887_set_config(struct tda9887 *t, char *buf) { - if (t->config & TDA9887_PORT1) + if (t->config & TDA9887_PORT1_ACTIVE) + buf[1] &= ~cOutputPort1Inactive; + if (t->config & TDA9887_PORT1_INACTIVE) buf[1] |= cOutputPort1Inactive; - if (t->config & TDA9887_PORT2) + if (t->config & TDA9887_PORT2_ACTIVE) + buf[1] &= ~cOutputPort2Inactive; + if (t->config & TDA9887_PORT2_INACTIVE) buf[1] |= cOutputPort2Inactive; + if (t->config & TDA9887_QSS) buf[1] |= cQSS; if (t->config & TDA9887_INTERCARRIER) @@ -437,14 +453,14 @@ { unsigned int bCarrierMode = UNSET; - if (t->std & V4L2_STD_PAL) { + if (t->std & V4L2_STD_625_50) { if ((1 == t->pinnacle_id) || (7 == t->pinnacle_id)) { bCarrierMode = cIntercarrier; } else { bCarrierMode = cQSS; } } - if (t->std & V4L2_STD_NTSC) { + if (t->std & V4L2_STD_525_60) { if ((5 == t->pinnacle_id) || (6 == t->pinnacle_id)) { bCarrierMode = cIntercarrier; } else { @@ -529,6 +545,8 @@ int rc; memset(buf,0,sizeof(buf)); + buf[1] |= cOutputPort1Inactive; + buf[1] |= cOutputPort2Inactive; tda9887_set_tvnorm(t,buf); if (UNSET != t->pinnacle_id) { tda9887_set_pinnacle(t,buf); diff -Nru a/drivers/media/video/tuner.c b/drivers/media/video/tuner.c --- a/drivers/media/video/tuner.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/tuner.c 2005-01-28 14:11:41 -08:00 @@ -1,5 +1,5 @@ /* - * $Id: tuner.c,v 1.31 2004/11/10 11:07:24 kraxel Exp $ + * $Id: tuner.c,v 1.36 2005/01/14 13:29:40 kraxel Exp $ */ #include @@ -62,7 +62,7 @@ v4l2_std_id std; int using_v4l2; - unsigned int radio; + enum v4l2_tuner_type mode; unsigned int input; // only for MT2032 @@ -265,6 +265,11 @@ { "Philips PAL/SECAM_D (FM 1256 I-H3)", Philips, PAL, 16*160.00,16*442.00,0x01,0x02,0x04,0x8e,623 }, + { "Thomson DDT 7610 ATSC/NTSC)", THOMSON, ATSC, + 16*157.25,16*454.00,0x39,0x3a,0x3c,0x8e,732}, + { "Philips FQ1286", Philips, NTSC, + 16*160.00,16*454.00,0x41,0x42,0x04,0x8e,940}, // UHF band untested + }; #define TUNERS ARRAY_SIZE(tuners) @@ -663,7 +668,8 @@ int ret; unsigned char buf[6]; - dprintk("mt2050_set_if_freq freq=%d\n",freq); + dprintk("mt2050_set_if_freq freq=%d if1=%d if2=%d\n", + freq,if1,if2); f_lo1=freq+if1; f_lo1=(f_lo1/1000000)*1000000; @@ -688,9 +694,10 @@ div2a=(lo2/8)-1; div2b=lo2-(div2a+1)*8; - dprintk("lo1 lo2 = %d %d\n", lo1, lo2); - dprintk("num1 num2 div1a div1b div2a div2b= %x %x %x %x %x %x\n",num1,num2,div1a,div1b,div2a,div2b); - + if (debug > 1) { + printk("lo1 lo2 = %d %d\n", lo1, lo2); + printk("num1 num2 div1a div1b div2a div2b= %x %x %x %x %x %x\n",num1,num2,div1a,div1b,div2a,div2b); + } buf[0]=1; buf[1]= 4*div1b + num1; @@ -702,7 +709,7 @@ buf[5]=div2a; if(num2!=0) buf[5]=buf[5]|0x40; - if(debug) { + if (debug > 1) { int i; printk("bufs is: "); for(i=0;i<6;i++) @@ -727,6 +734,10 @@ // PAL if2 = 38900*1000; } + if (V4L2_TUNER_DIGITAL_TV == t->mode) { + // testing for DVB ... + if2 = 36150*1000; + } mt2050_set_if_freq(c, freq*62500, if2); mt2050_set_antenna(c, tv_antenna); } @@ -1069,14 +1080,18 @@ { struct tuner *t = i2c_get_clientdata(c); - if (t->radio) { + switch (t->mode) { + case V4L2_TUNER_RADIO: dprintk("tuner: radio freq set to %lu.%02lu\n", freq/16,freq%16*100/16); set_radio_freq(c,freq); - } else { + break; + case V4L2_TUNER_ANALOG_TV: + case V4L2_TUNER_DIGITAL_TV: dprintk("tuner: tv freq set to %lu.%02lu\n", freq/16,freq%16*100/16); set_tv_freq(c, freq); + break; } t->freq = freq; } @@ -1237,9 +1252,9 @@ set_type(client,*iarg,client->adapter->name); break; case AUDC_SET_RADIO: - if (!t->radio) { + if (V4L2_TUNER_RADIO != t->mode) { set_tv_freq(client,400 * 16); - t->radio = 1; + t->mode = V4L2_TUNER_RADIO; } break; case AUDC_CONFIG_PINNACLE: @@ -1271,7 +1286,7 @@ struct video_channel *vc = arg; CHECK_V4L2; - t->radio = 0; + t->mode = V4L2_TUNER_ANALOG_TV; if (vc->norm < ARRAY_SIZE(map)) t->std = map[vc->norm]; tuner_fixup_std(t); @@ -1292,7 +1307,7 @@ struct video_tuner *vt = arg; CHECK_V4L2; - if (t->radio) + if (V4L2_TUNER_RADIO == t->mode) vt->signal = tuner_signal(client); return 0; } @@ -1301,7 +1316,7 @@ struct video_audio *va = arg; CHECK_V4L2; - if (t->radio) + if (V4L2_TUNER_RADIO == t->mode) va->mode = (tuner_stereo(client) ? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO); return 0; } @@ -1311,7 +1326,7 @@ v4l2_std_id *id = arg; SWITCH_V4L2; - t->radio = 0; + t->mode = V4L2_TUNER_ANALOG_TV; t->std = *id; tuner_fixup_std(t); if (t->freq) @@ -1323,15 +1338,10 @@ struct v4l2_frequency *f = arg; SWITCH_V4L2; - if (V4L2_TUNER_ANALOG_TV == f->type) { - t->radio = 0; - } - if (V4L2_TUNER_RADIO == f->type) { - if (!t->radio) { - set_tv_freq(client,400*16); - t->radio = 1; - } - } + if (V4L2_TUNER_RADIO == f->type && + V4L2_TUNER_RADIO != t->mode) + set_tv_freq(client,400*16); + t->mode = f->type; t->freq = f->frequency; set_freq(client,t->freq); break; @@ -1341,7 +1351,7 @@ struct v4l2_tuner *tuner = arg; SWITCH_V4L2; - if (t->radio) + if (V4L2_TUNER_RADIO == t->mode) tuner->signal = tuner_signal(client); break; } diff -Nru a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c --- a/drivers/media/video/tvaudio.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/tvaudio.c 2005-01-28 14:11:40 -08:00 @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -1027,6 +1028,21 @@ #define TEA6300_S_SC 0x04 /* stereo C */ #define TEA6300_S_GMU 0x80 /* general mute */ +#define TEA6320_V 0x00 /* volume (0-5)/loudness off (6)/zero crossing mute(7) */ +#define TEA6320_FFR 0x01 /* fader front right (0-5) */ +#define TEA6320_FFL 0x02 /* fader front left (0-5) */ +#define TEA6320_FRR 0x03 /* fader rear right (0-5) */ +#define TEA6320_FRL 0x04 /* fader rear left (0-5) */ +#define TEA6320_BA 0x05 /* bass (0-4) */ +#define TEA6320_TR 0x06 /* treble (0-4) */ +#define TEA6320_S 0x07 /* switch register */ + /* values for those registers: */ +#define TEA6320_S_SA 0x07 /* stereo A input */ +#define TEA6320_S_SB 0x06 /* stereo B */ +#define TEA6320_S_SC 0x05 /* stereo C */ +#define TEA6320_S_SD 0x04 /* stereo D */ +#define TEA6320_S_GMU 0x80 /* general mute */ + #define TEA6420_S_SA 0x00 /* stereo A input */ #define TEA6420_S_SB 0x01 /* stereo B */ #define TEA6420_S_SC 0x02 /* stereo C */ @@ -1037,6 +1053,20 @@ static int tea6300_shift10(int val) { return val >> 10; } static int tea6300_shift12(int val) { return val >> 12; } +/* Assumes 16bit input (values 0x3f to 0x0c are unique, values less than */ +/* 0x0c mirror those immediately higher) */ +static int tea6320_volume(int val) { return (val / (65535/(63-12)) + 12) & 0x3f; } +static int tea6320_shift11(int val) { return val >> 11; } +static int tea6320_initialize(struct CHIPSTATE * chip) +{ + chip_write(chip, TEA6320_FFR, 0x3f); + chip_write(chip, TEA6320_FFL, 0x3f); + chip_write(chip, TEA6320_FRR, 0x3f); + chip_write(chip, TEA6320_FRL, 0x3f); + + return 0; +} + /* ---------------------------------------------------------------------- */ /* audio chip descriptions - defines+functions for tda8425 */ @@ -1214,6 +1244,7 @@ int tda9873 = 1; int tda9874a = 1; int tea6300 = 0; // address clash with msp34xx +int tea6320 = 0; // address clash with msp34xx int tea6420 = 1; int pic16c54 = 1; int ta8874z = 0; // address clash with tda9840 @@ -1225,6 +1256,7 @@ module_param(tda9873, int, 0444); module_param(tda9874a, int, 0444); module_param(tea6300, int, 0444); +module_param(tea6320, int, 0444); module_param(tea6420, int, 0444); module_param(pic16c54, int, 0444); module_param(ta8874z, int, 0444); @@ -1339,6 +1371,28 @@ .inputmute = TEA6300_S_GMU, }, { + .name = "tea6320", + .id = I2C_DRIVERID_TEA6300, + .initialize = tea6320_initialize, + .insmodopt = &tea6320, + .addr_lo = I2C_TEA6300 >> 1, + .addr_hi = I2C_TEA6300 >> 1, + .registers = 8, + .flags = CHIP_HAS_VOLUME | CHIP_HAS_BASSTREBLE | CHIP_HAS_INPUTSEL, + + .leftreg = TEA6320_V, + .rightreg = TEA6320_V, + .bassreg = TEA6320_BA, + .treblereg = TEA6320_TR, + .volfunc = tea6320_volume, + .bassfunc = tea6320_shift11, + .treblefunc = tea6320_shift11, + + .inputreg = TEA6320_S, + .inputmap = { TEA6320_S_SA, TEA6420_S_SB, TEA6300_S_SC, TEA6320_S_SD }, + .inputmute = TEA6300_S_GMU, + }, + { .name = "tea6420", .id = I2C_DRIVERID_TEA6420, .insmodopt = &tea6420, @@ -1571,8 +1625,11 @@ if (desc->flags & CHIP_HAS_VOLUME) { va->flags |= VIDEO_AUDIO_VOLUME; va->volume = max(chip->left,chip->right); - va->balance = (32768*min(chip->left,chip->right))/ - (va->volume ? va->volume : 1); + if (va->volume) + va->balance = (32768*min(chip->left,chip->right))/ + va->volume; + else + va->balance = 32768; } if (desc->flags & CHIP_HAS_BASSTREBLE) { va->flags |= VIDEO_AUDIO_BASS | VIDEO_AUDIO_TREBLE; diff -Nru a/drivers/media/video/tvaudio.h b/drivers/media/video/tvaudio.h --- a/drivers/media/video/tvaudio.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/tvaudio.h 2005-01-28 14:11:40 -08:00 @@ -8,7 +8,7 @@ #define I2C_TDA985x_H 0xb6 #define I2C_TDA9874 0xb0 /* also used by 9875 */ -#define I2C_TEA6300 0x80 +#define I2C_TEA6300 0x80 /* also used by 6320 */ #define I2C_TEA6420 0x98 #define I2C_PIC16C54 0x96 /* PV951 */ diff -Nru a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/media/video/tveeprom.c 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,577 @@ +/* + * tveeprom - eeprom decoder for tvcard configuration eeproms + * + * Data and decoding routines shamelessly borrowed from bttv-cards.c + * eeprom access routine shamelessly borrowed from bttv-if.c + * which are: + + Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de) + & Marcus Metzler (mocm@thp.uni-koeln.de) + (c) 1999-2001 Gerd Knorr + + * Adjustments to fit a more general model and all bugs: + + Copyright (C) 2003 John Klar + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#include +#include +#include +#include +#include +#include + +#include +#include + +MODULE_DESCRIPTION("i2c Hauppauge eeprom decoder driver"); +MODULE_AUTHOR("John Klar"); +MODULE_LICENSE("GPL"); + +static int debug = 0; +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "Debug level (0-2)"); + +#define STRM(array,i) (i < sizeof(array)/sizeof(char*) ? array[i] : "unknown") + +#define dprintk(num, args...) \ + do { \ + if (debug >= num) \ + printk(KERN_INFO "tveeprom: " args); \ + } while (0) + +#define TVEEPROM_KERN_ERR(args...) printk(KERN_ERR "tveeprom: " args); +#define TVEEPROM_KERN_INFO(args...) printk(KERN_INFO "tveeprom: " args); + +/* ----------------------------------------------------------------------- */ +/* some hauppauge specific stuff */ + +static struct HAUPPAUGE_TUNER_FMT +{ + int id; + char *name; +} +hauppauge_tuner_fmt[] = +{ + { 0x00000000, "unknown1" }, + { 0x00000000, "unknown2" }, + { 0x00000007, "PAL(B/G)" }, + { 0x00001000, "NTSC(M)" }, + { 0x00000010, "PAL(I)" }, + { 0x00400000, "SECAM(L/L�)" }, + { 0x00000e00, "PAL(D/K)" }, + { 0x03000000, "ATSC Digital" }, +}; + +/* This is the full list of possible tuners. Many thanks to Hauppauge for + supplying this information. Note that many tuners where only used for + testing and never made it to the outside world. So you will only see + a subset in actual produced cards. */ +static struct HAUPPAUGE_TUNER +{ + int id; + char *name; +} +hauppauge_tuner[] = +{ + /* 0-9 */ + { TUNER_ABSENT, "None" }, + { TUNER_ABSENT, "External" }, + { TUNER_ABSENT, "Unspecified" }, + { TUNER_PHILIPS_PAL, "Philips FI1216" }, + { TUNER_PHILIPS_SECAM, "Philips FI1216MF" }, + { TUNER_PHILIPS_NTSC, "Philips FI1236" }, + { TUNER_PHILIPS_PAL_I, "Philips FI1246" }, + { TUNER_PHILIPS_PAL_DK,"Philips FI1256" }, + { TUNER_PHILIPS_PAL, "Philips FI1216 MK2" }, + { TUNER_PHILIPS_SECAM, "Philips FI1216MF MK2" }, + /* 10-19 */ + { TUNER_PHILIPS_NTSC, "Philips FI1236 MK2" }, + { TUNER_PHILIPS_PAL_I, "Philips FI1246 MK2" }, + { TUNER_PHILIPS_PAL_DK,"Philips FI1256 MK2" }, + { TUNER_TEMIC_NTSC, "Temic 4032FY5" }, + { TUNER_TEMIC_PAL, "Temic 4002FH5" }, + { TUNER_TEMIC_PAL_I, "Temic 4062FY5" }, + { TUNER_PHILIPS_PAL, "Philips FR1216 MK2" }, + { TUNER_PHILIPS_SECAM, "Philips FR1216MF MK2" }, + { TUNER_PHILIPS_NTSC, "Philips FR1236 MK2" }, + { TUNER_PHILIPS_PAL_I, "Philips FR1246 MK2" }, + /* 20-29 */ + { TUNER_PHILIPS_PAL_DK,"Philips FR1256 MK2" }, + { TUNER_PHILIPS_PAL, "Philips FM1216" }, + { TUNER_PHILIPS_SECAM, "Philips FM1216MF" }, + { TUNER_PHILIPS_NTSC, "Philips FM1236" }, + { TUNER_PHILIPS_PAL_I, "Philips FM1246" }, + { TUNER_PHILIPS_PAL_DK,"Philips FM1256" }, + { TUNER_TEMIC_4036FY5_NTSC, "Temic 4036FY5" }, + { TUNER_ABSENT, "Samsung TCPN9082D" }, + { TUNER_ABSENT, "Samsung TCPM9092P" }, + { TUNER_TEMIC_4006FH5_PAL, "Temic 4006FH5" }, + /* 30-39 */ + { TUNER_ABSENT, "Samsung TCPN9085D" }, + { TUNER_ABSENT, "Samsung TCPB9085P" }, + { TUNER_ABSENT, "Samsung TCPL9091P" }, + { TUNER_TEMIC_4039FR5_NTSC, "Temic 4039FR5" }, + { TUNER_PHILIPS_FQ1216ME, "Philips FQ1216 ME" }, + { TUNER_TEMIC_4066FY5_PAL_I, "Temic 4066FY5" }, + { TUNER_PHILIPS_NTSC, "Philips TD1536" }, + { TUNER_PHILIPS_NTSC, "Philips TD1536D" }, + { TUNER_PHILIPS_NTSC, "Philips FMR1236" }, /* mono radio */ + { TUNER_ABSENT, "Philips FI1256MP" }, + /* 40-49 */ + { TUNER_ABSENT, "Samsung TCPQ9091P" }, + { TUNER_TEMIC_4006FN5_MULTI_PAL, "Temic 4006FN5" }, + { TUNER_TEMIC_4009FR5_PAL, "Temic 4009FR5" }, + { TUNER_TEMIC_4046FM5, "Temic 4046FM5" }, + { TUNER_TEMIC_4009FN5_MULTI_PAL_FM, "Temic 4009FN5" }, + { TUNER_ABSENT, "Philips TD1536D FH 44"}, + { TUNER_LG_NTSC_FM, "LG TP18NSR01F"}, + { TUNER_LG_PAL_FM, "LG TP18PSB01D"}, + { TUNER_LG_PAL, "LG TP18PSB11D"}, + { TUNER_LG_PAL_I_FM, "LG TAPC-I001D"}, + /* 50-59 */ + { TUNER_LG_PAL_I, "LG TAPC-I701D"}, + { TUNER_ABSENT, "Temic 4042FI5"}, + { TUNER_MICROTUNE_4049FM5, "Microtune 4049 FM5"}, + { TUNER_ABSENT, "LG TPI8NSR11F"}, + { TUNER_ABSENT, "Microtune 4049 FM5 Alt I2C"}, + { TUNER_ABSENT, "Philips FQ1216ME MK3"}, + { TUNER_ABSENT, "Philips FI1236 MK3"}, + { TUNER_PHILIPS_FM1216ME_MK3, "Philips FM1216 ME MK3"}, + { TUNER_ABSENT, "Philips FM1236 MK3"}, + { TUNER_ABSENT, "Philips FM1216MP MK3"}, + /* 60-69 */ + { TUNER_ABSENT, "LG S001D MK3"}, + { TUNER_ABSENT, "LG M001D MK3"}, + { TUNER_ABSENT, "LG S701D MK3"}, + { TUNER_ABSENT, "LG M701D MK3"}, + { TUNER_ABSENT, "Temic 4146FM5"}, + { TUNER_ABSENT, "Temic 4136FY5"}, + { TUNER_ABSENT, "Temic 4106FH5"}, + { TUNER_ABSENT, "Philips FQ1216LMP MK3"}, + { TUNER_LG_NTSC_TAPE, "LG TAPE H001F MK3"}, + { TUNER_ABSENT, "LG TAPE H701F MK3"}, + /* 70-79 */ + { TUNER_ABSENT, "LG TALN H200T"}, + { TUNER_ABSENT, "LG TALN H250T"}, + { TUNER_ABSENT, "LG TALN M200T"}, + { TUNER_ABSENT, "LG TALN Z200T"}, + { TUNER_ABSENT, "LG TALN S200T"}, + { TUNER_ABSENT, "Thompson DTT7595"}, + { TUNER_ABSENT, "Thompson DTT7592"}, + { TUNER_ABSENT, "Silicon TDA8275C1 8290"}, + { TUNER_ABSENT, "Silicon TDA8275C1 8290 FM"}, + { TUNER_ABSENT, "Thompson DTT757"}, + /* 80-89 */ + { TUNER_ABSENT, "Philips FQ1216LME MK3"}, + { TUNER_ABSENT, "LG TAPC G701D"}, + { TUNER_LG_NTSC_NEW_TAPC, "LG TAPC H791F"}, + { TUNER_ABSENT, "TCL 2002MB 3"}, + { TUNER_ABSENT, "TCL 2002MI 3"}, + { TUNER_TCL_2002N, "TCL 2002N 6A"}, + { TUNER_ABSENT, "Philips FQ1236 MK3"}, + { TUNER_ABSENT, "Samsung TCPN 2121P30A"}, + { TUNER_ABSENT, "Samsung TCPE 4121P30A"}, + { TUNER_ABSENT, "TCL MFPE05 2"}, + /* 90-99 */ + { TUNER_ABSENT, "LG TALN H202T"}, + { TUNER_ABSENT, "Philips FQ1216AME MK4"}, + { TUNER_ABSENT, "Philips FQ1236A MK4"}, + { TUNER_ABSENT, "Philips FQ1286A MK4"}, + { TUNER_ABSENT, "Philips FQ1216ME MK5"}, + { TUNER_ABSENT, "Philips FQ1236 MK5"}, +}; + +static char *sndtype[] = { + "None", "TEA6300", "TEA6320", "TDA9850", "MSP3400C", "MSP3410D", + "MSP3415", "MSP3430", "MSP3438", "CS5331", "MSP3435", "MSP3440", + "MSP3445", "MSP3411", "MSP3416", "MSP3425", + + "Type 0x10","Type 0x11","Type 0x12","Type 0x13", + "Type 0x14","Type 0x15","Type 0x16","Type 0x17", + "Type 0x18","MSP4418","Type 0x1a","MSP4448", + "Type 0x1c","Type 0x1d","Type 0x1e","Type 0x1f", +}; + +static int hasRadioTuner(int tunerType) +{ + switch (tunerType) { + case 18: //PNPEnv_TUNER_FR1236_MK2: + case 23: //PNPEnv_TUNER_FM1236: + case 38: //PNPEnv_TUNER_FMR1236: + case 16: //PNPEnv_TUNER_FR1216_MK2: + case 19: //PNPEnv_TUNER_FR1246_MK2: + case 21: //PNPEnv_TUNER_FM1216: + case 24: //PNPEnv_TUNER_FM1246: + case 17: //PNPEnv_TUNER_FR1216MF_MK2: + case 22: //PNPEnv_TUNER_FM1216MF: + case 20: //PNPEnv_TUNER_FR1256_MK2: + case 25: //PNPEnv_TUNER_FM1256: + case 33: //PNPEnv_TUNER_4039FR5: + case 42: //PNPEnv_TUNER_4009FR5: + case 52: //PNPEnv_TUNER_4049FM5: + case 54: //PNPEnv_TUNER_4049FM5_AltI2C: + case 44: //PNPEnv_TUNER_4009FN5: + case 31: //PNPEnv_TUNER_TCPB9085P: + case 30: //PNPEnv_TUNER_TCPN9085D: + case 46: //PNPEnv_TUNER_TP18NSR01F: + case 47: //PNPEnv_TUNER_TP18PSB01D: + case 49: //PNPEnv_TUNER_TAPC_I001D: + case 60: //PNPEnv_TUNER_TAPE_S001D_MK3: + case 57: //PNPEnv_TUNER_FM1216ME_MK3: + case 59: //PNPEnv_TUNER_FM1216MP_MK3: + case 58: //PNPEnv_TUNER_FM1236_MK3: + case 68: //PNPEnv_TUNER_TAPE_H001F_MK3: + case 61: //PNPEnv_TUNER_TAPE_M001D_MK3: + case 78: //PNPEnv_TUNER_TDA8275C1_8290_FM: + case 89: //PNPEnv_TUNER_TCL_MFPE05_2: + return 1; + } + return 0; +} + +void tveeprom_hauppauge_analog(struct tveeprom *tvee, unsigned char *eeprom_data) +{ + /* ---------------------------------------------- + ** The hauppauge eeprom format is tagged + ** + ** if packet[0] == 0x84, then packet[0..1] == length + ** else length = packet[0] & 3f; + ** if packet[0] & f8 == f8, then EOD and packet[1] == checksum + ** + ** In our (ivtv) case we're interested in the following: + ** tuner type: tag [00].05 or [0a].01 (index into hauppauge_tuners) + ** tuner fmts: tag [00].04 or [0a].00 (bitmask index into hauppauge_fmts) + ** radio: tag [00].{last} or [0e].00 (bitmask. bit2=FM) + ** audio proc: tag [02].01 or [05].00 (lower nibble indexes lut?) + + ** Fun info: + ** model: tag [00].07-08 or [06].00-01 + ** revision: tag [00].09-0b or [06].04-06 + ** serial#: tag [01].05-07 or [04].04-06 + + ** # of inputs/outputs ??? + */ + + int i, j, len, done, tag, tuner = 0, t_format = 0; + char *t_name = NULL, *t_fmt_name = NULL; + + dprintk(1, "%s\n",__FUNCTION__); + tvee->revision = done = len = 0; + for (i = 0; !done && i < 256; i += len) { + dprintk(2, "processing pos = %02x (%02x, %02x)\n", + i, eeprom_data[i], eeprom_data[i + 1]); + + if (eeprom_data[i] == 0x84) { + len = eeprom_data[i + 1] + (eeprom_data[i + 2] << 8); + i+=3; + } else if ((eeprom_data[i] & 0xf0) == 0x70) { + if ((eeprom_data[i] & 0x08)) { + /* verify checksum! */ + done = 1; + break; + } + len = eeprom_data[i] & 0x07; + ++i; + } else { + TVEEPROM_KERN_ERR("Encountered bad packet header [%02x]. " + "Corrupt or not a Hauppauge eeprom.\n", eeprom_data[i]); + return; + } + + dprintk(1, "%3d [%02x] ", len, eeprom_data[i]); + for(j = 1; j < len; j++) { + dprintk(1, "%02x ", eeprom_data[i + j]); + } + dprintk(1, "\n"); + + /* process by tag */ + tag = eeprom_data[i]; + switch (tag) { + case 0x00: + tuner = eeprom_data[i+6]; + t_format = eeprom_data[i+5]; + tvee->has_radio = eeprom_data[i+len-1]; + tvee->model = + eeprom_data[i+8] + + (eeprom_data[i+9] << 8); + tvee->revision = eeprom_data[i+10] + + (eeprom_data[i+11] << 8) + + (eeprom_data[i+12] << 16); + break; + case 0x01: + tvee->serial_number = + eeprom_data[i+6] + + (eeprom_data[i+7] << 8) + + (eeprom_data[i+8] << 16); + break; + case 0x02: + tvee->audio_processor = eeprom_data[i+2] & 0x0f; + break; + case 0x04: + tvee->serial_number = + eeprom_data[i+5] + + (eeprom_data[i+6] << 8) + + (eeprom_data[i+7] << 16); + break; + case 0x05: + tvee->audio_processor = eeprom_data[i+1] & 0x0f; + break; + case 0x06: + tvee->model = + eeprom_data[i+1] + + (eeprom_data[i+2] << 8); + tvee->revision = eeprom_data[i+5] + + (eeprom_data[i+6] << 8) + + (eeprom_data[i+7] << 16); + break; + case 0x0a: + tuner = eeprom_data[i+2]; + t_format = eeprom_data[i+1]; + break; + case 0x0e: + tvee->has_radio = eeprom_data[i+1]; + break; + default: + dprintk(1, "Not sure what to do with tag [%02x]\n", tag); + /* dump the rest of the packet? */ + } + + } + + if (!done) { + TVEEPROM_KERN_ERR("Ran out of data!\n"); + return; + } + + if (tvee->revision != 0) { + tvee->rev_str[0] = 32 + ((tvee->revision >> 18) & 0x3f); + tvee->rev_str[1] = 32 + ((tvee->revision >> 12) & 0x3f); + tvee->rev_str[2] = 32 + ((tvee->revision >> 6) & 0x3f); + tvee->rev_str[3] = 32 + ( tvee->revision & 0x3f); + tvee->rev_str[4] = 0; + } + + if (hasRadioTuner(tuner) && !tvee->has_radio) { + TVEEPROM_KERN_INFO("The eeprom says no radio is present, but the tuner type\n"); + TVEEPROM_KERN_INFO("indicates otherwise. I will assume that radio is present.\n"); + tvee->has_radio = 1; + } + + if (tuner < sizeof(hauppauge_tuner)/sizeof(struct HAUPPAUGE_TUNER)) { + tvee->tuner_type = hauppauge_tuner[tuner].id; + t_name = hauppauge_tuner[tuner].name; + } else { + t_name = ""; + } + + tvee->tuner_formats = 0; + t_fmt_name = ""; + for (i = 0; i < 8; i++) { + if (t_format & (1<tuner_formats |= hauppauge_tuner_fmt[i].id; + /* yuck */ + t_fmt_name = hauppauge_tuner_fmt[i].name; + } + } + +#if 0 + if (t_format < sizeof(hauppauge_tuner_fmt)/sizeof(struct HAUPPAUGE_TUNER_FMT)) { + tvee->tuner_formats = hauppauge_tuner_fmt[t_format].id; + t_fmt_name = hauppauge_tuner_fmt[t_format].name; + } else { + t_fmt_name = ""; + } +#endif + + TVEEPROM_KERN_INFO("Hauppauge: model = %d, rev = %s, serial# = %d\n", + tvee->model, + tvee->rev_str, + tvee->serial_number); + TVEEPROM_KERN_INFO("tuner = %s (idx = %d, type = %d)\n", + t_name, + tuner, + tvee->tuner_type); + TVEEPROM_KERN_INFO("tuner fmt = %s (eeprom = 0x%02x, v4l2 = 0x%08x)\n", + t_fmt_name, + t_format, + tvee->tuner_formats); + + TVEEPROM_KERN_INFO("audio_processor = %s (type = %d)\n", + STRM(sndtype,tvee->audio_processor), + tvee->audio_processor); + +} +EXPORT_SYMBOL(tveeprom_hauppauge_analog); + +/* ----------------------------------------------------------------------- */ +/* generic helper functions */ + +int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len) +{ + unsigned char buf; + int err; + + dprintk(1, "%s\n",__FUNCTION__); + buf = 0; + if (1 != (err = i2c_master_send(c,&buf,1))) { + printk(KERN_INFO "tveeprom(%s): Huh, no eeprom present (err=%d)?\n", + c->name,err); + return -1; + } + if (len != (err = i2c_master_recv(c,eedata,len))) { + printk(KERN_WARNING "tveeprom(%s): i2c eeprom read error (err=%d)\n", + c->name,err); + return -1; + } + return 0; +} +EXPORT_SYMBOL(tveeprom_read); + +int tveeprom_dump(unsigned char *eedata, int len) +{ + int i; + + dprintk(1, "%s\n",__FUNCTION__); + for (i = 0; i < len; i++) { + if (0 == (i % 16)) + printk(KERN_INFO "tveeprom: %02x:",i); + printk(" %02x",eedata[i]); + if (15 == (i % 16)) + printk("\n"); + } + return 0; +} +EXPORT_SYMBOL(tveeprom_dump); + +/* ----------------------------------------------------------------------- */ +/* needed for ivtv.sf.net at the moment. Should go away in the long */ +/* run, just call the exported tveeprom_* directly, there is no point in */ +/* using the indirect way via i2c_driver->command() */ + +#ifndef I2C_DRIVERID_TVEEPROM +# define I2C_DRIVERID_TVEEPROM I2C_DRIVERID_EXP2 +#endif + +static unsigned short normal_i2c[] = { + 0xa0 >> 1, + I2C_CLIENT_END, +}; +static unsigned short normal_i2c_range[] = { I2C_CLIENT_END }; +I2C_CLIENT_INSMOD; + +struct i2c_driver i2c_driver_tveeprom; + +static int +tveeprom_command(struct i2c_client *client, + unsigned int cmd, + void *arg) +{ + struct tveeprom eeprom; + u32 *eeprom_props = arg; + u8 *buf; + + switch (cmd) { + case 0: + buf = kmalloc(256,GFP_KERNEL); + memset(buf,0,256); + tveeprom_read(client,buf,256); + tveeprom_hauppauge_analog(&eeprom,buf); + kfree(buf); + eeprom_props[0] = eeprom.tuner_type; + eeprom_props[1] = eeprom.tuner_formats; + eeprom_props[2] = eeprom.model; + eeprom_props[3] = eeprom.revision; + break; + default: + return -EINVAL; + } + return 0; +} + +static int +tveeprom_detect_client(struct i2c_adapter *adapter, + int address, + int kind) +{ + struct i2c_client *client; + + dprintk(1,"%s: id 0x%x @ 0x%x\n",__FUNCTION__, + adapter->id, address << 1); + client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); + if (NULL == client) + return -ENOMEM; + memset(client, 0, sizeof(struct i2c_client)); + client->addr = address; + client->adapter = adapter; + client->driver = &i2c_driver_tveeprom; + client->flags = I2C_CLIENT_ALLOW_USE; + snprintf(client->name, sizeof(client->name), "tveeprom"); + i2c_attach_client(client); + return 0; +} + +static int +tveeprom_attach_adapter (struct i2c_adapter *adapter) +{ + dprintk(1,"%s: id 0x%x\n",__FUNCTION__,adapter->id); + if (adapter->id != (I2C_ALGO_BIT | I2C_HW_B_BT848)) + return 0; + return i2c_probe(adapter, &addr_data, tveeprom_detect_client); +} + +static int +tveeprom_detach_client (struct i2c_client *client) +{ + int err; + + err = i2c_detach_client(client); + if (err < 0) + return err; + kfree(client); + return 0; +} + +struct i2c_driver i2c_driver_tveeprom = { + .owner = THIS_MODULE, + .name = "tveeprom", + .id = I2C_DRIVERID_TVEEPROM, + .flags = I2C_DF_NOTIFY, + .attach_adapter = tveeprom_attach_adapter, + .detach_client = tveeprom_detach_client, + .command = tveeprom_command, +}; + +static int __init tveeprom_init(void) +{ + return i2c_add_driver(&i2c_driver_tveeprom); +} + +static void __exit tveeprom_exit(void) +{ + i2c_del_driver(&i2c_driver_tveeprom); +} + +module_init(tveeprom_init); +module_exit(tveeprom_exit); + +/* + * Local variables: + * c-basic-offset: 8 + * End: + */ diff -Nru a/drivers/media/video/tvmixer.c b/drivers/media/video/tvmixer.c --- a/drivers/media/video/tvmixer.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/media/video/tvmixer.c 2005-01-28 14:11:41 -08:00 @@ -1,4 +1,5 @@ #include +#include #include #include #include diff -Nru a/drivers/media/video/video-buf-dvb.c b/drivers/media/video/video-buf-dvb.c --- a/drivers/media/video/video-buf-dvb.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/video-buf-dvb.c 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - * $Id: video-buf-dvb.c,v 1.5 2004/11/07 13:17:15 kraxel Exp $ + * $Id: video-buf-dvb.c,v 1.7 2004/12/09 12:51:35 kraxel Exp $ * * some helper function for simple DVB cards which simply DMA the * complete transport stream and let the computer sort everything else @@ -35,7 +35,7 @@ MODULE_PARM_DESC(debug,"enable debug messages"); #define dprintk(fmt, arg...) if (debug) \ - printk(KERN_DEBUG "%s/dvb: " fmt, dvb->name, ## arg) + printk(KERN_DEBUG "%s/dvb: " fmt, dvb->name , ## arg) /* ------------------------------------------------------------------ */ @@ -134,19 +134,22 @@ /* ------------------------------------------------------------------ */ -int videobuf_dvb_register(struct videobuf_dvb *dvb) +int videobuf_dvb_register(struct videobuf_dvb *dvb, + struct module *module, + void *adapter_priv) { int result; init_MUTEX(&dvb->lock); /* register adapter */ - result = dvb_register_adapter(&dvb->adapter, dvb->name, THIS_MODULE); + result = dvb_register_adapter(&dvb->adapter, dvb->name, module); if (result < 0) { printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n", dvb->name, result); goto fail_adapter; } + dvb->adapter->priv = adapter_priv; /* register frontend */ result = dvb_register_frontend(dvb->adapter, dvb->frontend); diff -Nru a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c --- a/drivers/media/video/video-buf.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/video-buf.c 2005-01-28 14:11:40 -08:00 @@ -1,5 +1,5 @@ /* - * $Id: video-buf.c,v 1.15 2004/11/07 14:45:00 kraxel Exp $ + * $Id: video-buf.c,v 1.17 2004/12/10 12:33:40 kraxel Exp $ * * generic helper functions for video4linux capture buffers, to handle * memory management and PCI DMA. Right now bttv + saa7134 use it. @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -892,6 +893,7 @@ int i; videobuf_queue_cancel(q); + videobuf_mmap_free(q); INIT_LIST_HEAD(&q->stream); for (i = 0; i < VIDEO_MAX_FRAME; i++) { if (NULL == q->bufs[i]) diff -Nru a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c --- a/drivers/media/video/w9966.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/w9966.c 2005-01-28 14:11:40 -08:00 @@ -330,7 +330,7 @@ // Fill in the video_device struct and register us to v4l memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device)); - cam->vdev.priv = (void*)cam; + cam->vdev.priv = cam; if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1) return -1; @@ -712,7 +712,7 @@ unsigned int cmd, void *arg) { struct video_device *vdev = video_devdata(file); - struct w9966_dev *cam = (struct w9966_dev*)vdev->priv; + struct w9966_dev *cam = vdev->priv; switch(cmd) { @@ -871,7 +871,7 @@ size_t count, loff_t *ppos) { struct video_device *vdev = video_devdata(file); - struct w9966_dev *cam = (struct w9966_dev *)vdev->priv; + struct w9966_dev *cam = vdev->priv; unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000 unsigned char __user *dest = (unsigned char __user *)buf; unsigned long dleft = count; diff -Nru a/drivers/media/video/zr36120.c b/drivers/media/video/zr36120.c --- a/drivers/media/video/zr36120.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/media/video/zr36120.c 2005-01-28 14:11:40 -08:00 @@ -338,7 +338,7 @@ { u32 stat,estat; int count = 0; - struct zoran *ztv = (struct zoran *)dev_id; + struct zoran *ztv = dev_id; UNUSED(irq); UNUSED(regs); for (;;) { @@ -775,7 +775,7 @@ memset(ztv->fbuffer,0,ZORAN_MAX_FBUFSIZE); if (!ztv->overinfo.overlay) - ztv->overinfo.overlay = (void*)kmalloc(1024*1024/8, GFP_KERNEL); + ztv->overinfo.overlay = kmalloc(1024*1024/8, GFP_KERNEL); if (!ztv->overinfo.overlay) { /* could not get an overlay buffer, bail out */ bfree(ztv->fbuffer, ZORAN_MAX_FBUFSIZE); @@ -1500,7 +1500,7 @@ static int vbi_open(struct video_device *dev, int flags) { - struct zoran *ztv = (struct zoran*)dev->priv; + struct zoran *ztv = dev->priv; struct vidinfo* item; DEBUG(printk(CARD_DEBUG "vbi_open(dev,%d)\n",CARD,flags)); @@ -1549,7 +1549,7 @@ static void vbi_close(struct video_device *dev) { - struct zoran *ztv = (struct zoran*)dev->priv; + struct zoran *ztv = dev->priv; struct vidinfo* item; DEBUG(printk(CARD_DEBUG "vbi_close(dev)\n",CARD)); @@ -1585,7 +1585,7 @@ static long vbi_read(struct video_device* dev, char* buf, unsigned long count, int nonblock) { - struct zoran *ztv = (struct zoran*)dev->priv; + struct zoran *ztv = dev->priv; unsigned long max; struct vidinfo* unused = 0; struct vidinfo* done = 0; @@ -1740,7 +1740,7 @@ static unsigned int vbi_poll(struct video_device *dev, struct file *file, poll_table *wait) { - struct zoran *ztv = (struct zoran*)dev->priv; + struct zoran *ztv = dev->priv; struct vidinfo* item; unsigned int mask = 0; @@ -1761,7 +1761,7 @@ static int vbi_ioctl(struct video_device *dev, unsigned int cmd, void *arg) { - struct zoran* ztv = (struct zoran*)dev->priv; + struct zoran* ztv = dev->priv; switch (cmd) { case VIDIOCGVBIFMT: @@ -1861,7 +1861,7 @@ DEBUG(printk(KERN_DEBUG "zoran: mapped-memory at 0x%p\n",ztv->zoran_mem)); result = request_irq(dev->irq, zoran_irq, - SA_SHIRQ|SA_INTERRUPT,"zoran",(void *)ztv); + SA_SHIRQ|SA_INTERRUPT,"zoran", ztv); if (result==-EINVAL) { iounmap(ztv->zoran_mem); diff -Nru a/drivers/net/3c59x.c b/drivers/net/3c59x.c --- a/drivers/net/3c59x.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/3c59x.c 2005-01-28 14:11:40 -08:00 @@ -752,6 +752,12 @@ /* Chip features we care about in vp->capabilities, read from the EEPROM. */ enum ChipCaps { CapBusMaster=0x20, CapPwrMgmt=0x2000 }; +struct vortex_extra_stats { + unsigned long tx_deferred; + unsigned long tx_multiple_collisions; + unsigned long rx_bad_ssd; +}; + struct vortex_private { /* The Rx and Tx rings should be quad-word-aligned. */ struct boom_rx_desc* rx_ring; @@ -763,7 +769,8 @@ struct sk_buff* tx_skbuff[TX_RING_SIZE]; unsigned int cur_rx, cur_tx; /* The next free ring entry */ unsigned int dirty_rx, dirty_tx; /* The ring entries to be free()ed. */ - struct net_device_stats stats; + struct net_device_stats stats; /* Generic stats */ + struct vortex_extra_stats xstats; /* NIC-specific extra stats */ struct sk_buff *tx_skb; /* Packet being eaten by bus master ctrl. */ dma_addr_t tx_skb_dma; /* Allocated DMA address for bus master ctrl DMA. */ @@ -854,18 +861,13 @@ static struct { const char str[ETH_GSTRING_LEN]; } ethtool_stats_keys[] = { - { "rx_packets" }, - { "tx_packets" }, - { "rx_bytes" }, - { "tx_bytes" }, - { "collisions" }, - { "tx_carrier_errors" }, - { "tx_heartbeat_errors" }, - { "tx_window_errors" }, + { "tx_deferred" }, + { "tx_multiple_collisions" }, + { "rx_bad_ssd" }, }; /* number of ETHTOOL_GSTATS u64's */ -#define VORTEX_NUM_STATS 8 +#define VORTEX_NUM_STATS 3 static int vortex_probe1(struct device *gendev, long ioaddr, int irq, int chip_idx, int card_idx); @@ -2871,23 +2873,23 @@ /* Switch to the stats window, and read everything. */ EL3WINDOW(6); vp->stats.tx_carrier_errors += inb(ioaddr + 0); - vp->stats.tx_heartbeat_errors += inb(ioaddr + 1); - /* Multiple collisions. */ inb(ioaddr + 2); + vp->stats.tx_heartbeat_errors += inb(ioaddr + 1); vp->stats.collisions += inb(ioaddr + 3); vp->stats.tx_window_errors += inb(ioaddr + 4); vp->stats.rx_fifo_errors += inb(ioaddr + 5); vp->stats.tx_packets += inb(ioaddr + 6); vp->stats.tx_packets += (inb(ioaddr + 9)&0x30) << 4; - /* Rx packets */ inb(ioaddr + 7); /* Must read to clear */ - /* Tx deferrals */ inb(ioaddr + 8); + /* Rx packets */ inb(ioaddr + 7); /* Must read to clear */ /* Don't bother with register 9, an extension of registers 6&7. If we do use the 6&7 values the atomic update assumption above is invalid. */ - vp->stats.rx_bytes += inw(ioaddr + 10); - vp->stats.tx_bytes += inw(ioaddr + 12); - /* New: On the Vortex we must also clear the BadSSD counter. */ + vp->stats.rx_bytes += inw(ioaddr + 10); + vp->stats.tx_bytes += inw(ioaddr + 12); + /* Extra stats for get_ethtool_stats() */ + vp->xstats.tx_multiple_collisions += inb(ioaddr + 2); + vp->xstats.tx_deferred += inb(ioaddr + 8); EL3WINDOW(4); - inb(ioaddr + 12); + vp->xstats.rx_bad_ssd += inb(ioaddr + 12); { u8 up = inb(ioaddr + 13); @@ -2980,14 +2982,9 @@ update_stats(dev->base_addr, dev); spin_unlock_irqrestore(&vp->lock, flags); - data[0] = vp->stats.rx_packets; - data[1] = vp->stats.tx_packets; - data[2] = vp->stats.rx_bytes; - data[3] = vp->stats.tx_bytes; - data[4] = vp->stats.collisions; - data[5] = vp->stats.tx_carrier_errors; - data[6] = vp->stats.tx_heartbeat_errors; - data[7] = vp->stats.tx_window_errors; + data[0] = vp->xstats.tx_deferred; + data[1] = vp->xstats.tx_multiple_collisions; + data[2] = vp->xstats.rx_bad_ssd; } diff -Nru a/drivers/net/e100.c b/drivers/net/e100.c --- a/drivers/net/e100.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/net/e100.c 2005-01-28 14:11:41 -08:00 @@ -1630,6 +1630,7 @@ struct nic *nic = netdev_priv(netdev); e100_disable_irq(nic); e100_intr(nic->pdev->irq, netdev, NULL); + e100_tx_clean(nic); e100_enable_irq(nic); } #endif diff -Nru a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h --- a/drivers/net/e1000/e1000.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/e1000/e1000.h 2005-01-28 14:11:40 -08:00 @@ -209,6 +209,7 @@ /* TX */ struct e1000_desc_ring tx_ring; + spinlock_t tx_lock; uint32_t txd_cmd; uint32_t tx_int_delay; uint32_t tx_abs_int_delay; diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c --- a/drivers/net/e1000/e1000_main.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/net/e1000/e1000_main.c 2005-01-28 14:11:41 -08:00 @@ -291,9 +291,7 @@ e1000_phy_reset(&adapter->hw); } - spin_lock_irq(&netdev->xmit_lock); e1000_set_multi(netdev); - spin_unlock_irq(&netdev->xmit_lock); e1000_restore_vlan(adapter); @@ -522,6 +520,9 @@ if(pci_using_dac) netdev->features |= NETIF_F_HIGHDMA; + /* hard_start_xmit is safe against parallel locking */ + netdev->features |= NETIF_F_LLTX; + /* before reading the EEPROM, reset the controller to * put the device in a known good starting state */ @@ -731,6 +732,7 @@ atomic_set(&adapter->irq_sem, 1); spin_lock_init(&adapter->stats_lock); + spin_lock_init(&adapter->tx_lock); return 0; } @@ -1291,8 +1293,6 @@ * list or the network interface flags are updated. This routine is * responsible for configuring the hardware for proper multicast, * promiscuous mode, and all-multi behavior. - * - * Called with netdev->xmit_lock held and IRQs disabled. **/ static void @@ -1304,9 +1304,12 @@ uint32_t rctl; uint32_t hash_value; int i; + unsigned long flags; /* Check for Promiscuous and All Multicast modes */ + spin_lock_irqsave(&adapter->tx_lock, flags); + rctl = E1000_READ_REG(hw, RCTL); if(netdev->flags & IFF_PROMISC) { @@ -1355,6 +1358,8 @@ if(hw->mac_type == e1000_82542_rev2_0) e1000_leave_82542_rst(adapter); + + spin_unlock_irqrestore(&adapter->tx_lock, flags); } /* Need to wait a few seconds after link up to get diagnostic information from @@ -1781,8 +1786,6 @@ } #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) - -/* Called with dev->xmit_lock held and interrupts disabled. */ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) { @@ -1791,6 +1794,7 @@ unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; unsigned int tx_flags = 0; unsigned int len = skb->len; + unsigned long flags; unsigned int nr_frags = 0; unsigned int mss = 0; int count = 0; @@ -1834,10 +1838,18 @@ if(adapter->pcix_82544) count += nr_frags; + local_irq_save(flags); + if (!spin_trylock(&adapter->tx_lock)) { + /* Collision - tell upper layer to requeue */ + local_irq_restore(flags); + return NETDEV_TX_LOCKED; + } + /* need: count + 2 desc gap to keep tail from touching * head, otherwise try next time */ if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2)) { netif_stop_queue(netdev); + spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_BUSY; } @@ -1845,6 +1857,7 @@ if(unlikely(e1000_82547_fifo_workaround(adapter, skb))) { netif_stop_queue(netdev); mod_timer(&adapter->tx_fifo_stall_timer, jiffies); + spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_BUSY; } } @@ -1871,6 +1884,7 @@ if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < MAX_SKB_FRAGS + 2)) netif_stop_queue(netdev); + spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_OK; } @@ -2220,13 +2234,13 @@ tx_ring->next_to_clean = i; - spin_lock(&netdev->xmit_lock); + spin_lock(&adapter->tx_lock); if(unlikely(cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev))) netif_wake_queue(netdev); - spin_unlock(&netdev->xmit_lock); + spin_unlock(&adapter->tx_lock); return cleaned; } @@ -2805,10 +2819,7 @@ if(wufc) { e1000_setup_rctl(adapter); - - spin_lock_irq(&netdev->xmit_lock); e1000_set_multi(netdev); - spin_unlock_irq(&netdev->xmit_lock); /* turn on all-multi mode if wake on multicast is enabled */ if(adapter->wol & E1000_WUFC_MC) { diff -Nru a/drivers/net/gianfar.c b/drivers/net/gianfar.c --- a/drivers/net/gianfar.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/gianfar.c 2005-01-28 14:11:40 -08:00 @@ -1190,8 +1190,8 @@ } else { #ifdef VERBOSE_GFAR_ERRORS printk(KERN_DEBUG "%s: receive called twice (%x)[%x]\n", - dev->name, gfar_read(priv->regs->ievent), - gfar_read(priv->regs->imask)); + dev->name, gfar_read(&priv->regs->ievent), + gfar_read(&priv->regs->imask)); #endif } #else @@ -1415,7 +1415,7 @@ #ifdef VERBOSE_GFAR_ERRORS printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n", dev->name, - gfar_read(priv->regs->rstat)); + gfar_read(&priv->regs->rstat)); #endif } if (events & IEVENT_BABR) { @@ -1793,7 +1793,7 @@ #ifdef VERBOSE_GFAR_ERRORS printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n", dev->name, - gfar_read(priv->regs->rstat)); + gfar_read(&priv->regs->rstat)); #endif } if (events & IEVENT_BABR) { diff -Nru a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c --- a/drivers/net/pcmcia/3c574_cs.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/pcmcia/3c574_cs.c 2005-01-28 14:11:40 -08:00 @@ -231,10 +231,10 @@ static int tc574_event(event_t event, int priority, event_callback_args_t *args); -static void mdio_sync(ioaddr_t ioaddr, int bits); -static int mdio_read(ioaddr_t ioaddr, int phy_id, int location); -static void mdio_write(ioaddr_t ioaddr, int phy_id, int location, int value); -static unsigned short read_eeprom(ioaddr_t ioaddr, int index); +static void mdio_sync(kio_addr_t ioaddr, int bits); +static int mdio_read(kio_addr_t ioaddr, int phy_id, int location); +static void mdio_write(kio_addr_t ioaddr, int phy_id, int location, int value); +static unsigned short read_eeprom(kio_addr_t ioaddr, int index); static void tc574_wait_for_completion(struct net_device *dev, int cmd); static void tc574_reset(struct net_device *dev); @@ -385,7 +385,7 @@ cisparse_t parse; unsigned short buf[32]; int last_fn, last_ret, i, j; - ioaddr_t ioaddr; + kio_addr_t ioaddr; u16 *phys_addr; char *cardname; union wn3_config config; @@ -606,7 +606,7 @@ static void dump_status(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; EL3WINDOW(1); printk(KERN_INFO " irq status %04x, rx status %04x, tx status " "%02x, tx free %04x\n", inw(ioaddr+EL3_STATUS), @@ -635,7 +635,7 @@ /* Read a word from the EEPROM using the regular EEPROM access register. Assume that we are in register window zero. */ -static unsigned short read_eeprom(ioaddr_t ioaddr, int index) +static unsigned short read_eeprom(kio_addr_t ioaddr, int index) { int timer; outw(EEPROM_Read + index, ioaddr + Wn0EepromCmd); @@ -663,9 +663,9 @@ /* Generate the preamble required for initial synchronization and a few older transceivers. */ -static void mdio_sync(ioaddr_t ioaddr, int bits) +static void mdio_sync(kio_addr_t ioaddr, int bits) { - int mdio_addr = ioaddr + Wn4_PhysicalMgmt; + kio_addr_t mdio_addr = ioaddr + Wn4_PhysicalMgmt; /* Establish sync by sending at least 32 logic ones. */ while (-- bits >= 0) { @@ -674,12 +674,12 @@ } } -static int mdio_read(ioaddr_t ioaddr, int phy_id, int location) +static int mdio_read(kio_addr_t ioaddr, int phy_id, int location) { int i; int read_cmd = (0xf6 << 10) | (phy_id << 5) | location; unsigned int retval = 0; - int mdio_addr = ioaddr + Wn4_PhysicalMgmt; + kio_addr_t mdio_addr = ioaddr + Wn4_PhysicalMgmt; if (mii_preamble_required) mdio_sync(ioaddr, 32); @@ -699,10 +699,10 @@ return (retval>>1) & 0xffff; } -static void mdio_write(ioaddr_t ioaddr, int phy_id, int location, int value) +static void mdio_write(kio_addr_t ioaddr, int phy_id, int location, int value) { int write_cmd = 0x50020000 | (phy_id << 23) | (location << 18) | value; - int mdio_addr = ioaddr + Wn4_PhysicalMgmt; + kio_addr_t mdio_addr = ioaddr + Wn4_PhysicalMgmt; int i; if (mii_preamble_required) @@ -727,7 +727,8 @@ static void tc574_reset(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); - int i, ioaddr = dev->base_addr; + int i; + kio_addr_t ioaddr = dev->base_addr; unsigned long flags; tc574_wait_for_completion(dev, TotalReset|0x10); @@ -831,7 +832,7 @@ static void el3_tx_timeout(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); dump_status(dev); @@ -846,7 +847,7 @@ static void pop_tx_status(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int i; /* Clear the Tx status stack. */ @@ -869,7 +870,7 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; struct el3_private *lp = netdev_priv(dev); unsigned long flags; @@ -903,7 +904,8 @@ { struct net_device *dev = (struct net_device *) dev_id; struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr, status; + kio_addr_t ioaddr; + unsigned status; int work_budget = max_interrupt_work; int handled = 0; @@ -996,7 +998,7 @@ { struct net_device *dev = (struct net_device *) arg; struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; unsigned long flags; unsigned short /* cable, */ media, partner; @@ -1085,7 +1087,7 @@ static void update_stats(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u8 rx, tx, up; DEBUG(2, "%s: updating the statistics.\n", dev->name); @@ -1122,7 +1124,7 @@ static int el3_rx(struct net_device *dev, int worklimit) { struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; short rx_status; DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", @@ -1184,7 +1186,7 @@ static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u16 *data = (u16 *)&rq->ifr_ifru; int phy = lp->phys & 0x1f; @@ -1238,7 +1240,7 @@ static void set_rx_mode(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; if (dev->flags & IFF_PROMISC) outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm, @@ -1251,7 +1253,7 @@ static int el3_close(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; struct el3_private *lp = netdev_priv(dev); dev_link_t *link = &lp->link; diff -Nru a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c --- a/drivers/net/pcmcia/3c589_cs.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/net/pcmcia/3c589_cs.c 2005-01-28 14:11:41 -08:00 @@ -147,7 +147,7 @@ static int tc589_event(event_t event, int priority, event_callback_args_t *args); -static u16 read_eeprom(ioaddr_t ioaddr, int index); +static u16 read_eeprom(kio_addr_t ioaddr, int index); static void tc589_reset(struct net_device *dev); static void media_check(unsigned long arg); static int el3_config(struct net_device *dev, struct ifmap *map); @@ -299,7 +299,7 @@ cisparse_t parse; u16 buf[32], *phys_addr; int last_fn, last_ret, i, j, multi = 0, fifo; - ioaddr_t ioaddr; + kio_addr_t ioaddr; char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; DEBUG(0, "3c589_config(0x%p)\n", link); @@ -500,7 +500,7 @@ Read a word from the EEPROM using the regular EEPROM access register. Assume that we are in register window zero. */ -static u16 read_eeprom(ioaddr_t ioaddr, int index) +static u16 read_eeprom(kio_addr_t ioaddr, int index) { int i; outw(EEPROM_READ + index, ioaddr + 10); @@ -518,7 +518,7 @@ static void tc589_set_xcvr(struct net_device *dev, int if_port) { struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; EL3WINDOW(0); switch (if_port) { @@ -540,7 +540,7 @@ static void dump_status(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; EL3WINDOW(1); printk(KERN_INFO " irq status %04x, rx status %04x, tx status " "%02x tx free %04x\n", inw(ioaddr+EL3_STATUS), @@ -556,7 +556,7 @@ /* Reset and restore all of the 3c589 registers. */ static void tc589_reset(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int i; EL3WINDOW(0); @@ -664,7 +664,7 @@ static void el3_tx_timeout(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; printk(KERN_WARNING "%s: Transmit timed out!\n", dev->name); dump_status(dev); @@ -679,7 +679,7 @@ static void pop_tx_status(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int i; /* Clear the Tx status stack. */ @@ -701,7 +701,7 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; struct el3_private *priv = netdev_priv(dev); DEBUG(3, "%s: el3_start_xmit(length = %ld) called, " @@ -734,7 +734,8 @@ { struct net_device *dev = (struct net_device *) dev_id; struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr, status; + kio_addr_t ioaddr; + __u16 status; int i = 0, handled = 1; if (!netif_device_present(dev)) @@ -819,7 +820,7 @@ { struct net_device *dev = (struct net_device *)(arg); struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u16 media, errs; unsigned long flags; @@ -921,7 +922,7 @@ static void update_stats(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; DEBUG(2, "%s: updating the statistics.\n", dev->name); /* Turn off statistics updates while reading. */ @@ -948,7 +949,7 @@ static int el3_rx(struct net_device *dev) { struct el3_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int worklimit = 32; short rx_status; @@ -1003,7 +1004,7 @@ { struct el3_private *lp = netdev_priv(dev); dev_link_t *link = &lp->link; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u16 opts = SetRxFilter | RxStation | RxBroadcast; if (!(DEV_OK(link))) return; @@ -1018,7 +1019,7 @@ { struct el3_private *lp = netdev_priv(dev); dev_link_t *link = &lp->link; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; DEBUG(1, "%s: shutting down ethercard.\n", dev->name); diff -Nru a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c --- a/drivers/net/pcmcia/axnet_cs.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/pcmcia/axnet_cs.c 2005-01-28 14:11:40 -08:00 @@ -98,8 +98,8 @@ static void ei_watchdog(u_long arg); static void axnet_reset_8390(struct net_device *dev); -static int mdio_read(ioaddr_t addr, int phy_id, int loc); -static void mdio_write(ioaddr_t addr, int phy_id, int loc, int value); +static int mdio_read(kio_addr_t addr, int phy_id, int loc); +static void mdio_write(kio_addr_t addr, int phy_id, int loc, int value); static void get_8390_hdr(struct net_device *, struct e8390_pkt_hdr *, int); @@ -243,7 +243,7 @@ static int get_prom(dev_link_t *link) { struct net_device *dev = link->priv; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int i, j; /* This is based on drivers/net/ne.c */ @@ -563,7 +563,7 @@ #define MDIO_MASK 0x0f #define MDIO_ENB_IN 0x02 -static void mdio_sync(ioaddr_t addr) +static void mdio_sync(kio_addr_t addr) { int bits; for (bits = 0; bits < 32; bits++) { @@ -572,7 +572,7 @@ } } -static int mdio_read(ioaddr_t addr, int phy_id, int loc) +static int mdio_read(kio_addr_t addr, int phy_id, int loc) { u_int cmd = (0xf6<<10)|(phy_id<<5)|loc; int i, retval = 0; @@ -591,7 +591,7 @@ return (retval>>1) & 0xffff; } -static void mdio_write(ioaddr_t addr, int phy_id, int loc, int value) +static void mdio_write(kio_addr_t addr, int phy_id, int loc, int value) { u_int cmd = (0x05<<28)|(phy_id<<23)|(loc<<18)|(1<<17)|value; int i; @@ -662,7 +662,7 @@ static void axnet_reset_8390(struct net_device *dev) { - ioaddr_t nic_base = dev->base_addr; + kio_addr_t nic_base = dev->base_addr; int i; ei_status.txing = ei_status.dmaing = 0; @@ -697,8 +697,8 @@ { struct net_device *dev = (struct net_device *)(arg); axnet_dev_t *info = PRIV(dev); - ioaddr_t nic_base = dev->base_addr; - ioaddr_t mii_addr = nic_base + AXNET_MII_EEP; + kio_addr_t nic_base = dev->base_addr; + kio_addr_t mii_addr = nic_base + AXNET_MII_EEP; u_short link; if (!netif_device_present(dev)) goto reschedule; @@ -768,7 +768,7 @@ { axnet_dev_t *info = PRIV(dev); u16 *data = (u16 *)&rq->ifr_ifru; - ioaddr_t mii_addr = dev->base_addr + AXNET_MII_EEP; + kio_addr_t mii_addr = dev->base_addr + AXNET_MII_EEP; switch (cmd) { case SIOCGMIIPHY: data[0] = info->phy_id; @@ -790,7 +790,7 @@ struct e8390_pkt_hdr *hdr, int ring_page) { - ioaddr_t nic_base = dev->base_addr; + kio_addr_t nic_base = dev->base_addr; outb_p(0, nic_base + EN0_RSARLO); /* On page boundary */ outb_p(ring_page, nic_base + EN0_RSARHI); @@ -808,7 +808,7 @@ static void block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset) { - ioaddr_t nic_base = dev->base_addr; + kio_addr_t nic_base = dev->base_addr; int xfer_count = count; char *buf = skb->data; @@ -831,7 +831,7 @@ static void block_output(struct net_device *dev, int count, const u_char *buf, const int start_page) { - ioaddr_t nic_base = dev->base_addr; + kio_addr_t nic_base = dev->base_addr; #ifdef PCMCIA_DEBUG if (ei_debug > 4) diff -Nru a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c --- a/drivers/net/pcmcia/fmvj18x_cs.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/net/pcmcia/fmvj18x_cs.c 2005-01-28 14:11:41 -08:00 @@ -343,7 +343,7 @@ static int mfc_try_io_port(dev_link_t *link) { int i, ret; - static ioaddr_t serial_base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; + static kio_addr_t serial_base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; for (i = 0; i < 5; i++) { link->io.BasePort2 = serial_base[i]; @@ -361,7 +361,7 @@ static int ungermann_try_io_port(dev_link_t *link) { int ret; - ioaddr_t ioaddr; + kio_addr_t ioaddr; /* Ungermann-Bass Access/CARD accepts 0x300,0x320,0x340,0x360 0x380,0x3c0 only for ioport. @@ -388,7 +388,7 @@ cisparse_t parse; u_short buf[32]; int i, last_fn, last_ret, ret; - ioaddr_t ioaddr; + kio_addr_t ioaddr; cardtype_t cardtype; char *card_name = "unknown"; u_char *node_id; @@ -668,7 +668,7 @@ u_char __iomem *base; int i, j; struct net_device *dev = link->priv; - ioaddr_t ioaddr; + kio_addr_t ioaddr; /* Allocate a small memory window */ req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_AM|WIN_ENABLE; @@ -793,7 +793,7 @@ { struct net_device *dev = dev_id; local_info_t *lp = netdev_priv(dev); - ioaddr_t ioaddr; + kio_addr_t ioaddr; unsigned short tx_stat, rx_stat; if (lp == NULL) { @@ -852,7 +852,7 @@ static void fjn_tx_timeout(struct net_device *dev) { struct local_info_t *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; printk(KERN_NOTICE "%s: transmit timed out with status %04x, %s?\n", dev->name, htons(inw(ioaddr + TX_STATUS)), @@ -882,7 +882,7 @@ static int fjn_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct local_info_t *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; short length = skb->len; if (length < ETH_ZLEN) @@ -956,7 +956,7 @@ static void fjn_reset(struct net_device *dev) { struct local_info_t *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int i; DEBUG(4, "fjn_reset(%s) called.\n",dev->name); @@ -1042,7 +1042,7 @@ static void fjn_rx(struct net_device *dev) { struct local_info_t *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int boguscount = 10; /* 5 -> 10: by agy 19940922 */ DEBUG(4, "%s: in rx_packet(), rx_status %02x.\n", @@ -1197,7 +1197,7 @@ { struct local_info_t *lp = netdev_priv(dev); dev_link_t *link = &lp->link; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; DEBUG(4, "fjn_close('%s').\n", dev->name); @@ -1240,7 +1240,7 @@ static void set_rx_mode(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; struct local_info_t *lp = netdev_priv(dev); u_char mc_filter[8]; /* Multicast hash filter */ u_long flags; diff -Nru a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c --- a/drivers/net/pcmcia/nmclan_cs.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/pcmcia/nmclan_cs.c 2005-01-28 14:11:40 -08:00 @@ -561,7 +561,7 @@ assuming that during normal operation, the MACE is always in bank 0. ---------------------------------------------------------------------------- */ -static int mace_read(mace_private *lp, ioaddr_t ioaddr, int reg) +static int mace_read(mace_private *lp, kio_addr_t ioaddr, int reg) { int data = 0xFF; unsigned long flags; @@ -588,7 +588,7 @@ are assuming that during normal operation, the MACE is always in bank 0. ---------------------------------------------------------------------------- */ -static void mace_write(mace_private *lp, ioaddr_t ioaddr, int reg, int data) +static void mace_write(mace_private *lp, kio_addr_t ioaddr, int reg, int data) { unsigned long flags; @@ -610,7 +610,7 @@ mace_init Resets the MACE chip. ---------------------------------------------------------------------------- */ -static int mace_init(mace_private *lp, ioaddr_t ioaddr, char *enet_addr) +static int mace_init(mace_private *lp, kio_addr_t ioaddr, char *enet_addr) { int i; int ct = 0; @@ -702,7 +702,7 @@ cisparse_t parse; u_char buf[64]; int i, last_ret, last_fn; - ioaddr_t ioaddr; + kio_addr_t ioaddr; DEBUG(0, "nmclan_config(0x%p)\n", link); @@ -935,7 +935,7 @@ ---------------------------------------------------------------------------- */ static int mace_open(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; mace_private *lp = netdev_priv(dev); dev_link_t *link = &lp->link; @@ -958,7 +958,7 @@ ---------------------------------------------------------------------------- */ static int mace_close(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; mace_private *lp = netdev_priv(dev); dev_link_t *link = &lp->link; @@ -1031,7 +1031,7 @@ static int mace_start_xmit(struct sk_buff *skb, struct net_device *dev) { mace_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; netif_stop_queue(dev); @@ -1092,7 +1092,7 @@ { struct net_device *dev = (struct net_device *) dev_id; mace_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int status; int IntrCnt = MACE_MAX_IR_ITERATIONS; @@ -1234,7 +1234,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt) { mace_private *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; unsigned char rx_framecnt; unsigned short rx_status; @@ -1398,7 +1398,7 @@ card's SRAM fast enough. If this happens, something is seriously wrong with the hardware. ---------------------------------------------------------------------------- */ -static void update_stats(ioaddr_t ioaddr, struct net_device *dev) +static void update_stats(kio_addr_t ioaddr, struct net_device *dev) { mace_private *lp = netdev_priv(dev); @@ -1544,7 +1544,7 @@ mace_private *lp = netdev_priv(dev); int num_addrs = lp->multicast_num_addrs; int *ladrf = lp->multicast_ladrf; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int i; DEBUG(2, "%s: restoring Rx mode to %d addresses.\n", @@ -1636,7 +1636,7 @@ static void restore_multicast_list(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; mace_private *lp = netdev_priv(dev); DEBUG(2, "%s: restoring Rx mode to %d addresses.\n", dev->name, diff -Nru a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c --- a/drivers/net/pcmcia/pcnet_cs.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/net/pcmcia/pcnet_cs.c 2005-01-28 14:11:41 -08:00 @@ -388,7 +388,7 @@ static hw_info_t *get_prom(dev_link_t *link) { struct net_device *dev = link->priv; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u_char prom[32]; int i, j; @@ -464,7 +464,7 @@ static hw_info_t *get_ax88190(dev_link_t *link) { struct net_device *dev = link->priv; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int i, j; /* Not much of a test, but the alternatives are messy */ @@ -852,7 +852,7 @@ #define MDIO_DATA_READ 0x10 #define MDIO_MASK 0x0f -static void mdio_sync(ioaddr_t addr) +static void mdio_sync(kio_addr_t addr) { int bits, mask = inb(addr) & MDIO_MASK; for (bits = 0; bits < 32; bits++) { @@ -861,7 +861,7 @@ } } -static int mdio_read(ioaddr_t addr, int phy_id, int loc) +static int mdio_read(kio_addr_t addr, int phy_id, int loc) { u_int cmd = (0x06<<10)|(phy_id<<5)|loc; int i, retval = 0, mask = inb(addr) & MDIO_MASK; @@ -880,7 +880,7 @@ return (retval>>1) & 0xffff; } -static void mdio_write(ioaddr_t addr, int phy_id, int loc, int value) +static void mdio_write(kio_addr_t addr, int phy_id, int loc, int value) { u_int cmd = (0x05<<28)|(phy_id<<23)|(loc<<18)|(1<<17)|value; int i, mask = inb(addr) & MDIO_MASK; @@ -897,7 +897,7 @@ } } -static void mdio_reset(ioaddr_t addr, int phy_id) +static void mdio_reset(kio_addr_t addr, int phy_id) { outb_p(0x08, addr); outb_p(0x0c, addr); @@ -923,10 +923,10 @@ #define DL19FDUPLX 0x0400 /* DL10019 Full duplex mode */ -static int read_eeprom(ioaddr_t ioaddr, int location) +static int read_eeprom(kio_addr_t ioaddr, int location) { int i, retval = 0; - ioaddr_t ee_addr = ioaddr + DLINK_EEPROM; + kio_addr_t ee_addr = ioaddr + DLINK_EEPROM; int read_cmd = location | (EE_READ_CMD << 8); outb(0, ee_addr); @@ -957,10 +957,10 @@ In ASIC mode, EE_ADOT is used to output the data to the ASIC. */ -static void write_asic(ioaddr_t ioaddr, int location, short asic_data) +static void write_asic(kio_addr_t ioaddr, int location, short asic_data) { int i; - ioaddr_t ee_addr = ioaddr + DLINK_EEPROM; + kio_addr_t ee_addr = ioaddr + DLINK_EEPROM; short dataval; int read_cmd = location | (EE_READ_CMD << 8); @@ -1002,7 +1002,7 @@ static void set_misc_reg(struct net_device *dev) { - ioaddr_t nic_base = dev->base_addr; + kio_addr_t nic_base = dev->base_addr; pcnet_dev_t *info = PRIV(dev); u_char tmp; @@ -1034,7 +1034,7 @@ static void mii_phy_probe(struct net_device *dev) { pcnet_dev_t *info = PRIV(dev); - ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO; + kio_addr_t mii_addr = dev->base_addr + DLINK_GPIO; int i; u_int tmp, phyid; @@ -1109,7 +1109,7 @@ static void pcnet_reset_8390(struct net_device *dev) { - ioaddr_t nic_base = dev->base_addr; + kio_addr_t nic_base = dev->base_addr; int i; ei_status.txing = ei_status.dmaing = 0; @@ -1167,8 +1167,8 @@ { struct net_device *dev = (struct net_device *)arg; pcnet_dev_t *info = PRIV(dev); - ioaddr_t nic_base = dev->base_addr; - ioaddr_t mii_addr = nic_base + DLINK_GPIO; + kio_addr_t nic_base = dev->base_addr; + kio_addr_t mii_addr = nic_base + DLINK_GPIO; u_short link; if (!netif_device_present(dev)) goto reschedule; @@ -1271,7 +1271,7 @@ { pcnet_dev_t *info = PRIV(dev); u16 *data = (u16 *)&rq->ifr_ifru; - ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO; + kio_addr_t mii_addr = dev->base_addr + DLINK_GPIO; switch (cmd) { case SIOCGMIIPHY: data[0] = info->phy_id; @@ -1293,7 +1293,7 @@ struct e8390_pkt_hdr *hdr, int ring_page) { - ioaddr_t nic_base = dev->base_addr; + kio_addr_t nic_base = dev->base_addr; if (ei_status.dmaing) { printk(KERN_NOTICE "%s: DMAing conflict in dma_block_input." @@ -1324,7 +1324,7 @@ static void dma_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset) { - ioaddr_t nic_base = dev->base_addr; + kio_addr_t nic_base = dev->base_addr; int xfer_count = count; char *buf = skb->data; @@ -1379,7 +1379,7 @@ static void dma_block_output(struct net_device *dev, int count, const u_char *buf, const int start_page) { - ioaddr_t nic_base = dev->base_addr; + kio_addr_t nic_base = dev->base_addr; pcnet_dev_t *info = PRIV(dev); #ifdef PCMCIA_DEBUG int retries = 0; diff -Nru a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c --- a/drivers/net/pcmcia/smc91c92_cs.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/net/pcmcia/smc91c92_cs.c 2005-01-28 14:11:41 -08:00 @@ -295,7 +295,7 @@ static void smc_set_xcvr(struct net_device *dev, int if_port); static void smc_reset(struct net_device *dev); static void media_check(u_long arg); -static void mdio_sync(ioaddr_t addr); +static void mdio_sync(kio_addr_t addr); static int mdio_read(struct net_device *dev, int phy_id, int loc); static void mdio_write(struct net_device *dev, int phy_id, int loc, int value); static int smc_link_ok(struct net_device *dev); @@ -611,8 +611,8 @@ { struct net_device *dev = link->priv; struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; - ioaddr_t iouart = link->io.BasePort2; + kio_addr_t ioaddr = dev->base_addr; + kio_addr_t iouart = link->io.BasePort2; /* Set UART base address and force map with COR bit 1 */ writeb(iouart & 0xff, smc->base + MOT_UART + CISREG_IOBASE_0); @@ -631,7 +631,7 @@ static int mot_setup(dev_link_t *link) { struct net_device *dev = link->priv; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int i, wait, loop; u_int addr; @@ -739,7 +739,7 @@ static int osi_config(dev_link_t *link) { struct net_device *dev = link->priv; - static ioaddr_t com[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; + static kio_addr_t com[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; int i, j; link->conf.Attributes |= CONF_ENABLE_SPKR; @@ -828,7 +828,7 @@ static int check_sig(dev_link_t *link) { struct net_device *dev = link->priv; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int width; u_short s; @@ -892,7 +892,7 @@ u_short buf[32]; char *name; int i, j, rev; - ioaddr_t ioaddr; + kio_addr_t ioaddr; u_long mir; DEBUG(0, "smc91c92_config(0x%p)\n", link); @@ -1171,7 +1171,7 @@ #define MDIO_DATA_WRITE1 (MDIO_DIR_WRITE | MDIO_DATA_OUT) #define MDIO_DATA_READ 0x02 -static void mdio_sync(ioaddr_t addr) +static void mdio_sync(kio_addr_t addr) { int bits; for (bits = 0; bits < 32; bits++) { @@ -1182,7 +1182,7 @@ static int mdio_read(struct net_device *dev, int phy_id, int loc) { - ioaddr_t addr = dev->base_addr + MGMT; + kio_addr_t addr = dev->base_addr + MGMT; u_int cmd = (0x06<<10)|(phy_id<<5)|loc; int i, retval = 0; @@ -1202,7 +1202,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int loc, int value) { - ioaddr_t addr = dev->base_addr + MGMT; + kio_addr_t addr = dev->base_addr + MGMT; u_int cmd = (0x05<<28)|(phy_id<<23)|(loc<<18)|(1<<17)|value; int i; @@ -1228,7 +1228,7 @@ #ifdef PCMCIA_DEBUG static void smc_dump(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u_short i, w, save; save = inw(ioaddr + BANK_SELECT); for (w = 0; w < 4; w++) { @@ -1283,7 +1283,7 @@ { struct smc_private *smc = netdev_priv(dev); dev_link_t *link = &smc->link; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; DEBUG(0, "%s: smc_close(), status %4.4x.\n", dev->name, inw(ioaddr + BANK_SELECT)); @@ -1320,7 +1320,7 @@ { struct smc_private *smc = netdev_priv(dev); struct sk_buff *skb = smc->saved_skb; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u_char packet_no; if (!skb) { @@ -1384,7 +1384,7 @@ static void smc_tx_timeout(struct net_device *dev) { struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; printk(KERN_NOTICE "%s: SMC91c92 transmit timed out, " "Tx_status %2.2x status %4.4x.\n", @@ -1399,7 +1399,7 @@ static int smc_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u_short num_pages; short time_out, ir; @@ -1465,7 +1465,7 @@ static void smc_tx_err(struct net_device * dev) { struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int saved_packet = inw(ioaddr + PNR_ARR) & 0xff; int packet_no = inw(ioaddr + FIFO_PORTS) & 0x7f; int tx_status; @@ -1509,7 +1509,7 @@ static void smc_eph_irq(struct net_device *dev) { struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u_short card_stats, ephs; SMC_SELECT_BANK(0); @@ -1544,7 +1544,7 @@ { struct net_device *dev = dev_id; struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr; + kio_addr_t ioaddr; u_short saved_bank, saved_pointer, mask, status; unsigned int handled = 1; char bogus_cnt = INTR_WORK; /* Work we are willing to do. */ @@ -1662,7 +1662,7 @@ static void smc_rx(struct net_device *dev) { struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int rx_status; int packet_length; /* Caution: not frame length, rather words to transfer from the chip. */ @@ -1768,7 +1768,7 @@ static void set_rx_mode(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; struct smc_private *smc = netdev_priv(dev); u_int multicast_table[ 2 ] = { 0, }; unsigned long flags; @@ -1835,7 +1835,7 @@ static void smc_set_xcvr(struct net_device *dev, int if_port) { struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u_short saved_bank; saved_bank = inw(ioaddr + BANK_SELECT); @@ -1858,7 +1858,7 @@ static void smc_reset(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; struct smc_private *smc = netdev_priv(dev); int i; @@ -1935,7 +1935,7 @@ { struct net_device *dev = (struct net_device *) arg; struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u_short i, media, saved_bank; u_short link; @@ -2047,7 +2047,7 @@ static int smc_link_ok(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; struct smc_private *smc = netdev_priv(dev); if (smc->cfg & CFG_MII_SELECT) { @@ -2061,7 +2061,7 @@ static int smc_netdev_get_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd) { u16 tmp; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; ecmd->supported = (SUPPORTED_TP | SUPPORTED_AUI | SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full); @@ -2083,7 +2083,7 @@ static int smc_netdev_set_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd) { u16 tmp; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; if (ecmd->speed != SPEED_10) return -EINVAL; @@ -2126,7 +2126,7 @@ static int smc_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) { struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u16 saved_bank = inw(ioaddr + BANK_SELECT); int ret; @@ -2144,7 +2144,7 @@ static int smc_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) { struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u16 saved_bank = inw(ioaddr + BANK_SELECT); int ret; @@ -2162,7 +2162,7 @@ static u32 smc_get_link(struct net_device *dev) { struct smc_private *smc = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u16 saved_bank = inw(ioaddr + BANK_SELECT); u32 ret; @@ -2190,7 +2190,7 @@ { struct smc_private *smc = netdev_priv(dev); if (smc->cfg & CFG_MII_SELECT) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u16 saved_bank = inw(ioaddr + BANK_SELECT); int res; @@ -2222,7 +2222,7 @@ struct mii_ioctl_data *mii = if_mii(rq); int rc = 0; u16 saved_bank; - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; if (!netif_running(dev)) return -EINVAL; diff -Nru a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c --- a/drivers/net/pcmcia/xirc2ps_cs.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/pcmcia/xirc2ps_cs.c 2005-01-28 14:11:40 -08:00 @@ -274,12 +274,12 @@ static unsigned maxrx_bytes = 22000; /* MII management prototypes */ -static void mii_idle(ioaddr_t ioaddr); -static void mii_putbit(ioaddr_t ioaddr, unsigned data); -static int mii_getbit(ioaddr_t ioaddr); -static void mii_wbits(ioaddr_t ioaddr, unsigned data, int len); -static unsigned mii_rd(ioaddr_t ioaddr, u_char phyaddr, u_char phyreg); -static void mii_wr(ioaddr_t ioaddr, u_char phyaddr, u_char phyreg, +static void mii_idle(kio_addr_t ioaddr); +static void mii_putbit(kio_addr_t ioaddr, unsigned data); +static int mii_getbit(kio_addr_t ioaddr); +static void mii_wbits(kio_addr_t ioaddr, unsigned data, int len); +static unsigned mii_rd(kio_addr_t ioaddr, u_char phyaddr, u_char phyreg); +static void mii_wr(kio_addr_t ioaddr, u_char phyaddr, u_char phyreg, unsigned data, int len); /* @@ -425,7 +425,7 @@ static void PrintRegisters(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; if (pc_debug > 1) { int i, page; @@ -461,7 +461,7 @@ * Turn around for read */ static void -mii_idle(ioaddr_t ioaddr) +mii_idle(kio_addr_t ioaddr) { PutByte(XIRCREG2_GPR2, 0x04|0); /* drive MDCK low */ udelay(1); @@ -473,7 +473,7 @@ * Write a bit to MDI/O */ static void -mii_putbit(ioaddr_t ioaddr, unsigned data) +mii_putbit(kio_addr_t ioaddr, unsigned data) { #if 1 if (data) { @@ -506,7 +506,7 @@ * Get a bit from MDI/O */ static int -mii_getbit(ioaddr_t ioaddr) +mii_getbit(kio_addr_t ioaddr) { unsigned d; @@ -519,7 +519,7 @@ } static void -mii_wbits(ioaddr_t ioaddr, unsigned data, int len) +mii_wbits(kio_addr_t ioaddr, unsigned data, int len) { unsigned m = 1 << (len-1); for (; m; m >>= 1) @@ -527,7 +527,7 @@ } static unsigned -mii_rd(ioaddr_t ioaddr, u_char phyaddr, u_char phyreg) +mii_rd(kio_addr_t ioaddr, u_char phyaddr, u_char phyreg) { int i; unsigned data=0, m; @@ -549,7 +549,7 @@ } static void -mii_wr(ioaddr_t ioaddr, u_char phyaddr, u_char phyreg, unsigned data, int len) +mii_wr(kio_addr_t ioaddr, u_char phyaddr, u_char phyreg, unsigned data, int len) { int i; @@ -805,7 +805,7 @@ local_info_t *local = netdev_priv(dev); tuple_t tuple; cisparse_t parse; - ioaddr_t ioaddr; + kio_addr_t ioaddr; int err, i; u_char buf[64]; cistpl_lan_node_id_t *node_id = (cistpl_lan_node_id_t*)parse.funce.data; @@ -1240,7 +1240,7 @@ { struct net_device *dev = (struct net_device *)dev_id; local_info_t *lp = netdev_priv(dev); - ioaddr_t ioaddr; + kio_addr_t ioaddr; u_char saved_page; unsigned bytes_rcvd; unsigned int_status, eth_status, rx_status, tx_status; @@ -1345,7 +1345,7 @@ unsigned i; u_long *p = skb_put(skb, pktlen); register u_long a; - ioaddr_t edpreg = ioaddr+XIRCREG_EDP-2; + kio_addr_t edpreg = ioaddr+XIRCREG_EDP-2; for (i=0; i < len ; i += 4, p++) { a = inl(edpreg); __asm__("rorl $16,%0\n\t" @@ -1474,7 +1474,7 @@ do_start_xmit(struct sk_buff *skb, struct net_device *dev) { local_info_t *lp = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; int okay; unsigned freespace; unsigned pktlen = skb? skb->len : 0; @@ -1544,7 +1544,7 @@ static void set_addresses(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; local_info_t *lp = netdev_priv(dev); struct dev_mc_list *dmi = dev->mc_list; char *addr; @@ -1586,7 +1586,7 @@ static void set_multicast_list(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; SelectPage(0x42); if (dev->flags & IFF_PROMISC) { /* snoop */ @@ -1670,7 +1670,7 @@ do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { local_info_t *local = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; u16 *data = (u16 *)&rq->ifr_ifru; DEBUG(1, "%s: ioctl(%-.6s, %#04x) %04x %04x %04x %04x\n", @@ -1702,7 +1702,7 @@ hardreset(struct net_device *dev) { local_info_t *local = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; SelectPage(4); udelay(1); @@ -1719,7 +1719,7 @@ do_reset(struct net_device *dev, int full) { local_info_t *local = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; unsigned value; DEBUG(0, "%s: do_reset(%p,%d)\n", dev? dev->name:"eth?", dev, full); @@ -1880,7 +1880,7 @@ init_mii(struct net_device *dev) { local_info_t *local = netdev_priv(dev); - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; unsigned control, status, linkpartner; int i; @@ -1953,7 +1953,7 @@ do_powerdown(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; DEBUG(0, "do_powerdown(%p)\n", dev); @@ -1965,7 +1965,7 @@ static int do_stop(struct net_device *dev) { - ioaddr_t ioaddr = dev->base_addr; + kio_addr_t ioaddr = dev->base_addr; local_info_t *lp = netdev_priv(dev); dev_link_t *link = &lp->link; diff -Nru a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c --- a/drivers/net/skfp/skfddi.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/skfp/skfddi.c 2005-01-28 14:11:40 -08:00 @@ -169,8 +169,6 @@ #define PRINTK(s, args...) #endif // DRIVERDEBUG -#define PRIV(dev) (&(((struct s_smc *)dev->priv)->os)) - /* * ================= * = skfp_init_one = @@ -205,7 +203,6 @@ { struct net_device *dev; struct s_smc *smc; /* board pointer */ - unsigned long port, len; void __iomem *mem; int err; @@ -216,62 +213,43 @@ err = pci_enable_device(pdev); if (err) + return err; + + err = pci_request_regions(pdev, "skfddi"); + if (err) goto err_out1; + pci_set_master(pdev); #ifdef MEM_MAPPED_IO if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { printk(KERN_ERR "skfp: region is not an MMIO resource\n"); err = -EIO; - goto err_out1; + goto err_out2; } - port = pci_resource_start(pdev, 0); - len = pci_resource_len(pdev, 0); - if (len < 0x4000) { - printk(KERN_ERR "skfp: Invalid PCI region size: %lu\n", len); - err = -EIO; - goto err_out1; - } + mem = ioremap(pci_resource_start(pdev, 0), 0x4000); #else if (!(pci_resource_flags(pdev, 1) & IO_RESOURCE_IO)) { printk(KERN_ERR "skfp: region is not PIO resource\n"); err = -EIO; - goto err_out1; + goto err_out2; } - port = pci_resource_start(pdev, 1); - len = pci_resource_len(pdev, 1); - if (len < FP_IO_LEN) { - printk(KERN_ERR "skfp: Invalid PCI region size: %d\n", - io_len); + mem = ioport_map(pci_resource_start(pdev, 1), FP_IO_LEN); +#endif + if (!mem) { + printk(KERN_ERR "skfp: Unable to map register, " + "FDDI adapter will be disabled.\n"); err = -EIO; - goto err_out1; + goto err_out2; } -#endif - err = pci_request_regions(pdev, "skfddi"); - if (err) - goto err_out1; - - pci_set_master(pdev); dev = alloc_fddidev(sizeof(struct s_smc)); if (!dev) { printk(KERN_ERR "skfp: Unable to allocate fddi device, " "FDDI adapter will be disabled.\n"); err = -ENOMEM; - goto err_out2; - } - -#ifdef MEM_MAPPED_IO - mem = ioremap(port, len); -#else - mem =ioport_map(port, len); -#endif - if (!mem) { - printk(KERN_ERR "skfp: Unable to map register, " - "FDDI adapter will be disabled.\n"); - err = -EIO; goto err_out3; } @@ -289,7 +267,7 @@ SET_NETDEV_DEV(dev, &pdev->dev); /* Initialize board structure with bus-specific info */ - smc = (struct s_smc *) dev->priv; + smc = netdev_priv(dev); smc->os.dev = dev; smc->os.bus_type = SK_BUS_TYPE_PCI; smc->os.pdev = *pdev; @@ -331,16 +309,17 @@ pci_free_consistent(pdev, MAX_FRAME_SIZE, smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA); err_out4: + free_netdev(dev); +err_out3: #ifdef MEM_MAPPED_IO - iounmap(smc->hw.iop); + iounmap(mem); #else - ioport_unmap(smc->hw.iop); + ioport_unmap(mem); #endif -err_out3: - free_netdev(dev); err_out2: pci_release_regions(pdev); err_out1: + pci_disable_device(pdev); return err; } @@ -350,7 +329,7 @@ static void __devexit skfp_remove_one(struct pci_dev *pdev) { struct net_device *p = pci_get_drvdata(pdev); - struct s_smc *lp = p->priv; + struct s_smc *lp = netdev_priv(p); unregister_netdev(p); @@ -376,6 +355,7 @@ pci_release_regions(pdev); free_netdev(p); + pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); } @@ -406,8 +386,8 @@ */ static int skfp_driver_init(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; int err = -EIO; PRINTK(KERN_INFO "entering skfp_driver_init\n"); @@ -513,7 +493,7 @@ */ static int skfp_open(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; + struct s_smc *smc = netdev_priv(dev); int err; PRINTK(KERN_INFO "entering skfp_open\n"); @@ -580,8 +560,8 @@ */ static int skfp_close(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; CLI_FBI(); smt_reset_defaults(smc, 1); @@ -640,15 +620,15 @@ { struct net_device *dev = (struct net_device *) dev_id; struct s_smc *smc; /* private board structure pointer */ - skfddi_priv *bp = PRIV(dev); - + skfddi_priv *bp; if (dev == NULL) { printk("%s: irq %d for unknown device\n", dev->name, irq); return IRQ_NONE; } - smc = (struct s_smc *) dev->priv; + smc = netdev_priv(dev); + bp = &smc->os; // IRQs enabled or disabled ? if (inpd(ADDR(B0_IMSK)) == 0) { @@ -710,7 +690,7 @@ */ struct net_device_stats *skfp_ctl_get_stats(struct net_device *dev) { - struct s_smc *bp = (struct s_smc *) dev->priv; + struct s_smc *bp = netdev_priv(dev); /* Fill the bp->stats structure with driver-maintained counters */ @@ -874,7 +854,8 @@ */ static void skfp_ctl_set_multicast_list(struct net_device *dev) { - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; unsigned long Flags; spin_lock_irqsave(&bp->DriverLock, Flags); @@ -887,7 +868,7 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; + struct s_smc *smc = netdev_priv(dev); struct dev_mc_list *dmi; /* ptr to multicast addr entry */ int i; @@ -970,9 +951,9 @@ */ static int skfp_ctl_set_mac_address(struct net_device *dev, void *addr) { - struct s_smc *smc = (struct s_smc *) dev->priv; + struct s_smc *smc = netdev_priv(dev); struct sockaddr *p_sockaddr = (struct sockaddr *) addr; - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; unsigned long Flags; @@ -1010,12 +991,14 @@ static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - skfddi_priv *lp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *lp = &smc->os; struct s_skfp_ioctl ioc; int status = 0; if (copy_from_user(&ioc, rq->ifr_data, sizeof(struct s_skfp_ioctl))) return -EFAULT; + switch (ioc.cmd) { case SKFP_GET_STATS: /* Get the driver statistics */ ioc.len = sizeof(lp->MacStat); @@ -1088,7 +1071,8 @@ */ static int skfp_send_pkt(struct sk_buff *skb, struct net_device *dev) { - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; PRINTK(KERN_INFO "skfp_send_pkt\n"); @@ -1115,7 +1099,7 @@ } bp->QueueSkb--; skb_queue_tail(&bp->SendSkbQueue, skb); - send_queued_packets((struct s_smc *) dev->priv); + send_queued_packets(netdev_priv(dev)); if (bp->QueueSkb == 0) { netif_stop_queue(dev); } @@ -1150,7 +1134,7 @@ */ static void send_queued_packets(struct s_smc *smc) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; struct sk_buff *skb; unsigned char fc; int queue; @@ -1322,7 +1306,7 @@ ************************/ void llc_restart_tx(struct s_smc *smc) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; PRINTK(KERN_INFO "[llc_restart_tx]\n"); @@ -1506,7 +1490,7 @@ * unmap first, the hardware module could read inconsistent data. */ if (flag & DMA_WR) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; volatile struct s_smt_fp_rxd *r = &descr->r; /* If SKB is NULL, we used the local buffer. */ @@ -1620,7 +1604,7 @@ void mac_drv_rx_complete(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd, int frag_count, int len) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; struct sk_buff *skb; unsigned char *virt, *cp; unsigned short ri; @@ -1752,7 +1736,7 @@ printk("fddi: Multi-fragment requeue!\n"); - MaxFrameSize = ((skfddi_priv *) & smc->os)->MaxFrameSize; + MaxFrameSize = smc->os.MaxFrameSize; src_rxd = rxd; for (; frag_count > 0; frag_count--) { next_rxd = src_rxd->rxd_next; @@ -1828,7 +1812,7 @@ // Walk through the list of free receive buffers, passing receive // buffers to the HWM as long as RXDs are available. - MaxFrameSize = ((skfddi_priv *) & smc->os)->MaxFrameSize; + MaxFrameSize = smc->os.MaxFrameSize; // Check if there is any RXD left. while (HWM_GET_RX_FREE(smc) > 0) { PRINTK(KERN_INFO ".\n"); @@ -1897,7 +1881,7 @@ for (; frag_count > 0; frag_count--) { skb = rxd->rxd_os.skb; if (skb != NULL) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; int MaxFrameSize = bp->MaxFrameSize; pci_unmap_single(&bp->pdev, rxd->rxd_os.dma_addr, @@ -1964,7 +1948,7 @@ memcpy(skb->data, look_ahead, len); // deliver frame to system - skb->protocol = fddi_type_trans(skb, ((skfddi_priv *) & smc->os)->dev); + skb->protocol = fddi_type_trans(skb, smc->os.dev); skb->dev->last_rx = jiffies; netif_rx(skb); diff -Nru a/drivers/net/sungem.c b/drivers/net/sungem.c --- a/drivers/net/sungem.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/net/sungem.c 2005-01-28 14:11:41 -08:00 @@ -835,9 +835,9 @@ } /* Run TX completion thread */ - spin_lock(&dev->xmit_lock); + spin_lock(&gp->tx_lock); gem_tx(dev, gp, gp->status); - spin_unlock(&dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irqrestore(&gp->lock, flags); @@ -932,12 +932,12 @@ readl(gp->regs + MAC_RXCFG)); spin_lock_irq(&gp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&gp->tx_lock); gp->reset_task_pending = 2; schedule_work(&gp->reset_task); - spin_unlock(&dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); } @@ -955,6 +955,7 @@ struct gem *gp = dev->priv; int entry; u64 ctrl; + unsigned long flags; ctrl = 0; if (skb->ip_summed == CHECKSUM_HW) { @@ -968,9 +969,17 @@ (csum_stuff_off << 21)); } + local_irq_save(flags); + if (!spin_trylock(&gp->tx_lock)) { + /* Tell upper layer to requeue */ + local_irq_restore(flags); + return NETDEV_TX_LOCKED; + } + /* This is a hard error, log it. */ if (TX_BUFFS_AVAIL(gp) <= (skb_shinfo(skb)->nr_frags + 1)) { netif_stop_queue(dev); + spin_unlock_irqrestore(&gp->tx_lock, flags); printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", dev->name); return NETDEV_TX_BUSY; @@ -1057,6 +1066,7 @@ dev->name, entry, skb->len); mb(); writel(gp->tx_new, gp->regs + TXDMA_KICK); + spin_unlock_irqrestore(&gp->tx_lock, flags); dev->trans_start = jiffies; @@ -1087,11 +1097,11 @@ } spin_lock_irq(&gp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&gp->tx_lock); dev->mtu = new_mtu; gp->reset_task_pending = 1; schedule_work(&gp->reset_task); - spin_unlock(&dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); flush_scheduled_work(); @@ -1101,7 +1111,7 @@ #define STOP_TRIES 32 -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static void gem_stop(struct gem *gp) { int limit; @@ -1127,7 +1137,7 @@ printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name); } -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static void gem_start_dma(struct gem *gp) { unsigned long val; @@ -1152,7 +1162,7 @@ } -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ // XXX dbl check what that function should do when called on PCS PHY static void gem_begin_auto_negotiation(struct gem *gp, struct ethtool_cmd *ep) { @@ -1239,7 +1249,7 @@ /* A link-up condition has occurred, initialize and enable the * rest of the chip. * - * Must be invoked under gp->lock and dev->xmit_lock. + * Must be invoked under gp->lock and gp->tx_lock. */ static int gem_set_link_modes(struct gem *gp) { @@ -1346,7 +1356,7 @@ return 0; } -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static int gem_mdio_link_not_up(struct gem *gp) { switch (gp->lstate) { @@ -1404,7 +1414,7 @@ netif_poll_disable(gp->dev); spin_lock_irq(&gp->lock); - spin_lock(&gp->dev->xmit_lock); + spin_lock(&gp->tx_lock); if (gp->hw_running && gp->opened) { netif_stop_queue(gp->dev); @@ -1420,7 +1430,7 @@ } gp->reset_task_pending = 0; - spin_unlock(&gp->dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); netif_poll_enable(gp->dev); } @@ -1434,7 +1444,7 @@ return; spin_lock_irq(&gp->lock); - spin_lock(&gp->dev->xmit_lock); + spin_lock(&gp->tx_lock); /* If the link of task is still pending, we just * reschedule the link timer @@ -1504,11 +1514,11 @@ restart: mod_timer(&gp->link_timer, jiffies + ((12 * HZ) / 10)); out_unlock: - spin_unlock(&gp->dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); } -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static void gem_clean_rings(struct gem *gp) { struct gem_init_block *gb = gp->init_block; @@ -1559,7 +1569,7 @@ } } -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static void gem_init_rings(struct gem *gp) { struct gem_init_block *gb = gp->init_block; @@ -1609,7 +1619,7 @@ wmb(); } -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static void gem_init_phy(struct gem *gp) { u32 mifcfg; @@ -1747,7 +1757,7 @@ } } -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static void gem_init_dma(struct gem *gp) { u64 desc_dma = (u64) gp->gblock_dvma; @@ -1785,7 +1795,7 @@ gp->regs + RXDMA_BLANK); } -/* Must be invoked under dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static u32 gem_setup_multicast(struct gem *gp) { @@ -1828,7 +1838,7 @@ return rxcfg; } -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static void gem_init_mac(struct gem *gp) { unsigned char *e = &gp->dev->dev_addr[0]; @@ -1906,7 +1916,7 @@ writel(0xffffffff, gp->regs + MAC_MCMASK); } -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static void gem_init_pause_thresholds(struct gem *gp) { u32 cfg; @@ -2042,7 +2052,7 @@ return 0; } -/* Must be invoked under gp->lock and dev->xmit_lock. */ +/* Must be invoked under gp->lock and gp->tx_lock. */ static void gem_init_hw(struct gem *gp, int restart_link) { /* On Apple's gmac, I initialize the PHY only after @@ -2140,11 +2150,11 @@ if (!gp->wake_on_lan) { spin_lock_irqsave(&gp->lock, flags); - spin_lock(&gp->dev->xmit_lock); + spin_lock(&gp->tx_lock); gem_stop(gp); writel(MAC_TXRST_CMD, gp->regs + MAC_TXRST); writel(MAC_RXRST_CMD, gp->regs + MAC_RXRST); - spin_unlock(&gp->dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irqrestore(&gp->lock, flags); } @@ -2192,9 +2202,9 @@ unsigned long flags; spin_lock_irqsave(&gp->lock, flags); - spin_lock(&gp->dev->xmit_lock); + spin_lock(&gp->tx_lock); gem_stop(gp); - spin_unlock(&gp->dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irqrestore(&gp->lock, flags); } } @@ -2255,9 +2265,9 @@ /* Reset the chip */ spin_lock_irq(&gp->lock); - spin_lock(&gp->dev->xmit_lock); + spin_lock(&gp->tx_lock); gem_stop(gp); - spin_unlock(&gp->dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); gp->hw_running = 1; @@ -2271,7 +2281,7 @@ printk(KERN_ERR "%s: failed to request irq !\n", gp->dev->name); spin_lock_irq(&gp->lock); - spin_lock(&gp->dev->xmit_lock); + spin_lock(&gp->tx_lock); #ifdef CONFIG_PPC_PMAC if (!hw_was_up && gp->pdev->vendor == PCI_VENDOR_ID_APPLE) gem_apple_powerdown(gp); @@ -2280,14 +2290,14 @@ gp->pm_timer.expires = jiffies + 10*HZ; add_timer(&gp->pm_timer); up(&gp->pm_sem); - spin_unlock(&gp->dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); return -EAGAIN; } spin_lock_irq(&gp->lock); - spin_lock(&gp->dev->xmit_lock); + spin_lock(&gp->tx_lock); /* Allocate & setup ring buffers */ gem_init_rings(gp); @@ -2297,7 +2307,7 @@ gp->opened = 1; - spin_unlock(&gp->dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); up(&gp->pm_sem); @@ -2318,7 +2328,7 @@ /* Stop traffic, mark us closed */ spin_lock_irq(&gp->lock); - spin_lock(&gp->dev->xmit_lock); + spin_lock(&gp->tx_lock); gp->opened = 0; @@ -2333,7 +2343,7 @@ /* Bye, the pm timer will finish the job */ free_irq(gp->pdev->irq, (void *) dev); - spin_unlock(&gp->dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); /* Fire the PM timer that will shut us down in about 10 seconds */ @@ -2364,7 +2374,7 @@ /* If the driver is opened, we stop the DMA */ if (gp->opened) { spin_lock_irq(&gp->lock); - spin_lock(&gp->dev->xmit_lock); + spin_lock(&gp->tx_lock); /* Stop traffic, mark us closed */ netif_device_detach(dev); @@ -2375,7 +2385,7 @@ /* Get rid of ring buffers */ gem_clean_rings(gp); - spin_unlock(&gp->dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE) @@ -2409,14 +2419,14 @@ } #endif /* CONFIG_PPC_PMAC */ spin_lock_irq(&gp->lock); - spin_lock(&gp->dev->xmit_lock); + spin_lock(&gp->tx_lock); gem_stop(gp); gp->hw_running = 1; gem_init_rings(gp); gem_init_hw(gp, 1); - spin_unlock(&gp->dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); netif_device_attach(dev); @@ -2437,7 +2447,7 @@ struct net_device_stats *stats = &gp->net_stats; spin_lock_irq(&gp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&gp->tx_lock); if (gp->hw_running) { stats->rx_crc_errors += readl(gp->regs + MAC_FCSERR); @@ -2457,13 +2467,12 @@ writel(0, gp->regs + MAC_LCOLL); } - spin_unlock(&dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); return &gp->net_stats; } -/* Called with dev->xmit_lock held and IRQs disabled. */ static void gem_set_multicast(struct net_device *dev) { struct gem *gp = dev->priv; @@ -2473,6 +2482,9 @@ if (!gp->hw_running) return; + spin_lock_irq(&gp->lock); + spin_lock(&gp->tx_lock); + netif_stop_queue(dev); rxcfg = readl(gp->regs + MAC_RXCFG); @@ -2495,6 +2507,9 @@ writel(rxcfg, gp->regs + MAC_RXCFG); netif_wake_queue(dev); + + spin_unlock(&gp->tx_lock); + spin_unlock_irq(&gp->lock); } static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) @@ -2525,7 +2540,7 @@ /* Return current PHY settings */ spin_lock_irq(&gp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&gp->tx_lock); cmd->autoneg = gp->want_autoneg; cmd->speed = gp->phy_mii.speed; cmd->duplex = gp->phy_mii.duplex; @@ -2537,7 +2552,7 @@ */ if (cmd->advertising == 0) cmd->advertising = cmd->supported; - spin_unlock(&dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); } else { // XXX PCS ? cmd->supported = @@ -2577,9 +2592,9 @@ /* Apply settings and restart link process. */ spin_lock_irq(&gp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&gp->tx_lock); gem_begin_auto_negotiation(gp, cmd); - spin_unlock(&dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); return 0; @@ -2594,9 +2609,9 @@ /* Restart link process. */ spin_lock_irq(&gp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&gp->tx_lock); gem_begin_auto_negotiation(gp, NULL); - spin_unlock(&dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); return 0; @@ -2848,6 +2863,7 @@ gp->msg_enable = DEFAULT_MSG; spin_lock_init(&gp->lock); + spin_lock_init(&gp->tx_lock); init_MUTEX(&gp->pm_sem); init_timer(&gp->link_timer); @@ -2883,9 +2899,9 @@ gem_apple_powerup(gp); #endif spin_lock_irq(&gp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&gp->tx_lock); gem_stop(gp); - spin_unlock(&dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); /* Fill up the mii_phy structure (even if we won't use it) */ @@ -2951,11 +2967,11 @@ /* Detect & init PHY, start autoneg */ spin_lock_irq(&gp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&gp->tx_lock); gp->hw_running = 1; gem_init_phy(gp); gem_begin_auto_negotiation(gp, NULL); - spin_unlock(&dev->xmit_lock); + spin_unlock(&gp->tx_lock); spin_unlock_irq(&gp->lock); if (gp->phy_type == phy_mii_mdio0 || @@ -2966,7 +2982,7 @@ pci_set_drvdata(pdev, dev); /* GEM can do it all... */ - dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; + dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_LLTX; if (pci_using_dac) dev->features |= NETIF_F_HIGHDMA; diff -Nru a/drivers/net/sungem.h b/drivers/net/sungem.h --- a/drivers/net/sungem.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/sungem.h 2005-01-28 14:11:40 -08:00 @@ -953,6 +953,7 @@ struct gem { spinlock_t lock; + spinlock_t tx_lock; void __iomem *regs; int rx_new, rx_old; int tx_new, tx_old; diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c --- a/drivers/net/tg3.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/tg3.c 2005-01-28 14:11:40 -08:00 @@ -60,8 +60,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "3.16" -#define DRV_MODULE_RELDATE "January 17, 2005" +#define DRV_MODULE_VERSION "3.18" +#define DRV_MODULE_RELDATE "January 24, 2005" #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE 0 @@ -2816,9 +2816,9 @@ /* run TX completion thread */ if (sblk->idx[0].tx_consumer != tp->tx_cons) { - spin_lock(&netdev->xmit_lock); + spin_lock(&tp->tx_lock); tg3_tx(tp); - spin_unlock(&netdev->xmit_lock); + spin_unlock(&tp->tx_lock); } spin_unlock_irqrestore(&tp->lock, flags); @@ -2939,7 +2939,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&tp->dev->xmit_lock); + spin_lock(&tp->tx_lock); restart_timer = tp->tg3_flags2 & TG3_FLG2_RESTART_TIMER; tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER; @@ -2949,7 +2949,7 @@ tg3_netif_start(tp); - spin_unlock(&tp->dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); if (restart_timer) @@ -3048,7 +3048,6 @@ (base + len + 8 < base)); } -/* dev->xmit_lock is held and IRQs are disabled. */ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct tg3 *tp = netdev_priv(dev); @@ -3056,12 +3055,39 @@ unsigned int i; u32 len, entry, base_flags, mss; int would_hit_hwbug; + unsigned long flags; len = skb_headlen(skb); + /* No BH disabling for tx_lock here. We are running in BH disabled + * context and TX reclaim runs via tp->poll inside of a software + * interrupt. Rejoice! + * + * Actually, things are not so simple. If we are to take a hw + * IRQ here, we can deadlock, consider: + * + * CPU1 CPU2 + * tg3_start_xmit + * take tp->tx_lock + * tg3_timer + * take tp->lock + * tg3_interrupt + * spin on tp->lock + * spin on tp->tx_lock + * + * So we really do need to disable interrupts when taking + * tx_lock here. + */ + local_irq_save(flags); + if (!spin_trylock(&tp->tx_lock)) { + local_irq_restore(flags); + return NETDEV_TX_LOCKED; + } + /* This is a hard error, log it. */ if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) { netif_stop_queue(dev); + spin_unlock_irqrestore(&tp->tx_lock, flags); printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", dev->name); return NETDEV_TX_BUSY; @@ -3085,11 +3111,19 @@ skb->nh.iph->check = 0; skb->nh.iph->tot_len = ntohs(mss + ip_tcp_len + tcp_opt_len); - skb->h.th->check = ~csum_tcpudp_magic(skb->nh.iph->saddr, - skb->nh.iph->daddr, - 0, IPPROTO_TCP, 0); + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { + skb->h.th->check = 0; + base_flags &= ~TXD_FLAG_TCPUDP_CSUM; + } + else { + skb->h.th->check = + ~csum_tcpudp_magic(skb->nh.iph->saddr, + skb->nh.iph->daddr, + 0, IPPROTO_TCP, 0); + } - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) { + if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) || + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) { if (tcp_opt_len || skb->nh.iph->ihl > 5) { int tsflags; @@ -3156,7 +3190,7 @@ would_hit_hwbug = entry + 1; } - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) tg3_set_txd(tp, entry, mapping, len, base_flags, (i == last)|(mss << 1)); else @@ -3198,7 +3232,7 @@ entry, len, last_plus_one, &start, mss)) - goto out; + goto out_unlock; entry = start; } @@ -3210,8 +3244,9 @@ if (TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1)) netif_stop_queue(dev); -out: +out_unlock: mmiowb(); + spin_unlock_irqrestore(&tp->tx_lock, flags); dev->trans_start = jiffies; @@ -3246,7 +3281,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); tg3_halt(tp); @@ -3256,7 +3291,7 @@ tg3_netif_start(tp); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); return 0; @@ -4747,7 +4782,7 @@ unsigned long cpu_base, cpu_scratch_base, cpu_scratch_size; int err, i; - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) return 0; if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) { @@ -5181,7 +5216,7 @@ } #if TG3_TSO_SUPPORT != 0 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) rdmac_mode |= (1 << 27); #endif @@ -5331,7 +5366,7 @@ tw32(RCVDBDI_MODE, RCVDBDI_MODE_ENABLE | RCVDBDI_MODE_INV_RING_SZ); tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE); #if TG3_TSO_SUPPORT != 0 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) tw32(SNDDATAI_MODE, SNDDATAI_MODE_ENABLE | 0x8); #endif tw32(SNDBDI_MODE, SNDBDI_MODE_ENABLE | SNDBDI_MODE_ATTN_ENABLE); @@ -5547,7 +5582,7 @@ unsigned long flags; spin_lock_irqsave(&tp->lock, flags); - spin_lock(&tp->dev->xmit_lock); + spin_lock(&tp->tx_lock); /* All of this garbage is because when using non-tagged * IRQ status the mailbox/status_block protocol the chip @@ -5563,7 +5598,7 @@ if (!(tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { tp->tg3_flags2 |= TG3_FLG2_RESTART_TIMER; - spin_unlock(&tp->dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irqrestore(&tp->lock, flags); schedule_work(&tp->reset_task); return; @@ -5632,7 +5667,7 @@ tp->asf_counter = tp->asf_multiplier; } - spin_unlock(&tp->dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irqrestore(&tp->lock, flags); tp->timer.expires = jiffies + tp->timer_offset; @@ -5645,12 +5680,12 @@ int err; spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); tg3_disable_ints(tp); tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); /* The placement of this call is tied @@ -5669,7 +5704,7 @@ } spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); err = tg3_init_hw(tp); if (err) { @@ -5689,7 +5724,7 @@ tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; } - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); if (err) { @@ -5699,11 +5734,11 @@ } spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); tg3_enable_ints(tp); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); netif_start_queue(dev); @@ -5951,7 +5986,7 @@ del_timer_sync(&tp->timer); spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); #if 0 tg3_dump_state(tp); #endif @@ -5965,7 +6000,7 @@ TG3_FLAG_GOT_SERDES_FLOWCTL); netif_carrier_off(tp->dev); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); free_irq(dev->irq, dev); @@ -6264,10 +6299,15 @@ } } -/* Called with dev->xmit_lock held and IRQs disabled. */ static void tg3_set_rx_mode(struct net_device *dev) { + struct tg3 *tp = netdev_priv(dev); + + spin_lock_irq(&tp->lock); + spin_lock(&tp->tx_lock); __tg3_set_rx_mode(dev); + spin_unlock(&tp->tx_lock); + spin_unlock_irq(&tp->lock); } #define TG3_REGDUMP_LEN (32 * 1024) @@ -6290,7 +6330,7 @@ memset(p, 0, TG3_REGDUMP_LEN); spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); #define __GET_REG32(reg) (*(p)++ = tr32(reg)) #define GET_REG32_LOOP(base,len) \ @@ -6340,17 +6380,19 @@ #undef GET_REG32_LOOP #undef GET_REG32_1 - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); } static int tg3_get_eeprom_len(struct net_device *dev) { - return EEPROM_CHIP_SIZE; + struct tg3 *tp = netdev_priv(dev); + + return tp->nvram_size; } -static int tg3_nvram_read_using_eeprom(struct tg3 *tp, - u32 offset, u32 *val); +static int tg3_nvram_read(struct tg3 *tp, u32 offset, u32 *val); + static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data) { struct tg3 *tp = netdev_priv(dev); @@ -6362,10 +6404,7 @@ len = eeprom->len; eeprom->len = 0; - ret = tg3_nvram_read_using_eeprom(tp, 0, &eeprom->magic); - if (ret) - return ret; - eeprom->magic = swab32(eeprom->magic); + eeprom->magic = TG3_EEPROM_MAGIC; if (offset & 3) { /* adjustments to start on required 4 byte boundary */ @@ -6375,9 +6414,10 @@ /* i.e. offset=1 len=2 */ b_count = len; } - ret = tg3_nvram_read_using_eeprom(tp, offset-b_offset, &val); + ret = tg3_nvram_read(tp, offset-b_offset, &val); if (ret) return ret; + val = cpu_to_le32(val); memcpy(data, ((char*)&val) + b_offset, b_count); len -= b_count; offset += b_count; @@ -6387,12 +6427,13 @@ /* read bytes upto the last 4 byte boundary */ pd = &data[eeprom->len]; for (i = 0; i < (len - (len & 3)); i += 4) { - ret = tg3_nvram_read_using_eeprom(tp, offset + i, - (u32*)(pd + i)); + ret = tg3_nvram_read(tp, offset + i, &val); if (ret) { eeprom->len += i; return ret; } + val = cpu_to_le32(val); + memcpy(pd + i, &val, 4); } eeprom->len += i; @@ -6401,15 +6442,72 @@ pd = &data[eeprom->len]; b_count = len & 3; b_offset = offset + len - b_count; - ret = tg3_nvram_read_using_eeprom(tp, b_offset, &val); + ret = tg3_nvram_read(tp, b_offset, &val); if (ret) return ret; + val = cpu_to_le32(val); memcpy(pd, ((char*)&val), b_count); eeprom->len += b_count; } return 0; } +static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf); + +static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data) +{ + struct tg3 *tp = netdev_priv(dev); + int ret; + u32 offset, len, b_offset, odd_len, start, end; + u8 *buf; + + if (eeprom->magic != TG3_EEPROM_MAGIC) + return -EINVAL; + + offset = eeprom->offset; + len = eeprom->len; + + if ((b_offset = (offset & 3))) { + /* adjustments to start on required 4 byte boundary */ + ret = tg3_nvram_read(tp, offset-b_offset, &start); + if (ret) + return ret; + start = cpu_to_le32(start); + len += b_offset; + offset &= ~3; + } + + odd_len = 0; + if ((len & 3) && ((len > 4) || (b_offset == 0))) { + /* adjustments to end on required 4 byte boundary */ + odd_len = 1; + len = (len + 3) & ~3; + ret = tg3_nvram_read(tp, offset+len-4, &end); + if (ret) + return ret; + end = cpu_to_le32(end); + } + + buf = data; + if (b_offset || odd_len) { + buf = kmalloc(len, GFP_KERNEL); + if (buf == 0) + return -ENOMEM; + if (b_offset) + memcpy(buf, &start, 4); + if (odd_len) + memcpy(buf+len-4, &end, 4); + memcpy(buf + b_offset, data, eeprom->len); + } + + ret = tg3_nvram_write_block(tp, offset, len, buf); + + if (buf != data) + kfree(buf); + + return ret; +} + static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) { struct tg3 *tp = netdev_priv(dev); @@ -6464,7 +6562,7 @@ } spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); tp->link_config.autoneg = cmd->autoneg; if (cmd->autoneg == AUTONEG_ENABLE) { @@ -6478,7 +6576,7 @@ } tg3_setup_phy(tp, 1); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); return 0; @@ -6595,7 +6693,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); tp->rx_pending = ering->rx_pending; @@ -6608,7 +6706,7 @@ tg3_halt(tp); tg3_init_hw(tp); tg3_netif_start(tp); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); return 0; @@ -6629,7 +6727,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); if (epause->autoneg) tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG; else @@ -6645,7 +6743,7 @@ tg3_halt(tp); tg3_init_hw(tp); tg3_netif_start(tp); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); return 0; @@ -6771,14 +6869,14 @@ struct tg3 *tp = netdev_priv(dev); spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); tp->vlgrp = grp; /* Update RX_MODE_KEEP_VLAN_TAG bit in RX_MODE register. */ __tg3_set_rx_mode(dev); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); } @@ -6787,10 +6885,10 @@ struct tg3 *tp = netdev_priv(dev); spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); if (tp->vlgrp) tp->vlgrp->vlan_devices[vid] = NULL; - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); } #endif @@ -6809,6 +6907,7 @@ .get_link = ethtool_op_get_link, .get_eeprom_len = tg3_get_eeprom_len, .get_eeprom = tg3_get_eeprom, + .set_eeprom = tg3_set_eeprom, .get_ringparam = tg3_get_ringparam, .set_ringparam = tg3_set_ringparam, .get_pauseparam = tg3_get_pauseparam, @@ -6828,6 +6927,103 @@ .get_ethtool_stats = tg3_get_ethtool_stats, }; +static void __devinit tg3_get_eeprom_size(struct tg3 *tp) +{ + u32 cursize, val; + + tp->nvram_size = EEPROM_CHIP_SIZE; + + if (tg3_nvram_read(tp, 0, &val) != 0) + return; + + if (swab32(val) != TG3_EEPROM_MAGIC) + return; + + /* + * Size the chip by reading offsets at increasing powers of two. + * When we encounter our validation signature, we know the addressing + * has wrapped around, and thus have our chip size. + */ + cursize = 0x800; + + while (cursize < tp->nvram_size) { + if (tg3_nvram_read(tp, cursize, &val) != 0) + return; + + if (swab32(val) == TG3_EEPROM_MAGIC) + break; + + cursize <<= 1; + } + + tp->nvram_size = cursize; +} + +static void __devinit tg3_get_nvram_size(struct tg3 *tp) +{ + u32 val; + + if (tg3_nvram_read(tp, 0xf0, &val) == 0) { + if (val != 0) { + tp->nvram_size = (val >> 16) * 1024; + return; + } + } + tp->nvram_size = 0x20000; +} + +static void __devinit tg3_get_nvram_info(struct tg3 *tp) +{ + u32 nvcfg1; + + nvcfg1 = tr32(NVRAM_CFG1); + if (nvcfg1 & NVRAM_CFG1_FLASHIF_ENAB) { + tp->tg3_flags2 |= TG3_FLG2_FLASH; + } + else { + nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS; + tw32(NVRAM_CFG1, nvcfg1); + } + + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) { + switch (nvcfg1 & NVRAM_CFG1_VENDOR_MASK) { + case FLASH_VENDOR_ATMEL_FLASH_BUFFERED: + tp->nvram_jedecnum = JEDEC_ATMEL; + tp->nvram_pagesize = ATMEL_AT45DB0X1B_PAGE_SIZE; + tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED; + break; + case FLASH_VENDOR_ATMEL_FLASH_UNBUFFERED: + tp->nvram_jedecnum = JEDEC_ATMEL; + tp->nvram_pagesize = ATMEL_AT25F512_PAGE_SIZE; + break; + case FLASH_VENDOR_ATMEL_EEPROM: + tp->nvram_jedecnum = JEDEC_ATMEL; + tp->nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE; + tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED; + break; + case FLASH_VENDOR_ST: + tp->nvram_jedecnum = JEDEC_ST; + tp->nvram_pagesize = ST_M45PEX0_PAGE_SIZE; + tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED; + break; + case FLASH_VENDOR_SAIFUN: + tp->nvram_jedecnum = JEDEC_SAIFUN; + tp->nvram_pagesize = SAIFUN_SA25F0XX_PAGE_SIZE; + break; + case FLASH_VENDOR_SST_SMALL: + case FLASH_VENDOR_SST_LARGE: + tp->nvram_jedecnum = JEDEC_SST; + tp->nvram_pagesize = SST_25VF0X0_PAGE_SIZE; + break; + } + } + else { + tp->nvram_jedecnum = JEDEC_ATMEL; + tp->nvram_pagesize = ATMEL_AT45DB0X1B_PAGE_SIZE; + tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED; + } +} + /* Chips other than 5700/5701 use the NVRAM for fetching info. */ static void __devinit tg3_nvram_init(struct tg3 *tp) { @@ -6852,32 +7048,27 @@ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700 && GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701) { - u32 nvcfg1; + tp->tg3_flags |= TG3_FLAG_NVRAM; if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) { u32 nvaccess = tr32(NVRAM_ACCESS); - tw32_f(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE); + tw32(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE); } - nvcfg1 = tr32(NVRAM_CFG1); - - tp->tg3_flags |= TG3_FLAG_NVRAM; - if (nvcfg1 & NVRAM_CFG1_FLASHIF_ENAB) { - if (nvcfg1 & NVRAM_CFG1_BUFFERED_MODE) - tp->tg3_flags |= TG3_FLAG_NVRAM_BUFFERED; - } else { - nvcfg1 &= ~NVRAM_CFG1_COMPAT_BYPASS; - tw32(NVRAM_CFG1, nvcfg1); - } + tg3_get_nvram_info(tp); + tg3_get_nvram_size(tp); if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) { u32 nvaccess = tr32(NVRAM_ACCESS); - tw32_f(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE); + tw32(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE); } + } else { tp->tg3_flags &= ~(TG3_FLAG_NVRAM | TG3_FLAG_NVRAM_BUFFERED); + + tg3_get_eeprom_size(tp); } } @@ -6915,11 +7106,30 @@ return 0; } -static int __devinit tg3_nvram_read(struct tg3 *tp, - u32 offset, u32 *val) +#define NVRAM_CMD_TIMEOUT 10000 + +static int tg3_nvram_exec_cmd(struct tg3 *tp, u32 nvram_cmd) { int i; + tw32(NVRAM_CMD, nvram_cmd); + for (i = 0; i < NVRAM_CMD_TIMEOUT; i++) { + udelay(10); + if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) { + udelay(10); + break; + } + } + if (i == NVRAM_CMD_TIMEOUT) { + return -EBUSY; + } + return 0; +} + +static int tg3_nvram_read(struct tg3 *tp, u32 offset, u32 *val) +{ + int ret; + if (tp->tg3_flags2 & TG3_FLG2_SUN_570X) { printk(KERN_ERR PFX "Attempt to do nvram_read on Sun 570X\n"); return -EINVAL; @@ -6928,10 +7138,14 @@ if (!(tp->tg3_flags & TG3_FLAG_NVRAM)) return tg3_nvram_read_using_eeprom(tp, offset, val); - if (tp->tg3_flags & TG3_FLAG_NVRAM_BUFFERED) - offset = ((offset / NVRAM_BUFFERED_PAGE_SIZE) << - NVRAM_BUFFERED_PAGE_POS) + - (offset % NVRAM_BUFFERED_PAGE_SIZE); + if ((tp->tg3_flags & TG3_FLAG_NVRAM_BUFFERED) && + (tp->tg3_flags2 & TG3_FLG2_FLASH) && + (tp->nvram_jedecnum == JEDEC_ATMEL)) { + + offset = ((offset / tp->nvram_pagesize) << + ATMEL_AT45DB0X1B_PAGE_POS) + + (offset % tp->nvram_pagesize); + } if (offset > NVRAM_ADDR_MSK) return -EINVAL; @@ -6945,19 +7159,11 @@ } tw32(NVRAM_ADDR, offset); - tw32(NVRAM_CMD, - NVRAM_CMD_RD | NVRAM_CMD_GO | - NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_DONE); + ret = tg3_nvram_exec_cmd(tp, NVRAM_CMD_RD | NVRAM_CMD_GO | + NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_DONE); - /* Wait for done bit to clear. */ - for (i = 0; i < 1000; i++) { - udelay(10); - if (tr32(NVRAM_CMD) & NVRAM_CMD_DONE) { - udelay(10); - *val = swab32(tr32(NVRAM_RDDATA)); - break; - } - } + if (ret == 0) + *val = swab32(tr32(NVRAM_RDDATA)); tg3_nvram_unlock(tp); @@ -6967,10 +7173,268 @@ tw32_f(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE); } - if (i >= 1000) - return -EBUSY; + return ret; +} - return 0; +static int tg3_nvram_write_block_using_eeprom(struct tg3 *tp, + u32 offset, u32 len, u8 *buf) +{ + int i, j, rc = 0; + u32 val; + + for (i = 0; i < len; i += 4) { + u32 addr, data; + + addr = offset + i; + + memcpy(&data, buf + i, 4); + + tw32(GRC_EEPROM_DATA, cpu_to_le32(data)); + + val = tr32(GRC_EEPROM_ADDR); + tw32(GRC_EEPROM_ADDR, val | EEPROM_ADDR_COMPLETE); + + val &= ~(EEPROM_ADDR_ADDR_MASK | EEPROM_ADDR_DEVID_MASK | + EEPROM_ADDR_READ); + tw32(GRC_EEPROM_ADDR, val | + (0 << EEPROM_ADDR_DEVID_SHIFT) | + (addr & EEPROM_ADDR_ADDR_MASK) | + EEPROM_ADDR_START | + EEPROM_ADDR_WRITE); + + for (j = 0; j < 10000; j++) { + val = tr32(GRC_EEPROM_ADDR); + + if (val & EEPROM_ADDR_COMPLETE) + break; + udelay(100); + } + if (!(val & EEPROM_ADDR_COMPLETE)) { + rc = -EBUSY; + break; + } + } + + return rc; +} + +/* offset and length are dword aligned */ +static int tg3_nvram_write_block_unbuffered(struct tg3 *tp, u32 offset, u32 len, + u8 *buf) +{ + int ret = 0; + u32 pagesize = tp->nvram_pagesize; + u32 pagemask = pagesize - 1; + u32 nvram_cmd; + u8 *tmp; + + tmp = kmalloc(pagesize, GFP_KERNEL); + if (tmp == NULL) + return -ENOMEM; + + while (len) { + int j; + u32 phy_addr, page_off, size, nvaccess; + + phy_addr = offset & ~pagemask; + + for (j = 0; j < pagesize; j += 4) { + if ((ret = tg3_nvram_read(tp, phy_addr + j, + (u32 *) (tmp + j)))) + break; + } + if (ret) + break; + + page_off = offset & pagemask; + size = pagesize; + if (len < size) + size = len; + + len -= size; + + memcpy(tmp + page_off, buf, size); + + offset = offset + (pagesize - page_off); + + nvaccess = tr32(NVRAM_ACCESS); + tw32_f(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE); + + /* + * Before we can erase the flash page, we need + * to issue a special "write enable" command. + */ + nvram_cmd = NVRAM_CMD_WREN | NVRAM_CMD_GO | NVRAM_CMD_DONE; + + if (tg3_nvram_exec_cmd(tp, nvram_cmd)) + break; + + /* Erase the target page */ + tw32(NVRAM_ADDR, phy_addr); + + nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE | NVRAM_CMD_WR | + NVRAM_CMD_FIRST | NVRAM_CMD_LAST | NVRAM_CMD_ERASE; + + if (tg3_nvram_exec_cmd(tp, nvram_cmd)) + break; + + /* Issue another write enable to start the write. */ + nvram_cmd = NVRAM_CMD_WREN | NVRAM_CMD_GO | NVRAM_CMD_DONE; + + if (tg3_nvram_exec_cmd(tp, nvram_cmd)) + break; + + for (j = 0; j < pagesize; j += 4) { + u32 data; + + data = *((u32 *) (tmp + j)); + tw32(NVRAM_WRDATA, cpu_to_be32(data)); + + tw32(NVRAM_ADDR, phy_addr + j); + + nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE | + NVRAM_CMD_WR; + + if (j == 0) + nvram_cmd |= NVRAM_CMD_FIRST; + else if (j == (pagesize - 4)) + nvram_cmd |= NVRAM_CMD_LAST; + + if ((ret = tg3_nvram_exec_cmd(tp, nvram_cmd))) + break; + } + if (ret) + break; + } + + nvram_cmd = NVRAM_CMD_WRDI | NVRAM_CMD_GO | NVRAM_CMD_DONE; + tg3_nvram_exec_cmd(tp, nvram_cmd); + + kfree(tmp); + + return ret; +} + +/* offset and length are dword aligned */ +static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len, + u8 *buf) +{ + int i, ret = 0; + + for (i = 0; i < len; i += 4, offset += 4) { + u32 data, page_off, phy_addr, nvram_cmd; + + memcpy(&data, buf + i, 4); + tw32(NVRAM_WRDATA, cpu_to_be32(data)); + + page_off = offset % tp->nvram_pagesize; + + if ((tp->tg3_flags2 & TG3_FLG2_FLASH) && + (tp->nvram_jedecnum == JEDEC_ATMEL)) { + + phy_addr = ((offset / tp->nvram_pagesize) << + ATMEL_AT45DB0X1B_PAGE_POS) + page_off; + } + else { + phy_addr = offset; + } + + tw32(NVRAM_ADDR, phy_addr); + + nvram_cmd = NVRAM_CMD_GO | NVRAM_CMD_DONE | NVRAM_CMD_WR; + + if ((page_off == 0) || (i == 0)) + nvram_cmd |= NVRAM_CMD_FIRST; + else if (page_off == (tp->nvram_pagesize - 4)) + nvram_cmd |= NVRAM_CMD_LAST; + + if (i == (len - 4)) + nvram_cmd |= NVRAM_CMD_LAST; + + if ((tp->nvram_jedecnum == JEDEC_ST) && + (nvram_cmd & NVRAM_CMD_FIRST)) { + + if ((ret = tg3_nvram_exec_cmd(tp, + NVRAM_CMD_WREN | NVRAM_CMD_GO | + NVRAM_CMD_DONE))) + + break; + } + if (!(tp->tg3_flags2 & TG3_FLG2_FLASH)) { + /* We always do complete word writes to eeprom. */ + nvram_cmd |= (NVRAM_CMD_FIRST | NVRAM_CMD_LAST); + } + + if ((ret = tg3_nvram_exec_cmd(tp, nvram_cmd))) + break; + } + return ret; +} + +/* offset and length are dword aligned */ +static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf) +{ + int ret; + + if (tp->tg3_flags2 & TG3_FLG2_SUN_570X) { + printk(KERN_ERR PFX "Attempt to do nvram_write on Sun 570X\n"); + return -EINVAL; + } + + if (tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) { + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | + GRC_LCLCTRL_GPIO_OE1); + udelay(40); + } + + if (!(tp->tg3_flags & TG3_FLAG_NVRAM)) { + ret = tg3_nvram_write_block_using_eeprom(tp, offset, len, buf); + } + else { + u32 grc_mode; + + tg3_nvram_lock(tp); + + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) { + u32 nvaccess = tr32(NVRAM_ACCESS); + + tw32(NVRAM_ACCESS, nvaccess | ACCESS_ENABLE); + + tw32(NVRAM_WRITE1, 0x406); + } + + grc_mode = tr32(GRC_MODE); + tw32(GRC_MODE, grc_mode | GRC_MODE_NVRAM_WR_ENABLE); + + if ((tp->tg3_flags & TG3_FLAG_NVRAM_BUFFERED) || + !(tp->tg3_flags2 & TG3_FLG2_FLASH)) { + + ret = tg3_nvram_write_block_buffered(tp, offset, len, + buf); + } + else { + ret = tg3_nvram_write_block_unbuffered(tp, offset, len, + buf); + } + + grc_mode = tr32(GRC_MODE); + tw32(GRC_MODE, grc_mode & ~GRC_MODE_NVRAM_WR_ENABLE); + + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) { + u32 nvaccess = tr32(NVRAM_ACCESS); + + tw32(NVRAM_ACCESS, nvaccess & ~ACCESS_ENABLE); + } + tg3_nvram_unlock(tp); + } + + if (tp->tg3_flags & TG3_FLAG_EEPROM_WRITE_PROT) { + tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl | + GRC_LCLCTRL_GPIO_OE1 | GRC_LCLCTRL_GPIO_OUTPUT1); + udelay(40); + } + + return ret; } struct subsys_tbl_ent { @@ -7411,6 +7875,9 @@ tp->pci_hdr_type = (cacheline_sz_reg >> 16) & 0xff; tp->pci_bist = (cacheline_sz_reg >> 24) & 0xff; + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) + tp->tg3_flags2 |= TG3_FLG2_HW_TSO; + if (pci_find_capability(tp->pdev, PCI_CAP_ID_EXP) != 0) tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS; @@ -8209,6 +8676,7 @@ if (pci_using_dac) dev->features |= NETIF_F_HIGHDMA; + dev->features |= NETIF_F_LLTX; #if TG3_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = tg3_vlan_rx_register; @@ -8250,6 +8718,7 @@ tp->grc_mode |= GRC_MODE_BSWAP_NONFRM_DATA; #endif spin_lock_init(&tp->lock); + spin_lock_init(&tp->tx_lock); spin_lock_init(&tp->indirect_lock); INIT_WORK(&tp->reset_task, tg3_reset_task, tp); @@ -8304,11 +8773,13 @@ } #if TG3_TSO_SUPPORT != 0 - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { + tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; + } + else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 || GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 || tp->pci_chip_rev_id == CHIPREV_ID_5705_A0 || - ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0 && - GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750)) { + (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) != 0) { tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE; } else { tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; @@ -8462,23 +8933,23 @@ del_timer_sync(&tp->timer); spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); tg3_disable_ints(tp); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); netif_device_detach(dev); spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); tg3_halt(tp); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); err = tg3_set_power_state(tp, state); if (err) { spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); tg3_init_hw(tp); @@ -8488,7 +8959,7 @@ netif_device_attach(dev); tg3_netif_start(tp); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); } @@ -8513,7 +8984,7 @@ netif_device_attach(dev); spin_lock_irq(&tp->lock); - spin_lock(&dev->xmit_lock); + spin_lock(&tp->tx_lock); tg3_init_hw(tp); @@ -8524,7 +8995,7 @@ tg3_netif_start(tp); - spin_unlock(&dev->xmit_lock); + spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); return 0; diff -Nru a/drivers/net/tg3.h b/drivers/net/tg3.h --- a/drivers/net/tg3.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/tg3.h 2005-01-28 14:11:40 -08:00 @@ -1274,6 +1274,7 @@ #define GRC_MODE_HOST_STACKUP 0x00010000 #define GRC_MODE_HOST_SENDBDS 0x00020000 #define GRC_MODE_NO_TX_PHDR_CSUM 0x00100000 +#define GRC_MODE_NVRAM_WR_ENABLE 0x00200000 #define GRC_MODE_NO_RX_PHDR_CSUM 0x00800000 #define GRC_MODE_IRQ_ON_TX_CPU_ATTN 0x01000000 #define GRC_MODE_IRQ_ON_RX_CPU_ATTN 0x02000000 @@ -1366,6 +1367,8 @@ #define NVRAM_CMD_ERASE 0x00000040 #define NVRAM_CMD_FIRST 0x00000080 #define NVRAM_CMD_LAST 0x00000100 +#define NVRAM_CMD_WREN 0x00010000 +#define NVRAM_CMD_WRDI 0x00020000 #define NVRAM_STAT 0x00007004 #define NVRAM_WRDATA 0x00007008 #define NVRAM_ADDR 0x0000700c @@ -1375,8 +1378,18 @@ #define NVRAM_CFG1_FLASHIF_ENAB 0x00000001 #define NVRAM_CFG1_BUFFERED_MODE 0x00000002 #define NVRAM_CFG1_PASS_THRU 0x00000004 +#define NVRAM_CFG1_STATUS_BITS 0x00000070 #define NVRAM_CFG1_BIT_BANG 0x00000008 +#define NVRAM_CFG1_FLASH_SIZE 0x02000000 #define NVRAM_CFG1_COMPAT_BYPASS 0x80000000 +#define NVRAM_CFG1_VENDOR_MASK 0x03000003 +#define FLASH_VENDOR_ATMEL_EEPROM 0x02000000 +#define FLASH_VENDOR_ATMEL_FLASH_BUFFERED 0x02000003 +#define FLASH_VENDOR_ATMEL_FLASH_UNBUFFERED 0x00000003 +#define FLASH_VENDOR_ST 0x03000001 +#define FLASH_VENDOR_SAIFUN 0x01000003 +#define FLASH_VENDOR_SST_SMALL 0x00000001 +#define FLASH_VENDOR_SST_LARGE 0x02000001 #define NVRAM_CFG2 0x00007018 #define NVRAM_CFG3 0x0000701c #define NVRAM_SWARB 0x00007020 @@ -1396,15 +1409,16 @@ #define SWARB_REQ1 0x00002000 #define SWARB_REQ2 0x00004000 #define SWARB_REQ3 0x00008000 -#define NVRAM_BUFFERED_PAGE_SIZE 264 -#define NVRAM_BUFFERED_PAGE_POS 9 #define NVRAM_ACCESS 0x00007024 #define ACCESS_ENABLE 0x00000001 #define ACCESS_WR_ENABLE 0x00000002 -/* 0x7024 --> 0x7400 unused */ +#define NVRAM_WRITE1 0x00007028 +/* 0x702c --> 0x7400 unused */ /* 0x7400 --> 0x8000 unused */ +#define TG3_EEPROM_MAGIC 0x669955aa + /* 32K Window into NIC internal memory */ #define NIC_SRAM_WIN_BASE 0x00008000 @@ -1980,11 +1994,12 @@ * lock: Held during all operations except TX packet * processing. * - * dev->xmit_lock: Held during tg3_start_xmit and tg3_tx + * tx_lock: Held during tg3_start_xmit{,_4gbug} and tg3_tx * * If you want to shut up all asynchronous processing you must - * acquire both locks, 'lock' taken before 'xmit_lock'. IRQs must - * be disabled to take either lock. + * acquire both locks, 'lock' taken before 'tx_lock'. IRQs must + * be disabled to take 'lock' but only softirq disabling is + * necessary for acquisition of 'tx_lock'. */ spinlock_t lock; spinlock_t indirect_lock; @@ -2003,6 +2018,8 @@ u32 tx_cons; u32 tx_pending; + spinlock_t tx_lock; + struct tg3_tx_buffer_desc *tx_ring; struct tx_ring_info *tx_buffers; dma_addr_t tx_desc_mapping; @@ -2087,6 +2104,8 @@ #define TG3_FLG2_PHY_JUST_INITTED 0x00001000 #define TG3_FLG2_PHY_SERDES 0x00002000 #define TG3_FLG2_CAPACITIVE_COUPLING 0x00004000 +#define TG3_FLG2_FLASH 0x00008000 +#define TG3_FLG2_HW_TSO 0x00010000 u32 split_mode_max_reqs; #define SPLIT_MODE_5704_MAX_REQ 3 @@ -2160,6 +2179,34 @@ struct tg3_hw_stats *hw_stats; dma_addr_t stats_mapping; struct work_struct reset_task; + + u32 nvram_size; + u32 nvram_pagesize; + u32 nvram_jedecnum; + +#define JEDEC_ATMEL 0x1f +#define JEDEC_ST 0x20 +#define JEDEC_SAIFUN 0x4f +#define JEDEC_SST 0xbf + +#define ATMEL_AT24C64_CHIP_SIZE (64 * 1024) +#define ATMEL_AT24C64_PAGE_SIZE (32) + +#define ATMEL_AT24C512_CHIP_SIZE (512 * 1024) +#define ATMEL_AT24C512_PAGE_SIZE (128) + +#define ATMEL_AT45DB0X1B_PAGE_POS 9 +#define ATMEL_AT45DB0X1B_PAGE_SIZE 264 + +#define ATMEL_AT25F512_PAGE_SIZE 256 + +#define ST_M45PEX0_PAGE_SIZE 256 + +#define SAIFUN_SA25F0XX_PAGE_SIZE 256 + +#define SST_25VF0X0_PAGE_SIZE 4098 + + }; #endif /* !(_T3_H) */ diff -Nru a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c --- a/drivers/net/tulip/de2104x.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/net/tulip/de2104x.c 2005-01-28 14:11:41 -08:00 @@ -1703,6 +1703,7 @@ value = dr32(ROMCmd); while (value < 0 && --boguscnt > 0); de->dev->dev_addr[i] = value; + udelay(1); if (boguscnt <= 0) printk(KERN_WARNING PFX "timeout reading 21040 MAC address byte %u\n", i); } diff -Nru a/drivers/net/tun.c b/drivers/net/tun.c --- a/drivers/net/tun.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/tun.c 2005-01-28 14:11:40 -08:00 @@ -113,6 +113,7 @@ /* Queue packet */ skb_queue_tail(&tun->readq, skb); + dev->trans_start = jiffies; /* Notify and wake up reader process */ if (tun->flags & TUN_FASYNC) @@ -259,6 +260,7 @@ skb->ip_summed = CHECKSUM_UNNECESSARY; netif_rx_ni(skb); + tun->dev->last_rx = jiffies; tun->stats.rx_packets++; tun->stats.rx_bytes += len; diff -Nru a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c --- a/drivers/net/wireless/netwave_cs.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/net/wireless/netwave_cs.c 2005-01-28 14:11:41 -08:00 @@ -206,7 +206,7 @@ static void netwave_detach(dev_link_t *); /* Destroy instance */ /* Hardware configuration */ -static void netwave_doreset(ioaddr_t iobase, u_char __iomem *ramBase); +static void netwave_doreset(kio_addr_t iobase, u_char __iomem *ramBase); static void netwave_reset(struct net_device *dev); /* Misc device stuff */ @@ -356,7 +356,7 @@ #ifdef WIRELESS_EXT static void netwave_snapshot(netwave_private *priv, u_char __iomem *ramBase, - ioaddr_t iobase) { + kio_addr_t iobase) { u_short resultBuffer; /* if time since last snapshot is > 1 sec. (100 jiffies?) then take @@ -389,7 +389,7 @@ static struct iw_statistics *netwave_get_wireless_stats(struct net_device *dev) { unsigned long flags; - ioaddr_t iobase = dev->base_addr; + kio_addr_t iobase = dev->base_addr; netwave_private *priv = netdev_priv(dev); u_char __iomem *ramBase = priv->ramBase; struct iw_statistics* wstats; @@ -575,7 +575,7 @@ char *extra) { unsigned long flags; - ioaddr_t iobase = dev->base_addr; + kio_addr_t iobase = dev->base_addr; netwave_private *priv = netdev_priv(dev); u_char __iomem *ramBase = priv->ramBase; @@ -633,7 +633,7 @@ char *key) { unsigned long flags; - ioaddr_t iobase = dev->base_addr; + kio_addr_t iobase = dev->base_addr; netwave_private *priv = netdev_priv(dev); u_char __iomem *ramBase = priv->ramBase; @@ -749,7 +749,7 @@ char *extra) { unsigned long flags; - ioaddr_t iobase = dev->base_addr; + kio_addr_t iobase = dev->base_addr; netwave_private *priv = netdev_priv(dev); u_char __iomem *ramBase = priv->ramBase; @@ -1192,7 +1192,7 @@ * * Proper hardware reset of the card. */ -static void netwave_doreset(ioaddr_t ioBase, u_char __iomem *ramBase) +static void netwave_doreset(kio_addr_t ioBase, u_char __iomem *ramBase) { /* Reset card */ wait_WOC(ioBase); @@ -1210,7 +1210,7 @@ /* u_char state; */ netwave_private *priv = netdev_priv(dev); u_char __iomem *ramBase = priv->ramBase; - ioaddr_t iobase = dev->base_addr; + kio_addr_t iobase = dev->base_addr; DEBUG(0, "netwave_reset: Done with hardware reset\n"); @@ -1291,7 +1291,7 @@ netwave_private *priv = netdev_priv(dev); u_char __iomem * ramBase = priv->ramBase; - ioaddr_t iobase = dev->base_addr; + kio_addr_t iobase = dev->base_addr; /* Disable interrupts & save flags */ spin_lock_irqsave(&priv->spinlock, flags); @@ -1383,7 +1383,7 @@ */ static irqreturn_t netwave_interrupt(int irq, void* dev_id, struct pt_regs *regs) { - ioaddr_t iobase; + kio_addr_t iobase; u_char __iomem *ramBase; struct net_device *dev = (struct net_device *)dev_id; struct netwave_private *priv = netdev_priv(dev); @@ -1553,7 +1553,7 @@ { netwave_private *priv = netdev_priv(dev); u_char __iomem *ramBase = priv->ramBase; - ioaddr_t iobase = dev->base_addr; + kio_addr_t iobase = dev->base_addr; u_char rxStatus; struct sk_buff *skb = NULL; unsigned int curBuffer, @@ -1699,7 +1699,7 @@ */ static void set_multicast_list(struct net_device *dev) { - ioaddr_t iobase = dev->base_addr; + kio_addr_t iobase = dev->base_addr; netwave_private *priv = netdev_priv(dev); u_char __iomem * ramBase = priv->ramBase; u_char rcvMode = 0; diff -Nru a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c --- a/drivers/net/wireless/wavelan_cs.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/net/wireless/wavelan_cs.c 2005-01-28 14:11:41 -08:00 @@ -164,7 +164,7 @@ net_local *lp = netdev_priv(dev); u_char __iomem *ptr = lp->mem + PSA_ADDR + (o << 1); int count = 0; - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; /* As there seem to have no flag PSA_BUSY as in the ISA model, we are * oblige to verify this address to know when the PSA is ready... */ volatile u_char __iomem *verify = lp->mem + PSA_ADDR + @@ -725,7 +725,7 @@ /* Perform a handover to a new WavePoint */ void wv_roam_handover(wavepoint_history *wavepoint, net_local *lp) { - ioaddr_t base = lp->dev->base_addr; + kio_addr_t base = lp->dev->base_addr; mm_t m; unsigned long flags; @@ -838,7 +838,7 @@ int cmd, int result) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; int status; int wait_completed; long spin; @@ -970,7 +970,7 @@ char * buf, int len) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; int ring_ptr = addr; int chunk_len; char * buf_ptr = buf; @@ -1136,7 +1136,7 @@ static void wv_mmc_show(struct net_device * dev) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local * lp = netdev_priv(dev); mmr_t m; @@ -1316,7 +1316,7 @@ static inline void wv_init_info(struct net_device * dev) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; psa_t psa; int i; @@ -1335,7 +1335,7 @@ #ifdef DEBUG_BASIC_SHOW /* Now, let's go for the basic stuff */ - printk(KERN_NOTICE "%s: WaveLAN: port %#x, irq %d, hw_addr", + printk(KERN_NOTICE "%s: WaveLAN: port %#lx, irq %d, hw_addr", dev->name, base, dev->irq); for(i = 0; i < WAVELAN_ADDR_SIZE; i++) printk("%s%02X", (i == 0) ? " " : ":", dev->dev_addr[i]); @@ -1870,7 +1870,7 @@ union iwreq_data *wrqu, char *extra) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local *lp = netdev_priv(dev); psa_t psa; mm_t m; @@ -1960,7 +1960,7 @@ union iwreq_data *wrqu, char *extra) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local *lp = netdev_priv(dev); unsigned long flags; int ret; @@ -1990,7 +1990,7 @@ union iwreq_data *wrqu, char *extra) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local *lp = netdev_priv(dev); psa_t psa; unsigned long flags; @@ -2036,7 +2036,7 @@ union iwreq_data *wrqu, char *extra) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local *lp = netdev_priv(dev); psa_t psa; unsigned long flags; @@ -2102,7 +2102,7 @@ union iwreq_data *wrqu, char *extra) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local *lp = netdev_priv(dev); unsigned long flags; psa_t psa; @@ -2172,7 +2172,7 @@ union iwreq_data *wrqu, char *extra) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local *lp = netdev_priv(dev); psa_t psa; unsigned long flags; @@ -2391,7 +2391,7 @@ union iwreq_data *wrqu, char *extra) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local *lp = netdev_priv(dev); struct iw_range *range = (struct iw_range *) extra; unsigned long flags; @@ -2467,7 +2467,7 @@ union iwreq_data *wrqu, char *extra) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local *lp = netdev_priv(dev); psa_t psa; unsigned long flags; @@ -2743,7 +2743,7 @@ static iw_stats * wavelan_get_wireless_stats(struct net_device * dev) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local * lp = netdev_priv(dev); mmr_t m; iw_stats * wstats; @@ -2807,7 +2807,7 @@ int rfp, /* end of frame */ int wrap) /* start of buffer */ { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; int rp; int len; @@ -2970,7 +2970,7 @@ static inline void wv_packet_rcv(struct net_device * dev) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local * lp = netdev_priv(dev); int newrfp; int rp; @@ -3107,7 +3107,7 @@ short length) { net_local * lp = netdev_priv(dev); - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; unsigned long flags; int clen = length; register u_short xmtdata_base = TX_BASE; @@ -3231,7 +3231,7 @@ static inline int wv_mmc_init(struct net_device * dev) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; psa_t psa; mmw_t m; int configured; @@ -3425,7 +3425,7 @@ static int wv_ru_stop(struct net_device * dev) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local * lp = netdev_priv(dev); unsigned long flags; int status; @@ -3488,7 +3488,7 @@ static int wv_ru_start(struct net_device * dev) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local * lp = netdev_priv(dev); unsigned long flags; @@ -3576,7 +3576,7 @@ static int wv_82593_config(struct net_device * dev) { - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; net_local * lp = netdev_priv(dev); struct i82593_conf_block cfblk; int ret = TRUE; @@ -3813,7 +3813,7 @@ wv_hw_config(struct net_device * dev) { net_local * lp = netdev_priv(dev); - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; unsigned long flags; int ret = FALSE; @@ -4144,7 +4144,7 @@ { struct net_device * dev; net_local * lp; - ioaddr_t base; + kio_addr_t base; int status0; u_int tx_status; @@ -4412,7 +4412,7 @@ wavelan_watchdog(struct net_device * dev) { net_local * lp = netdev_priv(dev); - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; unsigned long flags; int aborted = FALSE; @@ -4488,7 +4488,7 @@ { net_local * lp = netdev_priv(dev); dev_link_t * link = lp->link; - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; #ifdef DEBUG_CALLBACK_TRACE printk(KERN_DEBUG "%s: ->wavelan_open(dev=0x%x)\n", dev->name, @@ -4542,7 +4542,7 @@ wavelan_close(struct net_device * dev) { dev_link_t * link = ((net_local *)netdev_priv(dev))->link; - ioaddr_t base = dev->base_addr; + kio_addr_t base = dev->base_addr; #ifdef DEBUG_CALLBACK_TRACE printk(KERN_DEBUG "%s: ->wavelan_close(dev=0x%x)\n", dev->name, diff -Nru a/drivers/oprofile/oprof.c b/drivers/oprofile/oprof.c --- a/drivers/oprofile/oprof.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/oprofile/oprof.c 2005-01-28 14:11:40 -08:00 @@ -153,11 +153,11 @@ static int __init oprofile_init(void) { - int err = 0; + int err; - oprofile_arch_init(&oprofile_ops); + err = oprofile_arch_init(&oprofile_ops); - if (timer) { + if (err < 0 || timer) { printk(KERN_INFO "oprofile: using timer interrupt.\n"); oprofile_timer_init(&oprofile_ops); } diff -Nru a/drivers/parisc/led.c b/drivers/parisc/led.c --- a/drivers/parisc/led.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/parisc/led.c 2005-01-28 14:11:40 -08:00 @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -56,7 +56,7 @@ static int led_diskio = 1; static int led_lanrxtx = 1; static char lcd_text[32]; -static char lcd_text_default[] = "Linux " UTS_RELEASE; +static char lcd_text_default[32]; #if 0 #define DPRINTK(x) printk x @@ -675,6 +675,9 @@ { struct pdc_chassis_info chassis_info; int ret; + + snprintf(lcd_text_default, sizeof(lcd_text_default), + "Linux %s", system_utsname.release); /* Work around the buggy PDC of KittyHawk-machines */ switch (CPU_HVERSION) { diff -Nru a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c --- a/drivers/pcmcia/au1000_generic.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/pcmcia/au1000_generic.c 2005-01-28 14:11:41 -08:00 @@ -196,13 +196,13 @@ if (i == 0) { pcmcia_socket[i].virt_io = - (u32)ioremap((ioaddr_t)0xF00000000, 0x1000); + (u32)ioremap((kio_addr_t)0xF00000000, 0x1000); pcmcia_socket[i].phys_attr = (memaddr_t)0xF40000000; pcmcia_socket[i].phys_mem = (memaddr_t)0xF80000000; } else { pcmcia_socket[i].virt_io = - (u32)ioremap((ioaddr_t)0xF08000000, 0x1000); + (u32)ioremap((kio_addr_t)0xF08000000, 0x1000); pcmcia_socket[i].phys_attr = (memaddr_t)0xF48000000; pcmcia_socket[i].phys_mem = (memaddr_t)0xF88000000; } diff -Nru a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c --- a/drivers/pcmcia/cs.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/pcmcia/cs.c 2005-01-28 14:11:40 -08:00 @@ -341,25 +341,13 @@ /*====================================================================== - Shutdown_Socket() and setup_socket() are scheduled using add_timer - calls by the main event handler when card insertion and removal - events are received. Shutdown_Socket() unconfigures a socket and - turns off socket power. Setup_socket() turns on socket power - and resets the socket, in two stages. + socket_setup() and shutdown_socket() are called by the main event + handler when card insertion and removal events are received. + socket_setup() turns on socket power and resets the socket, in two stages. + shutdown_socket() unconfigures a socket and turns off socket power. ======================================================================*/ -static void free_regions(memory_handle_t *list) -{ - memory_handle_t tmp; - while (*list != NULL) { - tmp = *list; - *list = tmp->info.next; - tmp->region_magic = 0; - kfree(tmp); - } -} - static void shutdown_socket(struct pcmcia_socket *s) { cs_dbg(s, 1, "shutdown_socket\n"); @@ -379,8 +367,6 @@ kfree(s->config); s->config = NULL; } - free_regions(&s->a_region); - free_regions(&s->c_region); { int status; @@ -755,19 +741,19 @@ ioaddr_t num, u_int lines) { int i; - ioaddr_t try, align; + kio_addr_t try, align; align = (*base) ? (lines ? 1<flags, io->speed, io->start, io->stop); if (map >= MAX_IO_WIN) return -EINVAL; diff -Nru a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c --- a/drivers/pcmcia/i82092.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/pcmcia/i82092.c 2005-01-28 14:11:41 -08:00 @@ -81,7 +81,7 @@ 1 = empty socket, 2 = card but not initialized, 3 = operational card */ - int io_base; /* base io address of the socket */ + kio_addr_t io_base; /* base io address of the socket */ struct pcmcia_socket socket; struct pci_dev *dev; /* The PCI device for the socket */ @@ -122,7 +122,7 @@ } printk(KERN_INFO "i82092aa: configured as a %d socket device.\n", socket_count); - if (request_region(pci_resource_start(dev, 0), 2, "i82092aa")) { + if (!request_region(pci_resource_start(dev, 0), 2, "i82092aa")) { ret = -EBUSY; goto err_out_disable; } diff -Nru a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c --- a/drivers/pcmcia/i82365.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/pcmcia/i82365.c 2005-01-28 14:11:41 -08:00 @@ -96,7 +96,7 @@ /* Parameters that can be set with 'insmod' */ /* Default base address for i82365sl and other ISA chips */ -static int i365_base = 0x3e0; +static unsigned long i365_base = 0x3e0; /* Should we probe at 0x3e2 for an extra ISA controller? */ static int extra_sockets = 0; /* Specify a socket number to ignore */ @@ -130,7 +130,7 @@ static int cable_mode = -1; static int wakeup = 0; -module_param(i365_base, int, 0444); +module_param(i365_base, ulong, 0444); module_param(ignore, int, 0444); module_param(extra_sockets, int, 0444); module_param(irq_mask, int, 0444); @@ -167,7 +167,7 @@ u_short type, flags; struct pcmcia_socket socket; unsigned int number; - ioaddr_t ioaddr; + kio_addr_t ioaddr; u_short psock; u_char cs_irq, intr; union { @@ -240,7 +240,7 @@ unsigned long flags; spin_lock_irqsave(&bus_lock,flags); { - ioaddr_t port = socket[sock].ioaddr; + kio_addr_t port = socket[sock].ioaddr; u_char val; reg = I365_REG(socket[sock].psock, reg); outb(reg, port); val = inb(port+1); @@ -254,7 +254,7 @@ unsigned long flags; spin_lock_irqsave(&bus_lock,flags); { - ioaddr_t port = socket[sock].ioaddr; + kio_addr_t port = socket[sock].ioaddr; u_char val = I365_REG(socket[sock].psock, reg); outb(val, port); outb(data, port+1); spin_unlock_irqrestore(&bus_lock,flags); @@ -589,7 +589,7 @@ /*====================================================================*/ -static int __init identify(u_short port, u_short sock) +static int __init identify(kio_addr_t port, u_short sock) { u_char val; int type = -1; @@ -660,7 +660,7 @@ static int __init is_alive(u_short sock) { u_char stat; - u_short start, stop; + kio_addr_t start, stop; stat = i365_get(sock, I365_STATUS); start = i365_get_pair(sock, I365_IO(0)+I365_W_START); @@ -677,7 +677,7 @@ /*====================================================================*/ -static void __init add_socket(u_short port, int psock, int type) +static void __init add_socket(kio_addr_t port, int psock, int type) { socket[sockets].ioaddr = port; socket[sockets].psock = psock; @@ -699,7 +699,7 @@ if (base == 0) printk("\n"); printk(KERN_INFO " %s", pcic[type].name); - printk(" ISA-to-PCMCIA at port %#x ofs 0x%02x", + printk(" ISA-to-PCMCIA at port %#lx ofs 0x%02x", t->ioaddr, t->psock*0x40); printk(", %d socket%s\n", ns, ((ns > 1) ? "s" : "")); @@ -773,7 +773,7 @@ static void __init isa_probe(void) { int i, j, sock, k, ns, id; - ioaddr_t port; + kio_addr_t port; #ifdef CONFIG_PNP struct isapnp_device_id *devid; struct pnp_dev *dev; @@ -804,7 +804,7 @@ if (check_region(i365_base, 2) != 0) { if (sockets == 0) - printk("port conflict at %#x\n", i365_base); + printk("port conflict at %#lx\n", i365_base); return; } @@ -1127,7 +1127,7 @@ u_char map, ioctl; debug(1, "SetIOMap(%d, %d, %#2.2x, %d ns, " - "%#4.4x-%#4.4x)\n", sock, io->map, io->flags, + "%#lx-%#lx)\n", sock, io->map, io->flags, io->speed, io->start, io->stop); map = io->map; if ((map > 1) || (io->start > 0xffff) || (io->stop > 0xffff) || @@ -1156,8 +1156,8 @@ u_short base, i; u_char map; - debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, %#5.5lx-%#5.5" - "lx, %#5.5x)\n", sock, mem->map, mem->flags, mem->speed, + debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, %#lx-%#lx, " + "%#x)\n", sock, mem->map, mem->flags, mem->speed, mem->res->start, mem->res->end, mem->card_start); map = mem->map; @@ -1447,7 +1447,7 @@ i365_set(i, I365_CSCINT, 0); release_region(socket[i].ioaddr, 2); } -#ifdef __ISAPNP__ +#ifdef CONFIG_PNP if (i82365_pnpdev) pnp_disable_dev(i82365_pnpdev); #endif diff -Nru a/drivers/pcmcia/m32r_cfc.c b/drivers/pcmcia/m32r_cfc.c --- a/drivers/pcmcia/m32r_cfc.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/pcmcia/m32r_cfc.c 2005-01-28 14:11:40 -08:00 @@ -61,7 +61,7 @@ u_short type, flags; struct pcmcia_socket socket; unsigned int number; - ioaddr_t ioaddr; + kio_addr_t ioaddr; u_long mapaddr; u_long base; /* PCC register base */ u_char cs_irq1, cs_irq2, intr; @@ -300,7 +300,7 @@ return 0; } -static void add_pcc_socket(ulong base, int irq, ulong mapaddr, ioaddr_t ioaddr) +static void add_pcc_socket(ulong base, int irq, ulong mapaddr, kio_addr_t ioaddr) { pcc_socket_t *t = &socket[pcc_sockets]; @@ -568,7 +568,7 @@ u_char map; debug(3, "m32r_cfc: SetIOMap(%d, %d, %#2.2x, %d ns, " - "%#4.4x-%#4.4x)\n", sock, io->map, io->flags, + "%#lx-%#lx)\n", sock, io->map, io->flags, io->speed, io->start, io->stop); map = io->map; @@ -585,7 +585,7 @@ pcc_socket_t *t = &socket[sock]; debug(3, "m32r_cfc: SetMemMap(%d, %d, %#2.2x, %d ns, " - "%#5.5lx, %#5.5x)\n", sock, map, mem->flags, + "%#lx, %#x)\n", sock, map, mem->flags, mem->speed, mem->static_start, mem->card_start); /* @@ -807,7 +807,7 @@ #else /* CONFIG_PLAT_USRV */ { ulong base, mapaddr; - ioaddr_t ioaddr; + kio_addr_t ioaddr; for (i = 0 ; i < M32R_MAX_PCC ; i++) { base = (ulong)PLD_CFRSTCR; diff -Nru a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c --- a/drivers/pcmcia/m32r_pcc.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/pcmcia/m32r_pcc.c 2005-01-28 14:11:40 -08:00 @@ -68,7 +68,7 @@ u_short type, flags; struct pcmcia_socket socket; unsigned int number; - ioaddr_t ioaddr; + kio_addr_t ioaddr; u_long mapaddr; u_long base; /* PCC register base */ u_char cs_irq, intr; @@ -312,7 +312,7 @@ return 0; } -static void add_pcc_socket(ulong base, int irq, ulong mapaddr, ioaddr_t ioaddr) +static void add_pcc_socket(ulong base, int irq, ulong mapaddr, kio_addr_t ioaddr) { pcc_socket_t *t = &socket[pcc_sockets]; @@ -503,7 +503,7 @@ u_char map; debug(3, "m32r-pcc: SetIOMap(%d, %d, %#2.2x, %d ns, " - "%#4.4x-%#4.4x)\n", sock, io->map, io->flags, + "%#lx-%#lx)\n", sock, io->map, io->flags, io->speed, io->start, io->stop); map = io->map; @@ -526,7 +526,7 @@ #endif debug(3, "m32r-pcc: SetMemMap(%d, %d, %#2.2x, %d ns, " - "%#5.5lx, %#5.5x)\n", sock, map, mem->flags, + "%#lx, %#x)\n", sock, map, mem->flags, mem->speed, mem->static_start, mem->card_start); /* diff -Nru a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c --- a/drivers/pcmcia/rsrc_nonstatic.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/pcmcia/rsrc_nonstatic.c 2005-01-28 14:11:40 -08:00 @@ -186,14 +186,15 @@ ======================================================================*/ #ifdef CONFIG_PCMCIA_PROBE -static void do_io_probe(struct pcmcia_socket *s, ioaddr_t base, ioaddr_t num) +static void do_io_probe(struct pcmcia_socket *s, kio_addr_t base, kio_addr_t num) { struct resource *res; struct socket_data *s_data = s->resource_data; - ioaddr_t i, j, bad, any; + kio_addr_t i, j, bad; + int any; u_char *b, hole, most; - printk(KERN_INFO "cs: IO port probe 0x%04x-0x%04x:", + printk(KERN_INFO "cs: IO port probe %#lx-%#lx:", base, base+num-1); /* First, what does a floating port look like? */ @@ -233,7 +234,7 @@ } else { if (bad) { sub_interval(&s_data->io_db, bad, i-bad); - printk(" %#04x-%#04x", bad, i-1); + printk(" %#lx-%#lx", bad, i-1); bad = 0; } } @@ -244,7 +245,7 @@ return; } else { sub_interval(&s_data->io_db, bad, i-bad); - printk(" %#04x-%#04x", bad, i-1); + printk(" %#lx-%#lx", bad, i-1); } } @@ -725,7 +726,8 @@ static int adjust_io(struct pcmcia_socket *s, adjust_t *adj) { struct socket_data *data = s->resource_data; - int base, num, ret = CS_SUCCESS; + kio_addr_t base, num; + int ret = CS_SUCCESS; base = adj->resource.io.BasePort; num = adj->resource.io.NumPorts; diff -Nru a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c --- a/drivers/pcmcia/tcic.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/pcmcia/tcic.c 2005-01-28 14:11:40 -08:00 @@ -80,7 +80,7 @@ /* Parameters that can be set with 'insmod' */ /* The base port address of the TCIC-2 chip */ -static int tcic_base = TCIC_BASE; +static unsigned long tcic_base = TCIC_BASE; /* Specify a socket number to ignore */ static int ignore = -1; @@ -105,7 +105,7 @@ /* CCLK external clock time, in nanoseconds. 70 ns = 14.31818 MHz */ static int cycle_time = 70; -module_param(tcic_base, int, 0444); +module_param(tcic_base, ulong, 0444); module_param(ignore, int, 0444); module_param(do_scan, int, 0444); module_param(irq_mask, int, 0444); @@ -144,26 +144,26 @@ static u_char tcic_getb(u_char reg) { u_char val = inb(tcic_base+reg); - printk(KERN_DEBUG "tcic_getb(%#x) = %#x\n", tcic_base+reg, val); + printk(KERN_DEBUG "tcic_getb(%#lx) = %#x\n", tcic_base+reg, val); return val; } static u_short tcic_getw(u_char reg) { u_short val = inw(tcic_base+reg); - printk(KERN_DEBUG "tcic_getw(%#x) = %#x\n", tcic_base+reg, val); + printk(KERN_DEBUG "tcic_getw(%#lx) = %#x\n", tcic_base+reg, val); return val; } static void tcic_setb(u_char reg, u_char data) { - printk(KERN_DEBUG "tcic_setb(%#x, %#x)\n", tcic_base+reg, data); + printk(KERN_DEBUG "tcic_setb(%#lx, %#x)\n", tcic_base+reg, data); outb(data, tcic_base+reg); } static void tcic_setw(u_char reg, u_short data) { - printk(KERN_DEBUG "tcic_setw(%#x, %#x)\n", tcic_base+reg, data); + printk(KERN_DEBUG "tcic_setw(%#lx, %#x)\n", tcic_base+reg, data); outw(data, tcic_base+reg); } #else @@ -344,10 +344,14 @@ if ((sstat & TCIC_SSTAT_CD) && (pwr & TCIC_PWR_VCC(s)) && (scf1 & TCIC_SCF1_IOSTS) && (ioctl & TCIC_ICTL_ENA) && - (check_region(base, num) != 0) && ((base & 0xfeef) != 0x02e8)) - return 1; - else - return 0; + ((base & 0xfeef) != 0x02e8)) { + struct resource *res = request_region(base, num, "tcic-2"); + if (!res) /* region is busy */ + return 1; + release_region(base, num); + } + + return 0; } /*====================================================================== @@ -792,7 +796,7 @@ u_short base, len, ioctl; debug(1, "SetIOMap(%d, %d, %#2.2x, %d ns, " - "%#4.4x-%#4.4x)\n", psock, io->map, io->flags, + "%#lx-%#lx)\n", psock, io->map, io->flags, io->speed, io->start, io->stop); if ((io->map > 1) || (io->start > 0xffff) || (io->stop > 0xffff) || (io->stop < io->start)) return -EINVAL; @@ -829,7 +833,7 @@ u_long base, len, mmap; debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, " - "%#5.5lx-%#5.5lx, %#5.5x)\n", psock, mem->map, mem->flags, + "%#lx-%#lx, %#x)\n", psock, mem->map, mem->flags, mem->speed, mem->res->start, mem->res->end, mem->card_start); if ((mem->map > 3) || (mem->card_start > 0x3ffffff) || (mem->res->start > 0xffffff) || (mem->res->end > 0xffffff) || diff -Nru a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig --- a/drivers/scsi/Kconfig 2005-01-28 14:11:41 -08:00 +++ b/drivers/scsi/Kconfig 2005-01-28 14:11:41 -08:00 @@ -225,14 +225,14 @@ config SCSI_DECNCR tristate "DEC NCR53C94 Scsi Driver" - depends on DECSTATION && TC && SCSI + depends on MACH_DECSTATION && SCSI && TC help Say Y here to support the NCR53C94 SCSI controller chips on IOASIC based TURBOchannel DECstations and TURBOchannel PMAZ-A cards. config SCSI_DECSII tristate "DEC SII Scsi Driver" - depends on DECSTATION && SCSI + depends on MACH_DECSTATION && SCSI && MIPS32 config BLK_DEV_3W_XXXX_RAID tristate "3ware 5/6/7/8xxx ATA-RAID support" diff -Nru a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c --- a/drivers/scsi/NCR53C9x.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/NCR53C9x.c 2005-01-28 14:11:40 -08:00 @@ -290,7 +290,7 @@ #endif #ifdef DEBUG_ESP_CMDS -inline void esp_cmd(struct NCR_ESP *esp, struct ESP_regs *eregs, +static inline void esp_cmd(struct NCR_ESP *esp, struct ESP_regs *eregs, unchar cmd) { esp->espcmdlog[esp->espcmdent] = cmd; @@ -505,7 +505,7 @@ } /* This places the ESP into a known state at boot time. */ -static void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs) +void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs) { volatile unchar trash; diff -Nru a/drivers/scsi/NCR53C9x.h b/drivers/scsi/NCR53C9x.h --- a/drivers/scsi/NCR53C9x.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/NCR53C9x.h 2005-01-28 14:11:40 -08:00 @@ -652,7 +652,7 @@ /* External functions */ -extern void esp_cmd(struct NCR_ESP *esp, struct ESP_regs *eregs, unchar cmd); +extern void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs); extern struct NCR_ESP *esp_allocate(Scsi_Host_Template *, void *); extern void esp_deallocate(struct NCR_ESP *); extern void esp_release(void); diff -Nru a/drivers/scsi/NCR_Q720.c b/drivers/scsi/NCR_Q720.c --- a/drivers/scsi/NCR_Q720.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/NCR_Q720.c 2005-01-28 14:11:40 -08:00 @@ -48,7 +48,7 @@ struct Scsi_Host *hosts[4]; }; -struct scsi_host_template NCR_Q720_tpnt = { +static struct scsi_host_template NCR_Q720_tpnt = { .module = THIS_MODULE, .proc_name = "NCR_Q720", }; @@ -345,7 +345,7 @@ static short NCR_Q720_id_table[] = { NCR_Q720_MCA_ID, 0 }; -struct mca_driver NCR_Q720_driver = { +static struct mca_driver NCR_Q720_driver = { .id_table = NCR_Q720_id_table, .driver = { .name = "NCR_Q720", diff -Nru a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c --- a/drivers/scsi/aacraid/aachba.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/aacraid/aachba.c 2005-01-28 14:11:40 -08:00 @@ -1029,6 +1029,114 @@ return 0; } +static void synchronize_callback(void *context, struct fib *fibptr) +{ + struct aac_synchronize_reply *synchronizereply; + struct scsi_cmnd *cmd; + + cmd = context; + + dprintk((KERN_DEBUG "synchronize_callback[cpu %d]: t = %ld.\n", + smp_processor_id(), jiffies)); + BUG_ON(fibptr == NULL); + + + synchronizereply = fib_data(fibptr); + if (le32_to_cpu(synchronizereply->status) == CT_OK) + cmd->result = DID_OK << 16 | + COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; + else { + struct scsi_device *sdev = cmd->device; + struct aac_dev *dev = (struct aav_dev *)sdev->host->hostdata; + u32 cid = ID_LUN_TO_CONTAINER(sdev->id, sdev->lun); + printk(KERN_WARNING + "synchronize_callback: synchronize failed, status = %d\n", + synchronizereply->status); + cmd->result = DID_OK << 16 | + COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION; + set_sense((u8 *)&dev->fsa_dev[cid].sense_data, + HARDWARE_ERROR, + SENCODE_INTERNAL_TARGET_FAILURE, + ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0, + 0, 0); + memcpy(cmd->sense_buffer, &dev->fsa_dev[cid].sense_data, + min(sizeof(dev->fsa_dev[cid].sense_data), + sizeof(cmd->sense_buffer))); + } + + fib_complete(fibptr); + fib_free(fibptr); + aac_io_done(cmd); +} + +static int aac_synchronize(struct scsi_cmnd *scsicmd, int cid) +{ + int status; + struct fib *cmd_fibcontext; + struct aac_synchronize *synchronizecmd; + struct scsi_cmnd *cmd; + struct scsi_device *sdev = scsicmd->device; + int active = 0; + unsigned long flags; + + /* + * Wait for all commands to complete to this specific + * target (block). + */ + spin_lock_irqsave(&sdev->list_lock, flags); + list_for_each_entry(cmd, &sdev->cmd_list, list) + if (cmd != scsicmd && cmd->serial_number != 0) { + ++active; + break; + } + + spin_unlock_irqrestore(&sdev->list_lock, flags); + + /* + * Yield the processor (requeue for later) + */ + if (active) + return SCSI_MLQUEUE_DEVICE_BUSY; + + /* + * Alocate and initialize a Fib + */ + if (!(cmd_fibcontext = + fib_alloc((struct aac_dev *)scsicmd->device->host->hostdata))) + return SCSI_MLQUEUE_HOST_BUSY; + + fib_init(cmd_fibcontext); + + synchronizecmd = fib_data(cmd_fibcontext); + synchronizecmd->command = cpu_to_le32(VM_ContainerConfig); + synchronizecmd->type = cpu_to_le32(CT_FLUSH_CACHE); + synchronizecmd->cid = cpu_to_le32(cid); + synchronizecmd->count = + cpu_to_le32(sizeof(((struct aac_synchronize_reply *)NULL)->data)); + + /* + * Now send the Fib to the adapter + */ + status = fib_send(ContainerCommand, + cmd_fibcontext, + sizeof(struct aac_synchronize), + FsaNormal, + 0, 1, + (fib_callback)synchronize_callback, + (void *)scsicmd); + + /* + * Check that the command queued to the controller + */ + if (status == -EINPROGRESS) + return 0; + + printk(KERN_WARNING + "aac_synchronize: fib_send failed with status: %d.\n", status); + fib_complete(cmd_fibcontext); + fib_free(cmd_fibcontext); + return SCSI_MLQUEUE_HOST_BUSY; +} /** * aac_scsi_cmd() - Process SCSI command @@ -1274,6 +1382,11 @@ ret = aac_write(scsicmd, cid); spin_lock_irq(host->host_lock); return ret; + + case SYNCHRONIZE_CACHE: + /* Issue FIB to tell Firmware to flush it's cache */ + return aac_synchronize(scsicmd, cid); + default: /* * Unhandled commands diff -Nru a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h --- a/drivers/scsi/aacraid/aacraid.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/aacraid/aacraid.h 2005-01-28 14:11:40 -08:00 @@ -1069,6 +1069,30 @@ u32 committed; }; +#define CT_FLUSH_CACHE 129 +struct aac_synchronize { + u32 command; /* VM_ContainerConfig */ + u32 type; /* CT_FLUSH_CACHE */ + u32 cid; + u32 parm1; + u32 parm2; + u32 parm3; + u32 parm4; + u32 count; /* sizeof(((struct aac_synchronize_reply *)NULL)->data) */ +}; + +struct aac_synchronize_reply { + u32 dummy0; + u32 dummy1; + u32 status; /* CT_OK */ + u32 parm1; + u32 parm2; + u32 parm3; + u32 parm4; + u32 parm5; + u8 data[16]; +}; + struct aac_srb { u32 function; diff -Nru a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c --- a/drivers/scsi/ahci.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/ahci.c 2005-01-28 14:11:40 -08:00 @@ -246,6 +246,10 @@ board_ahci }, /* ICH7 */ { PCI_VENDOR_ID_INTEL, 0x27c5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, board_ahci }, /* ICH7M */ + { PCI_VENDOR_ID_INTEL, 0x27c2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, + board_ahci }, /* ICH7R */ + { PCI_VENDOR_ID_INTEL, 0x27c3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, + board_ahci }, /* ICH7R */ { } /* terminate list */ }; diff -Nru a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c --- a/drivers/scsi/aic7xxx_old.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/scsi/aic7xxx_old.c 2005-01-28 14:11:41 -08:00 @@ -224,7 +224,6 @@ #include #include #include -#include #include #include #include @@ -10564,8 +10563,7 @@ aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd) { - printk("aic7xxx driver version %s/%s\n", AIC7XXX_C_VERSION, - UTS_RELEASE); + printk("aic7xxx driver version %s\n", AIC7XXX_C_VERSION); printk("Controller type:\n %s\n", board_names[p->board_name_index]); printk("p->flags=0x%lx, p->chip=0x%x, p->features=0x%x, " "sequencer %s paused\n", diff -Nru a/drivers/scsi/dec_esp.c b/drivers/scsi/dec_esp.c --- a/drivers/scsi/dec_esp.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/scsi/dec_esp.c 2005-01-28 14:11:41 -08:00 @@ -17,6 +17,8 @@ * data. * 20001005 - Initialization fixes for 2.4.0-test9 * Florian Lohoff + * + * Copyright (C) 2002, 2003 Maciej W. Rozycki */ #include @@ -26,59 +28,52 @@ #include #include #include +#include #include -#include "scsi.h" -#include -#include "NCR53C9x.h" - -#include -#include -#include #include - +#include #include +#include -#include #include +#include #include #include #include +#include #define DEC_SCSI_SREG 0 #define DEC_SCSI_DMAREG 0x40000 #define DEC_SCSI_SRAM 0x80000 #define DEC_SCSI_DIAG 0xC0000 -/* - * Once upon a time the pmaz code used to be working but - * it hasn't been maintained for quite some time. - * It isn't working anymore but I'll leave here as a - * starting point. #define this an be prepared for tons - * of warnings and errors :) - */ +#include "scsi.h" +#include +#include "NCR53C9x.h" + static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count); static void dma_drain(struct NCR_ESP *esp); -static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd * sp); +static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp); static void dma_dump_state(struct NCR_ESP *esp); -static void dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length); -static void dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length); +static void dma_init_read(struct NCR_ESP *esp, u32 vaddress, int length); +static void dma_init_write(struct NCR_ESP *esp, u32 vaddress, int length); static void dma_ints_off(struct NCR_ESP *esp); static void dma_ints_on(struct NCR_ESP *esp); static int dma_irq_p(struct NCR_ESP *esp); static int dma_ports_p(struct NCR_ESP *esp); -static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write); -static void dma_mmu_get_scsi_one(struct NCR_ESP *esp, Scsi_Cmnd * sp); -static void dma_mmu_get_scsi_sgl(struct NCR_ESP *esp, Scsi_Cmnd * sp); -static void dma_advance_sg(Scsi_Cmnd * sp); +static void dma_setup(struct NCR_ESP *esp, u32 addr, int count, int write); +static void dma_mmu_get_scsi_one(struct NCR_ESP *esp, struct scsi_cmnd * sp); +static void dma_mmu_get_scsi_sgl(struct NCR_ESP *esp, struct scsi_cmnd * sp); +static void dma_advance_sg(struct scsi_cmnd * sp); static void pmaz_dma_drain(struct NCR_ESP *esp); -static void pmaz_dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length); -static void pmaz_dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length); +static void pmaz_dma_init_read(struct NCR_ESP *esp, u32 vaddress, int length); +static void pmaz_dma_init_write(struct NCR_ESP *esp, u32 vaddress, int length); static void pmaz_dma_ints_off(struct NCR_ESP *esp); static void pmaz_dma_ints_on(struct NCR_ESP *esp); -static void pmaz_dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write); -static void pmaz_dma_mmu_get_scsi_one(struct NCR_ESP *esp, Scsi_Cmnd * sp); +static void pmaz_dma_setup(struct NCR_ESP *esp, u32 addr, int count, int write); +static void pmaz_dma_mmu_get_scsi_one(struct NCR_ESP *esp, struct scsi_cmnd * sp); #define TC_ESP_RAM_SIZE 0x20000 #define ESP_TGT_DMA_SIZE ((TC_ESP_RAM_SIZE/7) & ~(sizeof(int)-1)) @@ -88,7 +83,7 @@ #define TC_ESP_DMAR_WRITE 0x80000000 #define TC_ESP_DMA_ADDR(x) ((unsigned)(x) & TC_ESP_DMAR_MASK) -__u32 esp_virt_buffer; +u32 esp_virt_buffer; int scsi_current_length; volatile unsigned char cmd_buffer[16]; @@ -98,16 +93,11 @@ * via PIO. */ -volatile unsigned long *scsi_dma_ptr; -volatile unsigned long *scsi_next_ptr; -volatile unsigned long *scsi_scr; -volatile unsigned long *ioasic_ssr; -volatile unsigned long *scsi_sdr0; -volatile unsigned long *scsi_sdr1; +static irqreturn_t scsi_dma_merr_int(int, void *, struct pt_regs *); +static irqreturn_t scsi_dma_err_int(int, void *, struct pt_regs *); +static irqreturn_t scsi_dma_int(int, void *, struct pt_regs *); -static void scsi_dma_int(int, void *, struct pt_regs *); - -int dec_esp_detect(Scsi_Host_Template * tpnt); +static int dec_esp_detect(struct scsi_host_template * tpnt); static int dec_esp_release(struct Scsi_Host *shost) { @@ -119,9 +109,9 @@ return 0; } -static Scsi_Host_Template driver_template = { +static struct scsi_host_template driver_template = { .proc_name = "dec_esp", - .proc_info = &esp_proc_info, + .proc_info = esp_proc_info, .name = "NCR53C94", .detect = dec_esp_detect, .slave_alloc = esp_slave_alloc, @@ -142,7 +132,7 @@ #include "scsi_module.c" /***************************************************************** Detection */ -int dec_esp_detect(Scsi_Host_Template * tpnt) +static int dec_esp_detect(Scsi_Host_Template * tpnt) { struct NCR_ESP *esp; struct ConfigDev *esp_dev; @@ -152,17 +142,10 @@ if (IOASIC) { esp_dev = 0; esp = esp_allocate(tpnt, (void *) esp_dev); - - scsi_dma_ptr = (unsigned long *) (system_base + IOCTL + SCSI_DMA_P); - scsi_next_ptr = (unsigned long *) (system_base + IOCTL + SCSI_DMA_BP); - scsi_scr = (unsigned long *) (system_base + IOCTL + SCSI_SCR); - ioasic_ssr = (unsigned long *) (system_base + IOCTL + SSR); - scsi_sdr0 = (unsigned long *) (system_base + IOCTL + SCSI_SDR0); - scsi_sdr1 = (unsigned long *) (system_base + IOCTL + SCSI_SDR1); /* Do command transfer with programmed I/O */ esp->do_pio_cmds = 1; - + /* Required functions */ esp->dma_bytes_sent = &dma_bytes_sent; esp->dma_can_transfer = &dma_can_transfer; @@ -185,7 +168,7 @@ esp->dma_reset = 0; esp->dma_led_off = 0; esp->dma_led_on = 0; - + /* virtual DMA functions */ esp->dma_mmu_get_scsi_one = &dma_mmu_get_scsi_one; esp->dma_mmu_get_scsi_sgl = &dma_mmu_get_scsi_sgl; @@ -197,38 +180,42 @@ /* SCSI chip speed */ esp->cfreq = 25000000; - /* - * we don't give the address of DMA channel, but the number - * of DMA channel, so we can use the jazz DMA functions - * - */ - esp->dregs = JAZZ_SCSI_DMA; - + esp->dregs = 0; + /* ESP register base */ - esp->eregs = (struct ESP_regs *) (system_base + SCSI); - + esp->eregs = (struct ESP_regs *) (system_base + IOASIC_SCSI); + /* Set the command buffer */ esp->esp_command = (volatile unsigned char *) cmd_buffer; - + /* get virtual dma address for command buffer */ - esp->esp_command_dvma = (__u32) KSEG1ADDR((volatile unsigned char *) cmd_buffer); - - esp->irq = SCSI_INT; + esp->esp_command_dvma = virt_to_phys(cmd_buffer); + + esp->irq = dec_interrupt[DEC_IRQ_ASC]; esp->scsi_id = 7; - + /* Check for differential SCSI-bus */ esp->diff = 0; esp_initialize(esp); - if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, - "NCR 53C94 SCSI", esp->ehost)) + if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, + "ncr53c94", esp->ehost)) goto err_dealloc; - if (request_irq(SCSI_DMA_INT, scsi_dma_int, SA_INTERRUPT, - "JUNKIO SCSI DMA", esp->ehost)) + if (request_irq(dec_interrupt[DEC_IRQ_ASC_MERR], + scsi_dma_merr_int, SA_INTERRUPT, + "ncr53c94 error", esp->ehost)) goto err_free_irq; - + if (request_irq(dec_interrupt[DEC_IRQ_ASC_ERR], + scsi_dma_err_int, SA_INTERRUPT, + "ncr53c94 overrun", esp->ehost)) + goto err_free_irq_merr; + if (request_irq(dec_interrupt[DEC_IRQ_ASC_DMA], + scsi_dma_int, SA_INTERRUPT, + "ncr53c94 dma", esp->ehost)) + goto err_free_irq_err; + } if (TURBOCHANNEL) { @@ -241,7 +228,7 @@ mem_start = get_tc_base_addr(slot); /* Store base addr into esp struct */ - esp->slot = mem_start; + esp->slot = PHYSADDR(mem_start); esp->dregs = 0; esp->eregs = (struct ESP_regs *) (mem_start + DEC_SCSI_SREG); @@ -251,7 +238,7 @@ esp->esp_command = (volatile unsigned char *) pmaz_cmd_buffer; /* get virtual dma address for command buffer */ - esp->esp_command_dvma = (__u32) KSEG0ADDR((volatile unsigned char *) pmaz_cmd_buffer); + esp->esp_command_dvma = virt_to_phys(pmaz_cmd_buffer); esp->cfreq = get_tc_speed(); @@ -286,7 +273,7 @@ esp->dma_mmu_release_scsi_sgl = 0; esp->dma_advance_sg = 0; - if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, + if (request_irq(esp->irq, esp_intr, SA_INTERRUPT, "PMAZ_AA", esp->ehost)) { esp_deallocate(esp); release_tc_card(slot); @@ -305,231 +292,259 @@ } return 0; - err_free_irq: +err_free_irq_err: + free_irq(dec_interrupt[DEC_IRQ_ASC_ERR], scsi_dma_err_int); +err_free_irq_merr: + free_irq(dec_interrupt[DEC_IRQ_ASC_MERR], scsi_dma_merr_int); +err_free_irq: free_irq(esp->irq, esp_intr); - err_dealloc: +err_dealloc: esp_deallocate(esp); return 0; } /************************************************************* DMA Functions */ -static void scsi_dma_int(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t scsi_dma_merr_int(int irq, void *dev_id, struct pt_regs *regs) { - extern volatile unsigned int *isr; - unsigned int dummy; + printk("Got unexpected SCSI DMA Interrupt! < "); + printk("SCSI_DMA_MEMRDERR "); + printk(">\n"); - if (*isr & SCSI_PTR_LOADED) { - /* next page */ - *scsi_next_ptr = ((*scsi_dma_ptr + PAGE_SIZE) & PAGE_MASK) << 3; - *isr &= ~SCSI_PTR_LOADED; - } else { - if (*isr & SCSI_PAGOVRRUN) - *isr &= ~SCSI_PAGOVRRUN; - if (*isr & SCSI_DMA_MEMRDERR) { - printk("Got unexpected SCSI DMA Interrupt! < "); - printk("SCSI_DMA_MEMRDERR "); - printk(">\n"); - *isr &= ~SCSI_DMA_MEMRDERR; - } - } + return IRQ_HANDLED; +} - /* - * This routine will only work on IOASIC machines - * so we can avoid an indirect function call here - * and flush the writeback buffer the fast way - */ - dummy = *isr; - dummy = *isr; +static irqreturn_t scsi_dma_err_int(int irq, void *dev_id, struct pt_regs *regs) +{ + /* empty */ + + return IRQ_HANDLED; +} + +static irqreturn_t scsi_dma_int(int irq, void *dev_id, struct pt_regs *regs) +{ + u32 scsi_next_ptr; + + scsi_next_ptr = ioasic_read(IO_REG_SCSI_DMA_P); + + /* next page */ + scsi_next_ptr = (((scsi_next_ptr >> 3) + PAGE_SIZE) & PAGE_MASK) << 3; + ioasic_write(IO_REG_SCSI_DMA_BP, scsi_next_ptr); + fast_iob(); + + return IRQ_HANDLED; } static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count) { - return fifo_count; + return fifo_count; } static void dma_drain(struct NCR_ESP *esp) { - unsigned long nw = *scsi_scr; - unsigned short *p = (unsigned short *)KSEG1ADDR((*scsi_dma_ptr) >> 3); + u32 nw, data0, data1, scsi_data_ptr; + u16 *p; + + nw = ioasic_read(IO_REG_SCSI_SCR); - /* + /* * Is there something in the dma buffers left? - */ + */ if (nw) { + scsi_data_ptr = ioasic_read(IO_REG_SCSI_DMA_P) >> 3; + p = phys_to_virt(scsi_data_ptr); switch (nw) { case 1: - *p = (unsigned short) *scsi_sdr0; + data0 = ioasic_read(IO_REG_SCSI_SDR0); + p[0] = data0 & 0xffff; break; case 2: - *p++ = (unsigned short) (*scsi_sdr0); - *p = (unsigned short) ((*scsi_sdr0) >> 16); + data0 = ioasic_read(IO_REG_SCSI_SDR0); + p[0] = data0 & 0xffff; + p[1] = (data0 >> 16) & 0xffff; break; case 3: - *p++ = (unsigned short) (*scsi_sdr0); - *p++ = (unsigned short) ((*scsi_sdr0) >> 16); - *p = (unsigned short) (*scsi_sdr1); + data0 = ioasic_read(IO_REG_SCSI_SDR0); + data1 = ioasic_read(IO_REG_SCSI_SDR1); + p[0] = data0 & 0xffff; + p[1] = (data0 >> 16) & 0xffff; + p[2] = data1 & 0xffff; break; default: - printk("Strange: %d words in dma buffer left\n", (int) nw); + printk("Strange: %d words in dma buffer left\n", nw); break; } } } -static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd * sp) +static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd * sp) { return sp->SCp.this_residual; } static void dma_dump_state(struct NCR_ESP *esp) { -/* - ESPLOG(("esp%d: dma -- enable <%08x> residue <%08x\n", - esp->esp_id, vdma_get_enable((int)esp->dregs), vdma_get_resdiue((int)esp->dregs))); - */ } -static void dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length) +static void dma_init_read(struct NCR_ESP *esp, u32 vaddress, int length) { - extern volatile unsigned int *isr; - unsigned int dummy; + u32 scsi_next_ptr, ioasic_ssr; + unsigned long flags; if (vaddress & 3) - panic("dec_efs.c: unable to handle partial word transfers, yet..."); + panic("dec_esp.c: unable to handle partial word transfers, yet..."); dma_cache_wback_inv((unsigned long) phys_to_virt(vaddress), length); - *ioasic_ssr &= ~SCSI_DMA_EN; - *scsi_scr = 0; - *scsi_dma_ptr = vaddress << 3; + spin_lock_irqsave(&ioasic_ssr_lock, flags); + + fast_mb(); + ioasic_ssr = ioasic_read(IO_REG_SSR); + + ioasic_ssr &= ~IO_SSR_SCSI_DMA_EN; + ioasic_write(IO_REG_SSR, ioasic_ssr); + + fast_wmb(); + ioasic_write(IO_REG_SCSI_SCR, 0); + ioasic_write(IO_REG_SCSI_DMA_P, vaddress << 3); /* prepare for next page */ - *scsi_next_ptr = ((vaddress + PAGE_SIZE) & PAGE_MASK) << 3; - *ioasic_ssr |= (SCSI_DMA_DIR | SCSI_DMA_EN); + scsi_next_ptr = ((vaddress + PAGE_SIZE) & PAGE_MASK) << 3; + ioasic_write(IO_REG_SCSI_DMA_BP, scsi_next_ptr); - /* - * see above - */ - dummy = *isr; - dummy = *isr; + ioasic_ssr |= (IO_SSR_SCSI_DMA_DIR | IO_SSR_SCSI_DMA_EN); + fast_wmb(); + ioasic_write(IO_REG_SSR, ioasic_ssr); + + fast_iob(); + spin_unlock_irqrestore(&ioasic_ssr_lock, flags); } -static void dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length) +static void dma_init_write(struct NCR_ESP *esp, u32 vaddress, int length) { - extern volatile unsigned int *isr; - unsigned int dummy; + u32 scsi_next_ptr, ioasic_ssr; + unsigned long flags; if (vaddress & 3) - panic("dec_efs.c: unable to handle partial word transfers, yet..."); + panic("dec_esp.c: unable to handle partial word transfers, yet..."); dma_cache_wback_inv((unsigned long) phys_to_virt(vaddress), length); - *ioasic_ssr &= ~(SCSI_DMA_DIR | SCSI_DMA_EN); - *scsi_scr = 0; - *scsi_dma_ptr = vaddress << 3; + spin_lock_irqsave(&ioasic_ssr_lock, flags); + + fast_mb(); + ioasic_ssr = ioasic_read(IO_REG_SSR); + + ioasic_ssr &= ~(IO_SSR_SCSI_DMA_DIR | IO_SSR_SCSI_DMA_EN); + ioasic_write(IO_REG_SSR, ioasic_ssr); + + fast_wmb(); + ioasic_write(IO_REG_SCSI_SCR, 0); + ioasic_write(IO_REG_SCSI_DMA_P, vaddress << 3); /* prepare for next page */ - *scsi_next_ptr = ((vaddress + PAGE_SIZE) & PAGE_MASK) << 3; - *ioasic_ssr |= SCSI_DMA_EN; + scsi_next_ptr = ((vaddress + PAGE_SIZE) & PAGE_MASK) << 3; + ioasic_write(IO_REG_SCSI_DMA_BP, scsi_next_ptr); - /* - * see above - */ - dummy = *isr; - dummy = *isr; + ioasic_ssr |= IO_SSR_SCSI_DMA_EN; + fast_wmb(); + ioasic_write(IO_REG_SSR, ioasic_ssr); + + fast_iob(); + spin_unlock_irqrestore(&ioasic_ssr_lock, flags); } static void dma_ints_off(struct NCR_ESP *esp) { - disable_irq(SCSI_DMA_INT); + disable_irq(dec_interrupt[DEC_IRQ_ASC_DMA]); } static void dma_ints_on(struct NCR_ESP *esp) { - enable_irq(SCSI_DMA_INT); + enable_irq(dec_interrupt[DEC_IRQ_ASC_DMA]); } static int dma_irq_p(struct NCR_ESP *esp) { - return (esp->eregs->esp_status & ESP_STAT_INTR); + return (esp->eregs->esp_status & ESP_STAT_INTR); } static int dma_ports_p(struct NCR_ESP *esp) { -/* - * FIXME: what's this good for? - */ + /* + * FIXME: what's this good for? + */ return 1; } -static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) +static void dma_setup(struct NCR_ESP *esp, u32 addr, int count, int write) { - /* - * On the Sparc, DMA_ST_WRITE means "move data from device to memory" - * so when (write) is true, it actually means READ! - */ - if (write) { - dma_init_read(esp, addr, count); - } else { - dma_init_write(esp, addr, count); - } + /* + * DMA_ST_WRITE means "move data from device to memory" + * so when (write) is true, it actually means READ! + */ + if (write) + dma_init_read(esp, addr, count); + else + dma_init_write(esp, addr, count); } -/* - * These aren't used yet - */ -static void dma_mmu_get_scsi_one(struct NCR_ESP *esp, Scsi_Cmnd * sp) +static void dma_mmu_get_scsi_one(struct NCR_ESP *esp, struct scsi_cmnd * sp) { - sp->SCp.ptr = (char *)PHYSADDR(sp->SCp.buffer); + sp->SCp.ptr = (char *)virt_to_phys(sp->request_buffer); } -static void dma_mmu_get_scsi_sgl(struct NCR_ESP *esp, Scsi_Cmnd * sp) +static void dma_mmu_get_scsi_sgl(struct NCR_ESP *esp, struct scsi_cmnd * sp) { - int sz = sp->SCp.buffers_residual; - struct mmu_sglist *sg = (struct mmu_sglist *) sp->SCp.buffer; + int sz = sp->SCp.buffers_residual; + struct scatterlist *sg = sp->SCp.buffer; - while (sz >= 0) { - sg[sz].dvma_addr = PHYSADDR(sg[sz].addr); - sz--; - } - sp->SCp.ptr = (char *) ((unsigned long) sp->SCp.buffer->dvma_address); + while (sz >= 0) { + sg[sz].dma_address = page_to_phys(sg[sz].page) + sg[sz].offset; + sz--; + } + sp->SCp.ptr = (char *)(sp->SCp.buffer->dma_address); } -static void dma_advance_sg(Scsi_Cmnd * sp) +static void dma_advance_sg(struct scsi_cmnd * sp) { - sp->SCp.ptr = (char *) ((unsigned long) sp->SCp.buffer->dvma_address); + sp->SCp.ptr = (char *)(sp->SCp.buffer->dma_address); } static void pmaz_dma_drain(struct NCR_ESP *esp) { - memcpy((void *) (KSEG0ADDR(esp_virt_buffer)), - (void *) ( esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE), + memcpy(phys_to_virt(esp_virt_buffer), + (void *)KSEG1ADDR(esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE), scsi_current_length); } -static void pmaz_dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length) +static void pmaz_dma_init_read(struct NCR_ESP *esp, u32 vaddress, int length) { - volatile int *dmareg = (volatile int *) (esp->slot + DEC_SCSI_DMAREG); + volatile u32 *dmareg = + (volatile u32 *)KSEG1ADDR(esp->slot + DEC_SCSI_DMAREG); if (length > ESP_TGT_DMA_SIZE) length = ESP_TGT_DMA_SIZE; - *dmareg = TC_ESP_DMA_ADDR(esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE); + *dmareg = TC_ESP_DMA_ADDR(ESP_TGT_DMA_SIZE); + + iob(); esp_virt_buffer = vaddress; scsi_current_length = length; } -static void pmaz_dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length) +static void pmaz_dma_init_write(struct NCR_ESP *esp, u32 vaddress, int length) { - volatile int *dmareg = (volatile int *) ( esp->slot + DEC_SCSI_DMAREG ); + volatile u32 *dmareg = + (volatile u32 *)KSEG1ADDR(esp->slot + DEC_SCSI_DMAREG); - memcpy((void *)(esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE), - (void *)KSEG0ADDR(vaddress), length); + memcpy((void *)KSEG1ADDR(esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE), + phys_to_virt(vaddress), length); - *dmareg = TC_ESP_DMAR_WRITE | - TC_ESP_DMA_ADDR(esp->slot + DEC_SCSI_SRAM + ESP_TGT_DMA_SIZE); + wmb(); + *dmareg = TC_ESP_DMAR_WRITE | TC_ESP_DMA_ADDR(ESP_TGT_DMA_SIZE); + iob(); } static void pmaz_dma_ints_off(struct NCR_ESP *esp) @@ -540,20 +555,19 @@ { } -static void pmaz_dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) +static void pmaz_dma_setup(struct NCR_ESP *esp, u32 addr, int count, int write) { /* - * On the Sparc, DMA_ST_WRITE means "move data from device to memory" + * DMA_ST_WRITE means "move data from device to memory" * so when (write) is true, it actually means READ! */ - if (write) { + if (write) pmaz_dma_init_read(esp, addr, count); - } else { + else pmaz_dma_init_write(esp, addr, count); - } } -static void pmaz_dma_mmu_get_scsi_one(struct NCR_ESP *esp, Scsi_Cmnd * sp) +static void pmaz_dma_mmu_get_scsi_one(struct NCR_ESP *esp, struct scsi_cmnd * sp) { - sp->SCp.ptr = (char *)KSEG0ADDR((sp->request_buffer)); + sp->SCp.ptr = (char *)virt_to_phys(sp->request_buffer); } diff -Nru a/drivers/scsi/dpt/dpt_osdutil.h b/drivers/scsi/dpt/dpt_osdutil.h --- a/drivers/scsi/dpt/dpt_osdutil.h 2005-01-28 14:11:41 -08:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,358 +0,0 @@ -/* BSDI osd_util.h,v 1.8 1998/06/03 19:14:58 karels Exp */ - -/* - * Copyright (c) 1996-1999 Distributed Processing Technology Corporation - * All rights reserved. - * - * Redistribution and use in source form, with or without modification, are - * permitted provided that redistributions of source code must retain the - * above copyright notice, this list of conditions and the following disclaimer. - * - * This software is provided `as is' by Distributed Processing Technology and - * any express or implied warranties, including, but not limited to, the - * implied warranties of merchantability and fitness for a particular purpose, - * are disclaimed. In no event shall Distributed Processing Technology be - * liable for any direct, indirect, incidental, special, exemplary or - * consequential damages (including, but not limited to, procurement of - * substitute goods or services; loss of use, data, or profits; or business - * interruptions) however caused and on any theory of liability, whether in - * contract, strict liability, or tort (including negligence or otherwise) - * arising in any way out of the use of this driver software, even if advised - * of the possibility of such damage. - * - */ - -#ifndef __OSD_UTIL_H -#define __OSD_UTIL_H - -/*File - OSD_UTIL.H - **************************************************************************** - * - *Description: - * - * This file contains defines and function prototypes that are - *operating system dependent. The resources defined in this file - *are not specific to any particular application. - * - *Copyright Distributed Processing Technology, Corp. - * 140 Candace Dr. - * Maitland, Fl. 32751 USA - * Phone: (407) 830-5522 Fax: (407) 260-5366 - * All Rights Reserved - * - *Author: Doug Anderson - *Date: 1/7/94 - * - *Editors: - * - *Remarks: - * - * - *****************************************************************************/ - - -/*Definitions - Defines & Constants ----------------------------------------- */ - -/*----------------------------- */ -/* Operating system selections: */ -/*----------------------------- */ - -/*#define _DPT_MSDOS */ -/*#define _DPT_WIN_3X */ -/*#define _DPT_WIN_4X */ -/*#define _DPT_WIN_NT */ -/*#define _DPT_NETWARE */ -/*#define _DPT_OS2 */ -/*#define _DPT_SCO */ -/*#define _DPT_UNIXWARE */ -/*#define _DPT_SOLARIS */ -/*#define _DPT_NEXTSTEP */ -/*#define _DPT_BANYAN */ - -/*-------------------------------- */ -/* Include the OS specific defines */ -/*-------------------------------- */ - -/*#define OS_SELECTION From Above List */ -/*#define SEMAPHORE_T ??? */ -/*#define DLL_HANDLE_T ??? */ - -#if (defined(KERNEL) && (defined(__FreeBSD__) || defined(__bsdi__))) -# include "i386/isa/dpt_osd_defs.h" -#else -# include "osd_defs.h" -#endif - -#ifndef DPT_UNALIGNED - #define DPT_UNALIGNED -#endif - -#ifndef DPT_EXPORT - #define DPT_EXPORT -#endif - -#ifndef DPT_IMPORT - #define DPT_IMPORT -#endif - -#ifndef DPT_RUNTIME_IMPORT - #define DPT_RUNTIME_IMPORT DPT_IMPORT -#endif - -/*--------------------- */ -/* OS dependent defines */ -/*--------------------- */ - -#if defined (_DPT_MSDOS) || defined (_DPT_WIN_3X) - #define _DPT_16_BIT -#else - #define _DPT_32_BIT -#endif - -#if defined (_DPT_SCO) || defined (_DPT_UNIXWARE) || defined (_DPT_SOLARIS) || defined (_DPT_AIX) || defined (SNI_MIPS) || defined (_DPT_BSDI) || defined (_DPT_FREE_BSD) || defined(_DPT_LINUX) - #define _DPT_UNIX -#endif - -#if defined (_DPT_WIN_3x) || defined (_DPT_WIN_4X) || defined (_DPT_WIN_NT) \ - || defined (_DPT_OS2) - #define _DPT_DLL_SUPPORT -#endif - -#if !defined (_DPT_MSDOS) && !defined (_DPT_WIN_3X) && !defined (_DPT_NETWARE) - #define _DPT_PREEMPTIVE -#endif - -#if !defined (_DPT_MSDOS) && !defined (_DPT_WIN_3X) - #define _DPT_MULTI_THREADED -#endif - -#if !defined (_DPT_MSDOS) - #define _DPT_MULTI_TASKING -#endif - - /* These exist for platforms that */ - /* chunk when accessing mis-aligned */ - /* data */ -#if defined (SNI_MIPS) || defined (_DPT_SOLARIS) - #if defined (_DPT_BIG_ENDIAN) - #if !defined (_DPT_STRICT_ALIGN) - #define _DPT_STRICT_ALIGN - #endif - #endif -#endif - - /* Determine if in C or C++ mode */ -#ifdef __cplusplus - #define _DPT_CPP -#else - #define _DPT_C -#endif - -/*-------------------------------------------------------------------*/ -/* Under Solaris the compiler refuses to accept code like: */ -/* { {"DPT"}, 0, NULL .... }, */ -/* and complains about the {"DPT"} part by saying "cannot use { } */ -/* to initialize char*". */ -/* */ -/* By defining these ugly macros we can get around this and also */ -/* not have to copy and #ifdef large sections of code. I know that */ -/* these macros are *really* ugly, but they should help reduce */ -/* maintenance in the long run. */ -/* */ -/*-------------------------------------------------------------------*/ -#if !defined (DPTSQO) - #if defined (_DPT_SOLARIS) - #define DPTSQO - #define DPTSQC - #else - #define DPTSQO { - #define DPTSQC } - #endif /* solaris */ -#endif /* DPTSQO */ - - -/*---------------------- */ -/* OS dependent typedefs */ -/*---------------------- */ - -#if defined (_DPT_MSDOS) || defined (_DPT_SCO) - #define BYTE unsigned char - #define WORD unsigned short -#endif - -#ifndef _DPT_TYPEDEFS - #define _DPT_TYPEDEFS - typedef unsigned char uCHAR; - typedef unsigned short uSHORT; - typedef unsigned int uINT; - typedef unsigned long uLONG; - - typedef union { - uCHAR u8[4]; - uSHORT u16[2]; - uLONG u32; - } access_U; -#endif - -#if !defined (NULL) - #define NULL 0 -#endif - - -/*Prototypes - function ----------------------------------------------------- */ - -#ifdef __cplusplus - extern "C" { /* Declare all these functions as "C" functions */ -#endif - -/*------------------------ */ -/* Byte reversal functions */ -/*------------------------ */ - - /* Reverses the byte ordering of a 2 byte variable */ -#if (!defined(osdSwap2)) - uSHORT osdSwap2(DPT_UNALIGNED uSHORT *); -#endif // !osdSwap2 - - /* Reverses the byte ordering of a 4 byte variable and shifts left 8 bits */ -#if (!defined(osdSwap3)) - uLONG osdSwap3(DPT_UNALIGNED uLONG *); -#endif // !osdSwap3 - - -#ifdef _DPT_NETWARE - #include "novpass.h" /* For DPT_Bswapl() prototype */ - /* Inline the byte swap */ - #ifdef __cplusplus - inline uLONG osdSwap4(uLONG *inLong) { - return *inLong = DPT_Bswapl(*inLong); - } - #else - #define osdSwap4(inLong) DPT_Bswapl(inLong) - #endif // cplusplus -#else - /* Reverses the byte ordering of a 4 byte variable */ -# if (!defined(osdSwap4)) - uLONG osdSwap4(DPT_UNALIGNED uLONG *); -# endif // !osdSwap4 - - /* The following functions ALWAYS swap regardless of the * - * presence of DPT_BIG_ENDIAN */ - - uSHORT trueSwap2(DPT_UNALIGNED uSHORT *); - uLONG trueSwap4(DPT_UNALIGNED uLONG *); - -#endif // netware - - -/*-------------------------------------* - * Network order swap functions * - * * - * These functions/macros will be used * - * by the structure insert()/extract() * - * functions. * - * - * We will enclose all structure * - * portability modifications inside * - * #ifdefs. When we are ready, we * - * will #define DPT_PORTABLE to begin * - * using the modifications. * - *-------------------------------------*/ -uLONG netSwap4(uLONG val); - -#if defined (_DPT_BIG_ENDIAN) - -// for big-endian we need to swap - -#ifndef NET_SWAP_2 -#define NET_SWAP_2(x) (((x) >> 8) | ((x) << 8)) -#endif // NET_SWAP_2 - -#ifndef NET_SWAP_4 -#define NET_SWAP_4(x) netSwap4((x)) -#endif // NET_SWAP_4 - -#else - -// for little-endian we don't need to do anything - -#ifndef NET_SWAP_2 -#define NET_SWAP_2(x) (x) -#endif // NET_SWAP_2 - -#ifndef NET_SWAP_4 -#define NET_SWAP_4(x) (x) -#endif // NET_SWAP_4 - -#endif // big endian - - - -/*----------------------------------- */ -/* Run-time loadable module functions */ -/*----------------------------------- */ - - /* Loads the specified run-time loadable DLL */ -DLL_HANDLE_T osdLoadModule(uCHAR *); - /* Unloads the specified run-time loadable DLL */ -uSHORT osdUnloadModule(DLL_HANDLE_T); - /* Returns a pointer to a function inside a run-time loadable DLL */ -void * osdGetFnAddr(DLL_HANDLE_T,uCHAR *); - -/*--------------------------------------- */ -/* Mutually exclusive semaphore functions */ -/*--------------------------------------- */ - - /* Create a named semaphore */ -SEMAPHORE_T osdCreateNamedSemaphore(char *); - /* Create a mutually exlusive semaphore */ -SEMAPHORE_T osdCreateSemaphore(void); - /* create an event semaphore */ -SEMAPHORE_T osdCreateEventSemaphore(void); - /* create a named event semaphore */ -SEMAPHORE_T osdCreateNamedEventSemaphore(char *); - - /* Destroy the specified mutually exclusive semaphore object */ -uSHORT osdDestroySemaphore(SEMAPHORE_T); - /* Request access to the specified mutually exclusive semaphore */ -uLONG osdRequestSemaphore(SEMAPHORE_T,uLONG); - /* Release access to the specified mutually exclusive semaphore */ -uSHORT osdReleaseSemaphore(SEMAPHORE_T); - /* wait for a event to happen */ -uLONG osdWaitForEventSemaphore(SEMAPHORE_T, uLONG); - /* signal an event */ -uLONG osdSignalEventSemaphore(SEMAPHORE_T); - /* reset the event */ -uLONG osdResetEventSemaphore(SEMAPHORE_T); - -/*----------------- */ -/* Thread functions */ -/*----------------- */ - - /* Releases control to the task switcher in non-preemptive */ - /* multitasking operating systems. */ -void osdSwitchThreads(void); - - /* Starts a thread function */ -uLONG osdStartThread(void *,void *); - -/* what is my thread id */ -uLONG osdGetThreadID(void); - -/* wakes up the specifed thread */ -void osdWakeThread(uLONG); - -/* osd sleep for x miliseconds */ -void osdSleep(uLONG); - -#define DPT_THREAD_PRIORITY_LOWEST 0x00 -#define DPT_THREAD_PRIORITY_NORMAL 0x01 -#define DPT_THREAD_PRIORITY_HIGHEST 0x02 - -uCHAR osdSetThreadPriority(uLONG tid, uCHAR priority); - -#ifdef __cplusplus - } /* end the xtern "C" declaration */ -#endif - -#endif /* osd_util_h */ diff -Nru a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c --- a/drivers/scsi/dpt_i2o.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/scsi/dpt_i2o.c 2005-01-28 14:11:41 -08:00 @@ -1178,7 +1178,6 @@ // dangerous. status = -ETIME; } - schedule_timeout(timeout*HZ); } if(pHba->host) spin_lock_irq(pHba->host->host_lock); diff -Nru a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c --- a/drivers/scsi/hosts.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/hosts.c 2005-01-28 14:11:40 -08:00 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -79,15 +80,8 @@ set_bit(SHOST_DEL, &shost->shost_state); - if (shost->transportt->host_destroy) - shost->transportt->host_destroy(shost); + transport_unregister_device(&shost->shost_gendev); class_device_unregister(&shost->shost_classdev); - if (shost->transport_classdev.class) { - if (shost->transportt->host_statistics) - sysfs_remove_group(&shost->transport_classdev.kobj, - shost->transportt->host_statistics); - class_device_unregister(&shost->transport_classdev); - } device_del(&shost->shost_gendev); } EXPORT_SYMBOL(scsi_remove_host); @@ -135,9 +129,6 @@ GFP_KERNEL)) == NULL) goto out_del_classdev; - if (shost->transportt->host_setup) - shost->transportt->host_setup(shost); - error = scsi_sysfs_add_host(shost); if (error) goto out_destroy_host; @@ -146,8 +137,6 @@ return error; out_destroy_host: - if (shost->transportt->host_destroy) - shost->transportt->host_destroy(shost); out_del_classdev: class_device_del(&shost->shost_classdev); out_del_gendev: @@ -397,3 +386,9 @@ { class_unregister(&shost_class); } + +int scsi_is_host_device(const struct device *dev) +{ + return dev->release == scsi_host_dev_release; +} +EXPORT_SYMBOL(scsi_is_host_device); diff -Nru a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c --- a/drivers/scsi/jazz_esp.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/jazz_esp.c 2005-01-28 14:11:40 -08:00 @@ -6,6 +6,7 @@ * jazz_esp is based on David S. Miller's ESP driver and cyber_esp */ +#include #include #include #include @@ -27,7 +28,7 @@ #include static int dma_bytes_sent(struct NCR_ESP *esp, int fifo_count); -static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp); +static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp); static void dma_dump_state(struct NCR_ESP *esp); static void dma_init_read(struct NCR_ESP *esp, __u32 vaddress, int length); static void dma_init_write(struct NCR_ESP *esp, __u32 vaddress, int length); @@ -36,11 +37,11 @@ static int dma_irq_p(struct NCR_ESP *esp); static int dma_ports_p(struct NCR_ESP *esp); static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write); -static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp); -static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp); -static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp); -static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp); -static void dma_advance_sg (Scsi_Cmnd *sp); +static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, struct scsi_cmnd *sp); +static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, struct scsi_cmnd *sp); +static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, struct scsi_cmnd *sp); +static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, struct scsi_cmnd *sp); +static void dma_advance_sg (struct scsi_cmnd *sp); static void dma_led_off(struct NCR_ESP *); static void dma_led_on(struct NCR_ESP *); @@ -52,7 +53,7 @@ */ /***************************************************************** Detection */ -int jazz_esp_detect(Scsi_Host_Template *tpnt) +static int jazz_esp_detect(struct scsi_host_template *tpnt) { struct NCR_ESP *esp; struct ConfigDev *esp_dev; @@ -115,7 +116,7 @@ esp->esp_command = (volatile unsigned char *)cmd_buffer; /* get virtual dma address for command buffer */ - esp->esp_command_dvma = vdma_alloc(PHYSADDR(cmd_buffer), sizeof (cmd_buffer)); + esp->esp_command_dvma = vdma_alloc(CPHYSADDR(cmd_buffer), sizeof (cmd_buffer)); esp->irq = JAZZ_SCSI_IRQ; request_irq(JAZZ_SCSI_IRQ, esp_intr, SA_INTERRUPT, "JAZZ SCSI", @@ -157,7 +158,7 @@ return fifo_count; } -static int dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp) +static int dma_can_transfer(struct NCR_ESP *esp, struct scsi_cmnd *sp) { /* * maximum DMA size is 1MB @@ -230,43 +231,43 @@ } } -static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp) +static void dma_mmu_get_scsi_one (struct NCR_ESP *esp, struct scsi_cmnd *sp) { - sp->SCp.have_data_in = vdma_alloc(PHYSADDR(sp->SCp.buffer), sp->SCp.this_residual); + sp->SCp.have_data_in = vdma_alloc(CPHYSADDR(sp->SCp.buffer), sp->SCp.this_residual); sp->SCp.ptr = (char *)((unsigned long)sp->SCp.have_data_in); } -static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp) +static void dma_mmu_get_scsi_sgl (struct NCR_ESP *esp, struct scsi_cmnd *sp) { int sz = sp->SCp.buffers_residual; - struct mmu_sglist *sg = (struct mmu_sglist *) sp->SCp.buffer; + struct scatterlist *sg = (struct scatterlist *) sp->SCp.buffer; while (sz >= 0) { - sg[sz].dvma_addr = vdma_alloc(PHYSADDR(sg[sz].addr), sg[sz].len); + sg[sz].dma_address = vdma_alloc(CPHYSADDR(page_address(sg[sz].page) + sg[sz].offset), sg[sz].length); sz--; } - sp->SCp.ptr=(char *)((unsigned long)sp->SCp.buffer->dvma_address); + sp->SCp.ptr=(char *)(sp->SCp.buffer->dma_address); } -static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp) +static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, struct scsi_cmnd *sp) { vdma_free(sp->SCp.have_data_in); } -static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, Scsi_Cmnd *sp) +static void dma_mmu_release_scsi_sgl (struct NCR_ESP *esp, struct scsi_cmnd *sp) { int sz = sp->use_sg - 1; - struct mmu_sglist *sg = (struct mmu_sglist *)sp->buffer; + struct scatterlist *sg = (struct scatterlist *)sp->buffer; while(sz >= 0) { - vdma_free(sg[sz].dvma_addr); + vdma_free(sg[sz].dma_address); sz--; } } -static void dma_advance_sg (Scsi_Cmnd *sp) +static void dma_advance_sg (struct scsi_cmnd *sp) { - sp->SCp.ptr = (char *)((unsigned long)sp->SCp.buffer->dvma_address); + sp->SCp.ptr = (char *)(sp->SCp.buffer->dma_address); } #define JAZZ_HDC_LED 0xe000d100 /* FIXME, find correct address */ @@ -285,9 +286,9 @@ #endif } -static Scsi_Host_Template driver_template = { +static struct scsi_host_template driver_template = { .proc_name = "jazz_esp", - .proc_info = &esp_proc_info, + .proc_info = esp_proc_info, .name = "ESP 100/100a/200", .detect = jazz_esp_detect, .slave_alloc = esp_slave_alloc, @@ -303,4 +304,4 @@ .cmd_per_lun = 1, .use_clustering = DISABLE_CLUSTERING, }; - +#include "scsi_module.c" diff -Nru a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c --- a/drivers/scsi/oktagon_esp.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/oktagon_esp.c 2005-01-28 14:11:40 -08:00 @@ -72,8 +72,6 @@ static void dma_advance_sg(Scsi_Cmnd *); static int oktagon_notify_reboot(struct notifier_block *this, unsigned long code, void *x); -void esp_bootup_reset(struct NCR_ESP *esp,struct ESP_regs *eregs); - #ifdef USE_BOTTOM_HALF static void dma_commit(void *opaque); diff -Nru a/drivers/scsi/osst.c b/drivers/scsi/osst.c --- a/drivers/scsi/osst.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/osst.c 2005-01-28 14:11:40 -08:00 @@ -63,10 +63,14 @@ in the drivers are more widely classified, this may be changed to KERN_DEBUG. */ #define OSST_DEB_MSG KERN_NOTICE -#include "scsi.h" -#include +#include +#include +#include #include +#include +#include #include +#include #define ST_KILOBYTE 1024 @@ -152,7 +156,7 @@ static struct osst_tape **os_scsi_tapes = NULL; static DEFINE_RWLOCK(os_scsi_tapes_lock); -static int modes_defined = FALSE; +static int modes_defined = 0; static struct osst_buffer *new_tape_buffer(int, int, int); static int enlarge_buffer(struct osst_buffer *, int); @@ -223,7 +227,7 @@ if (scode) printk(OSST_DEB_MSG "%s:D: Sense: %02x, ASC: %02x, ASCQ: %02x\n", name, scode, sense[12], sense[13]); if (driver_byte(result) & DRIVER_SENSE) - print_req_sense("osst ", SRpnt); + scsi_print_req_sense("osst ", SRpnt); } else #endif @@ -238,7 +242,7 @@ SRpnt->sr_cmnd[0] != TEST_UNIT_READY)) { /* Abnormal conditions for tape */ if (driver_byte(result) & DRIVER_SENSE) { printk(KERN_WARNING "%s:W: Command with sense data:\n", name); - print_req_sense("osst:", SRpnt); + scsi_print_req_sense("osst:", SRpnt); } else { static int notyetprinted = 1; @@ -282,7 +286,7 @@ /* Wakeup from interrupt */ -static void osst_sleep_done (Scsi_Cmnd * SCpnt) +static void osst_sleep_done (struct scsi_cmnd * SCpnt) { struct osst_tape * STp = container_of(SCpnt->request->rq_disk->private_data, struct osst_tape, driver); @@ -624,7 +628,7 @@ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = TEST_UNIT_READY; - SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, SCSI_DATA_NONE, STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, DMA_NONE, STp->timeout, MAX_RETRIES, 1); *aSRpnt = SRpnt; if (!SRpnt) return (-EBUSY); @@ -645,7 +649,7 @@ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = TEST_UNIT_READY; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, SCSI_DATA_NONE, STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, STp->timeout, MAX_RETRIES, 1); } *aSRpnt = SRpnt; #if DEBUG @@ -685,7 +689,7 @@ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = TEST_UNIT_READY; - SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, SCSI_DATA_NONE, STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, DMA_NONE, STp->timeout, MAX_RETRIES, 1); *aSRpnt = SRpnt; if (!SRpnt) return (-EBUSY); @@ -704,7 +708,7 @@ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = TEST_UNIT_READY; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, SCSI_DATA_NONE, STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, STp->timeout, MAX_RETRIES, 1); } *aSRpnt = SRpnt; #if DEBUG @@ -756,7 +760,7 @@ cmd[0] = WRITE_FILEMARKS; cmd[1] = 1; - SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, SCSI_DATA_NONE, STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, DMA_NONE, STp->timeout, MAX_RETRIES, 1); *aSRpnt = SRpnt; if (!SRpnt) return (-EBUSY); if (STp->buffer->syscall_result) { @@ -847,8 +851,8 @@ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = WRITE_FILEMARKS; cmd[1] = 1; - SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, SCSI_DATA_NONE, STp->timeout, - MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, DMA_NONE, STp->timeout, + MAX_RETRIES, 1); while (retval && time_before (jiffies, startwait + 5*60*HZ)) { @@ -865,8 +869,8 @@ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = READ_POSITION; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, 20, SCSI_DATA_READ, STp->timeout, - MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, 20, DMA_FROM_DEVICE, STp->timeout, + MAX_RETRIES, 1); retval = ( STp->buffer->syscall_result || (STp->buffer)->b_data[15] > 25 ); STp->buffer->b_data = olddata; STp->buffer->buffer_size = oldsize; @@ -911,8 +915,8 @@ if (debugging) printk(OSST_DEB_MSG "%s:D: Reading frame from OnStream tape\n", name); #endif - SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, OS_FRAME_SIZE, SCSI_DATA_READ, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, OS_FRAME_SIZE, DMA_FROM_DEVICE, + STp->timeout, MAX_RETRIES, 1); *aSRpnt = SRpnt; if (!SRpnt) return (-EBUSY); @@ -987,7 +991,7 @@ #if DEBUG printk(OSST_DEB_MSG "%s:D: Start Read Ahead on OnStream tape\n", name); #endif - SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, SCSI_DATA_NONE, STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, 0, DMA_NONE, STp->timeout, MAX_RETRIES, 1); *aSRpnt = SRpnt; if ((retval = STp->buffer->syscall_result)) printk(KERN_WARNING "%s:W: Error starting read ahead\n", name); @@ -1120,7 +1124,7 @@ "%s:D: Exit get logical frame (%d=>%d) from OnStream tape with code %d\n", name, frame_seq_number, STp->frame_seq_number, STps->eof); #endif - STp->fast_open = FALSE; + STp->fast_open = 0; STp->read_error_frame = 0; return (STps->eof); } @@ -1368,8 +1372,8 @@ cmd[7] = 32768 >> 8; cmd[8] = 32768 & 0xff; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, OS_FRAME_SIZE, SCSI_DATA_READ, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, OS_FRAME_SIZE, DMA_FROM_DEVICE, + STp->timeout, MAX_RETRIES, 1); if ((STp->buffer)->syscall_result || !SRpnt) { printk(KERN_ERR "%s:E: Failed to read frame back from OnStream buffer\n", name); @@ -1440,8 +1444,8 @@ name, new_frame+i, frame_seq_number+i, logical_blk_num + i*blks_per_frame, p[0], p[1], p[2], p[3]); #endif - SRpnt = osst_do_scsi(SRpnt, STp, cmd, OS_FRAME_SIZE, SCSI_DATA_WRITE, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, OS_FRAME_SIZE, DMA_TO_DEVICE, + STp->timeout, MAX_RETRIES, 1); if (STp->buffer->syscall_result) flag = 1; @@ -1456,8 +1460,8 @@ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = WRITE_FILEMARKS; cmd[1] = 1; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, SCSI_DATA_NONE, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, + STp->timeout, MAX_RETRIES, 1); #if DEBUG if (debugging) { printk(OSST_DEB_MSG "%s:D: Sleeping in re-write wait ready\n", name); @@ -1471,8 +1475,8 @@ memset(cmd, 0, MAX_COMMAND_SIZE); cmd[0] = TEST_UNIT_READY; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, SCSI_DATA_NONE, STp->timeout, - MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, STp->timeout, + MAX_RETRIES, 1); if (SRpnt->sr_sense_buffer[2] == 2 && SRpnt->sr_sense_buffer[12] == 4 && (SRpnt->sr_sense_buffer[13] == 1 || SRpnt->sr_sense_buffer[13] == 8)) { @@ -1577,8 +1581,8 @@ printk(OSST_DEB_MSG "%s:D: About to write pending fseq %d at fppos %d\n", name, STp->frame_seq_number-1, STp->first_frame_position); #endif - SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, OS_FRAME_SIZE, SCSI_DATA_WRITE, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, OS_FRAME_SIZE, DMA_TO_DEVICE, + STp->timeout, MAX_RETRIES, 1); *aSRpnt = SRpnt; if (STp->buffer->syscall_result) { /* additional write error */ @@ -2036,7 +2040,7 @@ if (debugging) printk(OSST_DEB_MSG "%s:D: Setting number of retries on OnStream tape to %d\n", name, retries); - SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], SCSI_DATA_WRITE, STp->timeout, 0, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_TO_DEVICE, STp->timeout, 0, 1); *aSRpnt = SRpnt; if ((STp->buffer)->syscall_result) @@ -2576,7 +2580,7 @@ cmd[2] = BLOCK_SIZE_PAGE; cmd[4] = BLOCK_SIZE_PAGE_LENGTH + MODE_HEADER_LENGTH; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], SCSI_DATA_READ, STp->timeout, 0, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_FROM_DEVICE, STp->timeout, 0, 1); if (SRpnt == NULL) { #if DEBUG printk(OSST_DEB_MSG "osst :D: Busy\n"); @@ -2613,7 +2617,7 @@ cmd[1] = 0x10; cmd[4] = BLOCK_SIZE_PAGE_LENGTH + MODE_HEADER_LENGTH; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], SCSI_DATA_WRITE, STp->timeout, 0, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_TO_DEVICE, STp->timeout, 0, 1); *aSRpnt = SRpnt; if ((STp->buffer)->syscall_result != 0) { printk (KERN_ERR "%s:E: Couldn't set tape block size mode page\n", name); @@ -2653,7 +2657,7 @@ (STp->buffer)->b_data[MODE_HEADER_LENGTH + 6] = 0; (STp->buffer)->b_data[MODE_HEADER_LENGTH + 7] = 0; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], SCSI_DATA_WRITE, STp->timeout, 0, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_TO_DEVICE, STp->timeout, 0, 1); *aSRpnt = SRpnt; if ((STp->buffer)->syscall_result != 0) { @@ -2668,7 +2672,7 @@ cmd[2] = CAPABILITIES_PAGE; cmd[4] = CAPABILITIES_PAGE_LENGTH + MODE_HEADER_LENGTH; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], SCSI_DATA_READ, STp->timeout, 0, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_FROM_DEVICE, STp->timeout, 0, 1); *aSRpnt = SRpnt; if ((STp->buffer)->syscall_result != 0) { @@ -2688,7 +2692,7 @@ cmd[2] = TAPE_PARAMTR_PAGE; cmd[4] = TAPE_PARAMTR_PAGE_LENGTH + MODE_HEADER_LENGTH; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], SCSI_DATA_READ, STp->timeout, 0, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_FROM_DEVICE, STp->timeout, 0, 1); *aSRpnt = SRpnt; if ((STp->buffer)->syscall_result != 0) { @@ -2762,8 +2766,8 @@ scmd[0] = READ_POSITION; STp->buffer->b_data = mybuf; STp->buffer->buffer_size = 24; - SRpnt = osst_do_scsi(*aSRpnt, STp, scmd, 20, SCSI_DATA_READ, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(*aSRpnt, STp, scmd, 20, DMA_FROM_DEVICE, + STp->timeout, MAX_RETRIES, 1); if (!SRpnt) { STp->buffer->b_data = olddata; STp->buffer->buffer_size = oldsize; return (-EBUSY); @@ -2782,8 +2786,8 @@ memset (scmd, 0, MAX_COMMAND_SIZE); scmd[0] = READ_POSITION; STp->buffer->b_data = mybuf; STp->buffer->buffer_size = 24; - SRpnt = osst_do_scsi(SRpnt, STp, scmd, 20, SCSI_DATA_READ, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, scmd, 20, DMA_FROM_DEVICE, + STp->timeout, MAX_RETRIES, 1); #if DEBUG printk(OSST_DEB_MSG "%s:D: Reread position, reason=[%02x:%02x:%02x], result=[%s%02x:%02x:%02x]\n", name, mysense[2], mysense[12], mysense[13], STp->buffer->syscall_result?"":"ok:", @@ -2861,8 +2865,8 @@ if (skip) scmd[9] = 0x80; - SRpnt = osst_do_scsi(*aSRpnt, STp, scmd, 0, SCSI_DATA_NONE, STp->long_timeout, - MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(*aSRpnt, STp, scmd, 0, DMA_NONE, STp->long_timeout, + MAX_RETRIES, 1); if (!SRpnt) return (-EBUSY); *aSRpnt = SRpnt; @@ -2999,8 +3003,8 @@ name, offset, transfer, blks); #endif - SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, transfer, SCSI_DATA_WRITE, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, transfer, DMA_TO_DEVICE, + STp->timeout, MAX_RETRIES, 1); *aSRpnt = SRpnt; if (!SRpnt) return (-EBUSY); @@ -3082,7 +3086,7 @@ if (!seek_next) { if (STps->eof == ST_FM_HIT) { - result = cross_eof(STp, aSRpnt, FALSE); /* Back over the EOF hit */ + result = cross_eof(STp, aSRpnt, 0); /* Back over the EOF hit */ if (!result) STps->eof = ST_NOEOF; else { @@ -3156,7 +3160,7 @@ if (!synchronous) STp->write_pending = 1; #endif - SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, OS_FRAME_SIZE, SCSI_DATA_WRITE, STp->timeout, + SRpnt = osst_do_scsi(*aSRpnt, STp, cmd, OS_FRAME_SIZE, DMA_TO_DEVICE, STp->timeout, MAX_RETRIES, synchronous); if (!SRpnt) return (-EBUSY); @@ -3218,7 +3222,7 @@ STps->rw = ST_IDLE; STps->eof = ST_NOEOF; STps->at_sm = 0; - STps->last_block_valid = FALSE; + STps->last_block_valid = 0; STps->drv_block = -1; STps->drv_file = -1; } @@ -3372,7 +3376,7 @@ #endif } } - STp->fast_open = FALSE; + STp->fast_open = 0; } if (!STp->header_ok) { #if DEBUG @@ -3447,7 +3451,7 @@ blks = do_count / STp->block_size; STp->logical_blk_num += blks; /* logical_blk_num is incremented as data is moved from user */ - i = osst_write_frame(STp, &SRpnt, TRUE); + i = osst_write_frame(STp, &SRpnt, 1); if (i == (-ENOSPC)) { transfer = STp->buffer->writing; /* FIXME -- check this logic */ @@ -3528,7 +3532,7 @@ STp->dirty = !((STp->buffer)->writing == (STp->buffer)->buffer_bytes); - i = osst_write_frame(STp, &SRpnt, FALSE); + i = osst_write_frame(STp, &SRpnt, 0); if (i < 0) { retval = (-EIO); goto out; @@ -3769,7 +3773,7 @@ STm = &(STp->modes[STp->current_mode]); if (!STm->defined) { memcpy(STm, &(STp->modes[0]), sizeof(*STm)); - modes_defined = TRUE; + modes_defined = 1; #if DEBUG if (debugging) printk(OSST_DEB_MSG "%s:D: Initialized mode %d definition from mode 0\n", @@ -3921,12 +3925,12 @@ int timeout; long ltmp; int i, ioctl_result; - int chg_eof = TRUE; + int chg_eof = 1; unsigned char cmd[MAX_COMMAND_SIZE]; struct scsi_request * SRpnt = * aSRpnt; struct st_partstat * STps; int fileno, blkno, at_sm, frame_seq_numbr, logical_blk_num; - int datalen = 0, direction = SCSI_DATA_NONE; + int datalen = 0, direction = DMA_NONE; char * name = tape_name(STp); if (STp->ready != ST_READY && cmd_in != MTLOAD) { @@ -3946,7 +3950,7 @@ memset(cmd, 0, MAX_COMMAND_SIZE); switch (cmd_in) { case MTFSFM: - chg_eof = FALSE; /* Changed from the FSF after this */ + chg_eof = 0; /* Changed from the FSF after this */ case MTFSF: if (STp->raw) return (-EIO); @@ -3961,7 +3965,7 @@ goto os_bypass; case MTBSF: - chg_eof = FALSE; /* Changed from the FSF after this */ + chg_eof = 0; /* Changed from the FSF after this */ case MTBSFM: if (STp->raw) return (-EIO); @@ -4176,7 +4180,7 @@ case MTSETDENSITY: /* Set tape density */ case MTSETDRVBUFFER: /* Set drive buffering */ case SET_DENS_AND_BLK: /* Set density and block size */ - chg_eof = FALSE; + chg_eof = 0; if (STp->dirty || (STp->buffer)->buffer_bytes != 0) return (-EIO); /* Not allowed if data in buffer */ if ((cmd_in == MTSETBLK || cmd_in == SET_DENS_AND_BLK) && @@ -4193,7 +4197,7 @@ return (-ENOSYS); } - SRpnt = osst_do_scsi(SRpnt, STp, cmd, datalen, direction, timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, datalen, direction, timeout, MAX_RETRIES, 1); ioctl_result = (STp->buffer)->syscall_result; @@ -4249,7 +4253,7 @@ else if (cmd_in == MTLOAD) { for (i=0; i < ST_NBR_PARTITIONS; i++) { STp->ps[i].rw = ST_IDLE; - STp->ps[i].last_block_valid = FALSE;/* FIXME - where else is this field maintained? */ + STp->ps[i].last_block_valid = 0;/* FIXME - where else is this field maintained? */ } STp->partition = 0; } @@ -4304,7 +4308,7 @@ static int os_scsi_tape_open(struct inode * inode, struct file * filp) { unsigned short flags; - int i, b_size, new_session = FALSE, retval = 0; + int i, b_size, new_session = 0, retval = 0; unsigned char cmd[MAX_COMMAND_SIZE]; struct scsi_request * SRpnt = NULL; struct osst_tape * STp; @@ -4353,7 +4357,7 @@ printk(OSST_DEB_MSG "%s:D: Mode change from %d to %d.\n", name, STp->current_mode, mode); #endif - new_session = TRUE; + new_session = 1; STp->current_mode = mode; } STm = &(STp->modes[STp->current_mode]); @@ -4403,7 +4407,7 @@ memset (cmd, 0, MAX_COMMAND_SIZE); cmd[0] = TEST_UNIT_READY; - SRpnt = osst_do_scsi(NULL, STp, cmd, 0, SCSI_DATA_NONE, STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(NULL, STp, cmd, 0, DMA_NONE, STp->timeout, MAX_RETRIES, 1); if (!SRpnt) { retval = (STp->buffer)->syscall_result; /* FIXME - valid? */ goto err_out; @@ -4423,8 +4427,8 @@ cmd[0] = START_STOP; cmd[1] = 1; cmd[4] = 1; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, SCSI_DATA_NONE, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, + STp->timeout, MAX_RETRIES, 1); } osst_wait_ready(STp, &SRpnt, (SRpnt->sr_sense_buffer[13]==1?15:3) * 60, 0); } @@ -4440,8 +4444,8 @@ memset (cmd, 0, MAX_COMMAND_SIZE); cmd[0] = TEST_UNIT_READY; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, SCSI_DATA_NONE, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, + STp->timeout, MAX_RETRIES, 1); if ((SRpnt->sr_sense_buffer[0] & 0x70) != 0x70 || (SRpnt->sr_sense_buffer[2] & 0x0f) != UNIT_ATTENTION) break; @@ -4456,11 +4460,11 @@ STps->rw = ST_IDLE; /* FIXME - seems to be redundant... */ STps->eof = ST_NOEOF; STps->at_sm = 0; - STps->last_block_valid = FALSE; + STps->last_block_valid = 0; STps->drv_block = 0; STps->drv_file = 0 ; } - new_session = TRUE; + new_session = 1; STp->recover_count = 0; STp->abort_count = 0; } @@ -4477,7 +4481,7 @@ cmd[2] = VENDOR_IDENT_PAGE; cmd[4] = VENDOR_IDENT_PAGE_LENGTH + MODE_HEADER_LENGTH; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], SCSI_DATA_READ, STp->timeout, 0, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_FROM_DEVICE, STp->timeout, 0, 1); if (STp->buffer->syscall_result || STp->buffer->b_data[MODE_HEADER_LENGTH + 2] != 'L' || @@ -4507,7 +4511,7 @@ STp->buffer->buffer_bytes = STp->buffer->read_pointer = 0; } STp->buffer->buffer_blocks = OS_DATA_SIZE / STp->block_size; - STp->fast_open = TRUE; + STp->fast_open = 1; scsi_release_request(SRpnt); return 0; } @@ -4518,7 +4522,7 @@ #endif STp->header_ok = 0; } - STp->fast_open = FALSE; + STp->fast_open = 0; if ((STp->buffer)->syscall_result != 0 && /* in all error conditions except no medium */ (SRpnt->sr_sense_buffer[2] != 2 || SRpnt->sr_sense_buffer[12] != 0x3A) ) { @@ -4540,7 +4544,7 @@ #if DEBUG printk(OSST_DEB_MSG "%s:D: Applying soft reset\n", name); #endif - SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], SCSI_DATA_WRITE, STp->timeout, 0, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, cmd[4], DMA_TO_DEVICE, STp->timeout, 0, 1); STp->header_ok = 0; @@ -4549,8 +4553,8 @@ memset (cmd, 0, MAX_COMMAND_SIZE); cmd[0] = TEST_UNIT_READY; - SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, SCSI_DATA_NONE, - STp->timeout, MAX_RETRIES, TRUE); + SRpnt = osst_do_scsi(SRpnt, STp, cmd, 0, DMA_NONE, + STp->timeout, MAX_RETRIES, 1); if ((SRpnt->sr_sense_buffer[0] & 0x70) != 0x70 || (SRpnt->sr_sense_buffer[2] & 0x0f) == NOT_READY) break; @@ -4565,11 +4569,11 @@ STps->rw = ST_IDLE; STps->eof = ST_NOEOF; STps->at_sm = 0; - STps->last_block_valid = FALSE; + STps->last_block_valid = 0; STps->drv_block = 0; STps->drv_file = 0 ; } - new_session = TRUE; + new_session = 1; } } } @@ -4629,8 +4633,8 @@ if (debugging) printk(OSST_DEB_MSG "%s:D: New Session\n", name); #endif - STp->density_changed = STp->blksize_changed = FALSE; - STp->compression_changed = FALSE; + STp->density_changed = STp->blksize_changed = 0; + STp->compression_changed = 0; } /* @@ -4704,7 +4708,7 @@ if (STp->can_bsr) result = osst_flush_buffer(STp, &SRpnt, 0); /* this is the default path */ else if (STps->eof == ST_FM_HIT) { - result = cross_eof(STp, &SRpnt, FALSE); + result = cross_eof(STp, &SRpnt, 0); if (result) { if (STps->drv_file >= 0) STps->drv_file++; @@ -4716,7 +4720,7 @@ } } else if ((STps->eof == ST_NOEOF && - !(result = cross_eof(STp, &SRpnt, TRUE))) || + !(result = cross_eof(STp, &SRpnt, 1))) || STps->eof == ST_FM_HIT) { if (STps->drv_file >= 0) STps->drv_file++; @@ -4971,7 +4975,7 @@ for (i=0; i < ST_NBR_PARTITIONS; i++) { STp->ps[i].rw = ST_IDLE; STp->ps[i].at_sm = 0; - STp->ps[i].last_block_valid = FALSE; + STp->ps[i].last_block_valid = 0; } STp->partition = STp->new_partition = 0; STp->nbr_partitions = 1; /* Bad guess ?-) */ @@ -4997,7 +5001,7 @@ } if (auto_weof) - cross_eof(STp, &SRpnt, FALSE); + cross_eof(STp, &SRpnt, 0); if (mtc.mt_op == MTCOMPRESSION) retval = -EINVAL; /* OnStream drives don't have compression hardware */ @@ -5013,7 +5017,7 @@ goto out; } - if ((i = osst_flush_buffer(STp, &SRpnt, FALSE)) < 0) { + if ((i = osst_flush_buffer(STp, &SRpnt, 0)) < 0) { retval = i; goto out; } @@ -5140,7 +5144,7 @@ memset(tb, 0, i); tb->sg_segs = tb->orig_sg_segs = 0; tb->use_sg = max_sg; - tb->in_use = TRUE; + tb->in_use = 1; tb->dma = need_dma; tb->buffer_size = 0; #if DEBUG @@ -5158,7 +5162,7 @@ int segs, nbr, max_segs, b_size, priority, order, got; if (STbuffer->buffer_size >= OS_FRAME_SIZE) - return TRUE; + return 1; if (STbuffer->sg_segs) { printk(KERN_WARNING "osst :A: Buffer not previously normalized.\n"); @@ -5167,7 +5171,7 @@ /* See how many segments we can use -- need at least two */ nbr = max_segs = STbuffer->use_sg; if (nbr <= 2) - return FALSE; + return 0; priority = GFP_KERNEL /* | __GFP_NOWARN */; if (need_dma) @@ -5186,7 +5190,7 @@ } if (STbuffer->sg[0].page == NULL) { printk(KERN_NOTICE "osst :I: Can't allocate tape buffer main segment.\n"); - return FALSE; + return 0; } /* Got initial segment of 'bsize,order', continue with same size if possible, except for AUX */ for (segs=STbuffer->sg_segs=1, got=b_size; @@ -5206,7 +5210,7 @@ STbuffer->buffer_size = got; #endif normalize_buffer(STbuffer); - return FALSE; + return 0; } STbuffer->sg[segs].length = (OS_FRAME_SIZE - got <= PAGE_SIZE / 2) ? (OS_FRAME_SIZE - got) : b_size; got += STbuffer->sg[segs].length; @@ -5225,7 +5229,7 @@ } #endif - return TRUE; + return 1; } @@ -5457,7 +5461,7 @@ .release = os_scsi_tape_close, }; -static int osst_supports(Scsi_Device * SDp) +static int osst_supports(struct scsi_device * SDp) { struct osst_support_data { char *vendor; @@ -5592,7 +5596,7 @@ if ( IS_ERR(osst_sysfs_class) ) printk(KERN_WARNING "osst :W: Unable to register sysfs class\n"); else - osst_sysfs_valid = TRUE; + osst_sysfs_valid = 1; } static void osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * STp, char * name) @@ -5636,7 +5640,7 @@ static int osst_probe(struct device *dev) { - Scsi_Device * SDp = to_scsi_device(dev); + struct scsi_device * SDp = to_scsi_device(dev); struct osst_tape * tpnt; struct st_modedef * STm; struct st_partstat * STps; @@ -5691,7 +5695,7 @@ i = SDp->host->sg_tablesize; if (osst_max_sg_segs < i) i = osst_max_sg_segs; - buffer = new_tape_buffer(TRUE, SDp->host->unchecked_isa_dma, i); + buffer = new_tape_buffer(1, SDp->host->unchecked_isa_dma, i); if (buffer == NULL) { write_unlock(&os_scsi_tapes_lock); printk(KERN_ERR "osst :E: Unable to allocate a tape buffer, device not attached.\n"); @@ -5741,7 +5745,7 @@ for (i=0; i < ST_NBR_MODES; i++) { STm = &(tpnt->modes[i]); - STm->defined = FALSE; + STm->defined = 0; STm->sysv = OSST_SYSV; STm->defaults_for_writes = 0; STm->do_async_writes = OSST_ASYNC_WRITES; @@ -5757,15 +5761,15 @@ STps->rw = ST_IDLE; STps->eof = ST_NOEOF; STps->at_sm = 0; - STps->last_block_valid = FALSE; + STps->last_block_valid = 0; STps->drv_block = (-1); STps->drv_file = (-1); } tpnt->current_mode = 0; - tpnt->modes[0].defined = TRUE; - tpnt->modes[2].defined = TRUE; - tpnt->density_changed = tpnt->compression_changed = tpnt->blksize_changed = FALSE; + tpnt->modes[0].defined = 1; + tpnt->modes[2].defined = 1; + tpnt->density_changed = tpnt->compression_changed = tpnt->blksize_changed = 0; init_MUTEX(&tpnt->lock); osst_nr_dev++; @@ -5804,7 +5808,7 @@ static int osst_remove(struct device *dev) { - Scsi_Device * SDp = to_scsi_device(dev); + struct scsi_device * SDp = to_scsi_device(dev); struct osst_tape * tpnt; int i, mode; diff -Nru a/drivers/scsi/osst.h b/drivers/scsi/osst.h --- a/drivers/scsi/osst.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/scsi/osst.h 2005-01-28 14:11:41 -08:00 @@ -518,7 +518,7 @@ int writing; int midlevel_result; int syscall_result; - Scsi_Request *last_SRpnt; + struct scsi_request *last_SRpnt; unsigned char *b_data; os_aux_t *aux; /* onstream AUX structure at end of each block */ unsigned short use_sg; /* zero or number of s/g segments for this adapter */ @@ -531,7 +531,7 @@ struct osst_tape { struct scsi_driver *driver; unsigned capacity; - Scsi_Device* device; + struct scsi_device *device; struct semaphore lock; /* for serialization */ struct completion wait; /* for SCSI commands */ struct osst_buffer * buffer; diff -Nru a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c --- a/drivers/scsi/sata_sil.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/sata_sil.c 2005-01-28 14:11:40 -08:00 @@ -90,6 +90,7 @@ { "ST3120023AS", SIL_QUIRK_MOD15WRITE }, { "ST3160023AS", SIL_QUIRK_MOD15WRITE }, { "ST3120026AS", SIL_QUIRK_MOD15WRITE }, + { "ST3200822AS", SIL_QUIRK_MOD15WRITE }, { "ST340014ASL", SIL_QUIRK_MOD15WRITE }, { "ST360014ASL", SIL_QUIRK_MOD15WRITE }, { "ST380011ASL", SIL_QUIRK_MOD15WRITE }, diff -Nru a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c --- a/drivers/scsi/scsi_debug.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/scsi/scsi_debug.c 2005-01-28 14:11:41 -08:00 @@ -11,7 +11,7 @@ * (or disk like devices) sharing a common amount of RAM * * - * For documentation see http://www.torque.net/sg/sdebug25.html + * For documentation see http://www.torque.net/sg/sdebug26.html * * D. Gilbert (dpg) work for Magneto-Optical device test [20010421] * dpg: work for devfs large number of disks [20010809] @@ -56,7 +56,7 @@ #include "scsi_debug.h" #define SCSI_DEBUG_VERSION "1.75" -static const char * scsi_debug_version_date = "20041023"; +static const char * scsi_debug_version_date = "20050113"; /* Additional Sense Code (ASC) used */ #define NO_ADDED_SENSE 0x0 @@ -1675,6 +1675,7 @@ driver_create_file(&sdebug_driverfs_driver, &driver_attr_add_host); driver_create_file(&sdebug_driverfs_driver, &driver_attr_delay); driver_create_file(&sdebug_driverfs_driver, &driver_attr_dev_size_mb); + driver_create_file(&sdebug_driverfs_driver, &driver_attr_dsense); driver_create_file(&sdebug_driverfs_driver, &driver_attr_every_nth); driver_create_file(&sdebug_driverfs_driver, &driver_attr_max_luns); driver_create_file(&sdebug_driverfs_driver, &driver_attr_num_tgts); @@ -1693,6 +1694,7 @@ driver_remove_file(&sdebug_driverfs_driver, &driver_attr_num_tgts); driver_remove_file(&sdebug_driverfs_driver, &driver_attr_max_luns); driver_remove_file(&sdebug_driverfs_driver, &driver_attr_every_nth); + driver_remove_file(&sdebug_driverfs_driver, &driver_attr_dsense); driver_remove_file(&sdebug_driverfs_driver, &driver_attr_dev_size_mb); driver_remove_file(&sdebug_driverfs_driver, &driver_attr_delay); driver_remove_file(&sdebug_driverfs_driver, &driver_attr_add_host); diff -Nru a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c --- a/drivers/scsi/scsi_error.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/scsi_error.c 2005-01-28 14:11:40 -08:00 @@ -1948,3 +1948,96 @@ sizeof(cmd->sense_buffer), sshdr); } EXPORT_SYMBOL(scsi_command_normalize_sense); + +/** + * scsi_sense_desc_find - search for a given descriptor type in + * descriptor sense data format. + * + * @sense_buffer: byte array of descriptor format sense data + * @sb_len: number of valid bytes in sense_buffer + * @desc_type: value of descriptor type to find + * (e.g. 0 -> information) + * + * Notes: + * only valid when sense data is in descriptor format + * + * Return value: + * pointer to start of (first) descriptor if found else NULL + **/ +const u8 * scsi_sense_desc_find(const u8 * sense_buffer, int sb_len, + int desc_type) +{ + int add_sen_len, add_len, desc_len, k; + const u8 * descp; + + if ((sb_len < 8) || (0 == (add_sen_len = sense_buffer[7]))) + return NULL; + if ((sense_buffer[0] < 0x72) || (sense_buffer[0] > 0x73)) + return NULL; + add_sen_len = (add_sen_len < (sb_len - 8)) ? + add_sen_len : (sb_len - 8); + descp = &sense_buffer[8]; + for (desc_len = 0, k = 0; k < add_sen_len; k += desc_len) { + descp += desc_len; + add_len = (k < (add_sen_len - 1)) ? descp[1]: -1; + desc_len = add_len + 2; + if (descp[0] == desc_type) + return descp; + if (add_len < 0) // short descriptor ?? + break; + } + return NULL; +} +EXPORT_SYMBOL(scsi_sense_desc_find); + +/** + * scsi_get_sense_info_fld - attempts to get information field from + * sense data (either fixed or descriptor format) + * + * @sense_buffer: byte array of sense data + * @sb_len: number of valid bytes in sense_buffer + * @info_out: pointer to 64 integer where 8 or 4 byte information + * field will be placed if found. + * + * Return value: + * 1 if information field found, 0 if not found. + **/ +int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len, + u64 * info_out) +{ + int j; + const u8 * ucp; + u64 ull; + + if (sb_len < 7) + return 0; + switch (sense_buffer[0] & 0x7f) { + case 0x70: + case 0x71: + if (sense_buffer[0] & 0x80) { + *info_out = (sense_buffer[3] << 24) + + (sense_buffer[4] << 16) + + (sense_buffer[5] << 8) + sense_buffer[6]; + return 1; + } else + return 0; + case 0x72: + case 0x73: + ucp = scsi_sense_desc_find(sense_buffer, sb_len, + 0 /* info desc */); + if (ucp && (0xa == ucp[1])) { + ull = 0; + for (j = 0; j < 8; ++j) { + if (j > 0) + ull <<= 8; + ull |= ucp[4 + j]; + } + *info_out = ull; + return 1; + } else + return 0; + default: + return 0; + } +} +EXPORT_SYMBOL(scsi_get_sense_info_fld); diff -Nru a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c --- a/drivers/scsi/scsi_lib.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/scsi_lib.c 2005-01-28 14:11:40 -08:00 @@ -498,19 +498,17 @@ /* * Function: scsi_end_request() * - * Purpose: Post-processing of completed commands called from interrupt - * handler or a bottom-half handler. + * Purpose: Post-processing of completed commands (usually invoked at end + * of upper level post-processing and scsi_io_completion). * * Arguments: cmd - command that is complete. - * uptodate - 1 if I/O indicates success, 0 for I/O error. - * sectors - number of sectors we want to mark. + * uptodate - 1 if I/O indicates success, <= 0 for I/O error. + * bytes - number of bytes of completed I/O * requeue - indicates whether we should requeue leftovers. - * frequeue - indicates that if we release the command block - * that the queue request function should be called. * * Lock status: Assumed that lock is not held upon entry. * - * Returns: Nothing + * Returns: cmd if requeue done or required, NULL otherwise * * Notes: This is called for block device requests in order to * mark some number of sectors as complete. @@ -694,8 +692,9 @@ int this_count = cmd->bufflen; request_queue_t *q = cmd->device->request_queue; struct request *req = cmd->request; - int clear_errors = 1; struct scsi_sense_hdr sshdr; + int sense_valid = 0; + int sense_deferred = 0; /* * Free up any indirection buffers we allocated for DMA purposes. @@ -714,11 +713,15 @@ kfree(cmd->buffer); } + if (result) { + sense_valid = scsi_command_normalize_sense(cmd, &sshdr); + if (sense_valid) + sense_deferred = scsi_sense_is_deferred(&sshdr); + } if (blk_pc_request(req)) { /* SG_IO ioctl from block level */ req->errors = result; if (result) { - clear_errors = 0; - if (scsi_command_normalize_sense(cmd, &sshdr)) { + if (sense_valid) { /* * SG_IO wants current and deferred errors */ @@ -742,6 +745,11 @@ cmd->request_buffer = NULL; cmd->request_bufflen = 0; + if (blk_pc_request(req)) { /* SG_IO ioctl from block level */ + scsi_end_request(cmd, 1, good_bytes, 0); + return; + } + /* * Next deal with any sectors which we were able to correctly * handle. @@ -751,8 +759,7 @@ req->nr_sectors, good_bytes)); SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n", cmd->use_sg)); - if (clear_errors) - req->errors = 0; + req->errors = 0; /* * If multiple sectors are requested in one buffer, then * they will have been finished off by the first command. @@ -779,52 +786,37 @@ * sense buffer. We can extract information from this, so we * can choose a block to remap, etc. */ - if (driver_byte(result) != 0) { - if (scsi_command_normalize_sense(cmd, &sshdr) && - !scsi_sense_is_deferred(&sshdr)) { - /* - * If the device is in the process of becoming ready, - * retry. - */ - if (sshdr.asc == 0x04 && sshdr.ascq == 0x01) { + if (sense_valid && !sense_deferred) { + switch (sshdr.sense_key) { + case UNIT_ATTENTION: + if (cmd->device->removable) { + /* detected disc change. set a bit + * and quietly refuse further access. + */ + cmd->device->changed = 1; + cmd = scsi_end_request(cmd, 0, + this_count, 1); + return; + } else { + /* + * Must have been a power glitch, or a + * bus reset. Could not have been a + * media change, so we just retry the + * request and see what happens. + */ scsi_requeue_command(q, cmd); return; } - if (sshdr.sense_key == UNIT_ATTENTION) { - if (cmd->device->removable) { - /* detected disc change. set a bit - * and quietly refuse further access. - */ - cmd->device->changed = 1; - cmd = scsi_end_request(cmd, 0, - this_count, 1); - return; - } else { - /* - * Must have been a power glitch, or a - * bus reset. Could not have been a - * media change, so we just retry the - * request and see what happens. - */ - scsi_requeue_command(q, cmd); - return; - } - } - } - /* - * If we had an ILLEGAL REQUEST returned, then we may have - * performed an unsupported command. The only thing this - * should be would be a ten byte read where only a six byte - * read was supported. Also, on a system where READ CAPACITY - * failed, we may have read past the end of the disk. - */ - - /* - * XXX: Following is probably broken since deferred errors - * fall through [dpg 20040827] - */ - switch (sshdr.sense_key) { + break; case ILLEGAL_REQUEST: + /* + * If we had an ILLEGAL REQUEST returned, then we may + * have performed an unsupported command. The only + * thing this should be would be a ten byte read where + * only a six byte read was supported. Also, on a + * system where READ CAPACITY failed, we may have read + * past the end of the disk. + */ if (cmd->device->use_10_for_rw && (cmd->cmnd[0] == READ_10 || cmd->cmnd[0] == WRITE_10)) { @@ -841,6 +833,14 @@ } break; case NOT_READY: + /* + * If the device is in the process of becoming ready, + * retry. + */ + if (sshdr.asc == 0x04 && sshdr.ascq == 0x01) { + scsi_requeue_command(q, cmd); + return; + } printk(KERN_INFO "Device %s not ready.\n", req->rq_disk ? req->rq_disk->disk_name : ""); cmd = scsi_end_request(cmd, 0, this_count, 1); diff -Nru a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h --- a/drivers/scsi/scsi_priv.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/scsi/scsi_priv.h 2005-01-28 14:11:41 -08:00 @@ -146,7 +146,7 @@ extern int scsi_sysfs_add_host(struct Scsi_Host *); extern int scsi_sysfs_register(void); extern void scsi_sysfs_unregister(void); -extern int scsi_sysfs_device_initialize(struct scsi_device *); +extern void scsi_sysfs_device_initialize(struct scsi_device *); extern int scsi_sysfs_target_initialize(struct scsi_device *); extern struct scsi_transport_template blank_transport_template; diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c --- a/drivers/scsi/scsi_scan.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/scsi/scsi_scan.c 2005-01-28 14:11:41 -08:00 @@ -254,10 +254,7 @@ sdev->request_queue->queuedata = sdev; scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun); - if (shost->transportt->device_setup) { - if (shost->transportt->device_setup(sdev)) - goto out_free_queue; - } + scsi_sysfs_device_initialize(sdev); if (shost->hostt->slave_alloc) { ret = shost->hostt->slave_alloc(sdev); @@ -272,10 +269,6 @@ } } - if (scsi_sysfs_device_initialize(sdev) != 0) - goto out_cleanup_slave; - - /* NOTE: this target initialisation code depends critically on * lun scanning being sequential. */ if (scsi_sysfs_target_initialize(sdev)) @@ -288,13 +281,11 @@ list_del(&sdev->siblings); list_del(&sdev->same_target_siblings); spin_unlock_irqrestore(shost->host_lock, flags); -out_cleanup_slave: + if (shost->hostt->slave_destroy) shost->hostt->slave_destroy(sdev); out_device_destroy: - if (shost->transportt->device_destroy) - shost->transportt->device_destroy(sdev); -out_free_queue: + transport_destroy_device(&sdev->sdev_gendev); scsi_free_queue(sdev->request_queue); out_free_dev: kfree(sdev); @@ -629,8 +620,7 @@ if (*bflags & BLIST_NOT_LOCKABLE) sdev->lockable = 0; - if (sdev->host->transportt->device_configure) - sdev->host->transportt->device_configure(sdev); + transport_configure_device(&sdev->sdev_gendev); if (sdev->host->hostt->slave_configure) sdev->host->hostt->slave_configure(sdev); @@ -749,8 +739,7 @@ } else { if (sdev->host->hostt->slave_destroy) sdev->host->hostt->slave_destroy(sdev); - if (sdev->host->transportt->device_destroy) - sdev->host->transportt->device_destroy(sdev); + transport_destroy_device(&sdev->sdev_gendev); put_device(&sdev->sdev_gendev); } out: @@ -1330,8 +1319,7 @@ if (sdev->host->hostt->slave_destroy) sdev->host->hostt->slave_destroy(sdev); - if (sdev->host->transportt->device_destroy) - sdev->host->transportt->device_destroy(sdev); + transport_destroy_device(&sdev->sdev_gendev); put_device(&sdev->sdev_gendev); } EXPORT_SYMBOL(scsi_free_host_dev); diff -Nru a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c --- a/drivers/scsi/scsi_sysfs.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/scsi_sysfs.c 2005-01-28 14:11:40 -08:00 @@ -170,14 +170,12 @@ if (delete) { struct scsi_target *starget = to_scsi_target(parent); - struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); if (!starget->create) { - if (shost->transportt->target_destroy) - shost->transportt->target_destroy(starget); + transport_remove_device(&starget->dev); device_del(parent); - if (starget->transport_classdev.class) - class_device_unregister(&starget->transport_classdev); } + transport_destroy_device(&starget->dev); + put_device(parent); } if (sdev->request_queue) @@ -553,7 +551,6 @@ **/ int scsi_sysfs_add_sdev(struct scsi_device *sdev) { - struct class_device_attribute **attrs; struct scsi_target *starget = sdev->sdev_target; struct Scsi_Host *shost = sdev->host; int error, i, create; @@ -570,31 +567,7 @@ printk(KERN_ERR "Target device_add failed\n"); return error; } - if (starget->transport_classdev.class) { - int i; - struct class_device_attribute **attrs = - sdev->host->transportt->target_attrs; - - error = class_device_add(&starget->transport_classdev); - if (error) { - dev_printk(KERN_ERR, &starget->dev, - "Target transport add failed\n"); - return error; - } - - /* take a reference for the transport_classdev; this - * is released by the transport_class .release */ - get_device(&starget->dev); - for (i = 0; attrs[i]; i++) { - error = class_device_create_file(&starget->transport_classdev, - attrs[i]); - if (error) { - dev_printk(KERN_ERR, &starget->dev, - "Target transport attr add failed\n"); - return error; - } - } - } + transport_add_device(&starget->dev); } if ((error = scsi_device_set_state(sdev, SDEV_RUNNING)) != 0) @@ -606,25 +579,15 @@ printk(KERN_INFO "error 1\n"); return error; } - error = class_device_add(&sdev->sdev_classdev); if (error) { printk(KERN_INFO "error 2\n"); goto clean_device; } + /* take a reference for the sdev_classdev; this is * released by the sdev_class .release */ get_device(&sdev->sdev_gendev); - if (sdev->transport_classdev.class) { - error = class_device_add(&sdev->transport_classdev); - if (error) - goto clean_device2; - /* take a reference for the transport_classdev; this - * is released by the transport_class .release */ - get_device(&sdev->sdev_gendev); - - } - if (sdev->host->hostt->sdev_attrs) { for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) { error = attr_add(&sdev->sdev_gendev, @@ -650,27 +613,16 @@ } } - if (sdev->transport_classdev.class) { - attrs = sdev->host->transportt->device_attrs; - for (i = 0; attrs[i]; i++) { - error = class_device_create_file(&sdev->transport_classdev, - attrs[i]); - if (error) { - scsi_remove_device(sdev); - goto out; - } - } - } - + transport_add_device(&sdev->sdev_gendev); out: return error; - clean_device2: class_device_del(&sdev->sdev_classdev); clean_device: scsi_device_set_state(sdev, SDEV_CANCEL); device_del(&sdev->sdev_gendev); + transport_destroy_device(&sdev->sdev_gendev); put_device(&sdev->sdev_gendev); return error; @@ -689,14 +641,11 @@ goto out; class_device_unregister(&sdev->sdev_classdev); - if (sdev->transport_classdev.class) - class_device_unregister(&sdev->transport_classdev); device_del(&sdev->sdev_gendev); scsi_device_set_state(sdev, SDEV_DEL); if (sdev->host->hostt->slave_destroy) sdev->host->hostt->slave_destroy(sdev); - if (sdev->host->transportt->device_destroy) - sdev->host->transportt->device_destroy(sdev); + transport_unregister_device(&sdev->sdev_gendev); put_device(&sdev->sdev_gendev); out: @@ -786,41 +735,11 @@ } } - class_device_initialize(&shost->transport_classdev); - shost->transport_classdev.class = shost->transportt->host_class; - shost->transport_classdev.dev = &shost->shost_gendev; - snprintf(shost->transport_classdev.class_id, BUS_ID_SIZE, - "host%d", shost->host_no); - - if (shost->transport_classdev.class) { - struct class_device_attribute **attrs = - shost->transportt->host_attrs; - error = class_device_add(&shost->transport_classdev); - if (error) - return error; - /* take a reference for the transport_classdev; this - * is released by the transport_class .release */ - get_device(&shost->shost_gendev); - for (i = 0; attrs[i]; i++) { - error = class_device_create_file(&shost->transport_classdev, - attrs[i]); - if (error) - return error; - } - - if (shost->transportt->host_statistics) { - error = sysfs_create_group( - &shost->transport_classdev.kobj, - shost->transportt->host_statistics); - if (error) - return error; - } - } - + transport_register_device(&shost->shost_gendev); return 0; } -int scsi_sysfs_device_initialize(struct scsi_device *sdev) +void scsi_sysfs_device_initialize(struct scsi_device *sdev) { device_initialize(&sdev->sdev_gendev); sdev->sdev_gendev.bus = &scsi_bus_type; @@ -836,14 +755,14 @@ "%d:%d:%d:%d", sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); - class_device_initialize(&sdev->transport_classdev); - sdev->transport_classdev.dev = &sdev->sdev_gendev; - sdev->transport_classdev.class = sdev->host->transportt->device_class; - snprintf(sdev->transport_classdev.class_id, BUS_ID_SIZE, - "%d:%d:%d:%d", sdev->host->host_no, - sdev->channel, sdev->id, sdev->lun); - return 0; + transport_setup_device(&sdev->sdev_gendev); +} + +int scsi_is_sdev_device(const struct device *dev) +{ + return dev->release == scsi_device_dev_release; } +EXPORT_SYMBOL(scsi_is_sdev_device); int scsi_sysfs_target_initialize(struct scsi_device *sdev) { @@ -886,12 +805,6 @@ dev->release = scsi_target_dev_release; sprintf(dev->bus_id, "target%d:%d:%d", shost->host_no, sdev->channel, sdev->id); - class_device_initialize(&starget->transport_classdev); - starget->transport_classdev.dev = &starget->dev; - starget->transport_classdev.class = shost->transportt->target_class; - snprintf(starget->transport_classdev.class_id, BUS_ID_SIZE, - "target%d:%d:%d", - shost->host_no, sdev->channel, sdev->id); starget->id = sdev->id; starget->channel = sdev->channel; create = starget->create = 1; @@ -907,10 +820,16 @@ sdev->sdev_target = starget; list_add_tail(&sdev->siblings, &shost->__devices); spin_unlock_irqrestore(shost->host_lock, flags); - if (create && shost->transportt->target_setup) - shost->transportt->target_setup(starget); + if (create) + transport_setup_device(&starget->dev); return 0; } + +int scsi_is_target_device(const struct device *dev) +{ + return dev->release == scsi_target_dev_release; +} +EXPORT_SYMBOL(scsi_is_target_device); /* A blank transport template that is used in drivers that don't * yet implement Transport Attributes */ diff -Nru a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c --- a/drivers/scsi/scsi_transport_fc.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/scsi_transport_fc.c 2005-01-28 14:11:40 -08:00 @@ -180,8 +180,6 @@ -static void transport_class_release(struct class_device *class_dev); -static void host_class_release(struct class_device *class_dev); static void fc_timeout_blocked_host(void *data); static void fc_timeout_blocked_tgt(void *data); @@ -207,32 +205,9 @@ #define to_fc_internal(tmpl) container_of(tmpl, struct fc_internal, t) -struct class fc_transport_class = { - .name = "fc_transport", - .release = transport_class_release, -}; - -struct class fc_host_class = { - .name = "fc_host", - .release = host_class_release, -}; - -static __init int fc_transport_init(void) -{ - int error = class_register(&fc_host_class); - if (error) - return error; - return class_register(&fc_transport_class); -} - -static void __exit fc_transport_exit(void) -{ - class_unregister(&fc_transport_class); - class_unregister(&fc_host_class); -} - -static int fc_setup_starget_transport_attrs(struct scsi_target *starget) +static int fc_add_target(struct device *dev) { + struct scsi_target *starget = to_scsi_target(dev); /* * Set default values easily detected by the midlayer as * failure cases. The scsi lldd is responsible for initializing @@ -247,15 +222,24 @@ return 0; } -static void fc_destroy_starget(struct scsi_target *starget) +static int fc_remove_target(struct device *dev) { + struct scsi_target *starget = to_scsi_target(dev); /* Stop the target timer */ if (cancel_delayed_work(&fc_starget_dev_loss_work(starget))) flush_scheduled_work(); + return 0; } -static int fc_setup_host_transport_attrs(struct Scsi_Host *shost) +static DECLARE_TRANSPORT_CLASS(fc_transport_class, + "fc_transport", + fc_add_target, + fc_remove_target, + NULL); + +static int fc_add_host(struct device *dev) { + struct Scsi_Host *shost = dev_to_shost(dev); /* * Set default values easily detected by the midlayer as * failure cases. The scsi lldd is responsible for initializing @@ -297,26 +281,35 @@ return 0; } -static void fc_destroy_host(struct Scsi_Host *shost) +static int fc_remove_host(struct device *dev) { + struct Scsi_Host *shost = dev_to_shost(dev); /* Stop the host timer */ if (cancel_delayed_work(&fc_host_link_down_work(shost))) flush_scheduled_work(); + return 0; } -static void transport_class_release(struct class_device *class_dev) +static DECLARE_TRANSPORT_CLASS(fc_host_class, + "fc_host", + fc_add_host, + fc_remove_host, + NULL); + +static __init int fc_transport_init(void) { - struct scsi_target *starget = transport_class_to_starget(class_dev); - put_device(&starget->dev); + int error = transport_class_register(&fc_host_class); + if (error) + return error; + return transport_class_register(&fc_transport_class); } -static void host_class_release(struct class_device *class_dev) +static void __exit fc_transport_exit(void) { - struct Scsi_Host *shost = transport_class_to_shost(class_dev); - put_device(&shost->shost_gendev); + transport_class_unregister(&fc_transport_class); + transport_class_unregister(&fc_host_class); } - /* * Remote Port (Target) Attribute Management */ @@ -731,6 +724,35 @@ .attrs = fc_statistics_attrs, }; +static int fc_host_match(struct attribute_container *cont, + struct device *dev) +{ + struct Scsi_Host *shost; + + if (!scsi_is_host_device(dev)) + return 0; + + shost = dev_to_shost(dev); + if (!shost->transportt || shost->transportt->host_attrs.class + != &fc_host_class.class) + return 0; + return 1; +} + +static int fc_target_match(struct attribute_container *cont, + struct device *dev) +{ + struct Scsi_Host *shost; + + if (!scsi_is_target_device(dev)) + return 0; + + shost = dev_to_shost(dev->parent); + if (!shost->transportt || shost->transportt->host_attrs.class + != &fc_host_class.class) + return 0; + return 1; +} struct scsi_transport_template * @@ -745,16 +767,16 @@ memset(i, 0, sizeof(struct fc_internal)); - i->t.target_attrs = &i->starget_attrs[0]; - i->t.target_class = &fc_transport_class; - i->t.target_setup = &fc_setup_starget_transport_attrs; - i->t.target_destroy = &fc_destroy_starget; + i->t.target_attrs.attrs = &i->starget_attrs[0]; + i->t.target_attrs.class = &fc_transport_class.class; + i->t.target_attrs.match = fc_target_match; + attribute_container_register(&i->t.target_attrs); i->t.target_size = sizeof(struct fc_starget_attrs); - i->t.host_attrs = &i->host_attrs[0]; - i->t.host_class = &fc_host_class; - i->t.host_setup = &fc_setup_host_transport_attrs; - i->t.host_destroy = &fc_destroy_host; + i->t.host_attrs.attrs = &i->host_attrs[0]; + i->t.host_attrs.class = &fc_host_class.class; + i->t.host_attrs.match = fc_host_match; + attribute_container_register(&i->t.host_attrs); i->t.host_size = sizeof(struct fc_host_attrs); if (ft->get_fc_host_stats) diff -Nru a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c --- a/drivers/scsi/scsi_transport_iscsi.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/scsi_transport_iscsi.c 2005-01-28 14:11:40 -08:00 @@ -40,28 +40,17 @@ #define to_iscsi_internal(tmpl) container_of(tmpl, struct iscsi_internal, t) -static void iscsi_transport_class_release(struct class_device *class_dev) -{ - struct scsi_target *starget = transport_class_to_starget(class_dev); - put_device(&starget->dev); -} - -struct class iscsi_transport_class = { - .name = "iscsi_transport_class", - .release = iscsi_transport_class_release, -}; - -static void iscsi_host_class_release(struct class_device *class_dev) -{ - struct Scsi_Host *shost = transport_class_to_shost(class_dev); - put_device(&shost->shost_gendev); -} - -struct class iscsi_host_class = { - .name = "iscsi_host", - .release = iscsi_host_class_release, -}; - +static DECLARE_TRANSPORT_CLASS(iscsi_transport_class, + "iscsi_transport", + NULL, + NULL, + NULL); + +static DECLARE_TRANSPORT_CLASS(iscsi_host_class, + "iscsi_host", + NULL, + NULL, + NULL); /* * iSCSI target and session attrs */ @@ -265,6 +254,36 @@ count++; \ } +static int iscsi_host_match(struct attribute_container *cont, + struct device *dev) +{ + struct Scsi_Host *shost; + + if (!scsi_is_host_device(dev)) + return 0; + + shost = dev_to_shost(dev); + if (!shost->transportt || shost->transportt->host_attrs.class + != &iscsi_host_class.class) + return 0; + return 1; +} + +static int iscsi_target_match(struct attribute_container *cont, + struct device *dev) +{ + struct Scsi_Host *shost; + + if (!scsi_is_target_device(dev)) + return 0; + + shost = dev_to_shost(dev->parent); + if (!shost->transportt || shost->transportt->host_attrs.class + != &iscsi_host_class.class) + return 0; + return 1; +} + struct scsi_transport_template * iscsi_attach_transport(struct iscsi_function_template *fnt) { @@ -278,9 +297,10 @@ memset(i, 0, sizeof(struct iscsi_internal)); i->fnt = fnt; - i->t.target_attrs = &i->session_attrs[0]; - i->t.target_class = &iscsi_transport_class; - i->t.target_setup = NULL; + i->t.target_attrs.attrs = &i->session_attrs[0]; + i->t.target_attrs.class = &iscsi_transport_class.class; + i->t.target_attrs.match = iscsi_target_match; + attribute_container_register(&i->t.target_attrs); i->t.target_size = sizeof(struct iscsi_class_session); SETUP_SESSION_RD_ATTR(tsih); @@ -307,9 +327,10 @@ BUG_ON(count > ISCSI_SESSION_ATTRS); i->session_attrs[count] = NULL; - i->t.host_attrs = &i->host_attrs[0]; - i->t.host_class = &iscsi_host_class; - i->t.host_setup = NULL; + i->t.host_attrs.attrs = &i->host_attrs[0]; + i->t.host_attrs.class = &iscsi_host_class.class; + i->t.host_attrs.match = iscsi_host_match; + attribute_container_register(&i->t.host_attrs); i->t.host_size = 0; count = 0; @@ -334,17 +355,17 @@ static __init int iscsi_transport_init(void) { - int err = class_register(&iscsi_transport_class); + int err = transport_class_register(&iscsi_transport_class); if (err) return err; - return class_register(&iscsi_host_class); + return transport_class_register(&iscsi_host_class); } static void __exit iscsi_transport_exit(void) { - class_unregister(&iscsi_host_class); - class_unregister(&iscsi_transport_class); + transport_class_unregister(&iscsi_host_class); + transport_class_unregister(&iscsi_transport_class); } module_init(iscsi_transport_init); diff -Nru a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c --- a/drivers/scsi/scsi_transport_spi.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/scsi_transport_spi.c 2005-01-28 14:11:40 -08:00 @@ -2,6 +2,7 @@ * Parallel SCSI (SPI) transport specific attributes exported to sysfs. * * Copyright (c) 2003 Silicon Graphics, Inc. All rights reserved. + * Copyright (c) 2004, 2005 James Bottomley * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,9 +38,6 @@ #define SPI_PRINTK(x, l, f, a...) dev_printk(l, &(x)->dev, f , ##a) -static void transport_class_release(struct class_device *class_dev); -static void host_class_release(struct class_device *class_dev); - #define SPI_NUM_ATTRS 10 /* increase this if you add attributes */ #define SPI_OTHER_ATTRS 1 /* Increase this if you add "always * on" attributes */ @@ -119,40 +117,39 @@ return SPI_SIGNAL_UNKNOWN; } +static int spi_host_setup(struct device *dev) +{ + struct Scsi_Host *shost = dev_to_shost(dev); -struct class spi_transport_class = { - .name = "spi_transport", - .release = transport_class_release, -}; - -struct class spi_host_class = { - .name = "spi_host", - .release = host_class_release, -}; + spi_signalling(shost) = SPI_SIGNAL_UNKNOWN; -static __init int spi_transport_init(void) -{ - int error = class_register(&spi_host_class); - if (error) - return error; - return class_register(&spi_transport_class); + return 0; } -static void __exit spi_transport_exit(void) -{ - class_unregister(&spi_transport_class); - class_unregister(&spi_host_class); -} +static DECLARE_TRANSPORT_CLASS(spi_host_class, + "spi_host", + spi_host_setup, + NULL, + NULL); -static int spi_setup_host_attrs(struct Scsi_Host *shost) +static int spi_host_match(struct attribute_container *cont, + struct device *dev) { - spi_signalling(shost) = SPI_SIGNAL_UNKNOWN; + struct Scsi_Host *shost; - return 0; + if (!scsi_is_host_device(dev)) + return 0; + + shost = dev_to_shost(dev); + if (!shost->transportt || shost->transportt->host_attrs.class + != &spi_host_class.class) + return 0; + return 1; } -static int spi_configure_device(struct scsi_device *sdev) +static int spi_device_configure(struct device *dev) { + struct scsi_device *sdev = to_scsi_device(dev); struct scsi_target *starget = sdev->sdev_target; /* Populate the target capability fields with the values @@ -168,8 +165,10 @@ return 0; } -static int spi_setup_transport_attrs(struct scsi_target *starget) +static int spi_setup_transport_attrs(struct device *dev) { + struct scsi_target *starget = to_scsi_target(dev); + spi_period(starget) = -1; /* illegal value */ spi_offset(starget) = 0; /* async */ spi_width(starget) = 0; /* narrow */ @@ -187,18 +186,6 @@ return 0; } -static void transport_class_release(struct class_device *class_dev) -{ - struct scsi_target *starget = transport_class_to_starget(class_dev); - put_device(&starget->dev); -} - -static void host_class_release(struct class_device *class_dev) -{ - struct Scsi_Host *shost = transport_class_to_shost(class_dev); - put_device(&shost->shost_gendev); -} - #define spi_transport_show_function(field, format_string) \ \ static ssize_t \ @@ -823,6 +810,48 @@ i->host_attrs[count] = &i->private_host_attrs[count]; \ count++ +static int spi_device_match(struct attribute_container *cont, + struct device *dev) +{ + struct scsi_device *sdev; + struct Scsi_Host *shost; + + if (!scsi_is_sdev_device(dev)) + return 0; + + sdev = to_scsi_device(dev); + shost = sdev->host; + if (!shost->transportt || shost->transportt->host_attrs.class + != &spi_host_class.class) + return 0; + return 1; +} + +static int spi_target_match(struct attribute_container *cont, + struct device *dev) +{ + struct Scsi_Host *shost; + + if (!scsi_is_target_device(dev)) + return 0; + + shost = dev_to_shost(dev->parent); + if (!shost->transportt || shost->transportt->host_attrs.class + != &spi_host_class.class) + return 0; + return 1; +} + +static DECLARE_TRANSPORT_CLASS(spi_transport_class, + "spi_transport", + spi_setup_transport_attrs, + NULL, + NULL); + +static DECLARE_ANON_TRANSPORT_CLASS(spi_device_class, + spi_device_match, + spi_device_configure); + struct scsi_transport_template * spi_attach_transport(struct spi_function_template *ft) { @@ -835,14 +864,15 @@ memset(i, 0, sizeof(struct spi_internal)); - i->t.target_attrs = &i->attrs[0]; - i->t.target_class = &spi_transport_class; - i->t.target_setup = &spi_setup_transport_attrs; - i->t.device_configure = &spi_configure_device; + i->t.target_attrs.class = &spi_transport_class.class; + i->t.target_attrs.attrs = &i->attrs[0]; + i->t.target_attrs.match = spi_target_match; + attribute_container_register(&i->t.target_attrs); i->t.target_size = sizeof(struct spi_transport_attrs); - i->t.host_attrs = &i->host_attrs[0]; - i->t.host_class = &spi_host_class; - i->t.host_setup = &spi_setup_host_attrs; + i->t.host_attrs.class = &spi_host_class.class; + i->t.host_attrs.attrs = &i->host_attrs[0]; + i->t.host_attrs.match = spi_host_match; + attribute_container_register(&i->t.host_attrs); i->t.host_size = sizeof(struct spi_host_attrs); i->f = ft; @@ -884,6 +914,21 @@ } EXPORT_SYMBOL(spi_release_transport); +static __init int spi_transport_init(void) +{ + int error = transport_class_register(&spi_transport_class); + if (error) + return error; + error = anon_transport_class_register(&spi_device_class); + return transport_class_register(&spi_host_class); +} + +static void __exit spi_transport_exit(void) +{ + transport_class_unregister(&spi_transport_class); + anon_transport_class_unregister(&spi_device_class); + transport_class_unregister(&spi_host_class); +} MODULE_AUTHOR("Martin Hicks"); MODULE_DESCRIPTION("SPI Transport Attributes"); diff -Nru a/drivers/scsi/sd.c b/drivers/scsi/sd.c --- a/drivers/scsi/sd.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/scsi/sd.c 2005-01-28 14:11:41 -08:00 @@ -87,6 +87,7 @@ * Number of allowed retries */ #define SD_MAX_RETRIES 5 +#define SD_PASSTHROUGH_RETRIES 1 static void scsi_disk_release(struct kref *kref); @@ -197,9 +198,11 @@ static void scsi_disk_put(struct scsi_disk *sdkp) { + struct scsi_device *sdev = sdkp->device; + down(&sd_ref_sem); kref_put(&sdkp->kref, scsi_disk_release); - scsi_device_put(sdkp->device); + scsi_device_put(sdev); up(&sd_ref_sem); } @@ -217,15 +220,14 @@ struct gendisk *disk; sector_t block; struct scsi_device *sdp = SCpnt->device; + struct request *rq = SCpnt->request; timeout = sdp->timeout; /* - * these are already setup, just copy cdb basically + * SG_IO from block layer already setup, just copy cdb basically */ - if (SCpnt->request->flags & REQ_BLOCK_PC) { - struct request *rq = SCpnt->request; - + if (blk_pc_request(rq)) { if (sizeof(rq->cmd) > sizeof(SCpnt->cmnd)) return 0; @@ -242,26 +244,28 @@ timeout = rq->timeout; SCpnt->transfersize = rq->data_len; + SCpnt->allowed = SD_PASSTHROUGH_RETRIES; goto queue; } /* * we only do REQ_CMD and REQ_BLOCK_PC */ - if (!(SCpnt->request->flags & REQ_CMD)) + if (!blk_fs_request(rq)) return 0; - disk = SCpnt->request->rq_disk; - block = SCpnt->request->sector; + disk = rq->rq_disk; + block = rq->sector; this_count = SCpnt->request_bufflen >> 9; SCSI_LOG_HLQUEUE(1, printk("sd_init_command: disk=%s, block=%llu, " - "count=%d\n", disk->disk_name, (unsigned long long)block, this_count)); + "count=%d\n", disk->disk_name, + (unsigned long long)block, this_count)); if (!sdp || !scsi_device_online(sdp) || - block + SCpnt->request->nr_sectors > get_capacity(disk)) { + block + rq->nr_sectors > get_capacity(disk)) { SCSI_LOG_HLQUEUE(2, printk("Finishing %ld sectors\n", - SCpnt->request->nr_sectors)); + rq->nr_sectors)); SCSI_LOG_HLQUEUE(2, printk("Retry with 0x%p\n", SCpnt)); return 0; } @@ -289,7 +293,7 @@ * for this. */ if (sdp->sector_size == 1024) { - if ((block & 1) || (SCpnt->request->nr_sectors & 1)) { + if ((block & 1) || (rq->nr_sectors & 1)) { printk(KERN_ERR "sd: Bad block number requested"); return 0; } else { @@ -298,7 +302,7 @@ } } if (sdp->sector_size == 2048) { - if ((block & 3) || (SCpnt->request->nr_sectors & 3)) { + if ((block & 3) || (rq->nr_sectors & 3)) { printk(KERN_ERR "sd: Bad block number requested"); return 0; } else { @@ -307,7 +311,7 @@ } } if (sdp->sector_size == 4096) { - if ((block & 7) || (SCpnt->request->nr_sectors & 7)) { + if ((block & 7) || (rq->nr_sectors & 7)) { printk(KERN_ERR "sd: Bad block number requested"); return 0; } else { @@ -315,25 +319,24 @@ this_count = this_count >> 3; } } - if (rq_data_dir(SCpnt->request) == WRITE) { + if (rq_data_dir(rq) == WRITE) { if (!sdp->writeable) { return 0; } SCpnt->cmnd[0] = WRITE_6; SCpnt->sc_data_direction = DMA_TO_DEVICE; - } else if (rq_data_dir(SCpnt->request) == READ) { + } else if (rq_data_dir(rq) == READ) { SCpnt->cmnd[0] = READ_6; SCpnt->sc_data_direction = DMA_FROM_DEVICE; } else { - printk(KERN_ERR "sd: Unknown command %lx\n", - SCpnt->request->flags); -/* overkill panic("Unknown sd command %lx\n", SCpnt->request->flags); */ + printk(KERN_ERR "sd: Unknown command %lx\n", rq->flags); +/* overkill panic("Unknown sd command %lx\n", rq->flags); */ return 0; } SCSI_LOG_HLQUEUE(2, printk("%s : %s %d/%ld 512 byte blocks.\n", - disk->disk_name, (rq_data_dir(SCpnt->request) == WRITE) ? - "writing" : "reading", this_count, SCpnt->request->nr_sectors)); + disk->disk_name, (rq_data_dir(rq) == WRITE) ? + "writing" : "reading", this_count, rq->nr_sectors)); SCpnt->cmnd[1] = 0; @@ -385,9 +388,9 @@ */ SCpnt->transfersize = sdp->sector_size; SCpnt->underflow = this_count << 9; + SCpnt->allowed = SD_MAX_RETRIES; queue: - SCpnt->allowed = SD_MAX_RETRIES; SCpnt->timeout_per_command = timeout; /* @@ -760,15 +763,26 @@ int this_count = SCpnt->bufflen; int good_bytes = (result == 0 ? this_count : 0); sector_t block_sectors = 1; + u64 first_err_block; sector_t error_sector; + struct scsi_sense_hdr sshdr; + int sense_valid = 0; + int sense_deferred = 0; + int info_valid; + + if (result) { + sense_valid = scsi_command_normalize_sense(SCpnt, &sshdr); + if (sense_valid) + sense_deferred = scsi_sense_is_deferred(&sshdr); + } + #ifdef CONFIG_SCSI_LOGGING SCSI_LOG_HLCOMPLETE(1, printk("sd_rw_intr: %s: res=0x%x\n", SCpnt->request->rq_disk->disk_name, result)); - if (0 != result) { - SCSI_LOG_HLCOMPLETE(1, printk("sd_rw_intr: sb[0,2,asc,ascq]" - "=%x,%x,%x,%x\n", SCpnt->sense_buffer[0], - SCpnt->sense_buffer[2], SCpnt->sense_buffer[12], - SCpnt->sense_buffer[13])); + if (sense_valid) { + SCSI_LOG_HLCOMPLETE(1, printk("sd_rw_intr: sb[respc,sk,asc," + "ascq]=%x,%x,%x,%x\n", sshdr.response_code, + sshdr.sense_key, sshdr.asc, sshdr.ascq)); } #endif /* @@ -777,19 +791,27 @@ unnecessary additional work such as memcpy's that could be avoided. */ - /* An error occurred */ - if (driver_byte(result) != 0 && /* An error occurred */ - (SCpnt->sense_buffer[0] & 0x7f) == 0x70) { /* Sense current */ - switch (SCpnt->sense_buffer[2]) { + /* + * If SG_IO from block layer then set good_bytes to stop retries; + * else if errors, check them, and if necessary prepare for + * (partial) retries. + */ + if (blk_pc_request(SCpnt->request)) + good_bytes = this_count; + else if (driver_byte(result) != 0 && + sense_valid && !sense_deferred) { + switch (sshdr.sense_key) { case MEDIUM_ERROR: - if (!(SCpnt->sense_buffer[0] & 0x80)) - break; if (!blk_fs_request(SCpnt->request)) break; - error_sector = (SCpnt->sense_buffer[3] << 24) | - (SCpnt->sense_buffer[4] << 16) | - (SCpnt->sense_buffer[5] << 8) | - SCpnt->sense_buffer[6]; + info_valid = scsi_get_sense_info_fld( + SCpnt->sense_buffer, SCSI_SENSE_BUFFERSIZE, + &first_err_block); + /* + * May want to warn and skip if following cast results + * in actual truncation (if sector_t < 64 bits) + */ + error_sector = (sector_t)first_err_block; if (SCpnt->request->bio != NULL) block_sectors = bio_sectors(SCpnt->request->bio); switch (SCpnt->device->sector_size) { @@ -829,7 +851,7 @@ */ scsi_print_sense("sd", SCpnt); SCpnt->result = 0; - SCpnt->sense_buffer[0] = 0x0; + memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); good_bytes = this_count; break; @@ -858,16 +880,20 @@ static int media_not_present(struct scsi_disk *sdkp, struct scsi_request *srp) { + struct scsi_sense_hdr sshdr; + if (!srp->sr_result) return 0; if (!(driver_byte(srp->sr_result) & DRIVER_SENSE)) return 0; - if (srp->sr_sense_buffer[2] != NOT_READY && - srp->sr_sense_buffer[2] != UNIT_ATTENTION) - return 0; - if (srp->sr_sense_buffer[12] != 0x3A) /* medium not present */ - return 0; - + /* not invoked for commands that could return deferred errors */ + if (scsi_request_normalize_sense(srp, &sshdr)) { + if (sshdr.sense_key != NOT_READY && + sshdr.sense_key != UNIT_ATTENTION) + return 0; + if (sshdr.asc != 0x3A) /* medium not present */ + return 0; + } set_media_not_present(sdkp); return 1; } @@ -882,6 +908,8 @@ unsigned long spintime_value = 0; int retries, spintime; unsigned int the_result; + struct scsi_sense_hdr sshdr; + int sense_valid = 0; spintime = 0; @@ -895,19 +923,22 @@ memset((void *) &cmd[1], 0, 9); SRpnt->sr_cmd_len = 0; - SRpnt->sr_sense_buffer[0] = 0; - SRpnt->sr_sense_buffer[2] = 0; + memset(SRpnt->sr_sense_buffer, 0, + SCSI_SENSE_BUFFERSIZE); SRpnt->sr_data_direction = DMA_NONE; scsi_wait_req (SRpnt, (void *) cmd, (void *) buffer, 0/*512*/, SD_TIMEOUT, SD_MAX_RETRIES); the_result = SRpnt->sr_result; + if (the_result) + sense_valid = scsi_request_normalize_sense( + SRpnt, &sshdr); retries++; } while (retries < 3 && (!scsi_status_is_good(the_result) || ((driver_byte(the_result) & DRIVER_SENSE) && - SRpnt->sr_sense_buffer[2] == UNIT_ATTENTION))); + sense_valid && sshdr.sense_key == UNIT_ATTENTION))); /* * If the drive has indicated to us that it doesn't have @@ -921,7 +952,8 @@ /* no sense, TUR either succeeded or failed * with a status error */ if(!spintime && !scsi_status_is_good(the_result)) - printk(KERN_NOTICE "%s: Unit Not Ready, error = 0x%x\n", diskname, the_result); + printk(KERN_NOTICE "%s: Unit Not Ready, " + "error = 0x%x\n", diskname, the_result); break; } @@ -936,15 +968,15 @@ * If manual intervention is required, or this is an * absent USB storage device, a spinup is meaningless. */ - if (SRpnt->sr_sense_buffer[2] == NOT_READY && - SRpnt->sr_sense_buffer[12] == 4 /* not ready */ && - SRpnt->sr_sense_buffer[13] == 3) { + if (sense_valid && + sshdr.sense_key == NOT_READY && + sshdr.asc == 4 && sshdr.ascq == 3) { break; /* manual intervention required */ /* * Issue command to spin up drive when not ready */ - } else if (SRpnt->sr_sense_buffer[2] == NOT_READY) { + } else if (sense_valid && sshdr.sense_key == NOT_READY) { if (!spintime) { printk(KERN_NOTICE "%s: Spinning up disk...", diskname); @@ -953,8 +985,8 @@ memset((void *) &cmd[2], 0, 8); cmd[4] = 1; /* Start spin cycle */ SRpnt->sr_cmd_len = 0; - SRpnt->sr_sense_buffer[0] = 0; - SRpnt->sr_sense_buffer[2] = 0; + memset(SRpnt->sr_sense_buffer, 0, + SCSI_SENSE_BUFFERSIZE); SRpnt->sr_data_direction = DMA_NONE; scsi_wait_req(SRpnt, (void *)cmd, @@ -970,7 +1002,8 @@ /* we don't understand the sense code, so it's * probably pointless to loop */ if(!spintime) { - printk(KERN_NOTICE "%s: Unit Not Ready, sense:\n", diskname); + printk(KERN_NOTICE "%s: Unit Not Ready, " + "sense:\n", diskname); scsi_print_req_sense("", SRpnt); } break; @@ -998,6 +1031,8 @@ int the_result, retries; int sector_size = 0; int longrc = 0; + struct scsi_sense_hdr sshdr; + int sense_valid = 0; repeat: retries = 3; @@ -1015,8 +1050,7 @@ } SRpnt->sr_cmd_len = 0; - SRpnt->sr_sense_buffer[0] = 0; - SRpnt->sr_sense_buffer[2] = 0; + memset(SRpnt->sr_sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); SRpnt->sr_data_direction = DMA_FROM_DEVICE; scsi_wait_req(SRpnt, (void *) cmd, (void *) buffer, @@ -1026,6 +1060,9 @@ return; the_result = SRpnt->sr_result; + if (the_result) + sense_valid = scsi_request_normalize_sense(SRpnt, + &sshdr); retries--; } while (the_result && retries); @@ -1047,7 +1084,7 @@ /* Set dirty bit for removable devices if not ready - * sometimes drives will not report this properly. */ if (sdp->removable && - SRpnt->sr_sense_buffer[2] == NOT_READY) + sense_valid && sshdr.sense_key == NOT_READY) sdp->changed = 1; /* Either no media are present but the drive didn't tell us, @@ -1255,6 +1292,7 @@ const int dbd = 0; /* DBD */ const int modepage = 0x08; /* current values, cache page */ struct scsi_mode_data data; + struct scsi_sense_hdr sshdr; if (sdkp->device->skip_ms_page_8) goto defaults; @@ -1304,17 +1342,14 @@ } bad_sense: - if ((SRpnt->sr_sense_buffer[0] & 0x70) == 0x70 - && (SRpnt->sr_sense_buffer[2] & 0x0f) == ILLEGAL_REQUEST - /* ASC 0x24 ASCQ 0x00: Invalid field in CDB */ - && SRpnt->sr_sense_buffer[12] == 0x24 - && SRpnt->sr_sense_buffer[13] == 0x00) { + if (scsi_request_normalize_sense(SRpnt, &sshdr) && + sshdr.sense_key == ILLEGAL_REQUEST && + sshdr.asc == 0x24 && sshdr.ascq == 0x0) printk(KERN_NOTICE "%s: cache data unavailable\n", - diskname); - } else { + diskname); /* Invalid field in CDB */ + else printk(KERN_ERR "%s: asking for cache data failed\n", diskname); - } defaults: printk(KERN_ERR "%s: assuming drive cache: write through\n", diff -Nru a/drivers/scsi/sg.c b/drivers/scsi/sg.c --- a/drivers/scsi/sg.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/scsi/sg.c 2005-01-28 14:11:40 -08:00 @@ -7,7 +7,7 @@ * Original driver (sg.c): * Copyright (C) 1992 Lawrence Foard * Version 2 and 3 extensions to driver: - * Copyright (C) 1998 - 2004 Douglas Gilbert + * Copyright (C) 1998 - 2005 Douglas Gilbert * * Modified 19-JAN-1998 Richard Gooch Devfs support * @@ -18,8 +18,8 @@ * */ -static int sg_version_num = 30531; /* 2 digits for each component */ -#define SG_VERSION_STR "3.5.31" +static int sg_version_num = 30532; /* 2 digits for each component */ +#define SG_VERSION_STR "3.5.32" /* * D. P. Gilbert (dgilbert@interlog.com, dougg@triode.net.au), notes: @@ -60,7 +60,7 @@ #ifdef CONFIG_SCSI_PROC_FS #include -static char *sg_version_date = "20040516"; +static char *sg_version_date = "20050117"; static int sg_proc_init(void); static void sg_proc_cleanup(void); @@ -1282,6 +1282,8 @@ srp->header.duration = jiffies_to_msecs(jiffies - srp->header.duration); if (0 != SRpnt->sr_result) { + struct scsi_sense_hdr sshdr; + memcpy(srp->sense_b, SRpnt->sr_sense_buffer, sizeof (srp->sense_b)); srp->header.status = 0xff & SRpnt->sr_result; @@ -1296,11 +1298,12 @@ /* Following if statement is a patch supplied by Eric Youngdale */ if (driver_byte(SRpnt->sr_result) != 0 - && (SRpnt->sr_sense_buffer[0] & 0x7f) == 0x70 - && (SRpnt->sr_sense_buffer[2] & 0xf) == UNIT_ATTENTION + && scsi_command_normalize_sense(SCpnt, &sshdr) + && !scsi_sense_is_deferred(&sshdr) + && sshdr.sense_key == UNIT_ATTENTION && sdp->device->removable) { - /* Detected disc change. Set the bit - this may be used if */ - /* there are filesystems using this device. */ + /* Detected possible disc change. Set the bit - this */ + /* may be used if there are filesystems using this device */ sdp->device->changed = 1; } } @@ -1573,8 +1576,8 @@ * of sysfs parameters (which module_param doesn't yet support). * Sysfs parameters defined explicitly below. */ -module_param_named(def_reserved_size, def_reserved_size, int, 0); -module_param_named(allow_dio, sg_allow_dio, int, 0); +module_param_named(def_reserved_size, def_reserved_size, int, S_IRUGO); +module_param_named(allow_dio, sg_allow_dio, int, S_IRUGO | S_IWUSR); MODULE_AUTHOR("Douglas Gilbert"); MODULE_DESCRIPTION("SCSI generic (sg) driver"); @@ -2606,9 +2609,14 @@ free_pages((unsigned long) buff, order); } +#ifndef MAINTENANCE_IN_CMD +#define MAINTENANCE_IN_CMD 0xa3 +#endif + static unsigned char allow_ops[] = { TEST_UNIT_READY, REQUEST_SENSE, INQUIRY, READ_CAPACITY, READ_BUFFER, READ_6, READ_10, READ_12, - MODE_SENSE, MODE_SENSE_10, LOG_SENSE + READ_16, MODE_SENSE, MODE_SENSE_10, LOG_SENSE, REPORT_LUNS, + SERVICE_ACTION_IN, RECEIVE_DIAGNOSTIC, READ_LONG, MAINTENANCE_IN_CMD }; static int diff -Nru a/drivers/scsi/sr.c b/drivers/scsi/sr.c --- a/drivers/scsi/sr.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/scsi/sr.c 2005-01-28 14:11:41 -08:00 @@ -152,9 +152,11 @@ static inline void scsi_cd_put(struct scsi_cd *cd) { + struct scsi_device *sdev = cd->device; + down(&sr_ref_sem); kref_put(&cd->kref, sr_kref_release); - scsi_device_put(cd->device); + scsi_device_put(sdev); up(&sr_ref_sem); } diff -Nru a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c --- a/drivers/serial/serial_cs.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/serial/serial_cs.c 2005-01-28 14:11:40 -08:00 @@ -289,7 +289,7 @@ /*====================================================================*/ -static int setup_serial(struct serial_info * info, ioaddr_t iobase, int irq) +static int setup_serial(struct serial_info * info, kio_addr_t iobase, int irq) { struct uart_port port; int line; @@ -351,7 +351,7 @@ static int simple_config(dev_link_t *link) { - static ioaddr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; + static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; static int size_table[2] = { 8, 16 }; client_handle_t handle = link->handle; struct serial_info *info = link->priv; @@ -366,7 +366,7 @@ /* If the card is already configured, look up the port and irq */ i = pcmcia_get_configuration_info(handle, &config); if ((i == CS_SUCCESS) && (config.Attributes & CONF_VALID_CLIENT)) { - ioaddr_t port = 0; + kio_addr_t port = 0; if ((config.BasePort2 != 0) && (config.NumPorts2 == 8)) { port = config.BasePort2; info->slave = 1; diff -Nru a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c --- a/drivers/usb/core/hcd.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/usb/core/hcd.c 2005-01-28 14:11:41 -08:00 @@ -33,7 +33,7 @@ #include #include #include -#include /* for UTS_SYSNAME */ +#include #include #include #include @@ -309,8 +309,8 @@ // id 3 == vendor description } else if (id == 3) { - sprintf (buf, "%s %s %s", UTS_SYSNAME, UTS_RELEASE, - hcd->driver->description); + sprintf (buf, "%s %s %s", system_utsname.sysname, + system_utsname.release, hcd->driver->description); // unsupported IDs --> "protocol stall" } else diff -Nru a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c --- a/drivers/usb/gadget/ether.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/usb/gadget/ether.c 2005-01-28 14:11:41 -08:00 @@ -36,8 +36,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -2337,8 +2336,8 @@ gadget->name); return -ENODEV; } - snprintf (manufacturer, sizeof manufacturer, - UTS_SYSNAME " " UTS_RELEASE "/%s", + snprintf (manufacturer, sizeof manufacturer, "%s %s/%s", + system_utsname.sysname, system_utsname.release, gadget->name); /* If there's an RNDIS configuration, that's what Windows wants to diff -Nru a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c --- a/drivers/usb/gadget/file_storage.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/usb/gadget/file_storage.c 2005-01-28 14:11:41 -08:00 @@ -236,8 +236,7 @@ #include #include #include -#include -#include +#include #include #include @@ -3954,8 +3953,8 @@ /* This should reflect the actual gadget power source */ usb_gadget_set_selfpowered(gadget); - snprintf(manufacturer, sizeof manufacturer, - UTS_SYSNAME " " UTS_RELEASE " with %s", + snprintf(manufacturer, sizeof manufacturer, "%s %s with %s", + system_utsname.sysname, system_utsname.release, gadget->name); /* On a real device, serial[] would be loaded from permanent diff -Nru a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c --- a/drivers/usb/gadget/serial.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/usb/gadget/serial.c 2005-01-28 14:11:41 -08:00 @@ -30,8 +30,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -1596,8 +1595,9 @@ if (dev == NULL) return -ENOMEM; - snprintf(manufacturer, sizeof(manufacturer), - UTS_SYSNAME " " UTS_RELEASE " with %s", gadget->name); + snprintf(manufacturer, sizeof(manufacturer), "%s %s with %s", + system_utsname.sysname, system_utsname.release, + gadget->name); memset(dev, 0, sizeof(struct gs_dev)); dev->dev_gadget = gadget; diff -Nru a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c --- a/drivers/usb/gadget/zero.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/usb/gadget/zero.c 2005-01-28 14:11:40 -08:00 @@ -75,8 +75,7 @@ #include #include #include -#include -#include +#include #include #include @@ -1265,8 +1264,8 @@ INFO (dev, "using %s, OUT %s IN %s\n", gadget->name, EP_OUT_NAME, EP_IN_NAME); - snprintf (manufacturer, sizeof manufacturer, - UTS_SYSNAME " " UTS_RELEASE " with %s", + snprintf (manufacturer, sizeof manufacturer, "%s %s with %s", + system_utsname.sysname, system_utsname.release, gadget->name); return 0; diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c --- a/drivers/usb/input/hid-core.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/usb/input/hid-core.c 2005-01-28 14:11:41 -08:00 @@ -925,8 +925,9 @@ break; case -ECONNRESET: /* unlink */ case -ENOENT: - case -ESHUTDOWN: case -EPERM: + case -ESHUTDOWN: /* unplug */ + case -EILSEQ: /* unplug timeout on uhci */ return; case -ETIMEDOUT: /* NAK */ break; @@ -1136,12 +1137,15 @@ { struct hid_device *hid = urb->context; unsigned long flags; + int unplug = 0; switch (urb->status) { case 0: /* success */ + case -ESHUTDOWN: /* unplug */ + case -EILSEQ: /* unplug timeout on uhci */ + unplug = 1; case -ECONNRESET: /* unlink */ case -ENOENT: - case -ESHUTDOWN: break; default: /* error */ warn("output irq status %d received", urb->status); @@ -1149,7 +1153,10 @@ spin_lock_irqsave(&hid->outlock, flags); - hid->outtail = (hid->outtail + 1) & (HID_OUTPUT_FIFO_SIZE - 1); + if (unplug) + hid->outtail = hid->outhead; + else + hid->outtail = (hid->outtail + 1) & (HID_OUTPUT_FIFO_SIZE - 1); if (hid->outhead != hid->outtail) { if (hid_submit_out(hid)) { @@ -1173,6 +1180,7 @@ { struct hid_device *hid = urb->context; unsigned long flags; + int unplug = 0; spin_lock_irqsave(&hid->ctrllock, flags); @@ -1180,16 +1188,21 @@ case 0: /* success */ if (hid->ctrl[hid->ctrltail].dir == USB_DIR_IN) hid_input_report(hid->ctrl[hid->ctrltail].report->type, urb, regs); + case -ESHUTDOWN: /* unplug */ + case -EILSEQ: /* unplug timectrl on uhci */ + unplug = 1; case -ECONNRESET: /* unlink */ case -ENOENT: - case -ESHUTDOWN: case -EPIPE: /* report not available */ break; default: /* error */ warn("ctrl urb status %d received", urb->status); } - hid->ctrltail = (hid->ctrltail + 1) & (HID_CONTROL_FIFO_SIZE - 1); + if (unplug) + hid->ctrltail = hid->ctrlhead; + else + hid->ctrltail = (hid->ctrltail + 1) & (HID_CONTROL_FIFO_SIZE - 1); if (hid->ctrlhead != hid->ctrltail) { if (hid_submit_ctrl(hid)) { diff -Nru a/drivers/usb/input/hid-debug.h b/drivers/usb/input/hid-debug.h --- a/drivers/usb/input/hid-debug.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/usb/input/hid-debug.h 2005-01-28 14:11:40 -08:00 @@ -81,15 +81,21 @@ {0, 0x8b, "SystemMenuLeft"}, {0, 0x8c, "SystemMenuUp"}, {0, 0x8d, "SystemMenuDown"}, - {0, 0x90, "D-padUp"}, - {0, 0x91, "D-padDown"}, - {0, 0x92, "D-padRight"}, - {0, 0x93, "D-padLeft"}, + {0, 0x90, "D-PadUp"}, + {0, 0x91, "D-PadDown"}, + {0, 0x92, "D-PadRight"}, + {0, 0x93, "D-PadLeft"}, { 7, 0, "Keyboard" }, + {0, 0x01, "NumLock"}, + {0, 0x02, "CapsLock"}, + {0, 0x03, "ScrollLock"}, + {0, 0x04, "Compose"}, + {0, 0x05, "Kana"}, { 8, 0, "LED" }, { 9, 0, "Button" }, { 10, 0, "Ordinal" }, - { 12, 0, "Hotkey" }, + { 12, 0, "Consumer" }, + {0, 0x238, "HorizontalWheel"}, { 13, 0, "Digitizers" }, {0, 0x01, "Digitizer"}, {0, 0x02, "Pen"}, @@ -653,12 +659,10 @@ [KEY_SLOW] = "Slow", [KEY_SHUFFLE] = "Shuffle", [KEY_BREAK] = "Break", [KEY_PREVIOUS] = "Previous", [KEY_DIGITS] = "Digits", [KEY_TEEN] = "TEEN", - [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "Delete EOL", - [KEY_DEL_EOS] = "Delete EOS", [KEY_INS_LINE] = "Insert line", - [KEY_DEL_LINE] = "Delete line", + [KEY_TWEN] = "TWEN", [KEY_DEL_EOL] = "DeleteEOL", + [KEY_DEL_EOS] = "DeleteEOS", [KEY_INS_LINE] = "InsertLine", + [KEY_DEL_LINE] = "DeleteLine", }; - -static char *absval[5] = { "Value", "Min ", "Max ", "Fuzz ", "Flat " }; static char *relatives[REL_MAX + 1] = { [0 ... REL_MAX] = NULL, diff -Nru a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c --- a/drivers/usb/input/hid-input.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/usb/input/hid-input.c 2005-01-28 14:11:40 -08:00 @@ -185,7 +185,9 @@ break; case HID_UP_LED: - map_led((usage->hid - 1) & 0xf); + if (usage->hid - 1 >= LED_MAX) + goto ignore; + map_led(usage->hid - 1); break; case HID_UP_DIGITIZER: @@ -231,7 +233,6 @@ case HID_UP_CONSUMER: /* USB HUT v1.1, pages 56-62 */ - set_bit(EV_REP, input->evbit); switch (usage->hid & HID_USAGE) { case 0x000: goto ignore; case 0x034: map_key_clear(KEY_SLEEP); break; @@ -268,6 +269,7 @@ case 0x226: map_key_clear(KEY_STOP); break; case 0x227: map_key_clear(KEY_REFRESH); break; case 0x22a: map_key_clear(KEY_BOOKMARKS); break; + case 0x238: map_rel(REL_HWHEEL); break; default: goto unknown; } break; @@ -288,9 +290,13 @@ case 0x084: map_key_clear(KEY_FINANCE); break; case 0x085: map_key_clear(KEY_SPORT); break; case 0x086: map_key_clear(KEY_SHOP); break; - default: goto unknown; + default: goto ignore; } break; + + case HID_UP_MSVENDOR: + + goto ignore; case HID_UP_PID: @@ -397,11 +403,12 @@ if (!input) return; + input_regs(input, regs); + input_event(input, EV_MSC, MSC_SCAN, usage->hid); + if (!usage->type) return; - input_regs(input, regs); - if (((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_5) && (usage->hid == 0x00090005)) || ((hid->quirks & HID_QUIRK_2WHEEL_MOUSE_HACK_7) && (usage->hid == 0x00090007))) { if (value) hid->quirks |= HID_QUIRK_2WHEEL_MOUSE_HACK_ON; @@ -568,13 +575,16 @@ hidinput->input.id.product = le16_to_cpu(dev->descriptor.idProduct); hidinput->input.id.version = le16_to_cpu(dev->descriptor.bcdDevice); hidinput->input.dev = &hid->intf->dev; + + set_bit(EV_MSC, hidinput->input.evbit); + set_bit(MSC_SCAN, hidinput->input.mscbit); } for (i = 0; i < report->maxfield; i++) for (j = 0; j < report->field[i]->maxusage; j++) hidinput_configure_usage(hidinput, report->field[i], report->field[i]->usage + j); - + if (hid->quirks & HID_QUIRK_MULTI_INPUT) { /* This will leave hidinput NULL, so that it * allocates another one if we have more inputs on diff -Nru a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h --- a/drivers/usb/input/hid.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/usb/input/hid.h 2005-01-28 14:11:40 -08:00 @@ -181,6 +181,7 @@ #define HID_UP_DIGITIZER 0x000d0000 #define HID_UP_PID 0x000f0000 #define HID_UP_HPVENDOR 0xff7f0000 +#define HID_UP_MSVENDOR 0xff000000 #define HID_USAGE 0x0000ffff diff -Nru a/drivers/video/Kconfig b/drivers/video/Kconfig --- a/drivers/video/Kconfig 2005-01-28 14:11:40 -08:00 +++ b/drivers/video/Kconfig 2005-01-28 14:11:40 -08:00 @@ -574,7 +574,7 @@ packed pixel and 32 bpp packed pixel. You can also use font widths different from 8. -config FB_MATROX_G450 +config FB_MATROX_G bool "G100/G200/G400/G450/G550 support" depends on FB_MATROX ---help--- @@ -585,10 +585,10 @@ different from 8. If you need support for G400 secondary head, you must first say Y to - "I2C support" and "I2C bit-banging support" in the character devices - section, and then to "Matrox I2C support" and "G400 second head - support" here in the framebuffer section. G450/G550 secondary head - and digital output are supported without additional modules. + "I2C support" in the character devices section, and then to + "Matrox I2C support" and "G400 second head support" here in the + framebuffer section. G450/G550 secondary head and digital output + are supported without additional modules. The driver starts in monitor mode. You must use the matroxset tool (available at ) to @@ -605,26 +605,6 @@ G450/G550 hardware can display TV picture only from secondary CRTC, and it performs no scaling, so picture must have 525 or 625 lines. -config FB_MATROX_G100A - bool "G100/G200/G400 support" - depends on FB_MATROX && !FB_MATROX_G450 - ---help--- - Say Y here if you have a Matrox G100, G200 or G400 based - video card. If you select "Advanced lowlevel driver options", you - should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed - pixel and 32 bpp packed pixel. You can also use font widths - different from 8. - - If you need support for G400 secondary head, you must first say Y to - "I2C support" and "I2C bit-banging support" in the character devices - section, and then to "Matrox I2C support" and "G400 second head - support" here in the framebuffer section. - -config FB_MATROX_G100 - bool - depends on FB_MATROX && (FB_MATROX_G450 || FB_MATROX_G100A) - default y - config FB_MATROX_I2C tristate "Matrox I2C support" depends on FB_MATROX && I2C @@ -644,7 +624,7 @@ config FB_MATROX_MAVEN tristate "G400 second head support" - depends on FB_MATROX_G100 && FB_MATROX_I2C + depends on FB_MATROX_G && FB_MATROX_I2C ---help--- WARNING !!! This support does not work with G450 !!! @@ -1107,7 +1087,7 @@ source "drivers/video/logo/Kconfig" endif -if SYSFS +if FB && SYSFS source "drivers/video/backlight/Kconfig" endif diff -Nru a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c --- a/drivers/video/aty/radeon_base.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/video/aty/radeon_base.c 2005-01-28 14:11:40 -08:00 @@ -1748,6 +1748,7 @@ info->fix.type_aux = 0; info->fix.mmio_start = rinfo->mmio_base_phys; info->fix.mmio_len = RADEON_REGSIZE; + info->fix.accel = FB_ACCEL_ATI_RADEON; fb_alloc_cmap(&info->cmap, 256, 0); diff -Nru a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig --- a/drivers/video/backlight/Kconfig 2005-01-28 14:11:40 -08:00 +++ b/drivers/video/backlight/Kconfig 2005-01-28 14:11:40 -08:00 @@ -11,6 +11,7 @@ config BACKLIGHT_CLASS_DEVICE tristate "Lowlevel Backlight controls" depends on BACKLIGHT_LCD_SUPPORT + default m help This framework adds support for low-level control of the LCD backlight. This includes support for brightness and power. @@ -26,6 +27,7 @@ config LCD_CLASS_DEVICE tristate "Lowlevel LCD controls" depends on BACKLIGHT_LCD_SUPPORT + default m help This framework adds support for low-level control of LCD. Some framebuffer devices connect to platform-specific LCD modules diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c --- a/drivers/video/console/fbcon.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/video/console/fbcon.c 2005-01-28 14:11:41 -08:00 @@ -2654,13 +2654,12 @@ vc = vc_cons[ops->currcon].d; if (CON_IS_VISIBLE(vc)) { - ops->blank_state = blank; - if (blank) do_blank_screen(0); else do_unblank_screen(0); } + ops->blank_state = blank; } } diff -Nru a/drivers/video/fbmem.c b/drivers/video/fbmem.c --- a/drivers/video/fbmem.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/video/fbmem.c 2005-01-28 14:11:40 -08:00 @@ -35,6 +35,7 @@ #include #include #include +#include #if defined(__mc68000__) || defined(CONFIG_APUS) #include @@ -967,9 +968,13 @@ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); #elif defined(__hppa__) pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE; -#elif defined(__ia64__) || defined(__arm__) || defined(__sh__) || \ - defined(__m32r__) +#elif defined(__arm__) || defined(__sh__) || defined(__m32r__) vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); +#elif defined(__ia64__) + if (efi_range_is_wc(vma->vm_start, vma->vm_end - vma->vm_start)) + vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); + else + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); #else #warning What do we have to do here?? #endif diff -Nru a/drivers/video/intelfb/intelfbhw.c b/drivers/video/intelfb/intelfbhw.c --- a/drivers/video/intelfb/intelfbhw.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/video/intelfb/intelfbhw.c 2005-01-28 14:11:40 -08:00 @@ -1207,6 +1207,22 @@ OUTREG(ADPA, tmp); /* setup display plane */ + if (dinfo->pdev->device == PCI_DEVICE_ID_INTEL_830M) { + /* + * i830M errata: the display plane must be enabled + * to allow writes to the other bits in the plane + * control register. + */ + tmp = INREG(DSPACNTR); + if ((tmp & DISPPLANE_PLANE_ENABLE) != DISPPLANE_PLANE_ENABLE) { + tmp |= DISPPLANE_PLANE_ENABLE; + OUTREG(DSPACNTR, tmp); + OUTREG(DSPACNTR, + hw->disp_a_ctrl|DISPPLANE_PLANE_ENABLE); + mdelay(1); + } + } + OUTREG(DSPACNTR, hw->disp_a_ctrl & ~DISPPLANE_PLANE_ENABLE); OUTREG(DSPASTRIDE, hw->disp_a_stride); OUTREG(DSPABASE, hw->disp_a_base); diff -Nru a/drivers/video/matrox/Makefile b/drivers/video/matrox/Makefile --- a/drivers/video/matrox/Makefile 2005-01-28 14:11:40 -08:00 +++ b/drivers/video/matrox/Makefile 2005-01-28 14:11:40 -08:00 @@ -4,8 +4,7 @@ # Each configuration option enables a list of files. -my-obj-$(CONFIG_FB_MATROX_G100) += g450_pll.o -my-obj-$(CONFIG_FB_MATROX_G450) += matroxfb_g450.o matroxfb_crtc2.o +my-obj-$(CONFIG_FB_MATROX_G) += g450_pll.o matroxfb_g450.o matroxfb_crtc2.o obj-$(CONFIG_FB_MATROX) += matroxfb_base.o matroxfb_accel.o matroxfb_DAC1064.o matroxfb_Ti3026.o matroxfb_misc.o $(my-obj-y) obj-$(CONFIG_FB_MATROX_I2C) += i2c-matroxfb.o diff -Nru a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c --- a/drivers/video/matrox/matroxfb_DAC1064.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/video/matrox/matroxfb_DAC1064.c 2005-01-28 14:11:40 -08:00 @@ -155,7 +155,7 @@ hw->MXoptionReg = mx; } -#ifdef CONFIG_FB_MATROX_G450 +#ifdef CONFIG_FB_MATROX_G static void g450_set_plls(WPMINFO2) { u_int32_t c2_ctl; unsigned int pxc; @@ -253,7 +253,7 @@ hw->DACreg[POS1064_XMISCCTRL] &= M1064_XMISCCTRL_DAC_WIDTHMASK; hw->DACreg[POS1064_XMISCCTRL] |= M1064_XMISCCTRL_LUT_EN; hw->DACreg[POS1064_XPIXCLKCTRL] = M1064_XPIXCLKCTRL_PLL_UP | M1064_XPIXCLKCTRL_EN | M1064_XPIXCLKCTRL_SRC_PLL; -#ifdef CONFIG_FB_MATROX_G450 +#ifdef CONFIG_FB_MATROX_G if (ACCESS_FBINFO(devflags.g450dac)) { hw->DACreg[POS1064_XPWRCTRL] = 0x1F; /* powerup everything */ hw->DACreg[POS1064_XOUTPUTCONN] = 0x00; /* disable outputs */ @@ -498,7 +498,7 @@ .compute = m1064_compute, }; -#ifdef CONFIG_FB_MATROX_G450 +#ifdef CONFIG_FB_MATROX_G static int g450_compute(void* out, struct my_timming* m) { #define minfo ((struct matrox_fb_info*)out) if (m->mnp < 0) { @@ -541,7 +541,7 @@ } #endif -#ifdef CONFIG_FB_MATROX_G100 +#ifdef CONFIG_FB_MATROX_G static int MGAG100_init(WPMINFO struct my_timming* m) { struct matrox_hw_state* hw = &ACCESS_FBINFO(hw); @@ -562,7 +562,7 @@ if (DAC1064_init_2(PMINFO m)) return 1; return 0; } -#endif /* G100 */ +#endif /* G */ #ifdef CONFIG_FB_MATROX_MYSTIQUE static void MGA1064_ramdac_init(WPMINFO2) { @@ -583,7 +583,7 @@ } #endif -#ifdef CONFIG_FB_MATROX_G100 +#ifdef CONFIG_FB_MATROX_G /* BIOS environ */ static int x7AF4 = 0x10; /* flags, maybe 0x10 = SDRAM, 0x00 = SGRAM??? */ /* G100 wants 0x10, G200 SGRAM does not care... */ @@ -692,8 +692,7 @@ } #endif -#ifdef CONFIG_FB_MATROX_G100 -#ifdef CONFIG_FB_MATROX_G450 +#ifdef CONFIG_FB_MATROX_G static void g450_mclk_init(WPMINFO2) { /* switch all clocks to PCI source */ pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, ACCESS_FBINFO(hw).MXoptionReg | 4); @@ -811,10 +810,6 @@ return; } -#else -static inline void g450_preinit(WPMINFO2) { -} -#endif static int MGAG100_preinit(WPMINFO2) { static const int vxres_g100[] = { 512, 640, 768, 800, 832, 960, @@ -851,7 +846,7 @@ ACCESS_FBINFO(capable.plnwt) = ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG100 ? ACCESS_FBINFO(devflags.sgram) : 1; -#ifdef CONFIG_FB_MATROX_G450 +#ifdef CONFIG_FB_MATROX_G if (ACCESS_FBINFO(devflags.g450dac)) { ACCESS_FBINFO(outputs[0]).output = &g450out; } else @@ -1043,7 +1038,7 @@ } #endif -#ifdef CONFIG_FB_MATROX_G100 +#ifdef CONFIG_FB_MATROX_G static void MGAG100_restore(WPMINFO2) { int i; struct matrox_hw_state* hw = &ACCESS_FBINFO(hw); @@ -1077,7 +1072,7 @@ EXPORT_SYMBOL(matrox_mystique); #endif -#ifdef CONFIG_FB_MATROX_G100 +#ifdef CONFIG_FB_MATROX_G struct matrox_switch matrox_G100 = { MGAG100_preinit, MGAG100_reset, MGAG100_init, MGAG100_restore, }; diff -Nru a/drivers/video/matrox/matroxfb_DAC1064.h b/drivers/video/matrox/matroxfb_DAC1064.h --- a/drivers/video/matrox/matroxfb_DAC1064.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/video/matrox/matroxfb_DAC1064.h 2005-01-28 14:11:41 -08:00 @@ -9,7 +9,7 @@ #ifdef CONFIG_FB_MATROX_MYSTIQUE extern struct matrox_switch matrox_mystique; #endif -#ifdef CONFIG_FB_MATROX_G100 +#ifdef CONFIG_FB_MATROX_G extern struct matrox_switch matrox_G100; #endif #ifdef NEED_DAC1064 diff -Nru a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c --- a/drivers/video/matrox/matroxfb_base.c 2005-01-28 14:11:41 -08:00 +++ b/drivers/video/matrox/matroxfb_base.c 2005-01-28 14:11:41 -08:00 @@ -1346,7 +1346,7 @@ #ifdef CONFIG_FB_MATROX_MYSTIQUE static struct video_board vbMystique = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGA1064SG, &matrox_mystique}; #endif /* CONFIG_FB_MATROX_MYSTIQUE */ -#ifdef CONFIG_FB_MATROX_G100 +#ifdef CONFIG_FB_MATROX_G static struct video_board vbG100 = {0x0800000, 0x0800000, FB_ACCEL_MATROX_MGAG100, &matrox_G100}; static struct video_board vbG200 = {0x1000000, 0x1000000, FB_ACCEL_MATROX_MGAG200, &matrox_G100}; #ifdef CONFIG_FB_MATROX_32MB @@ -1430,7 +1430,7 @@ &vbMystique, "Mystique 220 (PCI)"}, #endif -#ifdef CONFIG_FB_MATROX_G100 +#ifdef CONFIG_FB_MATROX_G {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100_MM, 0xFF, 0, 0, DEVF_G100, @@ -2105,7 +2105,7 @@ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_MYS, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, #endif -#ifdef CONFIG_FB_MATROX_G100 +#ifdef CONFIG_FB_MATROX_G {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100_MM, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100_AGP, diff -Nru a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h --- a/drivers/video/matrox/matroxfb_base.h 2005-01-28 14:11:40 -08:00 +++ b/drivers/video/matrox/matroxfb_base.h 2005-01-28 14:11:40 -08:00 @@ -127,7 +127,7 @@ /* G-series and Mystique have (almost) same DAC */ #undef NEED_DAC1064 -#if defined(CONFIG_FB_MATROX_MYSTIQUE) || defined(CONFIG_FB_MATROX_G100) +#if defined(CONFIG_FB_MATROX_MYSTIQUE) || defined(CONFIG_FB_MATROX_G) #define NEED_DAC1064 1 #endif diff -Nru a/drivers/video/matrox/matroxfb_g450.h b/drivers/video/matrox/matroxfb_g450.h --- a/drivers/video/matrox/matroxfb_g450.h 2005-01-28 14:11:41 -08:00 +++ b/drivers/video/matrox/matroxfb_g450.h 2005-01-28 14:11:41 -08:00 @@ -3,7 +3,7 @@ #include "matroxfb_base.h" -#ifdef CONFIG_FB_MATROX_G450 +#ifdef CONFIG_FB_MATROX_G void matroxfb_g450_connect(WPMINFO2); void matroxfb_g450_shutdown(WPMINFO2); #else diff -Nru a/drivers/video/vesafb.c b/drivers/video/vesafb.c --- a/drivers/video/vesafb.c 2005-01-28 14:11:40 -08:00 +++ b/drivers/video/vesafb.c 2005-01-28 14:11:40 -08:00 @@ -229,7 +229,7 @@ unsigned int size_total; if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB) - return -ENXIO; + return -ENODEV; vesafb_fix.smem_start = screen_info.lfb_base; vesafb_defined.bits_per_pixel = screen_info.lfb_depth; @@ -407,7 +407,7 @@ (ypan) ? FBINFO_HWACCEL_YPAN : 0; if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) { - err = -ENXIO; + err = -ENOMEM; goto err; } if (register_framebuffer(info)<0) { diff -Nru a/fs/binfmt_elf.c b/fs/binfmt_elf.c --- a/fs/binfmt_elf.c 2005-01-28 14:11:40 -08:00 +++ b/fs/binfmt_elf.c 2005-01-28 14:11:40 -08:00 @@ -110,15 +110,17 @@ be in memory */ -static void padzero(unsigned long elf_bss) +static int padzero(unsigned long elf_bss) { unsigned long nbyte; nbyte = ELF_PAGEOFFSET(elf_bss); if (nbyte) { nbyte = ELF_MIN_ALIGN - nbyte; - clear_user((void __user *) elf_bss, nbyte); + if (clear_user((void __user *) elf_bss, nbyte)) + return -EFAULT; } + return 0; } /* Let's use some macros to make this stack manipulation a litle clearer */ @@ -134,7 +136,7 @@ #define STACK_ALLOC(sp, len) ({ sp -= len ; sp; }) #endif -static void +static int create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec, int interp_aout, unsigned long load_addr, unsigned long interp_load_addr) @@ -179,7 +181,8 @@ STACK_ALLOC(p, ((current->pid % 64) << 7)); #endif u_platform = (elf_addr_t __user *)STACK_ALLOC(p, len); - __copy_to_user(u_platform, k_platform, len); + if (__copy_to_user(u_platform, k_platform, len)) + return -EFAULT; } /* Create the ELF interpreter info */ @@ -241,7 +244,8 @@ #endif /* Now, let's put argc (and argv, envp if appropriate) on the stack */ - __put_user(argc, sp++); + if (__put_user(argc, sp++)) + return -EFAULT; if (interp_aout) { argv = sp + 2; envp = argv + argc + 1; @@ -259,25 +263,29 @@ __put_user((elf_addr_t)p, argv++); len = strnlen_user((void __user *)p, PAGE_SIZE*MAX_ARG_PAGES); if (!len || len > PAGE_SIZE*MAX_ARG_PAGES) - return; + return 0; p += len; } - __put_user(0, argv); + if (__put_user(0, argv)) + return -EFAULT; current->mm->arg_end = current->mm->env_start = p; while (envc-- > 0) { size_t len; __put_user((elf_addr_t)p, envp++); len = strnlen_user((void __user *)p, PAGE_SIZE*MAX_ARG_PAGES); if (!len || len > PAGE_SIZE*MAX_ARG_PAGES) - return; + return 0; p += len; } - __put_user(0, envp); + if (__put_user(0, envp)) + return -EFAULT; current->mm->env_end = p; /* Put the elf_info on the stack in the right place. */ sp = (elf_addr_t __user *)envp + 1; - copy_to_user(sp, elf_info, ei_index * sizeof(elf_addr_t)); + if (copy_to_user(sp, elf_info, ei_index * sizeof(elf_addr_t))) + return -EFAULT; + return 0; } #ifndef elf_map @@ -411,7 +419,11 @@ * that there are zero-mapped pages up to and including the * last bss page. */ - padzero(elf_bss); + if (padzero(elf_bss)) { + error = -EFAULT; + goto out_close; + } + elf_bss = ELF_PAGESTART(elf_bss + ELF_MIN_ALIGN - 1); /* What we have mapped so far */ /* Map the last of the bss segment */ @@ -791,7 +803,11 @@ nbyte = ELF_MIN_ALIGN - nbyte; if (nbyte > elf_brk - elf_bss) nbyte = elf_brk - elf_bss; - clear_user((void __user *) elf_bss + load_bias, nbyte); + if (clear_user((void __user *) elf_bss + load_bias, nbyte)) { + retval = -EFAULT; + send_sig(SIGKILL, current, 0); + goto out_free_dentry; + } } } @@ -875,7 +891,11 @@ send_sig(SIGKILL, current, 0); goto out_free_dentry; } - padzero(elf_bss); + if (padzero(elf_bss)) { + send_sig(SIGSEGV, current, 0); + retval = -EFAULT; /* Nobody gets to see this, but.. */ + goto out_free_dentry; + } if (elf_interpreter) { if (interpreter_type == INTERPRETER_AOUT) @@ -1039,7 +1059,10 @@ goto out_free_ph; elf_bss = elf_phdata->p_vaddr + elf_phdata->p_filesz; - padzero(elf_bss); + if (padzero(elf_bss)) { + error = -EFAULT; + goto out_free_ph; + } len = ELF_PAGESTART(elf_phdata->p_filesz + elf_phdata->p_vaddr + ELF_MIN_ALIGN - 1); bss = elf_phdata->p_memsz + elf_phdata->p_vaddr; @@ -1246,8 +1269,8 @@ cputime_to_timeval(p->signal->cstime, &prstatus->pr_cstime); } -static void fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p, - struct mm_struct *mm) +static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p, + struct mm_struct *mm) { int i, len; @@ -1257,8 +1280,9 @@ len = mm->arg_end - mm->arg_start; if (len >= ELF_PRARGSZ) len = ELF_PRARGSZ-1; - copy_from_user(&psinfo->pr_psargs, - (const char __user *)mm->arg_start, len); + if (copy_from_user(&psinfo->pr_psargs, + (const char __user *)mm->arg_start, len)) + return -EFAULT; for(i = 0; i < len; i++) if (psinfo->pr_psargs[i] == 0) psinfo->pr_psargs[i] = ' '; @@ -1279,7 +1303,7 @@ SET_GID(psinfo->pr_gid, p->gid); strncpy(psinfo->pr_fname, p->comm, sizeof(psinfo->pr_fname)); - return; + return 0; } /* Here is the structure in which status of each thread is captured. */ diff -Nru a/fs/cifs/connect.c b/fs/cifs/connect.c --- a/fs/cifs/connect.c 2005-01-28 14:11:41 -08:00 +++ b/fs/cifs/connect.c 2005-01-28 14:11:41 -08:00 @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -1647,7 +1646,7 @@ 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bytes_returned = - cifs_strtoUCS((wchar_t *) bcc_ptr, UTS_RELEASE, 32, + cifs_strtoUCS((wchar_t *) bcc_ptr, system_utsname.release, 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; @@ -1674,8 +1673,8 @@ } strcpy(bcc_ptr, "Linux version "); bcc_ptr += strlen("Linux version "); - strcpy(bcc_ptr, UTS_RELEASE); - bcc_ptr += strlen(UTS_RELEASE) + 1; + strcpy(bcc_ptr, system_utsname.release); + bcc_ptr += strlen(system_utsname.release) + 1; strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; } @@ -1891,7 +1890,7 @@ 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bytes_returned = - cifs_strtoUCS((wchar_t *) bcc_ptr, UTS_RELEASE, 32, + cifs_strtoUCS((wchar_t *) bcc_ptr, system_utsname.release, 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; @@ -1916,8 +1915,8 @@ } strcpy(bcc_ptr, "Linux version "); bcc_ptr += strlen("Linux version "); - strcpy(bcc_ptr, UTS_RELEASE); - bcc_ptr += strlen(UTS_RELEASE) + 1; + strcpy(bcc_ptr, system_utsname.release); + bcc_ptr += strlen(system_utsname.release) + 1; strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; } @@ -2180,7 +2179,7 @@ 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bytes_returned = - cifs_strtoUCS((wchar_t *) bcc_ptr, UTS_RELEASE, 32, + cifs_strtoUCS((wchar_t *) bcc_ptr, system_utsname.release, 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; /* null terminate Linux version */ @@ -2197,8 +2196,8 @@ } else { /* ASCII */ strcpy(bcc_ptr, "Linux version "); bcc_ptr += strlen("Linux version "); - strcpy(bcc_ptr, UTS_RELEASE); - bcc_ptr += strlen(UTS_RELEASE) + 1; + strcpy(bcc_ptr, system_utsname.release); + bcc_ptr += strlen(system_utsname.release) + 1; strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; bcc_ptr++; /* empty domain field */ @@ -2565,7 +2564,7 @@ 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bytes_returned = - cifs_strtoUCS((wchar_t *) bcc_ptr, UTS_RELEASE, 32, + cifs_strtoUCS((wchar_t *) bcc_ptr, system_utsname.release, 32, nls_codepage); bcc_ptr += 2 * bytes_returned; bcc_ptr += 2; /* null term version string */ @@ -2617,8 +2616,8 @@ strcpy(bcc_ptr, "Linux version "); bcc_ptr += strlen("Linux version "); - strcpy(bcc_ptr, UTS_RELEASE); - bcc_ptr += strlen(UTS_RELEASE) + 1; + strcpy(bcc_ptr, system_utsname.release); + bcc_ptr += strlen(system_utsname.release) + 1; strcpy(bcc_ptr, CIFS_NETWORK_OPSYS); bcc_ptr += strlen(CIFS_NETWORK_OPSYS) + 1; bcc_ptr++; /* null domain */ diff -Nru a/fs/compat.c b/fs/compat.c --- a/fs/compat.c 2005-01-28 14:11:40 -08:00 +++ b/fs/compat.c 2005-01-28 14:11:40 -08:00 @@ -439,6 +439,11 @@ if (!filp) goto out; + /* RED-PEN how should LSM module know it's handling 32bit? */ + error = security_file_ioctl(filp, cmd, arg); + if (error) + goto out_fput; + /* * To allow the compat_ioctl handlers to be self contained * we need to check the common ioctls here first. @@ -496,11 +501,6 @@ found_handler: if (t->handler) { - /* RED-PEN how should LSM module know it's handling 32bit? */ - error = security_file_ioctl(filp, cmd, arg); - if (error) - goto out_fput; - lock_kernel(); error = t->handler(fd, cmd, arg, filp); unlock_kernel(); @@ -510,7 +510,7 @@ up_read(&ioctl32_sem); do_ioctl: - error = sys_ioctl(fd, cmd, arg); + error = vfs_ioctl(filp, fd, cmd, arg); out_fput: fput_light(filp, fput_needed); out: @@ -1126,7 +1126,6 @@ int seg; io_fn_t fn; iov_fn_t fnv; - struct inode *inode; /* * SuS says "The readv() function *may* fail if the iovcnt argument @@ -1191,11 +1190,7 @@ goto out; } - inode = file->f_dentry->d_inode; - /* VERIFY_WRITE actually means a read, as we write to user space */ - ret = locks_verify_area((type == READ - ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE), - inode, file, *pos, tot_len); + ret = rw_verify_area(type, file, pos, tot_len); if (ret) goto out; diff -Nru a/fs/compat_ioctl.c b/fs/compat_ioctl.c --- a/fs/compat_ioctl.c 2005-01-28 14:11:41 -08:00 +++ b/fs/compat_ioctl.c 2005-01-28 14:11:41 -08:00 @@ -645,8 +645,11 @@ /* Don't check these user accesses, just let that get trapped * in the ioctl handler instead. */ - copy_to_user(&u_ifreq64->ifr_ifrn.ifrn_name[0], &tmp_buf[0], IFNAMSIZ); - __put_user(data64, &u_ifreq64->ifr_ifru.ifru_data); + if (copy_to_user(&u_ifreq64->ifr_ifrn.ifrn_name[0], &tmp_buf[0], + IFNAMSIZ)) + return -EFAULT; + if (__put_user(data64, &u_ifreq64->ifr_ifru.ifru_data)) + return -EFAULT; return sys_ioctl(fd, cmd, (unsigned long) u_ifreq64); } @@ -2343,7 +2346,9 @@ __put_user(d->d_ino, &d32->d_ino); __put_user(d->d_off, &d32->d_off); __put_user(d->d_reclen, &d32->d_reclen); - __copy_to_user(d32->d_name, d->d_name, d->d_reclen); + if (__copy_to_user(d32->d_name, d->d_name, d->d_reclen)) + return -EFAULT; + return ret; } @@ -2486,7 +2491,8 @@ if (cmd == TIOCSSERIAL) { if (verify_area(VERIFY_READ, ss32, sizeof(SS32))) return -EFAULT; - __copy_from_user(&ss, ss32, offsetof(SS32, iomem_base)); + if (__copy_from_user(&ss, ss32, offsetof(SS32, iomem_base))) + return -EFAULT; __get_user(udata, &ss32->iomem_base); ss.iomem_base = compat_ptr(udata); __get_user(ss.iomem_reg_shift, &ss32->iomem_reg_shift); @@ -2499,7 +2505,8 @@ if (cmd == TIOCGSERIAL && err >= 0) { if (verify_area(VERIFY_WRITE, ss32, sizeof(SS32))) return -EFAULT; - __copy_to_user(ss32,&ss,offsetof(SS32,iomem_base)); + if (__copy_to_user(ss32,&ss,offsetof(SS32,iomem_base))) + return -EFAULT; __put_user((unsigned long)ss.iomem_base >> 32 ? 0xffffffff : (unsigned)(unsigned long)ss.iomem_base, &ss32->iomem_base); diff -Nru a/fs/ext2/acl.c b/fs/ext2/acl.c --- a/fs/ext2/acl.c 2005-01-28 14:11:41 -08:00 +++ b/fs/ext2/acl.c 2005-01-28 14:11:41 -08:00 @@ -255,8 +255,6 @@ return -EINVAL; } if (acl) { - if (acl->a_count > EXT2_ACL_MAX_ENTRIES) - return -EINVAL; value = ext2_acl_to_disk(acl, &size); if (IS_ERR(value)) return (int)PTR_ERR(value); diff -Nru a/fs/ext2/acl.h b/fs/ext2/acl.h --- a/fs/ext2/acl.h 2005-01-28 14:11:41 -08:00 +++ b/fs/ext2/acl.h 2005-01-28 14:11:41 -08:00 @@ -7,7 +7,6 @@ #include #define EXT2_ACL_VERSION 0x0001 -#define EXT2_ACL_MAX_ENTRIES 32 typedef struct { __le16 e_tag; diff -Nru a/fs/ext2/balloc.c b/fs/ext2/balloc.c --- a/fs/ext2/balloc.c 2005-01-28 14:11:40 -08:00 +++ b/fs/ext2/balloc.c 2005-01-28 14:11:40 -08:00 @@ -6,7 +6,7 @@ * Laboratoire MASI - Institut Blaise Pascal * Universite Pierre et Marie Curie (Paris VI) * - * Enhanced block allocation by Stephen Tweedie (sct@dcs.ed.ac.uk), 1993 + * Enhanced block allocation by Stephen Tweedie (sct@redhat.com), 1993 * Big-endian to little-endian byte-swapping/bitmaps by * David S. Miller (davem@caip.rutgers.edu), 1995 */ @@ -52,9 +52,9 @@ return NULL; } - - group_desc = block_group / EXT2_DESC_PER_BLOCK(sb); - offset = block_group % EXT2_DESC_PER_BLOCK(sb); + + group_desc = block_group >> EXT2_DESC_PER_BLOCK_BITS(sb); + offset = block_group & (EXT2_DESC_PER_BLOCK(sb) - 1); if (!sbi->s_group_desc[group_desc]) { ext2_error (sb, "ext2_get_group_desc", "Group descriptor not loaded - " @@ -62,7 +62,7 @@ block_group, group_desc, offset); return NULL; } - + desc = (struct ext2_group_desc *) sbi->s_group_desc[group_desc]->b_data; if (bh) *bh = sbi->s_group_desc[group_desc]; @@ -236,12 +236,12 @@ for (i = 0, group_freed = 0; i < count; i++) { if (!ext2_clear_bit_atomic(sb_bgl_lock(sbi, block_group), - bit + i, (void *) bitmap_bh->b_data)) - ext2_error (sb, "ext2_free_blocks", - "bit already cleared for block %lu", - block + i); - else + bit + i, bitmap_bh->b_data)) { + ext2_error(sb, __FUNCTION__, + "bit already cleared for block %lu", block + i); + } else { group_freed++; + } } mark_buffer_dirty(bitmap_bh); @@ -569,25 +569,24 @@ static inline int block_in_use(unsigned long block, struct super_block *sb, unsigned char *map) { - return ext2_test_bit ((block - le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block)) % + return ext2_test_bit ((block - + le32_to_cpu(EXT2_SB(sb)->s_es->s_first_data_block)) % EXT2_BLOCKS_PER_GROUP(sb), map); } static inline int test_root(int a, int b) { - if (a == 0) - return 1; - while (1) { - if (a == 1) - return 1; - if (a % b) - return 0; - a = a / b; - } + int num = b; + + while (a > num) + num *= b; + return num == a; } static int ext2_group_sparse(int group) { + if (group <= 1) + return 1; return (test_root(group, 3) || test_root(group, 5) || test_root(group, 7)); } diff -Nru a/fs/ext2/inode.c b/fs/ext2/inode.c --- a/fs/ext2/inode.c 2005-01-28 14:11:40 -08:00 +++ b/fs/ext2/inode.c 2005-01-28 14:11:40 -08:00 @@ -354,7 +354,7 @@ { struct ext2_inode_info *ei = EXT2_I(inode); write_lock(&ei->i_meta_lock); - if (block == ei->i_next_alloc_block + 1) { + if ((block == ei->i_next_alloc_block + 1) && ei->i_next_alloc_goal) { ei->i_next_alloc_block++; ei->i_next_alloc_goal++; } diff -Nru a/fs/ext3/acl.c b/fs/ext3/acl.c --- a/fs/ext3/acl.c 2005-01-28 14:11:40 -08:00 +++ b/fs/ext3/acl.c 2005-01-28 14:11:40 -08:00 @@ -259,8 +259,6 @@ return -EINVAL; } if (acl) { - if (acl->a_count > EXT3_ACL_MAX_ENTRIES) - return -EINVAL; value = ext3_acl_to_disk(acl, &size); if (IS_ERR(value)) return (int)PTR_ERR(value); diff -Nru a/fs/ext3/acl.h b/fs/ext3/acl.h --- a/fs/ext3/acl.h 2005-01-28 14:11:41 -08:00 +++ b/fs/ext3/acl.h 2005-01-28 14:11:41 -08:00 @@ -7,7 +7,6 @@ #include #define EXT3_ACL_VERSION 0x0001 -#define EXT3_ACL_MAX_ENTRIES 32 typedef struct { __le16 e_tag; diff -Nru a/fs/ext3/inode.c b/fs/ext3/inode.c --- a/fs/ext3/inode.c 2005-01-28 14:11:41 -08:00 +++ b/fs/ext3/inode.c 2005-01-28 14:11:41 -08:00 @@ -464,7 +464,7 @@ { struct ext3_inode_info *ei = EXT3_I(inode); /* Writer: ->i_next_alloc* */ - if (block == ei->i_next_alloc_block + 1) { + if ((block == ei->i_next_alloc_block + 1)&& ei->i_next_alloc_goal) { ei->i_next_alloc_block++; ei->i_next_alloc_goal++; } @@ -2493,15 +2493,30 @@ ei->i_data[block] = raw_inode->i_block[block]; INIT_LIST_HEAD(&ei->i_orphan); - ei->i_extra_isize = - (EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) ? - le16_to_cpu(raw_inode->i_extra_isize) : 0; - if (ei->i_extra_isize) { - __le32 *magic = (void *)raw_inode + EXT3_GOOD_OLD_INODE_SIZE + - ei->i_extra_isize; - if (le32_to_cpu(*magic)) - ei->i_state |= EXT3_STATE_XATTR; - } + if (inode->i_ino >= EXT3_FIRST_INO(inode->i_sb) + 1 && + EXT3_INODE_SIZE(inode->i_sb) > EXT3_GOOD_OLD_INODE_SIZE) { + /* + * When mke2fs creates big inodes it does not zero out + * the unused bytes above EXT3_GOOD_OLD_INODE_SIZE, + * so ignore those first few inodes. + */ + ei->i_extra_isize = le16_to_cpu(raw_inode->i_extra_isize); + if (EXT3_GOOD_OLD_INODE_SIZE + ei->i_extra_isize > + EXT3_INODE_SIZE(inode->i_sb)) + goto bad_inode; + if (ei->i_extra_isize == 0) { + /* The extra space is currently unused. Use it. */ + ei->i_extra_isize = sizeof(struct ext3_inode) - + EXT3_GOOD_OLD_INODE_SIZE; + } else { + __le32 *magic = (void *)raw_inode + + EXT3_GOOD_OLD_INODE_SIZE + + ei->i_extra_isize; + if (*magic == cpu_to_le32(EXT3_XATTR_MAGIC)) + ei->i_state |= EXT3_STATE_XATTR; + } + } else + ei->i_extra_isize = 0; if (S_ISREG(inode->i_mode)) { inode->i_op = &ext3_file_inode_operations; diff -Nru a/fs/ext3/xattr.c b/fs/ext3/xattr.c --- a/fs/ext3/xattr.c 2005-01-28 14:11:41 -08:00 +++ b/fs/ext3/xattr.c 2005-01-28 14:11:41 -08:00 @@ -37,9 +37,9 @@ * | value 2 | | * +------------------+ * - * The header is followed by multiple entry descriptors. Descriptors are - * kept sorted. The attribute values are aligned to the end of the block - * in no specific order. + * The header is followed by multiple entry descriptors. In disk blocks, the + * entry descriptors are kept sorted. In inodes, they are unsorted. The + * attribute values are aligned to the end of the block in no specific order. * * Locking strategy * ---------------- @@ -272,8 +272,7 @@ void *end; int error; - if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE || - !(EXT3_I(inode)->i_state & EXT3_STATE_XATTR)) + if (!(EXT3_I(inode)->i_state & EXT3_STATE_XATTR)) return -ENODATA; error = ext3_get_inode_loc(inode, &iloc); if (error) @@ -399,8 +398,7 @@ void *end; int error; - if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE || - !(EXT3_I(inode)->i_state & EXT3_STATE_XATTR)) + if (!(EXT3_I(inode)->i_state & EXT3_STATE_XATTR)) return 0; error = ext3_get_inode_loc(inode, &iloc); if (error) @@ -773,7 +771,7 @@ error = ext3_journal_get_write_access(handle, new_bh); if (error) - goto cleanup; + goto cleanup_dquot; lock_buffer(new_bh); BHDR(new_bh)->h_refcount = cpu_to_le32(1 + le32_to_cpu(BHDR(new_bh)->h_refcount)); @@ -783,7 +781,7 @@ error = ext3_journal_dirty_metadata(handle, new_bh); if (error) - goto cleanup; + goto cleanup_dquot; } mb_cache_entry_release(ce); ce = NULL; @@ -823,7 +821,6 @@ error = ext3_journal_dirty_metadata(handle, new_bh); if (error) goto cleanup; - ext3_xattr_update_super_block(handle, sb); } } @@ -844,6 +841,10 @@ return error; +cleanup_dquot: + DQUOT_FREE_BLOCK(inode, 1); + goto cleanup; + bad_block: ext3_error(inode->i_sb, __FUNCTION__, "inode %ld: bad block %d", inode->i_ino, @@ -866,7 +867,7 @@ struct ext3_inode *raw_inode; int error; - if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE) + if (EXT3_I(inode)->i_extra_isize == 0) return 0; raw_inode = ext3_raw_inode(&is->iloc); header = IHDR(inode, raw_inode); @@ -897,7 +898,7 @@ struct ext3_xattr_search *s = &is->s; int error; - if (EXT3_SB(inode->i_sb)->s_inode_size <= EXT3_GOOD_OLD_INODE_SIZE) + if (EXT3_I(inode)->i_extra_isize == 0) return -ENOSPC; error = ext3_xattr_set_entry(i, s); if (error) @@ -957,6 +958,13 @@ error = ext3_get_inode_loc(inode, &is.iloc); if (error) goto cleanup; + + if (EXT3_I(inode)->i_state & EXT3_STATE_NEW) { + struct ext3_inode *raw_inode = ext3_raw_inode(&is.iloc); + memset(raw_inode, 0, EXT3_SB(inode->i_sb)->s_inode_size); + EXT3_I(inode)->i_state &= ~EXT3_STATE_NEW; + } + error = ext3_xattr_ibody_find(inode, &i, &is); if (error) goto cleanup; @@ -1001,6 +1009,7 @@ } } if (!error) { + ext3_xattr_update_super_block(handle, inode->i_sb); inode->i_ctime = CURRENT_TIME_SEC; error = ext3_mark_iloc_dirty(handle, inode, &is.iloc); /* @@ -1066,7 +1075,6 @@ { struct buffer_head *bh = NULL; - down_write(&EXT3_I(inode)->xattr_sem); if (!EXT3_I(inode)->i_file_acl) goto cleanup; bh = sb_bread(inode->i_sb, EXT3_I(inode)->i_file_acl); @@ -1088,7 +1096,6 @@ cleanup: brelse(bh); - up_write(&EXT3_I(inode)->xattr_sem); } /* diff -Nru a/fs/file_table.c b/fs/file_table.c --- a/fs/file_table.c 2005-01-28 14:11:40 -08:00 +++ b/fs/file_table.c 2005-01-28 14:11:40 -08:00 @@ -85,6 +85,7 @@ rwlock_init(&f->f_owner.lock); /* f->f_version: 0 */ INIT_LIST_HEAD(&f->f_list); + f->f_maxcount = INT_MAX; return f; } } diff -Nru a/fs/ioctl.c b/fs/ioctl.c --- a/fs/ioctl.c 2005-01-28 14:11:40 -08:00 +++ b/fs/ioctl.c 2005-01-28 14:11:40 -08:00 @@ -77,25 +77,17 @@ return do_ioctl(filp, cmd, arg); } - /* * When you add any new common ioctls to the switches above and below * please update compat_sys_ioctl() too. + * + * vfs_ioctl() is not for drivers and not intended to be EXPORT_SYMBOL()'d. + * It's just a simple helper for sys_ioctl and compat_sys_ioctl. */ -asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) +int vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, unsigned long arg) { - struct file * filp; unsigned int flag; - int on, error = -EBADF; - int fput_needed; - - filp = fget_light(fd, &fput_needed); - if (!filp) - goto out; - - error = security_file_ioctl(filp, cmd, arg); - if (error) - goto out_fput; + int on, error = 0; switch (cmd) { case FIOCLEX: @@ -161,6 +153,24 @@ error = do_ioctl(filp, cmd, arg); break; } + return error; +} + +asmlinkage long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) +{ + struct file * filp; + int error = -EBADF; + int fput_needed; + + filp = fget_light(fd, &fput_needed); + if (!filp) + goto out; + + error = security_file_ioctl(filp, cmd, arg); + if (error) + goto out_fput; + + error = vfs_ioctl(filp, fd, cmd, arg); out_fput: fput_light(filp, fput_needed); out: diff -Nru a/fs/locks.c b/fs/locks.c --- a/fs/locks.c 2005-01-28 14:11:41 -08:00 +++ b/fs/locks.c 2005-01-28 14:11:41 -08:00 @@ -1011,7 +1011,7 @@ * @count: length of area to check * * Searches the inode's list of locks to find any POSIX locks which conflict. - * This function is called from locks_verify_area() and + * This function is called from rw_verify_area() and * locks_verify_truncate(). */ int locks_mandatory_area(int read_write, struct inode *inode, diff -Nru a/fs/mbcache.c b/fs/mbcache.c --- a/fs/mbcache.c 2005-01-28 14:11:41 -08:00 +++ b/fs/mbcache.c 2005-01-28 14:11:41 -08:00 @@ -554,8 +554,6 @@ __mb_cache_entry_find(struct list_head *l, struct list_head *head, int index, struct block_device *bdev, unsigned int key) { - DEFINE_WAIT(wait); - while (l != head) { struct mb_cache_entry *ce = list_entry(l, struct mb_cache_entry, diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog --- a/fs/ntfs/ChangeLog 2005-01-28 14:11:40 -08:00 +++ b/fs/ntfs/ChangeLog 2005-01-28 14:11:40 -08:00 @@ -25,6 +25,13 @@ - Enable the code for setting the NT4 compatibility flag when we start making NTFS 1.2 specific modifications. +2.1.23-WIP + + - Add printk rate limiting for ntfs_warning() and ntfs_error() when + compiled without debug. This avoids a possible denial of service + attack. Thanks to Carl-Daniel Hailfinger from SuSE for pointing this + out. + 2.1.22 - Many bug and race fixes and error handling improvements. - Improve error handling in fs/ntfs/inode.c::ntfs_truncate(). diff -Nru a/fs/ntfs/debug.c b/fs/ntfs/debug.c --- a/fs/ntfs/debug.c 2005-01-28 14:11:41 -08:00 +++ b/fs/ntfs/debug.c 2005-01-28 14:11:41 -08:00 @@ -53,6 +53,10 @@ va_list args; int flen = 0; +#ifndef DEBUG + if (!printk_ratelimit()) + return; +#endif if (function) flen = strlen(function); spin_lock(&err_buf_lock); @@ -93,6 +97,10 @@ va_list args; int flen = 0; +#ifndef DEBUG + if (!printk_ratelimit()) + return; +#endif if (function) flen = strlen(function); spin_lock(&err_buf_lock); diff -Nru a/fs/pipe.c b/fs/pipe.c --- a/fs/pipe.c 2005-01-28 14:11:40 -08:00 +++ b/fs/pipe.c 2005-01-28 14:11:40 -08:00 @@ -630,13 +630,13 @@ struct pipe_inode_info *info = inode->i_pipe; inode->i_pipe = NULL; - if (info->tmp_page) - __free_page(info->tmp_page); for (i = 0; i < PIPE_BUFFERS; i++) { struct pipe_buffer *buf = info->bufs + i; if (buf->ops) buf->ops->release(info, buf); } + if (info->tmp_page) + __free_page(info->tmp_page); kfree(info); } diff -Nru a/fs/read_write.c b/fs/read_write.c --- a/fs/read_write.c 2005-01-28 14:11:41 -08:00 +++ b/fs/read_write.c 2005-01-28 14:11:41 -08:00 @@ -182,6 +182,20 @@ } #endif + +int rw_verify_area(int read_write, struct file *file, loff_t *ppos, size_t count) +{ + struct inode *inode; + + if (count > file->f_maxcount) + return -EINVAL; + + inode = file->f_dentry->d_inode; + if (inode->i_flock && MANDATORY_LOCK(inode)) + return locks_mandatory_area(read_write == READ ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE, inode, file, *ppos, count); + return 0; +} + ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos) { struct kiocb kiocb; @@ -200,7 +214,6 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos) { - struct inode *inode = file->f_dentry->d_inode; ssize_t ret; if (!(file->f_mode & FMODE_READ)) @@ -208,7 +221,7 @@ if (!file->f_op || (!file->f_op->read && !file->f_op->aio_read)) return -EINVAL; - ret = locks_verify_area(FLOCK_VERIFY_READ, inode, file, *pos, count); + ret = rw_verify_area(READ, file, pos, count); if (!ret) { ret = security_file_permission (file, MAY_READ); if (!ret) { @@ -247,7 +260,6 @@ ssize_t vfs_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) { - struct inode *inode = file->f_dentry->d_inode; ssize_t ret; if (!(file->f_mode & FMODE_WRITE)) @@ -255,7 +267,7 @@ if (!file->f_op || (!file->f_op->write && !file->f_op->aio_write)) return -EINVAL; - ret = locks_verify_area(FLOCK_VERIFY_WRITE, inode, file, *pos, count); + ret = rw_verify_area(WRITE, file, pos, count); if (!ret) { ret = security_file_permission (file, MAY_WRITE); if (!ret) { @@ -399,7 +411,6 @@ int seg; io_fn_t fn; iov_fn_t fnv; - struct inode *inode; /* * SuS says "The readv() function *may* fail if the iovcnt argument @@ -452,11 +463,7 @@ goto out; } - inode = file->f_dentry->d_inode; - /* VERIFY_WRITE actually means a read, as we write to user space */ - ret = locks_verify_area((type == READ - ? FLOCK_VERIFY_READ : FLOCK_VERIFY_WRITE), - inode, file, *pos, tot_len); + ret = rw_verify_area(type, file, pos, tot_len); if (ret) goto out; @@ -603,7 +610,7 @@ else if (!(in_file->f_mode & FMODE_PREAD)) goto fput_in; - retval = locks_verify_area(FLOCK_VERIFY_READ, in_inode, in_file, *ppos, count); + retval = rw_verify_area(READ, in_file, ppos, count); if (retval) goto fput_in; @@ -624,7 +631,7 @@ if (!out_file->f_op || !out_file->f_op->sendpage) goto fput_out; out_inode = out_file->f_dentry->d_inode; - retval = locks_verify_area(FLOCK_VERIFY_WRITE, out_inode, out_file, out_file->f_pos, count); + retval = rw_verify_area(WRITE, out_file, &out_file->f_pos, count); if (retval) goto fput_out; diff -Nru a/include/asm-alpha/string.h b/include/asm-alpha/string.h --- a/include/asm-alpha/string.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-alpha/string.h 2005-01-28 14:11:40 -08:00 @@ -13,7 +13,6 @@ #define __HAVE_ARCH_MEMCPY extern void * memcpy(void *, const void *, size_t); #define __HAVE_ARCH_MEMMOVE -#define __HAVE_ARCH_BCOPY extern void * memmove(void *, const void *, size_t); /* For backward compatibility with modules. Unused otherwise. */ diff -Nru a/include/asm-arm/arch-cl7500/debug-macro.S b/include/asm-arm/arch-cl7500/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-cl7500/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,31 @@ +/* linux/include/asm-arm/arch-cl7500/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .macro addruart,rx + mov \rx, #0xe0000000 + orr \rx, \rx, #0x00010000 + orr \rx, \rx, #0x00000be0 + .endm + + .macro senduart,rd,rx + strb \rd, [\rx] + .endm + + .macro busyuart,rd,rx + .endm + + .macro waituart,rd,rx +1001: ldrb \rd, [\rx, #0x14] + tst \rd, #0x20 + beq 1001b + .endm diff -Nru a/include/asm-arm/arch-clps711x/debug-macro.S b/include/asm-arm/arch-clps711x/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-clps711x/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,46 @@ +/* linux/include/asm-arm/arch-clps711x/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + +#include + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #CLPS7111_PHYS_BASE + movne \rx, #CLPS7111_VIRT_BASE +#ifndef CONFIG_DEBUG_CLPS711X_UART2 + add \rx, \rx, #0x0000 @ UART1 +#else + add \rx, \rx, #0x1000 @ UART2 +#endif + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #0x0480] @ UARTDR + .endm + + .macro waituart,rd,rx +1001: ldr \rd, [\rx, #0x0140] @ SYSFLGx + tst \rd, #1 << 11 @ UBUSYx + bne 1001b + .endm + + .macro busyuart,rd,rx + tst \rx, #0x1000 @ UART2 does not have CTS here + bne 1002f +1001: ldr \rd, [\rx, #0x0140] @ SYSFLGx + tst \rd, #1 << 8 @ CTS + bne 1001b +1002: + .endm + diff -Nru a/include/asm-arm/arch-ebsa110/debug-macro.S b/include/asm-arm/arch-ebsa110/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-ebsa110/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,34 @@ +/* linux/include/asm-arm/arch-ebsa110/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +**/ + + .macro addruart,rx + mov \rx, #0xf0000000 + orr \rx, \rx, #0x00000be0 + .endm + + .macro senduart,rd,rx + strb \rd, [\rx] + .endm + + .macro busyuart,rd,rx +1002: ldrb \rd, [\rx, #0x14] + and \rd, \rd, #0x60 + teq \rd, #0x60 + bne 1002b + .endm + + .macro waituart,rd,rx +1001: ldrb \rd, [\rx, #0x18] + tst \rd, #0x10 + beq 1001b + .endm diff -Nru a/include/asm-arm/arch-ebsa285/debug-macro.S b/include/asm-arm/arch-ebsa285/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-ebsa285/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,66 @@ +/* linux/include/asm-arm/arch-ebsa285/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + +#include + +#ifndef CONFIG_DEBUG_DC21285_PORT + /* For NetWinder debugging */ + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x7c000000 @ physical + movne \rx, #0xff000000 @ virtual + orr \rx, \rx, #0x000003f8 + .endm + + .macro senduart,rd,rx + strb \rd, [\rx] + .endm + + .macro busyuart,rd,rx +1002: ldrb \rd, [\rx, #0x5] + and \rd, \rd, #0x60 + teq \rd, #0x60 + bne 1002b + .endm + + .macro waituart,rd,rx +1001: ldrb \rd, [\rx, #0x6] + tst \rd, #0x10 + beq 1001b + .endm +#else + /* For EBSA285 debugging */ + .equ dc21285_high, ARMCSR_BASE & 0xff000000 + .equ dc21285_low, ARMCSR_BASE & 0x00ffffff + + .macro addruart,rx + mov \rx, #dc21285_high + .if dc21285_low + orr \rx, \rx, #dc21285_low + .endif + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #0x160] @ UARTDR + .endm + + .macro busyuart,rd,rx +1001: ldr \rd, [\rx, #0x178] @ UARTFLG + tst \rd, #1 << 3 + bne 1001b + .endm + + .macro waituart,rd,rx + .endm +#endif diff -Nru a/include/asm-arm/arch-epxa10db/debug-macro.S b/include/asm-arm/arch-epxa10db/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-epxa10db/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,41 @@ +/* linux/include/asm-arm/arch-epxa10db/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + +#include +#define UART00_TYPE +#include + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + ldr \rx, =EXC_UART00_BASE @ physical base address + orrne \rx, \rx, #0xff000000 @ virtual base + orrne \rx, \rx, #0x00f00000 + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #UART_TD(0)] + .endm + + .macro waituart,rd,rx +1001: ldr \rd, [\rx, #UART_TSR(0)] + and \rd, \rd, #UART_TSR_TX_LEVEL_MSK + cmp \rd, #15 + beq 1001b + .endm + + .macro busyuart,rd,rx +1001: ldr \rd, [\rx, #UART_TSR(0)] + ands \rd, \rd, #UART_TSR_TX_LEVEL_MSK + bne 1001b + .endm diff -Nru a/include/asm-arm/arch-h720x/debug-macro.S b/include/asm-arm/arch-h720x/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-h720x/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,40 @@ +/* linux/include/asm-arm/arch-h720x/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .equ io_virt, IO_BASE + .equ io_phys, IO_START + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #io_phys @ physical base address + movne \rx, #io_virt @ virtual address + add \rx, \rx, #0x00020000 @ UART1 + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #0x0] @ UARTDR + + .endm + + .macro waituart,rd,rx +1001: ldr \rd, [\rx, #0x18] @ UARTFLG + tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full + bne 1001b + .endm + + .macro busyuart,rd,rx +1001: ldr \rd, [\rx, #0x18] @ UARTFLG + tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy + bne 1001b + .endm diff -Nru a/include/asm-arm/arch-imx/debug-macro.S b/include/asm-arm/arch-imx/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-imx/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,34 @@ +/* linux/include/asm-arm/arch-imx/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x00000000 @ physical + movne \rx, #0xe0000000 @ virtual + orr \rx, \rx, #0x00200000 + orr \rx, \rx, #0x00006000 @ UART1 offset + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #0x40] @ TXDATA + .endm + + .macro waituart,rd,rx + .endm + + .macro busyuart,rd,rx +1002: ldr \rd, [\rx, #0x98] @ SR2 + tst \rd, #1 << 3 @ TXDC + beq 1002b @ wait until transmit done + .endm diff -Nru a/include/asm-arm/arch-integrator/debug-macro.S b/include/asm-arm/arch-integrator/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-integrator/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,38 @@ +/* linux/include/asm-arm/arch-integrator/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + +#include + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x16000000 @ physical base address + movne \rx, #0xf0000000 @ virtual base + addne \rx, \rx, #0x16000000 >> 4 + .endm + + .macro senduart,rd,rx + strb \rd, [\rx, #UART01x_DR] + .endm + + .macro waituart,rd,rx +1001: ldr \rd, [\rx, #0x18] @ UARTFLG + tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full + bne 1001b + .endm + + .macro busyuart,rd,rx +1001: ldr \rd, [\rx, #0x18] @ UARTFLG + tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy + bne 1001b + .endm diff -Nru a/include/asm-arm/arch-iop3xx/debug-macro.S b/include/asm-arm/arch-iop3xx/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-iop3xx/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,48 @@ +/* linux/include/asm-arm/arch-iop3xx/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .macro addruart,rx + mov \rx, #0xfe000000 @ physical +#if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) + orr \rx, \rx, #0x00800000 @ location of the UART +#elif defined(CONFIG_ARCH_IOP331) + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x000fe000 @ Physical Base + movne \rx, #0 + orr \rx, \rx, #0xfe000000 + orr \rx, \rx, #0x00f00000 @ Virtual Base + orr \rx, \rx, #0x00001700 @ location of the UART +#else +#error Unknown IOP3XX implementation +#endif + .endm + + .macro senduart,rd,rx + strb \rd, [\rx] + .endm + + .macro busyuart,rd,rx +1002: ldrb \rd, [\rx, #0x5] + and \rd, \rd, #0x60 + teq \rd, #0x60 + bne 1002b + .endm + + .macro waituart,rd,rx +#if !defined(CONFIG_ARCH_IQ80321) || !defined(CONFIG_ARCH_IQ31244) || !defined(CONFIG_ARCH_IQ80331) +1001: ldrb \rd, [\rx, #0x6] + tst \rd, #0x10 + beq 1001b +#endif + .endm diff -Nru a/include/asm-arm/arch-ixp2000/debug-macro.S b/include/asm-arm/arch-ixp2000/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-ixp2000/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,40 @@ +/* linux/include/asm-arm/arch-ixp2000/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0xc0000000 @ Physical base + movne \rx, #0xfe000000 @ virtual base + orrne \rx, \rx, #0x00f00000 + orr \rx, \rx, #0x00030000 +#ifdef __ARMEB__ + orr \rx, \rx, #0x00000003 +#endif + .endm + + .macro senduart,rd,rx + strb \rd, [\rx] + .endm + + .macro busyuart,rd,rx +1002: ldrb \rd, [\rx, #0x14] + tst \rd, #0x20 + beq 1002b + .endm + + .macro waituart,rd,rx + nop + nop + nop + .endm diff -Nru a/include/asm-arm/arch-ixp4xx/debug-macro.S b/include/asm-arm/arch-ixp4xx/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-ixp4xx/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,34 @@ +/* linux/include/asm-arm/arch-ixp4xx/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0xc8000000 + movne \rx, #0xff000000 + add \rx,\rx,#3 @ Uart regs are at off set of 3 if + @ byte writes used - Big Endian. + .endm + + .macro senduart,rd,rx + strb \rd, [\rx] + .endm + + .macro waituart,rd,rx +1002: ldrb \rd, [\rx, #0x14] + and \rd, \rd, #0x60 @ check THRE and TEMT bits + teq \rd, #0x60 + bne 1002b + .endm + + .macro busyuart,rd,rx + .endm diff -Nru a/include/asm-arm/arch-ixp4xx/system.h b/include/asm-arm/arch-ixp4xx/system.h --- a/include/asm-arm/arch-ixp4xx/system.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-arm/arch-ixp4xx/system.h 2005-01-28 14:11:40 -08:00 @@ -31,13 +31,12 @@ /* set the "key" register to enable access to * "timer" and "enable" registers */ - *IXP4XX_OSWK = 0x482e; + *IXP4XX_OSWK = IXP4XX_WDT_KEY; - /* write 0 to the timer register for an immidiate reset */ + /* write 0 to the timer register for an immediate reset */ *IXP4XX_OSWT = 0; - /* disable watchdog interrupt, enable reset, enable count */ - *IXP4XX_OSWE = 0x3; + *IXP4XX_OSWE = IXP4XX_WDT_RESET_ENABLE | IXP4XX_WDT_COUNT_ENABLE; } } diff -Nru a/include/asm-arm/arch-l7200/debug-macro.S b/include/asm-arm/arch-l7200/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-l7200/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,40 @@ +/* linux/include/asm-arm/arch-l7200/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .equ io_virt, IO_BASE + .equ io_phys, IO_START + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #io_phys @ physical base address + movne \rx, #io_virt @ virtual address + add \rx, \rx, #0x00044000 @ UART1 +@ add \rx, \rx, #0x00045000 @ UART2 + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #0x0] @ UARTDR + .endm + + .macro waituart,rd,rx +1001: ldr \rd, [\rx, #0x18] @ UARTFLG + tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full + bne 1001b + .endm + + .macro busyuart,rd,rx +1001: ldr \rd, [\rx, #0x18] @ UARTFLG + tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy + bne 1001b + .endm diff -Nru a/include/asm-arm/arch-lh7a40x/debug-macro.S b/include/asm-arm/arch-lh7a40x/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-lh7a40x/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,39 @@ +/* linux/include/asm-arm/arch-lh7a40x/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + @ It is not known if this will be appropriate for every 40x + @ board. + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + mov \rx, #0x00000700 @ offset from base + orreq \rx, \rx, #0x80000000 @ physical base + orrne \rx, \rx, #0xf8000000 @ virtual base + .endm + + .macro senduart,rd,rx + strb \rd, [\rx] @ DATA + .endm + + .macro busyuart,rd,rx @ spin while busy +1001: ldr \rd, [\rx, #0x10] @ STATUS + tst \rd, #1 << 3 @ BUSY (TX FIFO not empty) + bne 1001b @ yes, spin + .endm + + .macro waituart,rd,rx @ wait for Tx FIFO room +1001: ldrb \rd, [\rx, #0x10] @ STATUS + tst \rd, #1 << 5 @ TXFF (TX FIFO full) + bne 1001b @ yes, spin + .endm diff -Nru a/include/asm-arm/arch-omap/debug-macro.S b/include/asm-arm/arch-omap/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-omap/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,45 @@ +/* linux/include/asm-arm/arch-omap/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0xff000000 @ physical base address + movne \rx, #0xfe000000 @ virtual base + orr \rx, \rx, #0x00fb0000 +#ifdef CONFIG_OMAP_LL_DEBUG_UART3 + orr \rx, \rx, #0x00009000 @ UART 3 +#endif +#if defined(CONFIG_OMAP_LL_DEBUG_UART2) || defined(CONFIG_OMAP_LL_DEBUG_UART3) + orr \rx, \rx, #0x00000800 @ UART 2 & 3 +#endif + .endm + + .macro senduart,rd,rx + strb \rd, [\rx] + .endm + + .macro busyuart,rd,rx +1001: ldrb \rd, [\rx, #(0x5 << 2)] @ OMAP-1510 and friends + and \rd, \rd, #0x60 + teq \rd, #0x60 + beq 1002f + ldrb \rd, [\rx, #(0x5 << 0)] @ OMAP-730 only + and \rd, \rd, #0x60 + teq \rd, #0x60 + bne 1001b +1002: + .endm + + .macro waituart,rd,rx + .endm diff -Nru a/include/asm-arm/arch-pxa/audio.h b/include/asm-arm/arch-pxa/audio.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-pxa/audio.h 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,16 @@ +#ifndef __ASM_ARCH_AUDIO_H__ +#define __ASM_ARCH_AUDIO_H__ + +#include +#include +#include + +typedef struct { + int (*startup)(snd_pcm_substream_t *, void *); + void (*shutdown)(snd_pcm_substream_t *, void *); + void (*suspend)(void *); + void (*resume)(void *); + void *priv; +} pxa2xx_audio_ops_t; + +#endif diff -Nru a/include/asm-arm/arch-pxa/debug-macro.S b/include/asm-arm/arch-pxa/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-pxa/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,36 @@ +/* linux/include/asm-arm/arch-pxa/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x40000000 @ physical + movne \rx, #io_p2v(0x40000000) @ virtual + orr \rx, \rx, #0x00100000 + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #0] + .endm + + .macro busyuart,rd,rx +1002: ldr \rd, [\rx, #0x14] + tst \rd, #(1 << 6) + beq 1002b + .endm + + .macro waituart,rd,rx +1001: ldr \rd, [\rx, #0x14] + tst \rd, #(1 << 5) + beq 1001b + .endm diff -Nru a/include/asm-arm/arch-rpc/debug-macro.S b/include/asm-arm/arch-rpc/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-rpc/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,35 @@ +/* linux/include/asm-arm/arch-rpc/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .macro addruart,rx + mov \rx, #0xe0000000 + orr \rx, \rx, #0x00010000 + orr \rx, \rx, #0x00000fe0 + .endm + + .macro senduart,rd,rx + strb \rd, [\rx] + .endm + + .macro busyuart,rd,rx +1001: ldrb \rd, [\rx, #0x14] + and \rd, \rd, #0x60 + teq \rd, #0x60 + bne 1001b + .endm + + .macro waituart,rd,rx +1001: ldrb \rd, [\rx, #0x18] + tst \rd, #0x10 + beq 1001b + .endm diff -Nru a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-s3c2410/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,97 @@ +/* linux/include/asm-arm/arch-s3c2410/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Copyright (C) 2005 Simtec Electronics + * + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + +#include +#include +#include + +#define S3C2410_UART1_OFF (0x4000) +#define SHIFT_2440TXF (14-9) + + .macro addruart, rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 + ldreq \rx, = S3C2410_PA_UART + ldrne \rx, = S3C2410_VA_UART +#if CONFIG_DEBUG_S3C2410_UART != 0 + add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) +#endif + .endm + + .macro senduart,rd,rx + str \rd, [\rx, # S3C2410_UTXH ] + .endm + + .macro busyuart, rd, rx + ldr \rd, [ \rx, # S3C2410_UFCON ] + tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? + beq 1001f @ + @ FIFO enabled... +1003: + mrc p15, 0, \rd, c1, c0 + tst \rd, #1 + addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) + addne \rd, \rx, #(S3C2410_VA_GPIO - S3C2410_VA_UART) + bic \rd, \rd, #0xff000 + ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] + and \rd, \rd, #0x00ff0000 + teq \rd, #0x00440000 @ is it 2440? + + ldr \rd, [ \rx, # S3C2410_UFSTAT ] + moveq \rd, \rd, lsr #SHIFT_2440TXF + tst \rd, #S3C2410_UFSTAT_TXFULL + bne 1003b + b 1002f + +1001: + @ busy waiting for non fifo + ldr \rd, [ \rx, # S3C2410_UTRSTAT ] + tst \rd, #S3C2410_UTRSTAT_TXFE + beq 1001b + +1002: @ exit busyuart + .endm + + .macro waituart,rd,rx + + ldr \rd, [ \rx, # S3C2410_UFCON ] + tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? + beq 1001f @ + @ FIFO enabled... +1003: + mrc p15, 0, \rd, c1, c0 + tst \rd, #1 + addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) + addne \rd, \rx, #(S3C2410_VA_GPIO - S3C2410_VA_UART) + bic \rd, \rd, #0xff000 + ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] + and \rd, \rd, #0x00ff0000 + teq \rd, #0x00440000 @ is it 2440? + + ldr \rd, [ \rx, # S3C2410_UFSTAT ] + andne \rd, \rd, #S3C2410_UFSTAT_TXMASK + andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK + teq \rd, #0 + bne 1003b + b 1002f + +1001: + @ idle waiting for non fifo + ldr \rd, [ \rx, # S3C2410_UTRSTAT ] + tst \rd, #S3C2410_UTRSTAT_TXFE + beq 1001b + +1002: @ exit busyuart + .endm diff -Nru a/include/asm-arm/arch-sa1100/debug-macro.S b/include/asm-arm/arch-sa1100/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-sa1100/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,57 @@ +/* linux/include/asm-arm/arch-sa1100/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x80000000 @ physical base address + movne \rx, #0xf8000000 @ virtual address + + @ We probe for the active serial port here, coherently with + @ the comment in include/asm-arm/arch-sa1100/uncompress.h. + @ We assume r1 can be clobbered. + + @ see if Ser3 is active + add \rx, \rx, #0x00050000 + ldr r1, [\rx, #UTCR3] + tst r1, #UTCR3_TXE + + @ if Ser3 is inactive, then try Ser1 + addeq \rx, \rx, #(0x00010000 - 0x00050000) + ldreq r1, [\rx, #UTCR3] + tsteq r1, #UTCR3_TXE + + @ if Ser1 is inactive, then try Ser2 + addeq \rx, \rx, #(0x00030000 - 0x00010000) + ldreq r1, [\rx, #UTCR3] + tsteq r1, #UTCR3_TXE + + @ if all ports are inactive, then there is nothing we can do + moveq pc, lr + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #UTDR] + .endm + + .macro waituart,rd,rx +1001: ldr \rd, [\rx, #UTSR1] + tst \rd, #UTSR1_TNF + beq 1001b + .endm + + .macro busyuart,rd,rx +1001: ldr \rd, [\rx, #UTSR1] + tst \rd, #UTSR1_TBY + bne 1001b + .endm diff -Nru a/include/asm-arm/arch-shark/debug-macro.S b/include/asm-arm/arch-shark/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-shark/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,31 @@ +/* linux/include/asm-arm/arch-shark/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + + .macro addruart,rx + mov \rx, #0xe0000000 + orr \rx, \rx, #0x000003f8 + .endm + + .macro senduart,rd,rx + strb \rd, [\rx] + .endm + + .macro busyuart,rd,rx + mov \rd, #0 +1001: add \rd, \rd, #1 + teq \rd, #0x10000 + bne 1001b + .endm + + .macro waituart,rd,rx + .endm diff -Nru a/include/asm-arm/arch-versatile/debug-macro.S b/include/asm-arm/arch-versatile/debug-macro.S --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/asm-arm/arch-versatile/debug-macro.S 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,39 @@ +/* linux/include/asm-arm/arch-versatile/debug-macro.S + * + * Debugging macro include header + * + * Copyright (C) 1994-1999 Russell King + * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * +*/ + +#include + + .macro addruart,rx + mrc p15, 0, \rx, c1, c0 + tst \rx, #1 @ MMU enabled? + moveq \rx, #0x10000000 + movne \rx, #0xf1000000 @ virtual base + orr \rx, \rx, #0x001F0000 + orr \rx, \rx, #0x00001000 + .endm + + .macro senduart,rd,rx + strb \rd, [\rx, #UART01x_DR] + .endm + + .macro waituart,rd,rx +1001: ldr \rd, [\rx, #0x18] @ UARTFLG + tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full + bne 1001b + .endm + + .macro busyuart,rd,rx +1001: ldr \rd, [\rx, #0x18] @ UARTFLG + tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy + bne 1001b + .endm diff -Nru a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h --- a/include/asm-arm/bitops.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-arm/bitops.h 2005-01-28 14:11:40 -08:00 @@ -224,8 +224,8 @@ extern int _test_and_set_bit_be(int nr, volatile unsigned long * p); extern int _test_and_clear_bit_be(int nr, volatile unsigned long * p); extern int _test_and_change_bit_be(int nr, volatile unsigned long * p); -extern int _find_first_zero_bit_be(void * p, unsigned size); -extern int _find_next_zero_bit_be(void * p, int size, int offset); +extern int _find_first_zero_bit_be(const void * p, unsigned size); +extern int _find_next_zero_bit_be(const void * p, int size, int offset); extern int _find_first_bit_be(const unsigned long *p, unsigned size); extern int _find_next_bit_be(const unsigned long *p, int size, int offset); diff -Nru a/include/asm-arm/string.h b/include/asm-arm/string.h --- a/include/asm-arm/string.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-arm/string.h 2005-01-28 14:11:40 -08:00 @@ -25,8 +25,6 @@ #define __HAVE_ARCH_MEMSET extern void * memset(void *, int, __kernel_size_t); -#define __HAVE_ARCH_BCOPY - extern void __memzero(void *ptr, __kernel_size_t n); #define memset(p,v,n) \ diff -Nru a/include/asm-h8300/bitops.h b/include/asm-h8300/bitops.h --- a/include/asm-h8300/bitops.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-h8300/bitops.h 2005-01-28 14:11:40 -08:00 @@ -196,7 +196,7 @@ return result; } -static __inline__ int find_next_zero_bit (void * addr, int size, int offset) +static __inline__ int find_next_zero_bit (const unsigned long * addr, int size, int offset) { unsigned long *p = (unsigned long *)(((unsigned long)addr + (offset >> 3)) & ~3); unsigned long result = offset & ~31UL; diff -Nru a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h --- a/include/asm-ia64/bitops.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ia64/bitops.h 2005-01-28 14:11:41 -08:00 @@ -359,7 +359,7 @@ #endif /* __KERNEL__ */ -extern int __find_next_zero_bit (void *addr, unsigned long size, +extern int __find_next_zero_bit (const void *addr, unsigned long size, unsigned long offset); extern int __find_next_bit(const void *addr, unsigned long size, unsigned long offset); diff -Nru a/include/asm-ia64/hardirq.h b/include/asm-ia64/hardirq.h --- a/include/asm-ia64/hardirq.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ia64/hardirq.h 2005-01-28 14:11:40 -08:00 @@ -19,7 +19,6 @@ #define __ARCH_IRQ_STAT 1 -#define softirq_pending(cpu) (cpu_data(cpu)->softirq_pending) #define local_softirq_pending() (local_cpu_data->softirq_pending) #define HARDIRQ_BITS 14 diff -Nru a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h --- a/include/asm-ia64/hw_irq.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ia64/hw_irq.h 2005-01-28 14:11:40 -08:00 @@ -99,18 +99,6 @@ extern irq_desc_t irq_desc[NR_IRQS]; #ifndef CONFIG_IA64_GENERIC -static inline irq_desc_t * -__ia64_irq_desc (unsigned int irq) -{ - return irq_desc + irq; -} - -static inline ia64_vector -__ia64_irq_to_vector (unsigned int irq) -{ - return (ia64_vector) irq; -} - static inline unsigned int __ia64_local_vector_to_irq (ia64_vector vec) { @@ -132,14 +120,14 @@ static inline irq_desc_t * irq_descp (int irq) { - return platform_irq_desc(irq); + return irq_desc + irq; } /* Extract the IA-64 vector that corresponds to IRQ. */ static inline ia64_vector irq_to_vector (int irq) { - return platform_irq_to_vector(irq); + return (ia64_vector) irq; } /* diff -Nru a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h --- a/include/asm-ia64/machvec.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ia64/machvec.h 2005-01-28 14:11:40 -08:00 @@ -17,7 +17,6 @@ struct device; struct pt_regs; struct scatterlist; -struct irq_desc; struct page; struct mm_struct; struct pci_bus; @@ -29,8 +28,6 @@ typedef void ia64_mv_timer_interrupt_t (int, void *, struct pt_regs *); typedef void ia64_mv_global_tlb_purge_t (unsigned long, unsigned long, unsigned long); typedef void ia64_mv_tlb_migrate_finish_t (struct mm_struct *); -typedef struct irq_desc *ia64_mv_irq_desc (unsigned int); -typedef u8 ia64_mv_irq_to_vector (unsigned int); typedef unsigned int ia64_mv_local_vector_to_irq (u8); typedef char *ia64_mv_pci_get_legacy_mem_t (struct pci_bus *); typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val, @@ -130,8 +127,6 @@ # define platform_dma_sync_sg_for_device ia64_mv.dma_sync_sg_for_device # define platform_dma_mapping_error ia64_mv.dma_mapping_error # define platform_dma_supported ia64_mv.dma_supported -# define platform_irq_desc ia64_mv.irq_desc -# define platform_irq_to_vector ia64_mv.irq_to_vector # define platform_local_vector_to_irq ia64_mv.local_vector_to_irq # define platform_pci_get_legacy_mem ia64_mv.pci_get_legacy_mem # define platform_pci_legacy_read ia64_mv.pci_legacy_read @@ -180,8 +175,6 @@ ia64_mv_dma_sync_sg_for_device *dma_sync_sg_for_device; ia64_mv_dma_mapping_error *dma_mapping_error; ia64_mv_dma_supported *dma_supported; - ia64_mv_irq_desc *irq_desc; - ia64_mv_irq_to_vector *irq_to_vector; ia64_mv_local_vector_to_irq *local_vector_to_irq; ia64_mv_pci_get_legacy_mem_t *pci_get_legacy_mem; ia64_mv_pci_legacy_read_t *pci_legacy_read; @@ -226,8 +219,6 @@ platform_dma_sync_sg_for_device, \ platform_dma_mapping_error, \ platform_dma_supported, \ - platform_irq_desc, \ - platform_irq_to_vector, \ platform_local_vector_to_irq, \ platform_pci_get_legacy_mem, \ platform_pci_legacy_read, \ @@ -337,12 +328,6 @@ #endif #ifndef platform_dma_supported # define platform_dma_supported swiotlb_dma_supported -#endif -#ifndef platform_irq_desc -# define platform_irq_desc __ia64_irq_desc -#endif -#ifndef platform_irq_to_vector -# define platform_irq_to_vector __ia64_irq_to_vector #endif #ifndef platform_local_vector_to_irq # define platform_local_vector_to_irq __ia64_local_vector_to_irq diff -Nru a/include/asm-ia64/machvec_init.h b/include/asm-ia64/machvec_init.h --- a/include/asm-ia64/machvec_init.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ia64/machvec_init.h 2005-01-28 14:11:41 -08:00 @@ -2,8 +2,6 @@ extern ia64_mv_send_ipi_t ia64_send_ipi; extern ia64_mv_global_tlb_purge_t ia64_global_tlb_purge; -extern ia64_mv_irq_desc __ia64_irq_desc; -extern ia64_mv_irq_to_vector __ia64_irq_to_vector; extern ia64_mv_local_vector_to_irq __ia64_local_vector_to_irq; extern ia64_mv_pci_get_legacy_mem_t ia64_pci_get_legacy_mem; extern ia64_mv_pci_legacy_read_t ia64_pci_legacy_read; diff -Nru a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h --- a/include/asm-ia64/machvec_sn2.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ia64/machvec_sn2.h 2005-01-28 14:11:40 -08:00 @@ -40,8 +40,6 @@ extern ia64_mv_timer_interrupt_t sn_timer_interrupt; extern ia64_mv_global_tlb_purge_t sn2_global_tlb_purge; extern ia64_mv_tlb_migrate_finish_t sn_tlb_migrate_finish; -extern ia64_mv_irq_desc sn_irq_desc; -extern ia64_mv_irq_to_vector sn_irq_to_vector; extern ia64_mv_local_vector_to_irq sn_local_vector_to_irq; extern ia64_mv_pci_get_legacy_mem_t sn_pci_get_legacy_mem; extern ia64_mv_pci_legacy_read_t sn_pci_legacy_read; @@ -105,8 +103,6 @@ #define platform_readw_relaxed __sn_readw_relaxed #define platform_readl_relaxed __sn_readl_relaxed #define platform_readq_relaxed __sn_readq_relaxed -#define platform_irq_desc sn_irq_desc -#define platform_irq_to_vector sn_irq_to_vector #define platform_local_vector_to_irq sn_local_vector_to_irq #define platform_pci_get_legacy_mem sn_pci_get_legacy_mem #define platform_pci_legacy_read sn_pci_legacy_read diff -Nru a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h --- a/include/asm-ia64/pal.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ia64/pal.h 2005-01-28 14:11:41 -08:00 @@ -66,7 +66,7 @@ #define PAL_CACHE_PROT_INFO 38 /* get i/d cache protection info */ #define PAL_REGISTER_INFO 39 /* return AR and CR register information*/ #define PAL_SHUTDOWN 40 /* enter processor shutdown state */ -#define PAL_PREFETCH_VISIBILITY 41 +#define PAL_PREFETCH_VISIBILITY 41 /* Make Processor Prefetches Visible */ #define PAL_COPY_PAL 256 /* relocate PAL procedures and PAL PMI */ #define PAL_HALT_INFO 257 /* return the low power capabilities of processor */ @@ -1537,11 +1537,25 @@ return iprv.status; } +/* + * PAL_PREFETCH_VISIBILITY transaction types + */ +#define PAL_VISIBILITY_VIRTUAL 0 +#define PAL_VISIBILITY_PHYSICAL 1 + +/* + * PAL_PREFETCH_VISIBILITY return codes + */ +#define PAL_VISIBILITY_OK 1 +#define PAL_VISIBILITY_OK_REMOTE_NEEDED 0 +#define PAL_VISIBILITY_INVAL_ARG -2 +#define PAL_VISIBILITY_ERROR -3 + static inline s64 -ia64_pal_prefetch_visibility (void) +ia64_pal_prefetch_visibility (s64 trans_type) { struct ia64_pal_retval iprv; - PAL_CALL(iprv, PAL_PREFETCH_VISIBILITY, 0, 0, 0); + PAL_CALL(iprv, PAL_PREFETCH_VISIBILITY, trans_type, 0, 0); return iprv.status; } diff -Nru a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h --- a/include/asm-ia64/sal.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ia64/sal.h 2005-01-28 14:11:41 -08:00 @@ -833,6 +833,8 @@ extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64, u64, u64, u64, u64, u64); +extern void ia64_sal_handler_init(void *entry_point, void *gpval); + #endif /* __ASSEMBLY__ */ #endif /* _ASM_IA64_SAL_H */ diff -Nru a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h --- a/include/asm-ia64/sn/sn_cpuid.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ia64/sn/sn_cpuid.h 2005-01-28 14:11:40 -08:00 @@ -82,7 +82,6 @@ */ #ifndef CONFIG_SMP -#define cpu_logical_id(cpu) 0 #define cpu_physical_id(cpuid) ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff) #endif diff -Nru a/include/asm-ia64/string.h b/include/asm-ia64/string.h --- a/include/asm-ia64/string.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ia64/string.h 2005-01-28 14:11:41 -08:00 @@ -14,7 +14,6 @@ #define __HAVE_ARCH_STRLEN 1 /* see arch/ia64/lib/strlen.S */ #define __HAVE_ARCH_MEMSET 1 /* see arch/ia64/lib/memset.S */ #define __HAVE_ARCH_MEMCPY 1 /* see arch/ia64/lib/memcpy.S */ -#define __HAVE_ARCH_BCOPY 1 /* see arch/ia64/lib/memcpy.S */ extern __kernel_size_t strlen (const char *); extern void *memcpy (void *, const void *, __kernel_size_t); diff -Nru a/include/asm-ia64/uaccess.h b/include/asm-ia64/uaccess.h --- a/include/asm-ia64/uaccess.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ia64/uaccess.h 2005-01-28 14:11:40 -08:00 @@ -132,7 +132,7 @@ #ifdef ASM_SUPPORTED struct __large_struct { unsigned long buf[100]; }; -# define __m(x) (*(struct __large_struct *)(x)) +# define __m(x) (*(struct __large_struct __user *)(x)) /* We need to declare the __ex_table section before we can use it in .xdata. */ asm (".section \"__ex_table\", \"a\"\n\t.previous"); diff -Nru a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h --- a/include/asm-ia64/unistd.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ia64/unistd.h 2005-01-28 14:11:40 -08:00 @@ -374,7 +374,7 @@ int fd, long pgoff); struct pt_regs; struct sigaction; -asmlinkage long sys_execve(char __user *filename, char __user * __user *argv, +long sys_execve(char __user *filename, char __user * __user *argv, char __user * __user *envp, struct pt_regs *regs); asmlinkage long sys_pipe(long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, long stack); diff -Nru a/include/asm-m68k/checksum.h b/include/asm-m68k/checksum.h --- a/include/asm-m68k/checksum.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-m68k/checksum.h 2005-01-28 14:11:41 -08:00 @@ -25,11 +25,14 @@ * better 64-bit) boundary */ -extern unsigned int csum_partial_copy_from_user(const char *src, char *dst, - int len, int sum, int *csum_err); +extern unsigned int csum_partial_copy_from_user(const unsigned char *src, + unsigned char *dst, + int len, int sum, + int *csum_err); -extern unsigned int csum_partial_copy_nocheck(const char *src, char *dst, - int len, int sum); +extern unsigned int csum_partial_copy_nocheck(const unsigned char *src, + unsigned char *dst, int len, + int sum); /* * This is a version of ip_compute_csum() optimized for IP headers, diff -Nru a/include/asm-mips/string.h b/include/asm-mips/string.h --- a/include/asm-mips/string.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-mips/string.h 2005-01-28 14:11:40 -08:00 @@ -137,9 +137,6 @@ #define __HAVE_ARCH_MEMMOVE extern void *memmove(void *__dest, __const__ void *__src, size_t __n); -/* Don't build bcopy at all ... */ -#define __HAVE_ARCH_BCOPY - #ifdef CONFIG_MIPS32 #define __HAVE_ARCH_MEMSCAN static __inline__ void *memscan(void *__addr, int __c, size_t __size) diff -Nru a/include/asm-parisc/string.h b/include/asm-parisc/string.h --- a/include/asm-parisc/string.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-parisc/string.h 2005-01-28 14:11:41 -08:00 @@ -7,7 +7,4 @@ #define __HAVE_ARCH_MEMCPY void * memcpy(void * dest,const void *src,size_t count); -#define __HAVE_ARCH_BCOPY -void bcopy(const void * srcp, void * destp, size_t count); - #endif diff -Nru a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h --- a/include/asm-ppc/processor.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ppc/processor.h 2005-01-28 14:11:40 -08:00 @@ -34,6 +34,7 @@ /* these are arbitrary */ #define _CHRP_Motorola 0x04 /* motorola chrp, the cobra */ #define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ +#define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ #define _GLOBAL(n)\ .stabs __stringify(n:F-1),N_FUN,0,0,n;\ @@ -54,6 +55,7 @@ /* what kind of prep workstation we are */ extern int _prep_type; +extern int _chrp_type; /* * This is used to identify the board type from a given PReP board diff -Nru a/include/asm-ppc/string.h b/include/asm-ppc/string.h --- a/include/asm-ppc/string.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ppc/string.h 2005-01-28 14:11:41 -08:00 @@ -9,7 +9,6 @@ #define __HAVE_ARCH_STRCMP #define __HAVE_ARCH_STRCAT #define __HAVE_ARCH_MEMSET -#define __HAVE_ARCH_BCOPY #define __HAVE_ARCH_MEMCPY #define __HAVE_ARCH_MEMMOVE #define __HAVE_ARCH_MEMCMP diff -Nru a/include/asm-ppc64/cacheflush.h b/include/asm-ppc64/cacheflush.h --- a/include/asm-ppc64/cacheflush.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ppc64/cacheflush.h 2005-01-28 14:11:40 -08:00 @@ -40,7 +40,7 @@ static inline void flush_icache_range(unsigned long start, unsigned long stop) { - if (!(cur_cpu_spec->cpu_features & ASM_CONST(CPU_FTR_COHERENT_ICACHE))) + if (!(cur_cpu_spec->cpu_features & CPU_FTR_COHERENT_ICACHE)) __flush_icache_range(start, stop); } diff -Nru a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h --- a/include/asm-ppc64/cputable.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ppc64/cputable.h 2005-01-28 14:11:41 -08:00 @@ -16,6 +16,7 @@ #define __ASM_PPC_CPUTABLE_H #include +#include /* for ASM_CONST */ /* Exposed to userland CPU features - Must match ppc32 definitions */ #define PPC_FEATURE_32 0x80000000 @@ -103,38 +104,38 @@ /* CPU kernel features */ /* Retain the 32b definitions for the time being - use bottom half of word */ -#define CPU_FTR_SPLIT_ID_CACHE 0x0000000000000001 -#define CPU_FTR_L2CR 0x0000000000000002 -#define CPU_FTR_SPEC7450 0x0000000000000004 -#define CPU_FTR_ALTIVEC 0x0000000000000008 -#define CPU_FTR_TAU 0x0000000000000010 -#define CPU_FTR_CAN_DOZE 0x0000000000000020 -#define CPU_FTR_USE_TB 0x0000000000000040 -#define CPU_FTR_604_PERF_MON 0x0000000000000080 -#define CPU_FTR_601 0x0000000000000100 -#define CPU_FTR_HPTE_TABLE 0x0000000000000200 -#define CPU_FTR_CAN_NAP 0x0000000000000400 -#define CPU_FTR_L3CR 0x0000000000000800 -#define CPU_FTR_L3_DISABLE_NAP 0x0000000000001000 -#define CPU_FTR_NAP_DISABLE_L2_PR 0x0000000000002000 -#define CPU_FTR_DUAL_PLL_750FX 0x0000000000004000 +#define CPU_FTR_SPLIT_ID_CACHE ASM_CONST(0x0000000000000001) +#define CPU_FTR_L2CR ASM_CONST(0x0000000000000002) +#define CPU_FTR_SPEC7450 ASM_CONST(0x0000000000000004) +#define CPU_FTR_ALTIVEC ASM_CONST(0x0000000000000008) +#define CPU_FTR_TAU ASM_CONST(0x0000000000000010) +#define CPU_FTR_CAN_DOZE ASM_CONST(0x0000000000000020) +#define CPU_FTR_USE_TB ASM_CONST(0x0000000000000040) +#define CPU_FTR_604_PERF_MON ASM_CONST(0x0000000000000080) +#define CPU_FTR_601 ASM_CONST(0x0000000000000100) +#define CPU_FTR_HPTE_TABLE ASM_CONST(0x0000000000000200) +#define CPU_FTR_CAN_NAP ASM_CONST(0x0000000000000400) +#define CPU_FTR_L3CR ASM_CONST(0x0000000000000800) +#define CPU_FTR_L3_DISABLE_NAP ASM_CONST(0x0000000000001000) +#define CPU_FTR_NAP_DISABLE_L2_PR ASM_CONST(0x0000000000002000) +#define CPU_FTR_DUAL_PLL_750FX ASM_CONST(0x0000000000004000) /* Add the 64b processor unique features in the top half of the word */ -#define CPU_FTR_SLB 0x0000000100000000 -#define CPU_FTR_16M_PAGE 0x0000000200000000 -#define CPU_FTR_TLBIEL 0x0000000400000000 -#define CPU_FTR_NOEXECUTE 0x0000000800000000 -#define CPU_FTR_NODSISRALIGN 0x0000001000000000 -#define CPU_FTR_IABR 0x0000002000000000 -#define CPU_FTR_MMCRA 0x0000004000000000 -#define CPU_FTR_PMC8 0x0000008000000000 -#define CPU_FTR_SMT 0x0000010000000000 -#define CPU_FTR_COHERENT_ICACHE 0x0000020000000000 -#define CPU_FTR_LOCKLESS_TLBIE 0x0000040000000000 -#define CPU_FTR_MMCRA_SIHV 0x0000080000000000 +#define CPU_FTR_SLB ASM_CONST(0x0000000100000000) +#define CPU_FTR_16M_PAGE ASM_CONST(0x0000000200000000) +#define CPU_FTR_TLBIEL ASM_CONST(0x0000000400000000) +#define CPU_FTR_NOEXECUTE ASM_CONST(0x0000000800000000) +#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000001000000000) +#define CPU_FTR_IABR ASM_CONST(0x0000002000000000) +#define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000) +#define CPU_FTR_PMC8 ASM_CONST(0x0000008000000000) +#define CPU_FTR_SMT ASM_CONST(0x0000010000000000) +#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) +#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) +#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) /* Platform firmware features */ -#define FW_FTR_ 0x0000000000000001 +#define FW_FTR_ ASM_CONST(0x0000000000000001) #ifndef __ASSEMBLY__ #define COMMON_USER_PPC64 (PPC_FEATURE_32 | PPC_FEATURE_64 | \ diff -Nru a/include/asm-ppc64/eeh.h b/include/asm-ppc64/eeh.h --- a/include/asm-ppc64/eeh.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ppc64/eeh.h 2005-01-28 14:11:41 -08:00 @@ -20,28 +20,28 @@ #ifndef _PPC64_EEH_H #define _PPC64_EEH_H +#include #include #include #include -#include struct pci_dev; struct device_node; +struct device_node; +struct notifier_block; + +#ifdef CONFIG_EEH /* Values for eeh_mode bits in device_node */ #define EEH_MODE_SUPPORTED (1<<0) #define EEH_MODE_NOCHECK (1<<1) #define EEH_MODE_ISOLATED (1<<2) -#ifdef CONFIG_PPC_PSERIES -extern void __init eeh_init(void); -unsigned long eeh_check_failure(const volatile void __iomem *token, unsigned long val); -int eeh_dn_check_failure (struct device_node *dn, struct pci_dev *dev); -void __iomem *eeh_ioremap(unsigned long addr, void __iomem *vaddr); +void __init eeh_init(void); +unsigned long eeh_check_failure(const volatile void __iomem *token, + unsigned long val); +int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev); void __init pci_addr_cache_build(void); -#else -#define eeh_check_failure(token, val) (val) -#endif /** * eeh_add_device_early @@ -52,7 +52,6 @@ * device (including config space i/o). Call eeh_add_device_late * to finish the eeh setup for this device. */ -struct device_node; void eeh_add_device_early(struct device_node *); void eeh_add_device_late(struct pci_dev *); @@ -69,8 +68,6 @@ #define EEH_ENABLE 1 #define EEH_RELEASE_LOADSTORE 2 #define EEH_RELEASE_DMA 3 -int eeh_set_option(struct pci_dev *dev, int options); - /** * Notifier event flags. @@ -107,6 +104,18 @@ */ #define EEH_IO_ERROR_VALUE(size) (~0U >> ((4 - (size)) * 8)) +#else +#define eeh_init() +#define eeh_check_failure(token, val) (val) +#define eeh_dn_check_failure(dn, dev) (0) +#define pci_addr_cache_build() +#define eeh_add_device_early(dn) +#define eeh_add_device_late(dev) +#define eeh_remove_device(dev) +#define EEH_POSSIBLE_ERROR(val, type) (0) +#define EEH_IO_ERROR_VALUE(size) (-1UL) +#endif + /* * MMIO read/write operations with EEH support. */ @@ -194,7 +203,8 @@ #define EEH_CHECK_ALIGN(v,a) \ ((((unsigned long)(v)) & ((a) - 1)) == 0) -static inline void eeh_memset_io(volatile void __iomem *addr, int c, unsigned long n) +static inline void eeh_memset_io(volatile void __iomem *addr, int c, + unsigned long n) { u32 lc = c; lc |= lc << 8; diff -Nru a/include/asm-ppc64/io.h b/include/asm-ppc64/io.h --- a/include/asm-ppc64/io.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ppc64/io.h 2005-01-28 14:11:41 -08:00 @@ -371,7 +371,7 @@ { unsigned long ret; - __asm__ __volatile__("ld %0,0(%1); twi 0,%0,0; isync" + __asm__ __volatile__("ld%U1%X1 %0,%1; twi 0,%0,0; isync" : "=r" (ret) : "m" (*addr)); return ret; } diff -Nru a/include/asm-ppc64/mmu_context.h b/include/asm-ppc64/mmu_context.h --- a/include/asm-ppc64/mmu_context.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ppc64/mmu_context.h 2005-01-28 14:11:40 -08:00 @@ -51,20 +51,17 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) { -#ifdef CONFIG_ALTIVEC - asm volatile ( - BEGIN_FTR_SECTION - "dssall;\n" - END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) - : : ); -#endif /* CONFIG_ALTIVEC */ - if (!cpu_isset(smp_processor_id(), next->cpu_vm_mask)) cpu_set(smp_processor_id(), next->cpu_vm_mask); /* No need to flush userspace segments if the mm doesnt change */ if (prev == next) return; + +#ifdef CONFIG_ALTIVEC + if (cur_cpu_spec->cpu_features & CPU_FTR_ALTIVEC) + asm volatile ("dssall"); +#endif /* CONFIG_ALTIVEC */ if (cur_cpu_spec->cpu_features & CPU_FTR_SLB) switch_slb(tsk, next); diff -Nru a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h --- a/include/asm-ppc64/page.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-ppc64/page.h 2005-01-28 14:11:40 -08:00 @@ -205,10 +205,8 @@ #define KERNELBASE PAGE_OFFSET #define VMALLOCBASE ASM_CONST(0xD000000000000000) #define IOREGIONBASE ASM_CONST(0xE000000000000000) -#define EEHREGIONBASE ASM_CONST(0xA000000000000000) #define IO_REGION_ID (IOREGIONBASE>>REGION_SHIFT) -#define EEH_REGION_ID (EEHREGIONBASE>>REGION_SHIFT) #define VMALLOC_REGION_ID (VMALLOCBASE>>REGION_SHIFT) #define KERNEL_REGION_ID (KERNELBASE>>REGION_SHIFT) #define USER_REGION_ID (0UL) diff -Nru a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h --- a/include/asm-ppc64/prom.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ppc64/prom.h 2005-01-28 14:11:41 -08:00 @@ -149,18 +149,15 @@ struct proc_dir_entry *pde; /* this node's proc directory */ struct proc_dir_entry *name_link; /* name symlink */ struct proc_dir_entry *addr_link; /* addr symlink */ - atomic_t _users; /* reference count */ + struct kref kref; unsigned long _flags; }; extern struct device_node *of_chosen; /* flag descriptions */ -#define OF_STALE 0 /* node is slated for deletion */ #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ -#define OF_IS_STALE(x) test_bit(OF_STALE, &x->_flags) -#define OF_MARK_STALE(x) set_bit(OF_STALE, &x->_flags) #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) diff -Nru a/include/asm-ppc64/string.h b/include/asm-ppc64/string.h --- a/include/asm-ppc64/string.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-ppc64/string.h 2005-01-28 14:11:41 -08:00 @@ -14,7 +14,6 @@ #define __HAVE_ARCH_STRCMP #define __HAVE_ARCH_STRCAT #define __HAVE_ARCH_MEMSET -#define __HAVE_ARCH_BCOPY #define __HAVE_ARCH_MEMCPY #define __HAVE_ARCH_MEMMOVE #define __HAVE_ARCH_MEMCMP diff -Nru a/include/asm-s390/hardirq.h b/include/asm-s390/hardirq.h --- a/include/asm-s390/hardirq.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-s390/hardirq.h 2005-01-28 14:11:41 -08:00 @@ -28,15 +28,6 @@ #define local_softirq_pending() (S390_lowcore.softirq_pending) -/* this is always called with cpu == smp_processor_id() at the moment */ -static inline __u32 -softirq_pending(unsigned int cpu) -{ - if (cpu == smp_processor_id()) - return local_softirq_pending(); - return lowcore_ptr[cpu]->softirq_pending; -} - #define __ARCH_IRQ_STAT #define __ARCH_HAS_DO_SOFTIRQ diff -Nru a/include/asm-s390/string.h b/include/asm-s390/string.h --- a/include/asm-s390/string.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-s390/string.h 2005-01-28 14:11:41 -08:00 @@ -15,7 +15,6 @@ #include #endif -#define __HAVE_ARCH_BCOPY /* arch function */ #define __HAVE_ARCH_MEMCHR /* inline & arch function */ #define __HAVE_ARCH_MEMCMP /* arch function */ #define __HAVE_ARCH_MEMCPY /* gcc builtin & arch function */ diff -Nru a/include/asm-sh/string.h b/include/asm-sh/string.h --- a/include/asm-sh/string.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-sh/string.h 2005-01-28 14:11:41 -08:00 @@ -124,7 +124,4 @@ #define __HAVE_ARCH_STRLEN extern size_t strlen(const char *); -/* Don't build bcopy at all ... */ -#define __HAVE_ARCH_BCOPY - #endif /* __ASM_SH_STRING_H */ diff -Nru a/include/asm-sparc/string.h b/include/asm-sparc/string.h --- a/include/asm-sparc/string.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-sparc/string.h 2005-01-28 14:11:40 -08:00 @@ -22,7 +22,6 @@ #ifndef EXPORT_SYMTAB_STROPS /* First the mem*() things. */ -#define __HAVE_ARCH_BCOPY #define __HAVE_ARCH_MEMMOVE #undef memmove #define memmove(_to, _from, _n) \ diff -Nru a/include/asm-v850/string.h b/include/asm-v850/string.h --- a/include/asm-v850/string.h 2005-01-28 14:11:41 -08:00 +++ b/include/asm-v850/string.h 2005-01-28 14:11:41 -08:00 @@ -14,13 +14,11 @@ #ifndef __V850_STRING_H__ #define __V850_STRING_H__ -#define __HAVE_ARCH_BCOPY #define __HAVE_ARCH_MEMCPY #define __HAVE_ARCH_MEMSET #define __HAVE_ARCH_MEMMOVE extern void *memcpy (void *, const void *, __kernel_size_t); -extern void bcopy (const char *, char *, int); extern void *memset (void *, int, __kernel_size_t); extern void *memmove (void *, const void *, __kernel_size_t); diff -Nru a/include/asm-x86_64/mtrr.h b/include/asm-x86_64/mtrr.h --- a/include/asm-x86_64/mtrr.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-x86_64/mtrr.h 2005-01-28 14:11:40 -08:00 @@ -79,7 +79,6 @@ unsigned int type, char increment); extern int mtrr_del (int reg, unsigned long base, unsigned long size); extern int mtrr_del_page (int reg, unsigned long base, unsigned long size); -extern void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi); # else static __inline__ int mtrr_add (unsigned long base, unsigned long size, unsigned int type, char increment) @@ -101,8 +100,6 @@ { return -ENODEV; } - -static __inline__ void mtrr_centaur_report_mcr(int mcr, u32 lo, u32 hi) {} # endif diff -Nru a/include/asm-x86_64/numnodes.h b/include/asm-x86_64/numnodes.h --- a/include/asm-x86_64/numnodes.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-x86_64/numnodes.h 2005-01-28 14:11:40 -08:00 @@ -3,6 +3,10 @@ #include +#ifdef CONFIG_NUMA #define NODES_SHIFT 6 +#else +#define NODES_SHIFT 0 +#endif #endif diff -Nru a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h --- a/include/asm-x86_64/pci.h 2005-01-28 14:11:40 -08:00 +++ b/include/asm-x86_64/pci.h 2005-01-28 14:11:40 -08:00 @@ -41,7 +41,6 @@ #include #include #include -#include #include extern int iommu_setup(char *opt); diff -Nru a/include/linux/attribute_container.h b/include/linux/attribute_container.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/linux/attribute_container.h 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,61 @@ +/* + * class_container.h - a generic container for all classes + * + * Copyright (c) 2005 - James Bottomley + * + * This file is licensed under GPLv2 + */ + +#ifndef _ATTRIBUTE_CONTAINER_H_ +#define _ATTRIBUTE_CONTAINER_H_ + +#include +#include + +struct attribute_container { + struct list_head node; + struct list_head containers; + struct class *class; + struct class_device_attribute **attrs; + int (*match)(struct attribute_container *, struct device *); +#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01 + unsigned long flags; +}; + +static inline int +attribute_container_no_classdevs(struct attribute_container *atc) +{ + return atc->flags & ATTRIBUTE_CONTAINER_NO_CLASSDEVS; +} + +static inline void +attribute_container_set_no_classdevs(struct attribute_container *atc) +{ + atc->flags |= ATTRIBUTE_CONTAINER_NO_CLASSDEVS; +} + +int attribute_container_register(struct attribute_container *cont); +int attribute_container_unregister(struct attribute_container *cont); +void attribute_container_create_device(struct device *dev, + int (*fn)(struct attribute_container *, + struct device *, + struct class_device *)); +void attribute_container_add_device(struct device *dev, + int (*fn)(struct attribute_container *, + struct device *, + struct class_device *)); +void attribute_container_remove_device(struct device *dev, + void (*fn)(struct attribute_container *, + struct device *, + struct class_device *)); +void attribute_container_device_trigger(struct device *dev, + int (*fn)(struct attribute_container *, + struct device *, + struct class_device *)); +void attribute_container_trigger(struct device *dev, + int (*fn)(struct attribute_container *, + struct device *)); + +struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev); + +#endif diff -Nru a/include/linux/crypto.h b/include/linux/crypto.h --- a/include/linux/crypto.h 2005-01-28 14:11:40 -08:00 +++ b/include/linux/crypto.h 2005-01-28 14:11:40 -08:00 @@ -16,6 +16,7 @@ #ifndef _LINUX_CRYPTO_H #define _LINUX_CRYPTO_H +#include #include #include #include @@ -121,7 +122,14 @@ /* * Algorithm query interface. */ +#ifdef CONFIG_CRYPTO int crypto_alg_available(const char *name, u32 flags); +#else +static inline int crypto_alg_available(const char *name, u32 flags) +{ + return 0; +} +#endif /* * Transforms: user-instantiated objects which encapsulate algorithms diff -Nru a/include/linux/device-mapper.h b/include/linux/device-mapper.h --- a/include/linux/device-mapper.h 2005-01-28 14:11:41 -08:00 +++ b/include/linux/device-mapper.h 2005-01-28 14:11:41 -08:00 @@ -52,7 +52,8 @@ struct bio *bio, int error, union map_info *map_context); -typedef void (*dm_suspend_fn) (struct dm_target *ti); +typedef void (*dm_presuspend_fn) (struct dm_target *ti); +typedef void (*dm_postsuspend_fn) (struct dm_target *ti); typedef void (*dm_resume_fn) (struct dm_target *ti); typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, @@ -82,7 +83,8 @@ dm_dtr_fn dtr; dm_map_fn map; dm_endio_fn end_io; - dm_suspend_fn suspend; + dm_presuspend_fn presuspend; + dm_postsuspend_fn postsuspend; dm_resume_fn resume; dm_status_fn status; dm_message_fn message; diff -Nru a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h --- a/include/linux/dm-ioctl.h 2005-01-28 14:11:40 -08:00 +++ b/include/linux/dm-ioctl.h 2005-01-28 14:11:40 -08:00 @@ -1,6 +1,6 @@ /* * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited. - * Copyright (C) 2004 Red Hat, Inc. All rights reserved. + * Copyright (C) 2004 - 2005 Red Hat, Inc. All rights reserved. * * This file is released under the LGPL. */ @@ -272,9 +272,9 @@ #define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl) #define DM_VERSION_MAJOR 4 -#define DM_VERSION_MINOR 3 +#define DM_VERSION_MINOR 4 #define DM_VERSION_PATCHLEVEL 0 -#define DM_VERSION_EXTRA "-ioctl (2004-09-30)" +#define DM_VERSION_EXTRA "-ioctl (2005-01-12)" /* Status bits */ #define DM_READONLY_FLAG (1 << 0) /* In/Out */ @@ -299,5 +299,10 @@ * results. */ #define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */ + +/* + * Set this to improve performance when you aren't going to use open_count + */ +#define DM_SKIP_BDGET_FLAG (1 << 9) /* In */ #endif /* _LINUX_DM_IOCTL_H */ diff -Nru a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h --- a/include/linux/dvb/frontend.h 2005-01-28 14:11:40 -08:00 +++ b/include/linux/dvb/frontend.h 2005-01-28 14:11:40 -08:00 @@ -158,10 +158,11 @@ QAM_64, QAM_128, QAM_256, - QAM_AUTO + QAM_AUTO, + VSB_8, + VSB_16 } fe_modulation_t; - typedef enum fe_transmit_mode { TRANSMISSION_MODE_2K, TRANSMISSION_MODE_8K, @@ -206,6 +207,9 @@ fe_modulation_t modulation; /* modulation type (see above) */ }; +struct dvb_vsb_parameters { + fe_modulation_t modulation; /* modulation type (see above) */ +}; struct dvb_ofdm_parameters { fe_bandwidth_t bandwidth; @@ -219,13 +223,14 @@ struct dvb_frontend_parameters { - __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM */ + __u32 frequency; /* (absolute) frequency in Hz for QAM/OFDM/ATSC */ /* intermediate frequency in kHz for QPSK */ fe_spectral_inversion_t inversion; union { struct dvb_qpsk_parameters qpsk; struct dvb_qam_parameters qam; struct dvb_ofdm_parameters ofdm; + struct dvb_vsb_parameters vsb; } u; }; diff -Nru a/include/linux/dvb/version.h b/include/linux/dvb/version.h --- a/include/linux/dvb/version.h 2005-01-28 14:11:40 -08:00 +++ b/include/linux/dvb/version.h 2005-01-28 14:11:40 -08:00 @@ -24,6 +24,7 @@ #define _DVBVERSION_H_ #define DVB_API_VERSION 3 +#define DVB_API_VERSION_MINOR 1 #endif /*_DVBVERSION_H_*/ diff -Nru a/include/linux/efi.h b/include/linux/efi.h --- a/include/linux/efi.h 2005-01-28 14:11:41 -08:00 +++ b/include/linux/efi.h 2005-01-28 14:11:41 -08:00 @@ -305,6 +305,27 @@ extern int __init efi_set_rtc_mmss(unsigned long nowtime); extern struct efi_memory_map memmap; +/** + * efi_range_is_wc - check the WC bit on an address range + * @start: starting kvirt address + * @len: length of range + * + * Consult the EFI memory map and make sure it's ok to set this range WC. + * Returns true or false. + */ +static inline int efi_range_is_wc(unsigned long start, unsigned long len) +{ + int i; + + for (i = 0; i < len; i += (1UL << EFI_PAGE_SHIFT)) { + unsigned long paddr = __pa(start + i); + if (!(efi_mem_attributes(paddr) & EFI_MEMORY_WC)) + return 0; + } + /* The range checked out */ + return 1; +} + #ifdef CONFIG_EFI_PCDP extern int __init efi_setup_pcdp_console(char *); #endif diff -Nru a/include/linux/fs.h b/include/linux/fs.h --- a/include/linux/fs.h 2005-01-28 14:11:40 -08:00 +++ b/include/linux/fs.h 2005-01-28 14:11:40 -08:00 @@ -586,6 +586,7 @@ unsigned int f_uid, f_gid; struct file_ra_state f_ra; + size_t f_maxcount; unsigned long f_version; void *f_security; @@ -1222,14 +1223,7 @@ return 0; } -static inline int locks_verify_area(int read_write, struct inode *inode, - struct file *filp, loff_t offset, - size_t count) -{ - if (inode->i_flock && MANDATORY_LOCK(inode)) - return locks_mandatory_area(read_write, inode, filp, offset, count); - return 0; -} +extern int rw_verify_area(int, struct file *, loff_t *, size_t); static inline int locks_verify_truncate(struct inode *inode, struct file *filp, @@ -1565,6 +1559,8 @@ extern int vfs_stat(char __user *, struct kstat *); extern int vfs_lstat(char __user *, struct kstat *); extern int vfs_fstat(unsigned int, struct kstat *); + +extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long); extern struct file_system_type *get_fs_type(const char *name); extern struct super_block *get_super(struct block_device *); diff -Nru a/include/linux/i2c-id.h b/include/linux/i2c-id.h --- a/include/linux/i2c-id.h 2005-01-28 14:11:40 -08:00 +++ b/include/linux/i2c-id.h 2005-01-28 14:11:40 -08:00 @@ -239,6 +239,7 @@ #define I2C_HW_B_IXP4XX 0x17 /* GPIO on IXP4XX systems */ #define I2C_HW_B_S3VIA 0x18 /* S3Via ProSavage adapter */ #define I2C_HW_B_ZR36067 0x19 /* Zoran-36057/36067 based boards */ +#define I2C_HW_B_CX2388x 0x1b /* connexant 2388x based tv cards */ /* --- PCF 8584 based algorithms */ #define I2C_HW_P_LP 0x00 /* Parallel port interface */ diff -Nru a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h --- a/include/linux/irq_cpustat.h 2005-01-28 14:11:41 -08:00 +++ b/include/linux/irq_cpustat.h 2005-01-28 14:11:41 -08:00 @@ -23,8 +23,8 @@ #endif /* arch independent irq_stat fields */ -#define softirq_pending(cpu) __IRQ_STAT((cpu), __softirq_pending) -#define local_softirq_pending() softirq_pending(smp_processor_id()) +#define local_softirq_pending() \ + __IRQ_STAT(smp_processor_id(), __softirq_pending) /* arch dependent irq_stat fields */ #define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count) /* i386 */ diff -Nru a/include/linux/moduleparam.h b/include/linux/moduleparam.h --- a/include/linux/moduleparam.h 2005-01-28 14:11:40 -08:00 +++ b/include/linux/moduleparam.h 2005-01-28 14:11:40 -08:00 @@ -64,7 +64,8 @@ param_set_XXX and param_check_XXX. */ #define module_param_named(name, value, type, perm) \ param_check_##type(name, &(value)); \ - module_param_call(name, param_set_##type, param_get_##type, &value, perm) + module_param_call(name, param_set_##type, param_get_##type, &value, perm); \ + __MODULE_INFO(parmtype, name##type, #name ":" #type) #define module_param(name, type, perm) \ module_param_named(name, name, type, perm) @@ -74,7 +75,8 @@ static struct kparam_string __param_string_##name \ = { len, string }; \ module_param_call(name, param_set_copystring, param_get_string, \ - &__param_string_##name, perm) + &__param_string_##name, perm); \ + __MODULE_INFO(parmtype, name##type, #name ":string") /* Called on module insert or kernel boot */ extern int parse_args(const char *name, @@ -135,7 +137,8 @@ = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\ sizeof(array[0]), array }; \ module_param_call(name, param_array_set, param_array_get, \ - &__param_arr_##name, perm) + &__param_arr_##name, perm); \ + __MODULE_INFO(parmtype, name##type, #name ":array of " #type) #define module_param_array(name, type, nump, perm) \ module_param_array_named(name, name, type, nump, perm) diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h 2005-01-28 14:11:41 -08:00 +++ b/include/linux/netdevice.h 2005-01-28 14:11:41 -08:00 @@ -76,6 +76,7 @@ /* Driver transmit return codes */ #define NETDEV_TX_OK 0 /* driver took care of packet */ #define NETDEV_TX_BUSY 1 /* driver tx path was busy*/ +#define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */ /* * Compute the worst case header length according to the protocols @@ -414,7 +415,7 @@ #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ -#define NETIF_F_LLTX 4096 /* Do not grab xmit_lock during ->hard_start_xmit */ +#define NETIF_F_LLTX 4096 /* LockLess TX */ /* Called after device is detached from network. */ void (*uninit)(struct net_device *dev); @@ -893,11 +894,9 @@ static inline void netif_tx_disable(struct net_device *dev) { - unsigned long flags; - - spin_lock_irqsave(&dev->xmit_lock, flags); + spin_lock_bh(&dev->xmit_lock); netif_stop_queue(dev); - spin_unlock_irqrestore(&dev->xmit_lock, flags); + spin_unlock_bh(&dev->xmit_lock); } /* These functions live elsewhere (drivers/net/net_init.c, but related) */ diff -Nru a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h --- a/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-28 14:11:41 -08:00 +++ b/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-28 14:11:41 -08:00 @@ -122,33 +122,6 @@ #define IP_NF_ASSERT(x) #endif -struct ip_conntrack_expect -{ - /* Internal linked list (global expectation list) */ - struct list_head list; - - /* We expect this tuple, with the following mask */ - struct ip_conntrack_tuple tuple, mask; - - /* Function to call after setup and insertion */ - void (*expectfn)(struct ip_conntrack *new, - struct ip_conntrack_expect *this); - - /* The conntrack of the master connection */ - struct ip_conntrack *master; - - /* Timer function; deletes the expectation. */ - struct timer_list timeout; - -#ifdef CONFIG_IP_NF_NAT_NEEDED - /* This is the original per-proto part, used to map the - * expected connection the way the recipient expects. */ - union ip_conntrack_manip_proto saved_proto; - /* Direction relative to the master connection. */ - enum ip_conntrack_dir dir; -#endif -}; - struct ip_conntrack_counter { u_int64_t packets; @@ -206,6 +179,33 @@ struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX]; }; +struct ip_conntrack_expect +{ + /* Internal linked list (global expectation list) */ + struct list_head list; + + /* We expect this tuple, with the following mask */ + struct ip_conntrack_tuple tuple, mask; + + /* Function to call after setup and insertion */ + void (*expectfn)(struct ip_conntrack *new, + struct ip_conntrack_expect *this); + + /* The conntrack of the master connection */ + struct ip_conntrack *master; + + /* Timer function; deletes the expectation. */ + struct timer_list timeout; + +#ifdef CONFIG_IP_NF_NAT_NEEDED + /* This is the original per-proto part, used to map the + * expected connection the way the recipient expects. */ + union ip_conntrack_manip_proto saved_proto; + /* Direction relative to the master connection. */ + enum ip_conntrack_dir dir; +#endif +}; + static inline struct ip_conntrack * tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash) { @@ -301,6 +301,7 @@ #define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) +#ifdef CONFIG_IP_NF_NAT_NEEDED static inline int ip_nat_initialized(struct ip_conntrack *conntrack, enum ip_nat_manip_type manip) { @@ -308,5 +309,7 @@ return test_bit(IPS_SRC_NAT_DONE_BIT, &conntrack->status); return test_bit(IPS_DST_NAT_DONE_BIT, &conntrack->status); } +#endif /* CONFIG_IP_NF_NAT_NEEDED */ + #endif /* __KERNEL__ */ #endif /* _IP_CONNTRACK_H */ diff -Nru a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h --- a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h 2005-01-28 14:11:40 -08:00 +++ b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h 2005-01-28 14:11:40 -08:00 @@ -13,7 +13,7 @@ #define TFTP_OPCODE_ACK 4 #define TFTP_OPCODE_ERROR 5 -unsigned int (*ip_nat_tftp_hook)(struct sk_buff **pskb, +extern unsigned int (*ip_nat_tftp_hook)(struct sk_buff **pskb, enum ip_conntrack_info ctinfo, struct ip_conntrack_expect *exp); diff -Nru a/include/linux/netfilter_ipv4/ipt_conntrack.h b/include/linux/netfilter_ipv4/ipt_conntrack.h --- a/include/linux/netfilter_ipv4/ipt_conntrack.h 2005-01-28 14:11:41 -08:00 +++ b/include/linux/netfilter_ipv4/ipt_conntrack.h 2005-01-28 14:11:41 -08:00 @@ -22,11 +22,32 @@ #define IPT_CONNTRACK_STATUS 0x40 #define IPT_CONNTRACK_EXPIRES 0x80 +/* This is exposed to userspace, so remains frozen in time. */ +struct ip_conntrack_old_tuple +{ + struct { + __u32 ip; + union { + __u16 all; + } u; + } src; + + struct { + __u32 ip; + union { + __u16 all; + } u; + + /* The protocol. */ + u16 protonum; + } dst; +}; + struct ipt_conntrack_info { unsigned int statemask, statusmask; - struct ip_conntrack_tuple tuple[IP_CT_DIR_MAX]; + struct ip_conntrack_old_tuple tuple[IP_CT_DIR_MAX]; struct in_addr sipmsk[IP_CT_DIR_MAX], dipmsk[IP_CT_DIR_MAX]; unsigned long expires_min, expires_max; diff -Nru a/include/linux/netfilter_ipv4/ipt_multiport.h b/include/linux/netfilter_ipv4/ipt_multiport.h --- a/include/linux/netfilter_ipv4/ipt_multiport.h 2005-01-28 14:11:40 -08:00 +++ b/include/linux/netfilter_ipv4/ipt_multiport.h 2005-01-28 14:11:40 -08:00 @@ -25,5 +25,6 @@ u_int8_t count; /* Number of ports */ u_int16_t ports[IPT_MULTI_PORTS]; /* Ports */ u_int8_t pflags[IPT_MULTI_PORTS]; /* Port flags */ + u_int8_t invert; /* Invert flag */ }; #endif /*_IPT_MULTIPORT_H*/ diff -Nru a/include/linux/oprofile.h b/include/linux/oprofile.h --- a/include/linux/oprofile.h 2005-01-28 14:11:41 -08:00 +++ b/include/linux/oprofile.h 2005-01-28 14:11:41 -08:00 @@ -48,7 +48,7 @@ * * If an error occurs, the fields should be left untouched. */ -void oprofile_arch_init(struct oprofile_operations * ops); +int oprofile_arch_init(struct oprofile_operations * ops); /** * One-time exit/cleanup for the arch. diff -Nru a/include/linux/transport_class.h b/include/linux/transport_class.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/linux/transport_class.h 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,77 @@ +/* + * transport_class.h - a generic container for all transport classes + * + * Copyright (c) 2005 - James Bottomley + * + * This file is licensed under GPLv2 + */ + +#ifndef _TRANSPORT_CLASS_H_ +#define _TRANSPORT_CLASS_H_ + +#include +#include + +struct transport_class { + struct class class; + int (*setup)(struct device *); + int (*configure)(struct device *); + int (*remove)(struct device *); +}; + +#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg) \ +struct transport_class cls = { \ + .class = { \ + .name = nm, \ + }, \ + .setup = su, \ + .remove = rm, \ + .configure = cfg, \ +} + + +struct anon_transport_class { + struct transport_class tclass; + struct attribute_container container; +}; + +#define DECLARE_ANON_TRANSPORT_CLASS(cls, mtch, cfg) \ +struct anon_transport_class cls = { \ + .tclass = { \ + .configure = cfg, \ + }, \ + . container = { \ + .match = mtch, \ + }, \ +} + +#define class_to_transport_class(x) \ + container_of(x, struct transport_class, class) + +void transport_remove_device(struct device *); +void transport_add_device(struct device *); +void transport_setup_device(struct device *); +void transport_configure_device(struct device *); +void transport_destroy_device(struct device *); + +static inline void +transport_register_device(struct device *dev) +{ + transport_setup_device(dev); + transport_add_device(dev); +} + +static inline void +transport_unregister_device(struct device *dev) +{ + transport_remove_device(dev); + transport_destroy_device(dev); +} + +int transport_class_register(struct transport_class *); +int anon_transport_class_register(struct anon_transport_class *); +void transport_class_unregister(struct transport_class *); +void anon_transport_class_unregister(struct anon_transport_class *); + + +#endif diff -Nru a/include/linux/videodev2.h b/include/linux/videodev2.h --- a/include/linux/videodev2.h 2005-01-28 14:11:41 -08:00 +++ b/include/linux/videodev2.h 2005-01-28 14:11:41 -08:00 @@ -78,6 +78,7 @@ enum v4l2_tuner_type { V4L2_TUNER_RADIO = 1, V4L2_TUNER_ANALOG_TV = 2, + V4L2_TUNER_DIGITAL_TV = 3, }; enum v4l2_memory { diff -Nru a/include/linux/videotext.h b/include/linux/videotext.h --- a/include/linux/videotext.h 2005-01-28 14:11:41 -08:00 +++ b/include/linux/videotext.h 2005-01-28 14:11:41 -08:00 @@ -1,7 +1,13 @@ #ifndef _VTX_H #define _VTX_H -/* $Id: videotext.h,v 1.1 1998/03/30 22:26:39 alan Exp $ +/* + * Teletext (=Videotext) hardware decoders using interface /dev/vtx + * Do not confuse with drivers using /dev/vbi which decode videotext by software + * + * Videotext IOCTLs changed in order to use _IO() macros defined in , + * unused tuner IOCTLs cleaned up by + * Michael Geng * * Copyright (c) 1994-97 Martin Buck * Read COPYING for more information @@ -12,19 +18,32 @@ /* * Videotext ioctls */ -#define VTXIOCGETINFO 0x7101 /* get version of driver & capabilities of vtx-chipset */ -#define VTXIOCCLRPAGE 0x7102 /* clear page-buffer */ -#define VTXIOCCLRFOUND 0x7103 /* clear bits indicating that page was found */ -#define VTXIOCPAGEREQ 0x7104 /* search for page */ -#define VTXIOCGETSTAT 0x7105 /* get status of page-buffer */ -#define VTXIOCGETPAGE 0x7106 /* get contents of page-buffer */ -#define VTXIOCSTOPDAU 0x7107 /* stop data acquisition unit */ -#define VTXIOCPUTPAGE 0x7108 /* display page on TV-screen */ -#define VTXIOCSETDISP 0x7109 /* set TV-mode */ -#define VTXIOCPUTSTAT 0x710a /* set status of TV-output-buffer */ -#define VTXIOCCLRCACHE 0x710b /* clear cache on VTX-interface (if avail.) */ -#define VTXIOCSETVIRT 0x710c /* turn on virtual mode (this disables TV-display) */ - +#define VTXIOCGETINFO _IOR (0x81, 1, vtx_info_t) +#define VTXIOCCLRPAGE _IOW (0x81, 2, vtx_pagereq_t) +#define VTXIOCCLRFOUND _IOW (0x81, 3, vtx_pagereq_t) +#define VTXIOCPAGEREQ _IOW (0x81, 4, vtx_pagereq_t) +#define VTXIOCGETSTAT _IOW (0x81, 5, vtx_pagereq_t) +#define VTXIOCGETPAGE _IOW (0x81, 6, vtx_pagereq_t) +#define VTXIOCSTOPDAU _IOW (0x81, 7, vtx_pagereq_t) +#define VTXIOCPUTPAGE _IO (0x81, 8) +#define VTXIOCSETDISP _IO (0x81, 9) +#define VTXIOCPUTSTAT _IO (0x81, 10) +#define VTXIOCCLRCACHE _IO (0x81, 11) +#define VTXIOCSETVIRT _IOW (0x81, 12, long) + +/* for compatibility, will go away some day */ +#define VTXIOCGETINFO_OLD 0x7101 /* get version of driver & capabilities of vtx-chipset */ +#define VTXIOCCLRPAGE_OLD 0x7102 /* clear page-buffer */ +#define VTXIOCCLRFOUND_OLD 0x7103 /* clear bits indicating that page was found */ +#define VTXIOCPAGEREQ_OLD 0x7104 /* search for page */ +#define VTXIOCGETSTAT_OLD 0x7105 /* get status of page-buffer */ +#define VTXIOCGETPAGE_OLD 0x7106 /* get contents of page-buffer */ +#define VTXIOCSTOPDAU_OLD 0x7107 /* stop data acquisition unit */ +#define VTXIOCPUTPAGE_OLD 0x7108 /* display page on TV-screen */ +#define VTXIOCSETDISP_OLD 0x7109 /* set TV-mode */ +#define VTXIOCPUTSTAT_OLD 0x710a /* set status of TV-output-buffer */ +#define VTXIOCCLRCACHE_OLD 0x710b /* clear cache on VTX-interface (if avail.) */ +#define VTXIOCSETVIRT_OLD 0x710c /* turn on virtual mode (this disables TV-display) */ /* * Definitions for VTXIOCGETINFO @@ -102,43 +121,5 @@ unsigned hamming : 1; /* hamming-error occurred */ } vtx_pageinfo_t; - - -/* - * Definitions for VTXIOCSETDISP - */ -typedef enum { - DISPOFF, DISPNORM, DISPTRANS, DISPINS, INTERLACE_OFFSET -} vtxdisp_t; - - - -/* - * Tuner ioctls - */ - -#define TUNIOCGETINFO 0x7201 /* get version of driver & capabilities of tuner */ -#define TUNIOCRESET 0x7202 /* reset tuner */ -#define TUNIOCSETFREQ 0x7203 /* set tuning frequency (unit: kHz) */ -#define TUNIOCGETFREQ 0x7204 /* get tuning frequency (unit: kHz) */ -#define TUNIOCSETCHAN 0x7205 /* set tuning channel */ -#define TUNIOCGETCHAN 0x7206 /* get tuning channel */ - - -typedef struct -{ - int version_major, version_minor; /* version of driver; if version_major changes, driver */ - /* is not backward compatible!!! CHECK THIS!!! */ - unsigned freq : 1; /* tuner can be set to given frequency */ - unsigned chan : 1; /* tuner stores several channels */ - unsigned scan : 1; /* tuner supports scanning */ - unsigned autoscan : 1; /* tuner supports scanning with automatic stop */ - unsigned afc : 1; /* tuner supports AFC */ - unsigned dummy1, dummy2, dummy3, dummy4, dummy5, dummy6, dummy7, dummy8, dummy9, dummy10, - dummy11 : 1; - int dummy12, dummy13, dummy14, dummy15, dummy16, dummy17, dummy18, dummy19; -} tuner_info_t; - - #endif /* _VTX_H */ diff -Nru a/include/media/tuner.h b/include/media/tuner.h --- a/include/media/tuner.h 2005-01-28 14:11:41 -08:00 +++ b/include/media/tuner.h 2005-01-28 14:11:41 -08:00 @@ -77,6 +77,7 @@ #define TUNER_MICROTUNE_4042FI5 49 /* FusionHDTV 3 Gold - 4042 FI5 (3X 8147) */ #define TUNER_TCL_2002N 50 #define TUNER_PHILIPS_FM1256_IH3 51 +#define TUNER_THOMSON_DTT7610 52 #define NOTUNER 0 #define PAL 1 /* PAL_BG */ @@ -97,6 +98,7 @@ #define HITACHI 9 #define Panasonic 10 #define TCL 11 +#define THOMSON 12 #define TUNER_SET_TYPE _IOW('t',1,int) /* set tuner type */ #define TUNER_SET_TVFREQ _IOW('t',2,int) /* set tv freq */ @@ -108,10 +110,12 @@ #define TDA9887_SET_CONFIG _IOW('t',5,int) /* tv card specific */ # define TDA9887_PRESENT (1<<0) -# define TDA9887_PORT1 (1<<1) -# define TDA9887_PORT2 (1<<2) +# define TDA9887_PORT1_INACTIVE (1<<1) +# define TDA9887_PORT2_INACTIVE (1<<2) # define TDA9887_QSS (1<<3) # define TDA9887_INTERCARRIER (1<<4) +# define TDA9887_PORT1_ACTIVE (1<<5) +# define TDA9887_PORT2_ACTIVE (1<<6) /* config options */ # define TDA9887_DEEMPHASIS_MASK (3<<16) # define TDA9887_DEEMPHASIS_NONE (1<<16) diff -Nru a/include/media/tveeprom.h b/include/media/tveeprom.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/include/media/tveeprom.h 2005-01-28 14:11:41 -08:00 @@ -0,0 +1,23 @@ +struct tveeprom { + u32 has_radio; + + u32 tuner_type; + u32 tuner_formats; + + u32 digitizer; + u32 digitizer_formats; + + u32 audio_processor; + /* a_p_fmts? */ + + u32 model; + u32 revision; + u32 serial_number; + char rev_str[5]; +}; + +void tveeprom_hauppauge_analog(struct tveeprom *tvee, + unsigned char *eeprom_data); + +int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len); +int tveeprom_dump(unsigned char *eedata, int len); diff -Nru a/include/media/video-buf-dvb.h b/include/media/video-buf-dvb.h --- a/include/media/video-buf-dvb.h 2005-01-28 14:11:41 -08:00 +++ b/include/media/video-buf-dvb.h 2005-01-28 14:11:41 -08:00 @@ -24,7 +24,9 @@ struct dvb_net net; }; -int videobuf_dvb_register(struct videobuf_dvb *dvb); +int videobuf_dvb_register(struct videobuf_dvb *dvb, + struct module *module, + void *adapter_priv); void videobuf_dvb_unregister(struct videobuf_dvb *dvb); /* diff -Nru a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h --- a/include/net/bluetooth/rfcomm.h 2005-01-28 14:11:41 -08:00 +++ b/include/net/bluetooth/rfcomm.h 2005-01-28 14:11:41 -08:00 @@ -28,6 +28,7 @@ #define RFCOMM_CONN_TIMEOUT (HZ * 30) #define RFCOMM_DISC_TIMEOUT (HZ * 20) +#define RFCOMM_AUTH_TIMEOUT (HZ * 25) #define RFCOMM_DEFAULT_MTU 127 #define RFCOMM_DEFAULT_CREDITS 7 @@ -198,14 +199,18 @@ /* DLC and session flags */ #define RFCOMM_RX_THROTTLED 0 #define RFCOMM_TX_THROTTLED 1 -#define RFCOMM_MSC_PENDING 2 -#define RFCOMM_TIMED_OUT 3 +#define RFCOMM_TIMED_OUT 2 +#define RFCOMM_MSC_PENDING 3 +#define RFCOMM_AUTH_PENDING 4 +#define RFCOMM_AUTH_ACCEPT 5 +#define RFCOMM_AUTH_REJECT 6 /* Scheduling flags and events */ #define RFCOMM_SCHED_STATE 0 #define RFCOMM_SCHED_RX 1 #define RFCOMM_SCHED_TX 2 #define RFCOMM_SCHED_TIMEO 3 +#define RFCOMM_SCHED_AUTH 4 #define RFCOMM_SCHED_WAKEUP 31 /* MSC exchange flags */ diff -Nru a/include/net/xfrm.h b/include/net/xfrm.h --- a/include/net/xfrm.h 2005-01-28 14:11:41 -08:00 +++ b/include/net/xfrm.h 2005-01-28 14:11:41 -08:00 @@ -873,9 +873,9 @@ extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); extern struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id); extern struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id); -extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name); -extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name); -extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name); +extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe); +extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe); +extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe); struct crypto_tfm; typedef void (icv_update_fn_t)(struct crypto_tfm *, struct scatterlist *, unsigned int); diff -Nru a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h --- a/include/pcmcia/cs_types.h 2005-01-28 14:11:40 -08:00 +++ b/include/pcmcia/cs_types.h 2005-01-28 14:11:40 -08:00 @@ -22,10 +22,12 @@ #endif #if defined(__arm__) || defined(__mips__) +/* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */ typedef u_int ioaddr_t; #else typedef u_short ioaddr_t; #endif +typedef unsigned long kio_addr_t; typedef u_short socket_t; typedef u_int event_t; diff -Nru a/include/pcmcia/ss.h b/include/pcmcia/ss.h --- a/include/pcmcia/ss.h 2005-01-28 14:11:41 -08:00 +++ b/include/pcmcia/ss.h 2005-01-28 14:11:41 -08:00 @@ -81,7 +81,7 @@ u_char map; u_char flags; u_short speed; - ioaddr_t start, stop; + kio_addr_t start, stop; } pccard_io_map; typedef struct pccard_mem_map { @@ -144,8 +144,8 @@ typedef struct io_window_t { u_int Attributes; - ioaddr_t BasePort, NumPorts; - ioaddr_t InUse, Config; + kio_addr_t BasePort, NumPorts; + kio_addr_t InUse, Config; struct resource *res; } io_window_t; @@ -165,7 +165,6 @@ #define MAX_WIN 4 struct config_t; -struct region_t; struct pcmcia_callback; @@ -185,7 +184,6 @@ } irq; io_window_t io[MAX_IO_WIN]; window_t win[MAX_WIN]; - struct region_t *c_region, *a_region; struct list_head cis_cache; u_int fake_cis_len; char *fake_cis; @@ -201,7 +199,7 @@ u_int features; u_int irq_mask; u_int map_size; - ioaddr_t io_offset; + kio_addr_t io_offset; u_char pci_irq; struct pci_dev * cb_dev; diff -Nru a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h --- a/include/scsi/scsi_device.h 2005-01-28 14:11:40 -08:00 +++ b/include/scsi/scsi_device.h 2005-01-28 14:11:40 -08:00 @@ -123,8 +123,6 @@ struct device sdev_gendev; struct class_device sdev_classdev; - struct class_device transport_classdev; - enum scsi_device_state sdev_state; unsigned long sdev_data[0]; } __attribute__((aligned(sizeof(unsigned long)))); @@ -133,7 +131,7 @@ #define class_to_sdev(d) \ container_of(d, struct scsi_device, sdev_classdev) #define transport_class_to_sdev(class_dev) \ - container_of(class_dev, struct scsi_device, transport_classdev) + to_scsi_device(class_dev->dev) /* * scsi_target: representation of a scsi target, for now, this is only @@ -146,7 +144,6 @@ unsigned int channel; unsigned int id; /* target id ... replace * scsi_device.id eventually */ - struct class_device transport_classdev; unsigned long create:1; /* signal that it needs to be added */ unsigned long starget_data[0]; } __attribute__((aligned(sizeof(unsigned long)))); @@ -157,7 +154,7 @@ return to_scsi_target(sdev->sdev_gendev.parent); } #define transport_class_to_starget(class_dev) \ - container_of(class_dev, struct scsi_target, transport_classdev) + to_scsi_target(class_dev->dev) extern struct scsi_device *__scsi_add_device(struct Scsi_Host *, uint, uint, uint, void *hostdata); @@ -226,6 +223,8 @@ extern void scsi_target_quiesce(struct scsi_target *); extern void scsi_target_resume(struct scsi_target *); extern const char *scsi_device_state_name(enum scsi_device_state); +extern int scsi_is_sdev_device(const struct device *); +extern int scsi_is_target_device(const struct device *); static inline int scsi_device_online(struct scsi_device *sdev) { return sdev->sdev_state != SDEV_OFFLINE; diff -Nru a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h --- a/include/scsi/scsi_eh.h 2005-01-28 14:11:41 -08:00 +++ b/include/scsi/scsi_eh.h 2005-01-28 14:11:41 -08:00 @@ -44,6 +44,12 @@ { return ((sshdr->response_code >= 0x70) && (sshdr->response_code & 1)); } + +extern const u8 * scsi_sense_desc_find(const u8 * sense_buffer, int sb_len, + int desc_type); + +extern int scsi_get_sense_info_fld(const u8 * sense_buffer, int sb_len, + u64 * info_out); /* * Reset request from external source diff -Nru a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h --- a/include/scsi/scsi_host.h 2005-01-28 14:11:40 -08:00 +++ b/include/scsi/scsi_host.h 2005-01-28 14:11:40 -08:00 @@ -71,7 +71,18 @@ * Status: OPTIONAL */ int (* ioctl)(struct scsi_device *dev, int cmd, void __user *arg); - + + +#ifdef CONFIG_COMPAT + /* + * Compat handler. Handle 32bit ABI. + * When unknown ioctl is passed return -ENOIOCTLCMD. + * + * Status: OPTIONAL + */ + int (* compat_ioctl)(struct scsi_device *dev, int cmd, void __user *arg); +#endif + /* * The queuecommand function is used to queue up a scsi * command block to the LLDD. When the driver finished @@ -528,7 +539,6 @@ * separately */ void *shost_data; - struct class_device transport_classdev; /* * We should ensure that this is aligned, both for better performance @@ -542,8 +552,6 @@ container_of(d, struct Scsi_Host, shost_gendev) #define class_to_shost(d) \ container_of(d, struct Scsi_Host, shost_classdev) -#define transport_class_to_shost(class_dev) \ - container_of(class_dev, struct Scsi_Host, transport_classdev) extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int); @@ -578,6 +586,7 @@ extern void scsi_unblock_requests(struct Scsi_Host *); extern void scsi_block_requests(struct Scsi_Host *); +struct class_container; /* * These two functions are used to allocate and free a pseudo device * which will connect to the host adapter itself rather than any @@ -587,6 +596,8 @@ */ extern void scsi_free_host_dev(struct scsi_device *); extern struct scsi_device *scsi_get_host_dev(struct Scsi_Host *); +int scsi_is_host_device(const struct device *); + /* legacy interfaces */ extern struct Scsi_Host *scsi_register(struct scsi_host_template *, int); diff -Nru a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h --- a/include/scsi/scsi_transport.h 2005-01-28 14:11:41 -08:00 +++ b/include/scsi/scsi_transport.h 2005-01-28 14:11:41 -08:00 @@ -20,31 +20,16 @@ #ifndef SCSI_TRANSPORT_H #define SCSI_TRANSPORT_H -struct scsi_transport_template { - /* The NULL terminated list of transport attributes - * that should be exported. - */ - struct class_device_attribute **device_attrs; - struct class_device_attribute **target_attrs; - struct class_device_attribute **host_attrs; - +#include - /* The transport class that the device is in */ - struct class *device_class; - struct class *target_class; - struct class *host_class; +struct scsi_transport_template { + /* The statistics attached to the host class only */ struct attribute_group *host_statistics; - /* Constructor functions */ - int (*device_setup)(struct scsi_device *); - int (*device_configure)(struct scsi_device *); - int (*target_setup)(struct scsi_target *); - int (*host_setup)(struct Scsi_Host *); - - /* Destructor functions */ - void (*device_destroy)(struct scsi_device *); - void (*target_destroy)(struct scsi_target *); - void (*host_destroy)(struct Scsi_Host *); + /* the attribute containers */ + struct attribute_container host_attrs; + struct attribute_container target_attrs; + struct attribute_container device_attrs; /* The size of the specific transport attribute structure (a * space of this size will be left at the end of the @@ -53,5 +38,9 @@ int target_size; int host_size; }; + +#define transport_class_to_shost(tc) \ + dev_to_shost((tc)->dev) + #endif /* SCSI_TRANSPORT_H */ diff -Nru a/include/scsi/scsi_transport_spi.h b/include/scsi/scsi_transport_spi.h --- a/include/scsi/scsi_transport_spi.h 2005-01-28 14:11:40 -08:00 +++ b/include/scsi/scsi_transport_spi.h 2005-01-28 14:11:40 -08:00 @@ -21,6 +21,7 @@ #define SCSI_TRANSPORT_SPI_H #include +#include struct scsi_transport_template; diff -Nru a/init/do_mounts.c b/init/do_mounts.c --- a/init/do_mounts.c 2005-01-28 14:11:40 -08:00 +++ b/init/do_mounts.c 2005-01-28 14:11:40 -08:00 @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -228,8 +229,16 @@ return 1; } +static unsigned int __initdata root_delay; +static int __init root_delay_setup(char *str) +{ + root_delay = simple_strtoul(str, NULL, 0); + return 1; +} + __setup("rootflags=", root_data_setup); __setup("rootfstype=", fs_names_setup); +__setup("rootdelay=", root_delay_setup); static void __init get_fs_names(char *page) { @@ -386,6 +395,12 @@ int is_floppy; mount_devfs(); + + if (root_delay) { + printk(KERN_INFO "Waiting %dsec before mounting root device...\n", + root_delay); + ssleep(root_delay); + } md_run_setup(); diff -Nru a/kernel/kallsyms.c b/kernel/kallsyms.c --- a/kernel/kallsyms.c 2005-01-28 14:11:41 -08:00 +++ b/kernel/kallsyms.c 2005-01-28 14:11:41 -08:00 @@ -53,6 +53,13 @@ return in_gate_area_no_task(addr); } +static inline int is_kernel(unsigned long addr) +{ + if (addr >= (unsigned long)_stext && addr <= (unsigned long)_end) + return 1; + return in_gate_area_no_task(addr); +} + /* expand a compressed symbol data into the resulting uncompressed string, given the offset to where the symbol is in the compressed stream */ static unsigned int kallsyms_expand_symbol(unsigned int off, char *result) @@ -153,7 +160,8 @@ namebuf[KSYM_NAME_LEN] = 0; namebuf[0] = 0; - if (all_var || is_kernel_text(addr) || is_kernel_inittext(addr)) { + if ((all_var && is_kernel(addr)) || + (!all_var && (is_kernel_text(addr) || is_kernel_inittext(addr)))) { unsigned long symbol_end=0; /* do a binary search on the sorted kallsyms_addresses array */ diff -Nru a/kernel/params.c b/kernel/params.c --- a/kernel/params.c 2005-01-28 14:11:41 -08:00 +++ b/kernel/params.c 2005-01-28 14:11:41 -08:00 @@ -640,9 +640,33 @@ return ret; } +static ssize_t module_attr_store(struct kobject *kobj, + struct attribute *attr, + const char *buf, size_t len) +{ + struct module_attribute *attribute; + struct module_kobject *mk; + int ret; + + attribute = to_module_attr(attr); + mk = to_module_kobject(kobj); + + if (!attribute->store) + return -EPERM; + + if (!try_module_get(mk->mod)) + return -ENODEV; + + ret = attribute->store(attribute, mk->mod, buf, len); + + module_put(mk->mod); + + return ret; +} + static struct sysfs_ops module_sysfs_ops = { .show = module_attr_show, - .store = NULL, + .store = module_attr_store, }; #else diff -Nru a/kernel/power/main.c b/kernel/power/main.c --- a/kernel/power/main.c 2005-01-28 14:11:40 -08:00 +++ b/kernel/power/main.c 2005-01-28 14:11:40 -08:00 @@ -141,14 +141,14 @@ if (down_trylock(&pm_sem)) return -EBUSY; - /* Suspend is hard to get right on SMP. */ - if (num_online_cpus() != 1) { - error = -EPERM; + if (state == PM_SUSPEND_DISK) { + error = pm_suspend_disk(); goto Unlock; } - if (state == PM_SUSPEND_DISK) { - error = pm_suspend_disk(); + /* Suspend is hard to get right on SMP. */ + if (num_online_cpus() != 1) { + error = -EPERM; goto Unlock; } diff -Nru a/kernel/sys_ni.c b/kernel/sys_ni.c --- a/kernel/sys_ni.c 2005-01-28 14:11:41 -08:00 +++ b/kernel/sys_ni.c 2005-01-28 14:11:41 -08:00 @@ -81,4 +81,5 @@ cond_syscall(sys_pciconfig_read) cond_syscall(sys_pciconfig_write) cond_syscall(sys_pciconfig_iobase) - +cond_syscall(sys32_ipc) +cond_syscall(sys32_sysctl) diff -Nru a/lib/string.c b/lib/string.c --- a/lib/string.c 2005-01-28 14:11:41 -08:00 +++ b/lib/string.c 2005-01-28 14:11:41 -08:00 @@ -454,30 +454,6 @@ EXPORT_SYMBOL(memset); #endif -#ifndef __HAVE_ARCH_BCOPY -/** - * bcopy - Copy one area of memory to another - * @srcp: Where to copy from - * @destp: Where to copy to - * @count: The size of the area. - * - * Note that this is the same as memcpy(), with the arguments reversed. - * memcpy() is the standard, bcopy() is a legacy BSD function. - * - * You should not use this function to access IO space, use memcpy_toio() - * or memcpy_fromio() instead. - */ -void bcopy(const void * srcp, void * destp, size_t count) -{ - const char *src = srcp; - char *dest = destp; - - while (count--) - *dest++ = *src++; -} -EXPORT_SYMBOL(bcopy); -#endif - #ifndef __HAVE_ARCH_MEMCPY /** * memcpy - Copy one area of memory to another diff -Nru a/mm/memory.c b/mm/memory.c --- a/mm/memory.c 2005-01-28 14:11:40 -08:00 +++ b/mm/memory.c 2005-01-28 14:11:40 -08:00 @@ -442,17 +442,18 @@ if (next > end || next <= addr) next = end; if (pgd_none(*src_pgd)) - continue; + goto next_pgd; if (pgd_bad(*src_pgd)) { pgd_ERROR(*src_pgd); pgd_clear(src_pgd); - continue; + goto next_pgd; } err = copy_pud_range(dst, src, dst_pgd, src_pgd, vma, addr, next); if (err) break; +next_pgd: src_pgd++; dst_pgd++; addr = next; @@ -1555,8 +1556,17 @@ spin_lock(&mapping->i_mmap_lock); + /* serialize i_size write against truncate_count write */ + smp_wmb(); /* Protect against page faults, and endless unmapping loops */ mapping->truncate_count++; + /* + * For archs where spin_lock has inclusive semantics like ia64 + * this smp_mb() will prevent to read pagetable contents + * before the truncate_count increment is visible to + * other cpus. + */ + smp_mb(); if (unlikely(is_restart_addr(mapping->truncate_count))) { if (mapping->truncate_count == 0) reset_vma_truncate_counts(mapping); @@ -1864,10 +1874,18 @@ if (vma->vm_file) { mapping = vma->vm_file->f_mapping; sequence = mapping->truncate_count; + smp_rmb(); /* serializes i_size against truncate_count */ } retry: cond_resched(); new_page = vma->vm_ops->nopage(vma, address & PAGE_MASK, &ret); + /* + * No smp_rmb is needed here as long as there's a full + * spin_lock/unlock sequence inside the ->nopage callback + * (for the pagecache lookup) that acts as an implicit + * smp_mb() and prevents the i_size read to happen + * after the next truncate_count read. + */ /* no page was available -- either SIGBUS or OOM */ if (new_page == NOPAGE_SIGBUS) diff -Nru a/mm/page-writeback.c b/mm/page-writeback.c --- a/mm/page-writeback.c 2005-01-28 14:11:41 -08:00 +++ b/mm/page-writeback.c 2005-01-28 14:11:41 -08:00 @@ -133,17 +133,29 @@ * clamping level. */ static void -get_dirty_limits(struct writeback_state *wbs, long *pbackground, long *pdirty) +get_dirty_limits(struct writeback_state *wbs, long *pbackground, long *pdirty, + struct address_space *mapping) { int background_ratio; /* Percentages */ int dirty_ratio; int unmapped_ratio; long background; long dirty; + unsigned long available_memory = total_pages; struct task_struct *tsk; get_writeback_state(wbs); +#ifdef CONFIG_HIGHMEM + /* + * If this mapping can only allocate from low memory, + * we exclude high memory from our count. + */ + if (mapping && !(mapping_gfp_mask(mapping) & __GFP_HIGHMEM)) + available_memory -= totalhigh_pages; +#endif + + unmapped_ratio = 100 - (wbs->nr_mapped * 100) / total_pages; dirty_ratio = vm_dirty_ratio; @@ -157,8 +169,8 @@ if (background_ratio >= dirty_ratio) background_ratio = dirty_ratio / 2; - background = (background_ratio * total_pages) / 100; - dirty = (dirty_ratio * total_pages) / 100; + background = (background_ratio * available_memory) / 100; + dirty = (dirty_ratio * available_memory) / 100; tsk = current; if (tsk->flags & PF_LESS_THROTTLE || rt_task(tsk)) { background += background / 4; @@ -194,7 +206,8 @@ .nr_to_write = write_chunk, }; - get_dirty_limits(&wbs, &background_thresh, &dirty_thresh); + get_dirty_limits(&wbs, &background_thresh, + &dirty_thresh, mapping); nr_reclaimable = wbs.nr_dirty + wbs.nr_unstable; if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh) break; @@ -210,7 +223,7 @@ if (nr_reclaimable) { writeback_inodes(&wbc); get_dirty_limits(&wbs, &background_thresh, - &dirty_thresh); + &dirty_thresh, mapping); nr_reclaimable = wbs.nr_dirty + wbs.nr_unstable; if (nr_reclaimable + wbs.nr_writeback <= dirty_thresh) break; @@ -296,7 +309,7 @@ long background_thresh; long dirty_thresh; - get_dirty_limits(&wbs, &background_thresh, &dirty_thresh); + get_dirty_limits(&wbs, &background_thresh, &dirty_thresh, NULL); if (wbs.nr_dirty + wbs.nr_unstable < background_thresh && min_pages <= 0) break; diff -Nru a/net/8021q/vlanproc.h b/net/8021q/vlanproc.h --- a/net/8021q/vlanproc.h 2005-01-28 14:11:41 -08:00 +++ b/net/8021q/vlanproc.h 2005-01-28 14:11:41 -08:00 @@ -11,8 +11,8 @@ #define vlan_proc_init() (0) #define vlan_proc_cleanup() do {} while(0) -#define vlan_proc_add_dev(dev) ((void)(dev), 0) -#define vlan_proc_rem_dev(dev) ((void)(dev), 0) +#define vlan_proc_add_dev(dev) ({(void)(dev), 0;}) +#define vlan_proc_rem_dev(dev) ({(void)(dev), 0;}) #endif diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c 2005-01-28 14:11:41 -08:00 +++ b/net/atm/clip.c 2005-01-28 14:11:41 -08:00 @@ -97,7 +97,7 @@ printk(KERN_CRIT "!clip_vcc->entry (clip_vcc %p)\n",clip_vcc); return; } - spin_lock_irq(&entry->neigh->dev->xmit_lock); /* block clip_start_xmit() */ + spin_lock_bh(&entry->neigh->dev->xmit_lock); /* block clip_start_xmit() */ entry->neigh->used = jiffies; for (walk = &entry->vccs; *walk; walk = &(*walk)->next) if (*walk == clip_vcc) { @@ -121,7 +121,7 @@ printk(KERN_CRIT "ATMARP: unlink_clip_vcc failed (entry %p, vcc " "0x%p)\n",entry,clip_vcc); out: - spin_unlock_irq(&entry->neigh->dev->xmit_lock); + spin_unlock_bh(&entry->neigh->dev->xmit_lock); } /* The neighbour entry n->lock is held. */ diff -Nru a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c --- a/net/bluetooth/cmtp/capi.c 2005-01-28 14:11:41 -08:00 +++ b/net/bluetooth/cmtp/capi.c 2005-01-28 14:11:41 -08:00 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -440,10 +441,8 @@ static void cmtp_release_appl(struct capi_ctr *ctrl, __u16 appl) { - DECLARE_WAITQUEUE(wait, current); struct cmtp_session *session = ctrl->driverdata; struct cmtp_application *application; - unsigned long timeo = CMTP_INTEROP_TIMEOUT; BT_DBG("ctrl %p appl %d", ctrl, appl); @@ -458,20 +457,8 @@ cmtp_send_interopmsg(session, CAPI_REQ, application->mapping, application->msgnum, CAPI_FUNCTION_RELEASE, NULL, 0); - add_wait_queue(&session->wait, &wait); - while (timeo) { - set_current_state(TASK_INTERRUPTIBLE); - - if (application->state == BT_CLOSED) - break; - - if (signal_pending(current)) - break; - - timeo = schedule_timeout(timeo); - } - set_current_state(TASK_RUNNING); - remove_wait_queue(&session->wait, &wait); + wait_event_interruptible_timeout(session->wait, + (application->state == BT_CLOSED), CMTP_INTEROP_TIMEOUT); cmtp_application_del(session, application); } @@ -541,9 +528,8 @@ int cmtp_attach_device(struct cmtp_session *session) { - DECLARE_WAITQUEUE(wait, current); - unsigned long timeo = CMTP_INTEROP_TIMEOUT; unsigned char buf[4]; + long ret; BT_DBG("session %p", session); @@ -552,29 +538,16 @@ cmtp_send_interopmsg(session, CAPI_REQ, 0xffff, CMTP_INITIAL_MSGNUM, CAPI_FUNCTION_GET_PROFILE, buf, 4); - add_wait_queue(&session->wait, &wait); - while (timeo) { - set_current_state(TASK_INTERRUPTIBLE); - - if (session->ncontroller) - break; - - if (signal_pending(current)) - break; - - timeo = schedule_timeout(timeo); - } - set_current_state(TASK_RUNNING); - remove_wait_queue(&session->wait, &wait); - + ret = wait_event_interruptible_timeout(session->wait, + session->ncontroller, CMTP_INTEROP_TIMEOUT); + BT_INFO("Found %d CAPI controller(s) on device %s", session->ncontroller, session->name); - if (!timeo) + if (!ret) return -ETIMEDOUT; if (!session->ncontroller) return -ENODEV; - if (session->ncontroller > 1) BT_INFO("Setting up only CAPI controller 1"); diff -Nru a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c --- a/net/bluetooth/hidp/core.c 2005-01-28 14:11:41 -08:00 +++ b/net/bluetooth/hidp/core.c 2005-01-28 14:11:41 -08:00 @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -74,6 +75,8 @@ 150,158,159,128,136,177,178,176,142,152,173,140 }; +static unsigned char hidp_mkeyspat[] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }; + static struct hidp_session *__hidp_get_session(bdaddr_t *bdaddr) { struct hidp_session *session; @@ -175,6 +178,11 @@ for (i = 0; i < 8; i++) input_report_key(dev, hidp_keycode[i + 224], (udata[0] >> i) & 1); + /* If all the key codes have been set to 0x01, it means + * too many keys were pressed at the same time. */ + if (!memcmp(udata + 2, hidp_mkeyspat, 6)) + break; + for (i = 2; i < 8; i++) { if (keys[i] > 3 && memscan(udata + 2, keys[i], 6) == udata + 8) { if (hidp_keycode[keys[i]]) @@ -459,7 +467,6 @@ struct sk_buff *skb; int vendor = 0x0000, product = 0x0000; wait_queue_t ctrl_wait, intr_wait; - unsigned long timeo = HZ; BT_DBG("session %p", session); @@ -504,28 +511,12 @@ hidp_del_timer(session); - if (intr_sk->sk_state != BT_CONNECTED) { - init_waitqueue_entry(&ctrl_wait, current); - add_wait_queue(ctrl_sk->sk_sleep, &ctrl_wait); - while (timeo && ctrl_sk->sk_state != BT_CLOSED) { - set_current_state(TASK_INTERRUPTIBLE); - timeo = schedule_timeout(timeo); - } - set_current_state(TASK_RUNNING); - remove_wait_queue(ctrl_sk->sk_sleep, &ctrl_wait); - timeo = HZ; - } + if (intr_sk->sk_state != BT_CONNECTED) + wait_event_timeout(*(ctrl_sk->sk_sleep), (ctrl_sk->sk_state == BT_CLOSED), HZ); fput(session->ctrl_sock->file); - init_waitqueue_entry(&intr_wait, current); - add_wait_queue(intr_sk->sk_sleep, &intr_wait); - while (timeo && intr_sk->sk_state != BT_CLOSED) { - set_current_state(TASK_INTERRUPTIBLE); - timeo = schedule_timeout(timeo); - } - set_current_state(TASK_RUNNING); - remove_wait_queue(intr_sk->sk_sleep, &intr_wait); + wait_event_timeout(*(intr_sk->sk_sleep), (intr_sk->sk_state == BT_CLOSED), HZ); fput(session->intr_sock->file); diff -Nru a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c --- a/net/bluetooth/rfcomm/core.c 2005-01-28 14:11:40 -08:00 +++ b/net/bluetooth/rfcomm/core.c 2005-01-28 14:11:40 -08:00 @@ -47,10 +47,11 @@ #include #include +#include #include #include -#define VERSION "1.4" +#define VERSION "1.5" #ifndef CONFIG_BT_RFCOMM_DEBUG #undef BT_DBG @@ -1094,6 +1095,35 @@ return 0; } +static inline int rfcomm_check_link_mode(struct rfcomm_dlc *d) +{ + struct sock *sk = d->session->sock->sk; + + if (d->link_mode & (RFCOMM_LM_ENCRYPT | RFCOMM_LM_SECURE)) { + if (!hci_conn_encrypt(l2cap_pi(sk)->conn->hcon)) + return 1; + } else if (d->link_mode & RFCOMM_LM_AUTH) { + if (!hci_conn_auth(l2cap_pi(sk)->conn->hcon)) + return 1; + } + + return 0; +} + +static void rfcomm_dlc_accept(struct rfcomm_dlc *d) +{ + BT_DBG("dlc %p", d); + + rfcomm_send_ua(d->session, d->dlci); + + rfcomm_dlc_lock(d); + d->state = BT_CONNECTED; + d->state_change(d, 0); + rfcomm_dlc_unlock(d); + + rfcomm_send_msc(d->session, 1, d->dlci, d->v24_sig); +} + static int rfcomm_recv_sabm(struct rfcomm_session *s, u8 dlci) { struct rfcomm_dlc *d; @@ -1116,14 +1146,13 @@ if (d) { if (d->state == BT_OPEN) { /* DLC was previously opened by PN request */ - rfcomm_send_ua(s, dlci); - - rfcomm_dlc_lock(d); - d->state = BT_CONNECTED; - d->state_change(d, 0); - rfcomm_dlc_unlock(d); + if (rfcomm_check_link_mode(d)) { + set_bit(RFCOMM_AUTH_PENDING, &d->flags); + rfcomm_dlc_set_timer(d, RFCOMM_AUTH_TIMEOUT); + return 0; + } - rfcomm_send_msc(s, 1, dlci, d->v24_sig); + rfcomm_dlc_accept(d); } return 0; } @@ -1135,14 +1164,13 @@ d->addr = __addr(s->initiator, dlci); rfcomm_dlc_link(s, d); - rfcomm_send_ua(s, dlci); - - rfcomm_dlc_lock(d); - d->state = BT_CONNECTED; - d->state_change(d, 0); - rfcomm_dlc_unlock(d); + if (rfcomm_check_link_mode(d)) { + set_bit(RFCOMM_AUTH_PENDING, &d->flags); + rfcomm_dlc_set_timer(d, RFCOMM_AUTH_TIMEOUT); + return 0; + } - rfcomm_send_msc(s, 1, dlci, d->v24_sig); + rfcomm_dlc_accept(d); } else { rfcomm_send_dm(s, dlci); } @@ -1480,7 +1508,7 @@ /* Trim FCS */ skb->len--; skb->tail--; fcs = *(u8 *) skb->tail; - + if (__check_fcs(skb->data, type, fcs)) { BT_ERR("bad checksum in packet"); kfree_skb(skb); @@ -1491,7 +1519,7 @@ skb_pull(skb, 3); else skb_pull(skb, 4); - + switch (type) { case RFCOMM_SABM: if (__test_pf(hdr->ctrl)) @@ -1559,7 +1587,7 @@ /* Send pending MSC */ if (test_and_clear_bit(RFCOMM_MSC_PENDING, &d->flags)) rfcomm_send_msc(d->session, 1, d->dlci, d->v24_sig); - + if (d->cfc) { /* CFC enabled. * Give them some credits */ @@ -1605,11 +1633,27 @@ list_for_each_safe(p, n, &s->dlcs) { d = list_entry(p, struct rfcomm_dlc, list); + if (test_bit(RFCOMM_TIMED_OUT, &d->flags)) { __rfcomm_dlc_close(d, ETIMEDOUT); continue; } + if (test_and_clear_bit(RFCOMM_AUTH_ACCEPT, &d->flags)) { + rfcomm_dlc_clear_timer(d); + rfcomm_dlc_accept(d); + if (d->link_mode & RFCOMM_LM_SECURE) { + struct sock *sk = s->sock->sk; + hci_conn_change_link_key(l2cap_pi(sk)->conn->hcon); + } + continue; + } else if (test_and_clear_bit(RFCOMM_AUTH_REJECT, &d->flags)) { + rfcomm_dlc_clear_timer(d); + rfcomm_send_dm(s, d->dlci); + __rfcomm_dlc_close(d, ECONNREFUSED); + continue; + } + if (test_bit(RFCOMM_TX_THROTTLED, &s->flags)) continue; @@ -1733,7 +1777,7 @@ rfcomm_session_put(s); } - + rfcomm_unlock(); } @@ -1842,6 +1886,77 @@ return 0; } +static void rfcomm_auth_cfm(struct hci_conn *conn, u8 status) +{ + struct rfcomm_session *s; + struct rfcomm_dlc *d; + struct list_head *p, *n; + + BT_DBG("conn %p status 0x%02x", conn, status); + + s = rfcomm_session_get(&conn->hdev->bdaddr, &conn->dst); + if (!s) + return; + + rfcomm_session_hold(s); + + list_for_each_safe(p, n, &s->dlcs) { + d = list_entry(p, struct rfcomm_dlc, list); + + if (d->link_mode & (RFCOMM_LM_ENCRYPT | RFCOMM_LM_SECURE)) + continue; + + if (!test_and_clear_bit(RFCOMM_AUTH_PENDING, &d->flags)) + continue; + + if (!status) + set_bit(RFCOMM_AUTH_ACCEPT, &d->flags); + else + set_bit(RFCOMM_AUTH_REJECT, &d->flags); + } + + rfcomm_session_put(s); + + rfcomm_schedule(RFCOMM_SCHED_AUTH); +} + +static void rfcomm_encrypt_cfm(struct hci_conn *conn, u8 status, u8 encrypt) +{ + struct rfcomm_session *s; + struct rfcomm_dlc *d; + struct list_head *p, *n; + + BT_DBG("conn %p status 0x%02x encrypt 0x%02x", conn, status, encrypt); + + s = rfcomm_session_get(&conn->hdev->bdaddr, &conn->dst); + if (!s) + return; + + rfcomm_session_hold(s); + + list_for_each_safe(p, n, &s->dlcs) { + d = list_entry(p, struct rfcomm_dlc, list); + + if (!test_and_clear_bit(RFCOMM_AUTH_PENDING, &d->flags)) + continue; + + if (!status && encrypt) + set_bit(RFCOMM_AUTH_ACCEPT, &d->flags); + else + set_bit(RFCOMM_AUTH_REJECT, &d->flags); + } + + rfcomm_session_put(s); + + rfcomm_schedule(RFCOMM_SCHED_AUTH); +} + +static struct hci_cb rfcomm_cb = { + .name = "RFCOMM", + .auth_cfm = rfcomm_auth_cfm, + .encrypt_cfm = rfcomm_encrypt_cfm +}; + /* ---- Proc fs support ---- */ #ifdef CONFIG_PROC_FS static void *rfcomm_seq_start(struct seq_file *seq, loff_t *pos) @@ -1959,6 +2074,8 @@ { l2cap_load(); + hci_register_cb(&rfcomm_cb); + kernel_thread(rfcomm_run, NULL, CLONE_KERNEL); BT_INFO("RFCOMM ver %s", VERSION); @@ -1976,6 +2093,8 @@ static void __exit rfcomm_exit(void) { + hci_unregister_cb(&rfcomm_cb); + /* Terminate working thread. * ie. Set terminate flag and wake it up */ atomic_inc(&terminate); diff -Nru a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c --- a/net/bluetooth/rfcomm/sock.c 2005-01-28 14:11:41 -08:00 +++ b/net/bluetooth/rfcomm/sock.c 2005-01-28 14:11:41 -08:00 @@ -117,8 +117,13 @@ bh_unlock_sock(sk); - if (parent && sk->sk_zapped) + if (parent && sk->sk_zapped) { + /* We have to drop DLC lock here, otherwise + * rfcomm_sock_destruct() will dead lock. */ + rfcomm_dlc_unlock(d); rfcomm_sock_kill(sk); + rfcomm_dlc_lock(d); + } } /* ---- Socket functions ---- */ @@ -184,7 +189,7 @@ rfcomm_dlc_lock(d); rfcomm_pi(sk)->dlc = NULL; - + /* Detach DLC if it's owned by this socket */ if (d->owner == sk) d->owner = NULL; diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c 2005-01-28 14:11:40 -08:00 +++ b/net/core/dev.c 2005-01-28 14:11:40 -08:00 @@ -1190,7 +1190,7 @@ #define HARD_TX_LOCK(dev, cpu) { \ if ((dev->features & NETIF_F_LLTX) == 0) { \ - spin_lock_irq(&dev->xmit_lock); \ + spin_lock(&dev->xmit_lock); \ dev->xmit_lock_owner = cpu; \ } \ } @@ -1198,7 +1198,7 @@ #define HARD_TX_UNLOCK(dev) { \ if ((dev->features & NETIF_F_LLTX) == 0) { \ dev->xmit_lock_owner = -1; \ - spin_unlock_irq(&dev->xmit_lock); \ + spin_unlock(&dev->xmit_lock); \ } \ } diff -Nru a/net/core/dev_mcast.c b/net/core/dev_mcast.c --- a/net/core/dev_mcast.c 2005-01-28 14:11:40 -08:00 +++ b/net/core/dev_mcast.c 2005-01-28 14:11:40 -08:00 @@ -93,9 +93,9 @@ void dev_mc_upload(struct net_device *dev) { - spin_lock_irq(&dev->xmit_lock); + spin_lock_bh(&dev->xmit_lock); __dev_mc_upload(dev); - spin_unlock_irq(&dev->xmit_lock); + spin_unlock_bh(&dev->xmit_lock); } /* @@ -107,7 +107,7 @@ int err = 0; struct dev_mc_list *dmi, **dmip; - spin_lock_irq(&dev->xmit_lock); + spin_lock_bh(&dev->xmit_lock); for (dmip = &dev->mc_list; (dmi = *dmip) != NULL; dmip = &dmi->next) { /* @@ -139,13 +139,13 @@ */ __dev_mc_upload(dev); - spin_unlock_irq(&dev->xmit_lock); + spin_unlock_bh(&dev->xmit_lock); return 0; } } err = -ENOENT; done: - spin_unlock_irq(&dev->xmit_lock); + spin_unlock_bh(&dev->xmit_lock); return err; } @@ -160,7 +160,7 @@ dmi1 = (struct dev_mc_list *)kmalloc(sizeof(*dmi), GFP_ATOMIC); - spin_lock_irq(&dev->xmit_lock); + spin_lock_bh(&dev->xmit_lock); for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { if (memcmp(dmi->dmi_addr, addr, dmi->dmi_addrlen) == 0 && dmi->dmi_addrlen == alen) { @@ -176,7 +176,7 @@ } if ((dmi = dmi1) == NULL) { - spin_unlock_irq(&dev->xmit_lock); + spin_unlock_bh(&dev->xmit_lock); return -ENOMEM; } memcpy(dmi->dmi_addr, addr, alen); @@ -189,11 +189,11 @@ __dev_mc_upload(dev); - spin_unlock_irq(&dev->xmit_lock); + spin_unlock_bh(&dev->xmit_lock); return 0; done: - spin_unlock_irq(&dev->xmit_lock); + spin_unlock_bh(&dev->xmit_lock); if (dmi1) kfree(dmi1); return err; @@ -205,7 +205,7 @@ void dev_mc_discard(struct net_device *dev) { - spin_lock_irq(&dev->xmit_lock); + spin_lock_bh(&dev->xmit_lock); while (dev->mc_list != NULL) { struct dev_mc_list *tmp = dev->mc_list; @@ -216,7 +216,7 @@ } dev->mc_count = 0; - spin_unlock_irq(&dev->xmit_lock); + spin_unlock_bh(&dev->xmit_lock); } #ifdef CONFIG_PROC_FS @@ -251,7 +251,7 @@ struct dev_mc_list *m; struct net_device *dev = v; - spin_lock_irq(&dev->xmit_lock); + spin_lock_bh(&dev->xmit_lock); for (m = dev->mc_list; m; m = m->next) { int i; @@ -263,7 +263,7 @@ seq_putc(seq, '\n'); } - spin_unlock_irq(&dev->xmit_lock); + spin_unlock_bh(&dev->xmit_lock); return 0; } diff -Nru a/net/core/neighbour.c b/net/core/neighbour.c --- a/net/core/neighbour.c 2005-01-28 14:11:40 -08:00 +++ b/net/core/neighbour.c 2005-01-28 14:11:40 -08:00 @@ -1556,6 +1556,7 @@ sizeof(struct ndmsg)); struct ndmsg *ndm = NLMSG_DATA(nlh); + nlh->nlmsg_flags = pid ? NLM_F_MULTI : 0; ndm->ndm_family = n->ops->family; ndm->ndm_flags = n->flags; ndm->ndm_type = n->type; diff -Nru a/net/core/netpoll.c b/net/core/netpoll.c --- a/net/core/netpoll.c 2005-01-28 14:11:41 -08:00 +++ b/net/core/netpoll.c 2005-01-28 14:11:41 -08:00 @@ -65,27 +65,25 @@ return csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)); } -void netpoll_poll(struct netpoll *np) +/* + * Check whether delayed processing was scheduled for our current CPU, + * and then manually invoke NAPI polling to pump data off the card. + * + * In cases where there is bi-directional communications, reading only + * one message at a time can lead to packets being dropped by the + * network adapter, forcing superfluous retries and possibly timeouts. + * Thus, we set our budget to greater than 1. + */ +static void poll_napi(struct netpoll *np) { - /* - * In cases where there is bi-directional communications, reading - * only one message at a time can lead to packets being dropped by - * the network adapter, forcing superfluous retries and possibly - * timeouts. Thus, we set our budget to a more reasonable value. - */ int budget = 16; unsigned long flags; + struct softnet_data *queue; - if(!np->dev || !netif_running(np->dev) || !np->dev->poll_controller) - return; - - /* Process pending work on NIC */ - np->dev->poll_controller(np->dev); - - /* If scheduling is stopped, tickle NAPI bits */ spin_lock_irqsave(&netpoll_poll_lock, flags); - if (np->dev->poll && - test_bit(__LINK_STATE_RX_SCHED, &np->dev->state)) { + queue = &__get_cpu_var(softnet_data); + if (test_bit(__LINK_STATE_RX_SCHED, &np->dev->state) && + !list_empty(&queue->poll_list)) { np->dev->netpoll_rx |= NETPOLL_RX_DROP; atomic_inc(&trapped); @@ -95,6 +93,17 @@ np->dev->netpoll_rx &= ~NETPOLL_RX_DROP; } spin_unlock_irqrestore(&netpoll_poll_lock, flags); +} + +void netpoll_poll(struct netpoll *np) +{ + if(!np->dev || !netif_running(np->dev) || !np->dev->poll_controller) + return; + + /* Process pending work on NIC */ + np->dev->poll_controller(np->dev); + if (np->dev->poll) + poll_napi(np); zap_completion_queue(); } @@ -188,7 +197,7 @@ return; } - spin_lock_irq(&np->dev->xmit_lock); + spin_lock(&np->dev->xmit_lock); np->dev->xmit_lock_owner = smp_processor_id(); /* @@ -197,7 +206,7 @@ */ if (netif_queue_stopped(np->dev)) { np->dev->xmit_lock_owner = -1; - spin_unlock_irq(&np->dev->xmit_lock); + spin_unlock(&np->dev->xmit_lock); netpoll_poll(np); goto repeat; @@ -205,7 +214,7 @@ status = np->dev->hard_start_xmit(skb, np->dev); np->dev->xmit_lock_owner = -1; - spin_unlock_irq(&np->dev->xmit_lock); + spin_unlock(&np->dev->xmit_lock); /* transmit busy */ if(status) { diff -Nru a/net/core/pktgen.c b/net/core/pktgen.c --- a/net/core/pktgen.c 2005-01-28 14:11:41 -08:00 +++ b/net/core/pktgen.c 2005-01-28 14:11:41 -08:00 @@ -2664,11 +2664,12 @@ } } - spin_lock_irq(&odev->xmit_lock); + spin_lock_bh(&odev->xmit_lock); if (!netif_queue_stopped(odev)) { u64 now; atomic_inc(&(pkt_dev->skb->users)); +retry_now: ret = odev->hard_start_xmit(pkt_dev->skb, odev); if (likely(ret == NETDEV_TX_OK)) { pkt_dev->last_ok = 1; @@ -2676,6 +2677,10 @@ pkt_dev->seq_num++; pkt_dev->tx_bytes += pkt_dev->cur_pkt_size; + } else if (ret == NETDEV_TX_LOCKED + && (odev->features & NETIF_F_LLTX)) { + cpu_relax(); + goto retry_now; } else { /* Retry it next time */ atomic_dec(&(pkt_dev->skb->users)); @@ -2711,7 +2716,7 @@ pkt_dev->next_tx_ns = 0; } - spin_unlock_irq(&odev->xmit_lock); + spin_unlock_bh(&odev->xmit_lock); /* If pkt_dev->count is zero, then run forever */ if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) { @@ -2801,7 +2806,7 @@ tx_since_softirq += pkt_dev->last_ok; if (tx_since_softirq > max_before_softirq) { - if(softirq_pending(smp_processor_id())) + if (local_softirq_pending()) do_softirq(); tx_since_softirq = 0; } diff -Nru a/net/ipv4/ah4.c b/net/ipv4/ah4.c --- a/net/ipv4/ah4.c 2005-01-28 14:11:41 -08:00 +++ b/net/ipv4/ah4.c 2005-01-28 14:11:41 -08:00 @@ -236,7 +236,7 @@ * we need for AH processing. This lookup cannot fail here * after a successful crypto_alloc_tfm(). */ - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != diff -Nru a/net/ipv4/esp4.c b/net/ipv4/esp4.c --- a/net/ipv4/esp4.c 2005-01-28 14:11:41 -08:00 +++ b/net/ipv4/esp4.c 2005-01-28 14:11:41 -08:00 @@ -392,7 +392,7 @@ goto error; esp->auth.icv = esp_hmac_digest; - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c --- a/net/ipv4/ip_output.c 2005-01-28 14:11:41 -08:00 +++ b/net/ipv4/ip_output.c 2005-01-28 14:11:41 -08:00 @@ -504,6 +504,7 @@ /* Prepare header of the next frame, * before previous one went down. */ if (frag) { + frag->ip_summed = CHECKSUM_NONE; frag->h.raw = frag->data; frag->nh.raw = __skb_push(frag, hlen); memcpy(frag->nh.raw, iph, hlen); diff -Nru a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c --- a/net/ipv4/ipcomp.c 2005-01-28 14:11:41 -08:00 +++ b/net/ipv4/ipcomp.c 2005-01-28 14:11:41 -08:00 @@ -472,7 +472,7 @@ goto error_tunnel; } - calg_desc = xfrm_calg_get_byname(x->calg->alg_name); + calg_desc = xfrm_calg_get_byname(x->calg->alg_name, 0); BUG_ON(!calg_desc); ipcd->threshold = calg_desc->uinfo.comp.threshold; x->data = ipcd; diff -Nru a/net/ipv4/netfilter/ip_conntrack_irc.c b/net/ipv4/netfilter/ip_conntrack_irc.c --- a/net/ipv4/netfilter/ip_conntrack_irc.c 2005-01-28 14:11:41 -08:00 +++ b/net/ipv4/netfilter/ip_conntrack_irc.c 2005-01-28 14:11:41 -08:00 @@ -209,9 +209,14 @@ DEBUGP("tcph->seq = %u\n", th->seq); seq = ntohl(th->seq) + (addr_beg_p - ib_ptr); + /* We refer to the reverse direction ("!dir") + * tuples here, because we're expecting + * something in the other * direction. + * Doesn't matter unless NAT is happening. */ exp->tuple = ((struct ip_conntrack_tuple) { { 0, { 0 } }, - { ct->tuplehash[dir].tuple.src.ip, { .tcp = { htons(dcc_port) } }, + { ct->tuplehash[!dir].tuple.dst.ip, + { .tcp = { htons(dcc_port) } }, IPPROTO_TCP }}); exp->mask = ((struct ip_conntrack_tuple) { { 0, { 0 } }, diff -Nru a/net/ipv4/netfilter/ip_nat_irc.c b/net/ipv4/netfilter/ip_nat_irc.c --- a/net/ipv4/netfilter/ip_nat_irc.c 2005-01-28 14:11:41 -08:00 +++ b/net/ipv4/netfilter/ip_nat_irc.c 2005-01-28 14:11:41 -08:00 @@ -83,7 +83,10 @@ * 0x01, \n: terminators */ - sprintf(buffer, "%u %u", ntohl(exp->tuple.src.ip), port); + /* AAA = "us", ie. where server normally talks to. */ + sprintf(buffer, "%u %u", + ntohl(exp->master->tuplehash[IP_CT_DIR_REPLY].tuple.dst.ip), + port); DEBUGP("ip_nat_irc: Inserting '%s' == %u.%u.%u.%u, port %u\n", buffer, NIPQUAD(exp->tuple.src.ip), port); diff -Nru a/net/ipv4/netfilter/ip_nat_rule.c b/net/ipv4/netfilter/ip_nat_rule.c --- a/net/ipv4/netfilter/ip_nat_rule.c 2005-01-28 14:11:40 -08:00 +++ b/net/ipv4/netfilter/ip_nat_rule.c 2005-01-28 14:11:40 -08:00 @@ -181,7 +181,7 @@ return 0; } - if (targinfosize != sizeof(struct ip_nat_multi_range_compat)) { + if (targinfosize != IPT_ALIGN(sizeof(struct ip_nat_multi_range_compat))) { DEBUGP("SNAT: Target size %u wrong for %u ranges\n", targinfosize, mr->rangesize); return 0; @@ -214,7 +214,7 @@ return 0; } - if (targinfosize != sizeof(struct ip_nat_multi_range_compat)) { + if (targinfosize != IPT_ALIGN(sizeof(struct ip_nat_multi_range_compat))) { DEBUGP("DNAT: Target size %u wrong for %u ranges\n", targinfosize, mr->rangesize); return 0; diff -Nru a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c 2005-01-28 14:11:40 -08:00 +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c 2005-01-28 14:11:40 -08:00 @@ -29,6 +29,7 @@ #include #include #include +#include #define CLUSTERIP_VERSION "0.6" diff -Nru a/net/ipv4/netfilter/ipt_multiport.c b/net/ipv4/netfilter/ipt_multiport.c --- a/net/ipv4/netfilter/ipt_multiport.c 2005-01-28 14:11:40 -08:00 +++ b/net/ipv4/netfilter/ipt_multiport.c 2005-01-28 14:11:40 -08:00 @@ -64,30 +64,31 @@ if (minfo->flags == IPT_MULTIPORT_SOURCE && src >= s && src <= e) - return 1; + return 1 ^ minfo->invert; if (minfo->flags == IPT_MULTIPORT_DESTINATION && dst >= s && dst <= e) - return 1; + return 1 ^ minfo->invert; if (minfo->flags == IPT_MULTIPORT_EITHER && ((dst >= s && dst <= e) || (src >= s && src <= e))) - return 1; + return 1 ^ minfo->invert; } else { /* exact port matching */ duprintf("src or dst matches with %d?\n", s); + if (minfo->flags == IPT_MULTIPORT_SOURCE && src == s) - return 1; + return 1 ^ minfo->invert; if (minfo->flags == IPT_MULTIPORT_DESTINATION && dst == s) - return 1; + return 1 ^ minfo->invert; if (minfo->flags == IPT_MULTIPORT_EITHER && (src == s || dst == s)) - return 1; + return 1 ^ minfo->invert; } } - return 0; + return minfo->invert; } static int diff -Nru a/net/ipv6/ah6.c b/net/ipv6/ah6.c --- a/net/ipv6/ah6.c 2005-01-28 14:11:41 -08:00 +++ b/net/ipv6/ah6.c 2005-01-28 14:11:41 -08:00 @@ -375,7 +375,7 @@ * we need for AH processing. This lookup cannot fail here * after a successful crypto_alloc_tfm(). */ - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != diff -Nru a/net/ipv6/esp6.c b/net/ipv6/esp6.c --- a/net/ipv6/esp6.c 2005-01-28 14:11:41 -08:00 +++ b/net/ipv6/esp6.c 2005-01-28 14:11:41 -08:00 @@ -329,7 +329,7 @@ goto error; esp->auth.icv = esp_hmac_digest; - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != diff -Nru a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c --- a/net/ipv6/ip6_output.c 2005-01-28 14:11:40 -08:00 +++ b/net/ipv6/ip6_output.c 2005-01-28 14:11:40 -08:00 @@ -592,6 +592,7 @@ /* Prepare header of the next frame, * before previous one went down. */ if (frag) { + frag->ip_summed = CHECKSUM_NONE; frag->h.raw = frag->data; fh = (struct frag_hdr*)__skb_push(frag, sizeof(struct frag_hdr)); frag->nh.raw = __skb_push(frag, hlen); diff -Nru a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c --- a/net/ipv6/ipcomp6.c 2005-01-28 14:11:40 -08:00 +++ b/net/ipv6/ipcomp6.c 2005-01-28 14:11:40 -08:00 @@ -468,7 +468,7 @@ goto error_tunnel; } - calg_desc = xfrm_calg_get_byname(x->calg->alg_name); + calg_desc = xfrm_calg_get_byname(x->calg->alg_name, 0); BUG_ON(!calg_desc); ipcd->threshold = calg_desc->uinfo.comp.threshold; x->data = ipcd; diff -Nru a/net/key/af_key.c b/net/key/af_key.c --- a/net/key/af_key.c 2005-01-28 14:11:41 -08:00 +++ b/net/key/af_key.c 2005-01-28 14:11:41 -08:00 @@ -665,18 +665,18 @@ sa->sadb_sa_state = SADB_SASTATE_DEAD; sa->sadb_sa_auth = 0; if (x->aalg) { - struct xfrm_algo_desc *a = xfrm_aalg_get_byname(x->aalg->alg_name); + struct xfrm_algo_desc *a = xfrm_aalg_get_byname(x->aalg->alg_name, 0); sa->sadb_sa_auth = a ? a->desc.sadb_alg_id : 0; } sa->sadb_sa_encrypt = 0; BUG_ON(x->ealg && x->calg); if (x->ealg) { - struct xfrm_algo_desc *a = xfrm_ealg_get_byname(x->ealg->alg_name); + struct xfrm_algo_desc *a = xfrm_ealg_get_byname(x->ealg->alg_name, 0); sa->sadb_sa_encrypt = a ? a->desc.sadb_alg_id : 0; } /* KAME compatible: sadb_sa_encrypt is overloaded with calg id */ if (x->calg) { - struct xfrm_algo_desc *a = xfrm_calg_get_byname(x->calg->alg_name); + struct xfrm_algo_desc *a = xfrm_calg_get_byname(x->calg->alg_name, 0); sa->sadb_sa_encrypt = a ? a->desc.sadb_alg_id : 0; } diff -Nru a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c --- a/net/netlink/af_netlink.c 2005-01-28 14:11:40 -08:00 +++ b/net/netlink/af_netlink.c 2005-01-28 14:11:40 -08:00 @@ -91,12 +91,12 @@ struct netlink_table { struct nl_pid_hash hash; struct hlist_head mc_list; + unsigned int nl_nonroot; }; static struct netlink_table *nl_table; static DECLARE_WAIT_QUEUE_HEAD(nl_table_wait); -static unsigned int nl_nonroot[MAX_LINKS]; static int netlink_dump(struct sock *sk); static void netlink_destroy_callback(struct netlink_callback *cb); @@ -438,7 +438,7 @@ static inline int netlink_capable(struct socket *sock, unsigned int flag) { - return (nl_nonroot[sock->sk->sk_protocol] & flag) || + return (nl_table[sock->sk->sk_protocol].nl_nonroot & flag) || capable(CAP_NET_ADMIN); } @@ -1066,7 +1066,7 @@ void netlink_set_nonroot(int protocol, unsigned int flags) { if ((unsigned int)protocol < MAX_LINKS) - nl_nonroot[protocol] = flags; + nl_table[protocol].nl_nonroot = flags; } static void netlink_destroy_callback(struct netlink_callback *cb) diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c --- a/net/sched/sch_generic.c 2005-01-28 14:11:40 -08:00 +++ b/net/sched/sch_generic.c 2005-01-28 14:11:40 -08:00 @@ -99,11 +99,17 @@ if ((skb = q->dequeue(q)) != NULL) { unsigned nolock = (dev->features & NETIF_F_LLTX); /* - * When the driver has LLTX set it does not require any - * locking in start_xmit. + * When the driver has LLTX set it does its own locking + * in start_xmit. No need to add additional overhead by + * locking again. These checks are worth it because + * even uncongested locks can be quite expensive. + * The driver can do trylock like here too, in case + * of lock congestion it should return -1 and the packet + * will be requeued. */ if (!nolock) { - if (!spin_trylock_irq(&dev->xmit_lock)) { + if (!spin_trylock(&dev->xmit_lock)) { + collision: /* So, someone grabbed the driver. */ /* It may be transient configuration error, @@ -137,18 +143,22 @@ if (ret == NETDEV_TX_OK) { if (!nolock) { dev->xmit_lock_owner = -1; - spin_unlock_irq(&dev->xmit_lock); + spin_unlock(&dev->xmit_lock); } spin_lock(&dev->queue_lock); return -1; } + if (ret == NETDEV_TX_LOCKED && nolock) { + spin_lock(&dev->queue_lock); + goto collision; + } } /* NETDEV_TX_BUSY - we need to requeue */ /* Release the driver */ if (!nolock) { dev->xmit_lock_owner = -1; - spin_unlock_irq(&dev->xmit_lock); + spin_unlock(&dev->xmit_lock); } spin_lock(&dev->queue_lock); q = dev->qdisc; @@ -176,7 +186,7 @@ { struct net_device *dev = (struct net_device *)arg; - spin_lock_irq(&dev->xmit_lock); + spin_lock(&dev->xmit_lock); if (dev->qdisc != &noop_qdisc) { if (netif_device_present(dev) && netif_running(dev) && @@ -190,7 +200,7 @@ dev_hold(dev); } } - spin_unlock_irq(&dev->xmit_lock); + spin_unlock(&dev->xmit_lock); dev_put(dev); } @@ -214,17 +224,17 @@ static void dev_watchdog_up(struct net_device *dev) { - spin_lock_irq(&dev->xmit_lock); + spin_lock_bh(&dev->xmit_lock); __netdev_watchdog_up(dev); - spin_unlock_irq(&dev->xmit_lock); + spin_unlock_bh(&dev->xmit_lock); } static void dev_watchdog_down(struct net_device *dev) { - spin_lock_irq(&dev->xmit_lock); + spin_lock_bh(&dev->xmit_lock); if (del_timer(&dev->watchdog_timer)) __dev_put(dev); - spin_unlock_irq(&dev->xmit_lock); + spin_unlock_bh(&dev->xmit_lock); } /* "NOOP" scheduler: the best scheduler, recommended for all interfaces diff -Nru a/net/sched/sch_teql.c b/net/sched/sch_teql.c --- a/net/sched/sch_teql.c 2005-01-28 14:11:40 -08:00 +++ b/net/sched/sch_teql.c 2005-01-28 14:11:40 -08:00 @@ -301,12 +301,12 @@ switch (teql_resolve(skb, skb_res, slave)) { case 0: - if (spin_trylock_irq(&slave->xmit_lock)) { + if (spin_trylock(&slave->xmit_lock)) { slave->xmit_lock_owner = smp_processor_id(); if (!netif_queue_stopped(slave) && slave->hard_start_xmit(skb, slave) == 0) { slave->xmit_lock_owner = -1; - spin_unlock_irq(&slave->xmit_lock); + spin_unlock(&slave->xmit_lock); master->slaves = NEXT_SLAVE(q); netif_wake_queue(dev); master->stats.tx_packets++; @@ -314,7 +314,7 @@ return 0; } slave->xmit_lock_owner = -1; - spin_unlock_irq(&slave->xmit_lock); + spin_unlock(&slave->xmit_lock); } if (netif_queue_stopped(dev)) busy = 1; diff -Nru a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c --- a/net/xfrm/xfrm_algo.c 2005-01-28 14:11:41 -08:00 +++ b/net/xfrm/xfrm_algo.c 2005-01-28 14:11:41 -08:00 @@ -13,6 +13,7 @@ #include #include #include +#include #include #if defined(CONFIG_INET_AH) || defined(CONFIG_INET_AH_MODULE) || defined(CONFIG_INET6_AH) || defined(CONFIG_INET6_AH_MODULE) #include @@ -346,58 +347,48 @@ return NULL; } -struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name) +static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list, + int entries, char *name, + int probe) { - int i; + int i, status; if (!name) return NULL; - for (i=0; i < aalg_entries(); i++) { - if (strcmp(name, aalg_list[i].name) == 0) { - if (aalg_list[i].available) - return &aalg_list[i]; - else - break; - } + for (i = 0; i < entries; i++) { + if (!strcmp(name, list[i].name)) + continue; + + if (list[i].available) + return &list[i]; + + if (!probe) + break; + + status = crypto_alg_available(name, 0); + if (!status) + break; + + list[i].available = status; + return &list[i]; } return NULL; } -struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name) +struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe) { - int i; - - if (!name) - return NULL; - - for (i=0; i < ealg_entries(); i++) { - if (strcmp(name, ealg_list[i].name) == 0) { - if (ealg_list[i].available) - return &ealg_list[i]; - else - break; - } - } - return NULL; + return xfrm_get_byname(aalg_list, aalg_entries(), name, probe); } -struct xfrm_algo_desc *xfrm_calg_get_byname(char *name) +struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe) { - int i; - - if (!name) - return NULL; + return xfrm_get_byname(ealg_list, ealg_entries(), name, probe); +} - for (i=0; i < calg_entries(); i++) { - if (strcmp(name, calg_list[i].name) == 0) { - if (calg_list[i].available) - return &calg_list[i]; - else - break; - } - } - return NULL; +struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe) +{ + return xfrm_get_byname(calg_list, calg_entries(), name, probe); } struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx) diff -Nru a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c --- a/net/xfrm/xfrm_user.c 2005-01-28 14:11:41 -08:00 +++ b/net/xfrm/xfrm_user.c 2005-01-28 14:11:41 -08:00 @@ -156,7 +156,7 @@ } static int attach_one_algo(struct xfrm_algo **algpp, u8 *props, - struct xfrm_algo_desc *(*get_byname)(char *), + struct xfrm_algo_desc *(*get_byname)(char *, int), struct rtattr *u_arg) { struct rtattr *rta = u_arg; @@ -168,7 +168,7 @@ ualg = RTA_DATA(rta); - algo = get_byname(ualg->alg_name); + algo = get_byname(ualg->alg_name, 1); if (!algo) return -ENOSYS; *props = algo->desc.sadb_alg_id; @@ -272,8 +272,6 @@ err = verify_newsa_info(p, (struct rtattr **) xfrma); if (err) return err; - - xfrm_probe_algs(); x = xfrm_state_construct(p, (struct rtattr **) xfrma, &err); if (!x) diff -Nru a/sound/oss/i810_audio.c b/sound/oss/i810_audio.c --- a/sound/oss/i810_audio.c 2005-01-28 14:11:41 -08:00 +++ b/sound/oss/i810_audio.c 2005-01-28 14:11:41 -08:00 @@ -1196,9 +1196,19 @@ if (count < fragsize) return; + /* if we are currently stopped, then our CIV is actually set to our + * *last* sg segment and we are ready to wrap to the next. However, + * if we set our LVI to the last sg segment, then it won't wrap to + * the next sg segment, it won't even get a start. So, instead, when + * we are stopped, we set both the LVI value and also we increment + * the CIV value to the next sg segment to be played so that when + * we call start, things will operate properly + */ if (!dmabuf->enable && dmabuf->ready) { if (!(dmabuf->trigger & trigger)) return; + + CIV_TO_LVI(state->card, port, 1); start(state); while (!(I810_IOREADB(state->card, port + OFF_CR) & ((1<<4) | (1<<2))))