aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/powerpc/mpc52xx-device-tree-bindings.txt11
-rw-r--r--Documentation/scsi/ChangeLog.megaraid_sas22
-rw-r--r--Documentation/vm/slabinfo.c10
-rw-r--r--MAINTAINERS2
-rw-r--r--Makefile4
-rw-r--r--arch/arm/kernel/sys_arm.c17
-rw-r--r--arch/avr32/kernel/sys_avr32.c13
-rw-r--r--arch/blackfin/kernel/sys_bfin.c17
-rw-r--r--arch/frv/kernel/sys_frv.c17
-rw-r--r--arch/h8300/kernel/sys_h8300.c17
-rw-r--r--arch/m68k/kernel/sys_m68k.c17
-rw-r--r--arch/m68knommu/kernel/sys_m68k.c17
-rw-r--r--arch/mn10300/kernel/sys_mn10300.c17
-rw-r--r--arch/parisc/kernel/sys_parisc.c13
-rw-r--r--arch/powerpc/boot/dts/mpc8610_hpcd.dts23
-rw-r--r--arch/powerpc/configs/ps3_defconfig132
-rw-r--r--arch/powerpc/kernel/smp.c2
-rw-r--r--arch/powerpc/kernel/syscalls.c17
-rw-r--r--arch/powerpc/mm/slb.c27
-rw-r--r--arch/powerpc/platforms/ps3/interrupt.c6
-rw-r--r--arch/powerpc/sysdev/fsl_rio.c9
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c4
-rw-r--r--arch/powerpc/sysdev/xilinx_intc.c2
-rw-r--r--arch/s390/kernel/sys_s390.c17
-rw-r--r--arch/sh/kernel/sys_sh64.c17
-rw-r--r--arch/sparc/kernel/setup.c5
-rw-r--r--arch/sparc/mm/fault.c61
-rw-r--r--arch/sparc/prom/init.c7
-rw-r--r--arch/sparc/prom/memory.c235
-rw-r--r--arch/sparc64/kernel/pci.c130
-rw-r--r--arch/sparc64/kernel/pci_common.c6
-rw-r--r--arch/sparc64/kernel/pci_impl.h9
-rw-r--r--arch/sparc64/kernel/process.c6
-rw-r--r--arch/sparc64/kernel/signal.c6
-rw-r--r--arch/sparc64/kernel/signal32.c6
-rw-r--r--arch/um/kernel/syscall.c17
-rw-r--r--arch/v850/kernel/syscalls.c17
-rw-r--r--arch/x86/kernel/sys_i386_32.c17
-rw-r--r--arch/x86/kernel/sys_x86_64.c17
-rw-r--r--block/bsg.c12
-rw-r--r--block/scsi_ioctl.c5
-rw-r--r--drivers/bluetooth/hci_usb.h21
-rw-r--r--drivers/char/xilinx_hwicap/xilinx_hwicap.c6
-rw-r--r--drivers/firewire/fw-sbp2.c2
-rw-r--r--drivers/net/8390.c2
-rw-r--r--drivers/net/bnx2.c43
-rw-r--r--drivers/net/bnx2_fw2.h502
-rw-r--r--drivers/net/fec_mpc52xx.c97
-rw-r--r--drivers/net/fec_mpc52xx.h19
-rw-r--r--drivers/net/tg3.c149
-rw-r--r--drivers/net/tg3.h15
-rw-r--r--drivers/net/wireless/b43/b43.h4
-rw-r--r--drivers/net/wireless/b43/main.c51
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c29
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c26
-rw-r--r--drivers/net/wireless/libertas/scan.c3
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00leds.c15
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h6
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c2
-rw-r--r--drivers/net/xen-netfront.c2
-rw-r--r--drivers/power/pda_power.c11
-rw-r--r--drivers/power/pmu_battery.c2
-rw-r--r--drivers/ps3/ps3-lpm.c1
-rw-r--r--drivers/ps3/ps3-sys-manager.c7
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c2
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c2
-rw-r--r--drivers/scsi/53c700.c6
-rw-r--r--drivers/scsi/Kconfig3
-rw-r--r--drivers/scsi/a100u2w.c2
-rw-r--r--drivers/scsi/aacraid/aachba.c133
-rw-r--r--drivers/scsi/aacraid/aacraid.h28
-rw-r--r--drivers/scsi/aacraid/comminit.c2
-rw-r--r--drivers/scsi/aacraid/commsup.c34
-rw-r--r--drivers/scsi/aacraid/linit.c22
-rw-r--r--drivers/scsi/aic94xx/aic94xx_init.c6
-rw-r--r--drivers/scsi/constants.c10
-rw-r--r--drivers/scsi/dpt/dpti_ioctl.h16
-rw-r--r--drivers/scsi/dpt/dptsig.h8
-rw-r--r--drivers/scsi/dpt/sys_info.h4
-rw-r--r--drivers/scsi/dpt_i2o.c640
-rw-r--r--drivers/scsi/dpti.h15
-rw-r--r--drivers/scsi/gdth.c2
-rw-r--r--drivers/scsi/hptiop.c6
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c7
-rw-r--r--drivers/scsi/ibmvscsi/viosrp.h9
-rw-r--r--drivers/scsi/initio.c2
-rw-r--r--drivers/scsi/ipr.c2
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c17
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.h1
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.c13
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.h6
-rw-r--r--drivers/scsi/qla1280.c4
-rw-r--r--drivers/scsi/scsi.c23
-rw-r--r--drivers/scsi/scsi_error.c15
-rw-r--r--drivers/scsi/scsi_lib.c7
-rw-r--r--drivers/scsi/scsi_tgt_lib.c2
-rw-r--r--drivers/scsi/u14-34f.c6
-rw-r--r--drivers/serial/mpc52xx_uart.c2
-rw-r--r--drivers/serial/sunhv.c2
-rw-r--r--drivers/serial/sunsab.c2
-rw-r--r--drivers/serial/sunsu.c2
-rw-r--r--drivers/serial/sunzilog.c2
-rw-r--r--drivers/usb/storage/cypress_atacb.c2
-rw-r--r--drivers/usb/storage/isd200.c2
-rw-r--r--fs/ocfs2/cluster/sys.c2
-rw-r--r--fs/ocfs2/dlm/dlmdebug.c8
-rw-r--r--fs/ocfs2/file.c4
-rw-r--r--fs/ocfs2/localalloc.c4
-rw-r--r--fs/ocfs2/stack_o2cb.c2
-rw-r--r--fs/ocfs2/stack_user.c2
-rw-r--r--fs/ocfs2/symlink.c2
-rw-r--r--fs/pipe.c17
-rw-r--r--fs/proc/generic.c17
-rw-r--r--fs/proc/proc_net.c11
-rw-r--r--include/asm-alpha/types.h36
-rw-r--r--include/asm-arm/types.h33
-rw-r--r--include/asm-avr32/types.h32
-rw-r--r--include/asm-blackfin/types.h34
-rw-r--r--include/asm-cris/types.h33
-rw-r--r--include/asm-frv/types.h34
-rw-r--r--include/asm-generic/Kbuild2
-rw-r--r--include/asm-generic/int-l64.h71
-rw-r--r--include/asm-generic/int-ll64.h76
-rw-r--r--include/asm-h8300/types.h33
-rw-r--r--include/asm-ia64/types.h31
-rw-r--r--include/asm-m32r/types.h32
-rw-r--r--include/asm-m68k/types.h32
-rw-r--r--include/asm-mips/types.h56
-rw-r--r--include/asm-mn10300/types.h33
-rw-r--r--include/asm-parisc/types.h33
-rw-r--r--include/asm-powerpc/ps3.h3
-rw-r--r--include/asm-powerpc/syscalls.h2
-rw-r--r--include/asm-powerpc/types.h48
-rw-r--r--include/asm-s390/types.h48
-rw-r--r--include/asm-sh/types.h34
-rw-r--r--include/asm-sparc/oplib.h17
-rw-r--r--include/asm-sparc/page.h5
-rw-r--r--include/asm-sparc/types.h30
-rw-r--r--include/asm-sparc64/types.h30
-rw-r--r--include/asm-v850/types.h32
-rw-r--r--include/asm-x86/types.h38
-rw-r--r--include/asm-xtensa/types.h33
-rw-r--r--include/linux/ieee80211.h2
-rw-r--r--include/linux/if_bridge.h4
-rw-r--r--include/linux/pda_power.h4
-rw-r--r--include/linux/rio.h2
-rw-r--r--include/linux/wireless.h7
-rw-r--r--include/scsi/scsi.h40
-rw-r--r--include/scsi/scsi_cmnd.h23
-rw-r--r--include/scsi/scsi_eh.h4
-rw-r--r--include/scsi/scsi_host.h8
-rw-r--r--init/Kconfig2
-rw-r--r--ipc/mqueue.c3
-rw-r--r--kernel/time.c8
-rw-r--r--kernel/timeconst.pl120
-rw-r--r--mm/slub.c44
-rw-r--r--net/8021q/vlanproc.c7
-rw-r--r--net/atm/proc.c6
-rw-r--r--net/bluetooth/bnep/core.c8
-rw-r--r--net/bluetooth/hci_event.c9
-rw-r--r--net/bluetooth/hci_sock.c2
-rw-r--r--net/bluetooth/l2cap.c2
-rw-r--r--net/bridge/br_fdb.c4
-rw-r--r--net/bridge/br_stp_bpdu.c4
-rw-r--r--net/core/dev.c19
-rw-r--r--net/core/filter.c4
-rw-r--r--net/core/neighbour.c5
-rw-r--r--net/core/net-sysfs.c7
-rw-r--r--net/core/net-sysfs.h2
-rw-r--r--net/core/pktgen.c12
-rw-r--r--net/core/sock.c3
-rw-r--r--net/dccp/ccids/ccid2.c2
-rw-r--r--net/dccp/ccids/ccid3.c4
-rw-r--r--net/ipv4/cipso_ipv4.c18
-rw-r--r--net/ipv4/netfilter/ipt_CLUSTERIP.c6
-rw-r--r--net/ipv4/tcp_hybla.c6
-rw-r--r--net/ipv4/tcp_input.c18
-rw-r--r--net/ipv4/tcp_ipv4.c10
-rw-r--r--net/ipv4/tcp_vegas.c6
-rw-r--r--net/ipv4/tcp_veno.c6
-rw-r--r--net/ipv4/udp.c7
-rw-r--r--net/ipv6/proc.c6
-rw-r--r--net/ipv6/reassembly.c4
-rw-r--r--net/irda/iriap.c8
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/main.c47
-rw-r--r--net/mac80211/mesh.c17
-rw-r--r--net/mac80211/mesh.h2
-rw-r--r--net/mac80211/tkip.c6
-rw-r--r--net/netfilter/nf_conntrack_standalone.c6
-rw-r--r--net/netfilter/x_tables.c13
-rw-r--r--net/netfilter/xt_hashlimit.c12
-rw-r--r--net/rose/rose_route.c8
-rw-r--r--net/rxrpc/ar-transport.c3
-rw-r--r--net/sched/sch_generic.c1
-rw-r--r--net/sunrpc/cache.c15
-rw-r--r--net/sunrpc/stats.c8
-rw-r--r--net/sysctl_net.c2
205 files changed, 2273 insertions, 2431 deletions
diff --git a/Documentation/powerpc/mpc52xx-device-tree-bindings.txt b/Documentation/powerpc/mpc52xx-device-tree-bindings.txt
index cda7a7dffa6d..6f12f1c79c0c 100644
--- a/Documentation/powerpc/mpc52xx-device-tree-bindings.txt
+++ b/Documentation/powerpc/mpc52xx-device-tree-bindings.txt
@@ -237,6 +237,17 @@ Each GPIO controller node should have the empty property gpio-controller and
237according to the bit numbers in the GPIO control registers. The second cell 237according to the bit numbers in the GPIO control registers. The second cell
238is for flags which is currently unsused. 238is for flags which is currently unsused.
239 239
2408) FEC nodes
241The FEC node can specify one of the following properties to configure
242the MII link:
243"fsl,7-wire-mode" - An empty property that specifies the link uses 7-wire
244 mode instead of MII
245"current-speed" - Specifies that the MII should be configured for a fixed
246 speed. This property should contain two cells. The
247 first cell specifies the speed in Mbps and the second
248 should be '0' for half duplex and '1' for full duplex
249"phy-handle" - Contains a phandle to an Ethernet PHY.
250
240IV - Extra Notes 251IV - Extra Notes
241================ 252================
242 253
diff --git a/Documentation/scsi/ChangeLog.megaraid_sas b/Documentation/scsi/ChangeLog.megaraid_sas
index 91c81db0ba71..716fcc1cafb5 100644
--- a/Documentation/scsi/ChangeLog.megaraid_sas
+++ b/Documentation/scsi/ChangeLog.megaraid_sas
@@ -1,3 +1,25 @@
11 Release Date : Mon. March 10 11:02:31 PDT 2008 -
2 (emaild-id:megaraidlinux@lsi.com)
3 Sumant Patro
4 Bo Yang
5
62 Current Version : 00.00.03.20-RC1
73 Older Version : 00.00.03.16
8
91. Rollback the sense info implementation
10 Sense buffer ptr data type in the ioctl path is reverted back
11 to u32 * as in previous versions of driver.
12
132. Fixed the driver frame count.
14 When Driver sent wrong frame count to firmware. As this
15 particular command is sent to drive, FW is seeing continuous
16 chip resets and so the command will timeout.
17
183. Add the new controller(1078DE) support to the driver
19 and Increase the max_wait to 60 from 10 in the controller
20 operational status. With this max_wait increase, driver will
21 make sure the FW will finish the pending cmd for KDUMP case.
22
11 Release Date : Thur. Nov. 07 16:30:43 PST 2007 - 231 Release Date : Thur. Nov. 07 16:30:43 PST 2007 -
2 (emaild-id:megaraidlinux@lsi.com) 24 (emaild-id:megaraidlinux@lsi.com)
3 Sumant Patro 25 Sumant Patro
diff --git a/Documentation/vm/slabinfo.c b/Documentation/vm/slabinfo.c
index d3ce295bffac..e4230ed16ee7 100644
--- a/Documentation/vm/slabinfo.c
+++ b/Documentation/vm/slabinfo.c
@@ -38,7 +38,7 @@ struct slabinfo {
38 unsigned long alloc_from_partial, alloc_slab, free_slab, alloc_refill; 38 unsigned long alloc_from_partial, alloc_slab, free_slab, alloc_refill;
39 unsigned long cpuslab_flush, deactivate_full, deactivate_empty; 39 unsigned long cpuslab_flush, deactivate_full, deactivate_empty;
40 unsigned long deactivate_to_head, deactivate_to_tail; 40 unsigned long deactivate_to_head, deactivate_to_tail;
41 unsigned long deactivate_remote_frees; 41 unsigned long deactivate_remote_frees, order_fallback;
42 int numa[MAX_NODES]; 42 int numa[MAX_NODES];
43 int numa_partial[MAX_NODES]; 43 int numa_partial[MAX_NODES];
44} slabinfo[MAX_SLABS]; 44} slabinfo[MAX_SLABS];
@@ -293,7 +293,7 @@ int line = 0;
293void first_line(void) 293void first_line(void)
294{ 294{
295 if (show_activity) 295 if (show_activity)
296 printf("Name Objects Alloc Free %%Fast\n"); 296 printf("Name Objects Alloc Free %%Fast Fallb O\n");
297 else 297 else
298 printf("Name Objects Objsize Space " 298 printf("Name Objects Objsize Space "
299 "Slabs/Part/Cpu O/S O %%Fr %%Ef Flg\n"); 299 "Slabs/Part/Cpu O/S O %%Fr %%Ef Flg\n");
@@ -573,11 +573,12 @@ void slabcache(struct slabinfo *s)
573 total_alloc = s->alloc_fastpath + s->alloc_slowpath; 573 total_alloc = s->alloc_fastpath + s->alloc_slowpath;
574 total_free = s->free_fastpath + s->free_slowpath; 574 total_free = s->free_fastpath + s->free_slowpath;
575 575
576 printf("%-21s %8ld %8ld %8ld %3ld %3ld \n", 576 printf("%-21s %8ld %10ld %10ld %3ld %3ld %5ld %1d\n",
577 s->name, s->objects, 577 s->name, s->objects,
578 total_alloc, total_free, 578 total_alloc, total_free,
579 total_alloc ? (s->alloc_fastpath * 100 / total_alloc) : 0, 579 total_alloc ? (s->alloc_fastpath * 100 / total_alloc) : 0,
580 total_free ? (s->free_fastpath * 100 / total_free) : 0); 580 total_free ? (s->free_fastpath * 100 / total_free) : 0,
581 s->order_fallback, s->order);
581 } 582 }
582 else 583 else
583 printf("%-21s %8ld %7d %8s %14s %4d %1d %3ld %3ld %s\n", 584 printf("%-21s %8ld %7d %8s %14s %4d %1d %3ld %3ld %s\n",
@@ -1188,6 +1189,7 @@ void read_slab_dir(void)
1188 slab->deactivate_to_head = get_obj("deactivate_to_head"); 1189 slab->deactivate_to_head = get_obj("deactivate_to_head");
1189 slab->deactivate_to_tail = get_obj("deactivate_to_tail"); 1190 slab->deactivate_to_tail = get_obj("deactivate_to_tail");
1190 slab->deactivate_remote_frees = get_obj("deactivate_remote_frees"); 1191 slab->deactivate_remote_frees = get_obj("deactivate_remote_frees");
1192 slab->order_fallback = get_obj("order_fallback");
1191 chdir(".."); 1193 chdir("..");
1192 if (slab->name[0] == ':') 1194 if (slab->name[0] == ':')
1193 alias_targets++; 1195 alias_targets++;
diff --git a/MAINTAINERS b/MAINTAINERS
index 93547d3d04b9..abe27871ad6a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3130,7 +3130,7 @@ PCI SUBSYSTEM
3130P: Jesse Barnes 3130P: Jesse Barnes
3131M: jbarnes@virtuousgeek.org 3131M: jbarnes@virtuousgeek.org
3132L: linux-kernel@vger.kernel.org 3132L: linux-kernel@vger.kernel.org
3133L: linux-pci@atrey.karlin.mff.cuni.cz 3133L: linux-pci@vger.kernel.org
3134T: git kernel.org:/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git 3134T: git kernel.org:/pub/scm/linux/kernel/git/jbarnes/pci-2.6.git
3135S: Supported 3135S: Supported
3136 3136
diff --git a/Makefile b/Makefile
index 5cf825819533..4492984efc09 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 2 1VERSION = 2
2PATCHLEVEL = 6 2PATCHLEVEL = 6
3SUBLEVEL = 25 3SUBLEVEL = 26
4EXTRAVERSION = 4EXTRAVERSION = -rc1
5NAME = Funky Weasel is Jiggy wit it 5NAME = Funky Weasel is Jiggy wit it
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index 9bd1870d980e..0128687ba0f7 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -34,23 +34,6 @@ extern unsigned long do_mremap(unsigned long addr, unsigned long old_len,
34 unsigned long new_len, unsigned long flags, 34 unsigned long new_len, unsigned long flags,
35 unsigned long new_addr); 35 unsigned long new_addr);
36 36
37/*
38 * sys_pipe() is the normal C calling standard for creating
39 * a pipe. It's not the way unix traditionally does this, though.
40 */
41asmlinkage int sys_pipe(unsigned long __user *fildes)
42{
43 int fd[2];
44 int error;
45
46 error = do_pipe(fd);
47 if (!error) {
48 if (copy_to_user(fildes, fd, 2*sizeof(int)))
49 error = -EFAULT;
50 }
51 return error;
52}
53
54/* common code for old and new mmaps */ 37/* common code for old and new mmaps */
55inline long do_mmap2( 38inline long do_mmap2(
56 unsigned long addr, unsigned long len, 39 unsigned long addr, unsigned long len,
diff --git a/arch/avr32/kernel/sys_avr32.c b/arch/avr32/kernel/sys_avr32.c
index 8deb6003ee62..8e8911e55c8f 100644
--- a/arch/avr32/kernel/sys_avr32.c
+++ b/arch/avr32/kernel/sys_avr32.c
@@ -14,19 +14,6 @@
14#include <asm/mman.h> 14#include <asm/mman.h>
15#include <asm/uaccess.h> 15#include <asm/uaccess.h>
16 16
17asmlinkage int sys_pipe(unsigned long __user *filedes)
18{
19 int fd[2];
20 int error;
21
22 error = do_pipe(fd);
23 if (!error) {
24 if (copy_to_user(filedes, fd, sizeof(fd)))
25 error = -EFAULT;
26 }
27 return error;
28}
29
30asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 17asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
31 unsigned long prot, unsigned long flags, 18 unsigned long prot, unsigned long flags,
32 unsigned long fd, off_t offset) 19 unsigned long fd, off_t offset)
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c
index efb7b25a2633..fce49d7cf001 100644
--- a/arch/blackfin/kernel/sys_bfin.c
+++ b/arch/blackfin/kernel/sys_bfin.c
@@ -45,23 +45,6 @@
45#include <asm/cacheflush.h> 45#include <asm/cacheflush.h>
46#include <asm/dma.h> 46#include <asm/dma.h>
47 47
48/*
49 * sys_pipe() is the normal C calling standard for creating
50 * a pipe. It's not the way unix traditionally does this, though.
51 */
52asmlinkage int sys_pipe(unsigned long __user *fildes)
53{
54 int fd[2];
55 int error;
56
57 error = do_pipe(fd);
58 if (!error) {
59 if (copy_to_user(fildes, fd, 2 * sizeof(int)))
60 error = -EFAULT;
61 }
62 return error;
63}
64
65/* common code for old and new mmaps */ 48/* common code for old and new mmaps */
66static inline long 49static inline long
67do_mmap2(unsigned long addr, unsigned long len, 50do_mmap2(unsigned long addr, unsigned long len,
diff --git a/arch/frv/kernel/sys_frv.c b/arch/frv/kernel/sys_frv.c
index 04c6b1677ccf..49b2cf2c38f3 100644
--- a/arch/frv/kernel/sys_frv.c
+++ b/arch/frv/kernel/sys_frv.c
@@ -28,23 +28,6 @@
28#include <asm/setup.h> 28#include <asm/setup.h>
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30 30
31/*
32 * sys_pipe() is the normal C calling standard for creating
33 * a pipe. It's not the way unix traditionally does this, though.
34 */
35asmlinkage long sys_pipe(unsigned long __user * fildes)
36{
37 int fd[2];
38 int error;
39
40 error = do_pipe(fd);
41 if (!error) {
42 if (copy_to_user(fildes, fd, 2*sizeof(int)))
43 error = -EFAULT;
44 }
45 return error;
46}
47
48asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 31asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
49 unsigned long prot, unsigned long flags, 32 unsigned long prot, unsigned long flags,
50 unsigned long fd, unsigned long pgoff) 33 unsigned long fd, unsigned long pgoff)
diff --git a/arch/h8300/kernel/sys_h8300.c b/arch/h8300/kernel/sys_h8300.c
index 00608be6d567..2745656dcc52 100644
--- a/arch/h8300/kernel/sys_h8300.c
+++ b/arch/h8300/kernel/sys_h8300.c
@@ -27,23 +27,6 @@
27#include <asm/traps.h> 27#include <asm/traps.h>
28#include <asm/unistd.h> 28#include <asm/unistd.h>
29 29
30/*
31 * sys_pipe() is the normal C calling standard for creating
32 * a pipe. It's not the way unix traditionally does this, though.
33 */
34asmlinkage int sys_pipe(unsigned long * fildes)
35{
36 int fd[2];
37 int error;
38
39 error = do_pipe(fd);
40 if (!error) {
41 if (copy_to_user(fildes, fd, 2*sizeof(int)))
42 error = -EFAULT;
43 }
44 return error;
45}
46
47/* common code for old and new mmaps */ 30/* common code for old and new mmaps */
48static inline long do_mmap2( 31static inline long do_mmap2(
49 unsigned long addr, unsigned long len, 32 unsigned long addr, unsigned long len,
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index e892f17ba3fa..7f54efaf60bb 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -30,23 +30,6 @@
30#include <asm/page.h> 30#include <asm/page.h>
31#include <asm/unistd.h> 31#include <asm/unistd.h>
32 32
33/*
34 * sys_pipe() is the normal C calling standard for creating
35 * a pipe. It's not the way unix traditionally does this, though.
36 */
37asmlinkage int sys_pipe(unsigned long __user * fildes)
38{
39 int fd[2];
40 int error;
41
42 error = do_pipe(fd);
43 if (!error) {
44 if (copy_to_user(fildes, fd, 2*sizeof(int)))
45 error = -EFAULT;
46 }
47 return error;
48}
49
50/* common code for old and new mmaps */ 33/* common code for old and new mmaps */
51static inline long do_mmap2( 34static inline long do_mmap2(
52 unsigned long addr, unsigned long len, 35 unsigned long addr, unsigned long len,
diff --git a/arch/m68knommu/kernel/sys_m68k.c b/arch/m68knommu/kernel/sys_m68k.c
index 65f7a95f056e..700281638629 100644
--- a/arch/m68knommu/kernel/sys_m68k.c
+++ b/arch/m68knommu/kernel/sys_m68k.c
@@ -28,23 +28,6 @@
28#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
29#include <asm/unistd.h> 29#include <asm/unistd.h>
30 30
31/*
32 * sys_pipe() is the normal C calling standard for creating
33 * a pipe. It's not the way unix traditionally does this, though.
34 */
35asmlinkage int sys_pipe(unsigned long * fildes)
36{
37 int fd[2];
38 int error;
39
40 error = do_pipe(fd);
41 if (!error) {
42 if (copy_to_user(fildes, fd, 2*sizeof(int)))
43 error = -EFAULT;
44 }
45 return error;
46}
47
48/* common code for old and new mmaps */ 31/* common code for old and new mmaps */
49static inline long do_mmap2( 32static inline long do_mmap2(
50 unsigned long addr, unsigned long len, 33 unsigned long addr, unsigned long len,
diff --git a/arch/mn10300/kernel/sys_mn10300.c b/arch/mn10300/kernel/sys_mn10300.c
index 5f17a1ebc825..bca5a84dc72c 100644
--- a/arch/mn10300/kernel/sys_mn10300.c
+++ b/arch/mn10300/kernel/sys_mn10300.c
@@ -29,23 +29,6 @@
29#define MIN_MAP_ADDR PAGE_SIZE /* minimum fixed mmap address */ 29#define MIN_MAP_ADDR PAGE_SIZE /* minimum fixed mmap address */
30 30
31/* 31/*
32 * sys_pipe() is the normal C calling standard for creating
33 * a pipe. It's not the way Unix traditionally does this, though.
34 */
35asmlinkage long sys_pipe(unsigned long __user *fildes)
36{
37 int fd[2];
38 int error;
39
40 error = do_pipe(fd);
41 if (!error) {
42 if (copy_to_user(fildes, fd, 2 * sizeof(int)))
43 error = -EFAULT;
44 }
45 return error;
46}
47
48/*
49 * memory mapping syscall 32 * memory mapping syscall
50 */ 33 */
51asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 34asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index 4f589216b39e..71b31957c8f1 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -33,19 +33,6 @@
33#include <linux/utsname.h> 33#include <linux/utsname.h>
34#include <linux/personality.h> 34#include <linux/personality.h>
35 35
36int sys_pipe(int __user *fildes)
37{
38 int fd[2];
39 int error;
40
41 error = do_pipe(fd);
42 if (!error) {
43 if (copy_to_user(fildes, fd, 2*sizeof(int)))
44 error = -EFAULT;
45 }
46 return error;
47}
48
49static unsigned long get_unshared_area(unsigned long addr, unsigned long len) 36static unsigned long get_unshared_area(unsigned long addr, unsigned long len)
50{ 37{
51 struct vm_area_struct *vma; 38 struct vm_area_struct *vma;
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
index 1f2f1e0a5571..bba234eb14a9 100644
--- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -21,6 +21,7 @@
21 serial1 = &serial1; 21 serial1 = &serial1;
22 pci0 = &pci0; 22 pci0 = &pci0;
23 pci1 = &pci1; 23 pci1 = &pci1;
24 pci2 = &pci2;
24 }; 25 };
25 26
26 cpus { 27 cpus {
@@ -105,7 +106,7 @@
105 compatible = "ns16550"; 106 compatible = "ns16550";
106 reg = <0x4600 0x100>; 107 reg = <0x4600 0x100>;
107 clock-frequency = <0>; 108 clock-frequency = <0>;
108 interrupts = <28 2>; 109 interrupts = <42 2>;
109 interrupt-parent = <&mpic>; 110 interrupt-parent = <&mpic>;
110 }; 111 };
111 112
@@ -322,4 +323,24 @@
322 }; 323 };
323 }; 324 };
324 }; 325 };
326
327 pci2: pcie@e0009000 {
328 #address-cells = <3>;
329 #size-cells = <2>;
330 #interrupt-cells = <1>;
331 device_type = "pci";
332 compatible = "fsl,mpc8641-pcie";
333 reg = <0xe0009000 0x00001000>;
334 ranges = <0x02000000 0 0x90000000 0x90000000 0 0x10000000
335 0x01000000 0 0x00000000 0xe2000000 0 0x00100000>;
336 bus-range = <0 255>;
337 interrupt-map-mask = <0xf800 0 0 7>;
338 interrupt-map = <0x0000 0 0 1 &mpic 4 1
339 0x0000 0 0 2 &mpic 5 1
340 0x0000 0 0 3 &mpic 6 1
341 0x0000 0 0 4 &mpic 7 1>;
342 interrupt-parent = <&mpic>;
343 interrupts = <25 2>;
344 clock-frequency = <33333333>;
345 };
325}; 346};
diff --git a/arch/powerpc/configs/ps3_defconfig b/arch/powerpc/configs/ps3_defconfig
index 7a64c564f6e6..71d79e428d20 100644
--- a/arch/powerpc/configs/ps3_defconfig
+++ b/arch/powerpc/configs/ps3_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.25-rc6 3# Linux kernel version: 2.6.25
4# Thu Mar 20 11:07:04 2008 4# Mon Apr 28 12:39:10 2008
5# 5#
6CONFIG_PPC64=y 6CONFIG_PPC64=y
7 7
@@ -30,6 +30,9 @@ CONFIG_GENERIC_CLOCKEVENTS=y
30CONFIG_GENERIC_HARDIRQS=y 30CONFIG_GENERIC_HARDIRQS=y
31CONFIG_HAVE_SETUP_PER_CPU_AREA=y 31CONFIG_HAVE_SETUP_PER_CPU_AREA=y
32CONFIG_IRQ_PER_CPU=y 32CONFIG_IRQ_PER_CPU=y
33CONFIG_STACKTRACE_SUPPORT=y
34CONFIG_TRACE_IRQFLAGS_SUPPORT=y
35CONFIG_LOCKDEP_SUPPORT=y
33CONFIG_RWSEM_XCHGADD_ALGORITHM=y 36CONFIG_RWSEM_XCHGADD_ALGORITHM=y
34CONFIG_ARCH_HAS_ILOG2_U32=y 37CONFIG_ARCH_HAS_ILOG2_U32=y
35CONFIG_ARCH_HAS_ILOG2_U64=y 38CONFIG_ARCH_HAS_ILOG2_U64=y
@@ -73,8 +76,6 @@ CONFIG_POSIX_MQUEUE=y
73CONFIG_LOG_BUF_SHIFT=17 76CONFIG_LOG_BUF_SHIFT=17
74# CONFIG_CGROUPS is not set 77# CONFIG_CGROUPS is not set
75# CONFIG_GROUP_SCHED is not set 78# CONFIG_GROUP_SCHED is not set
76# CONFIG_USER_SCHED is not set
77# CONFIG_CGROUP_SCHED is not set
78CONFIG_SYSFS_DEPRECATED=y 79CONFIG_SYSFS_DEPRECATED=y
79CONFIG_SYSFS_DEPRECATED_V2=y 80CONFIG_SYSFS_DEPRECATED_V2=y
80# CONFIG_RELAY is not set 81# CONFIG_RELAY is not set
@@ -161,7 +162,6 @@ CONFIG_PPC_MULTIPLATFORM=y
161# CONFIG_PPC_PMAC is not set 162# CONFIG_PPC_PMAC is not set
162# CONFIG_PPC_MAPLE is not set 163# CONFIG_PPC_MAPLE is not set
163# CONFIG_PPC_PASEMI is not set 164# CONFIG_PPC_PASEMI is not set
164# CONFIG_PPC_CELLEB is not set
165CONFIG_PPC_PS3=y 165CONFIG_PPC_PS3=y
166 166
167# 167#
@@ -181,6 +181,7 @@ CONFIG_PS3_LPM=m
181CONFIG_PPC_CELL=y 181CONFIG_PPC_CELL=y
182# CONFIG_PPC_CELL_NATIVE is not set 182# CONFIG_PPC_CELL_NATIVE is not set
183# CONFIG_PPC_IBM_CELL_BLADE is not set 183# CONFIG_PPC_IBM_CELL_BLADE is not set
184# CONFIG_PPC_CELLEB is not set
184 185
185# 186#
186# Cell Broadband Engine options 187# Cell Broadband Engine options
@@ -205,9 +206,9 @@ CONFIG_SPU_BASE=y
205# 206#
206# Kernel options 207# Kernel options
207# 208#
208# CONFIG_TICK_ONESHOT is not set 209CONFIG_TICK_ONESHOT=y
209# CONFIG_NO_HZ is not set 210# CONFIG_NO_HZ is not set
210# CONFIG_HIGH_RES_TIMERS is not set 211CONFIG_HIGH_RES_TIMERS=y
211CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 212CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
212# CONFIG_HZ_100 is not set 213# CONFIG_HZ_100 is not set
213CONFIG_HZ_250=y 214CONFIG_HZ_250=y
@@ -221,7 +222,6 @@ CONFIG_PREEMPT_NONE=y
221CONFIG_BINFMT_ELF=y 222CONFIG_BINFMT_ELF=y
222CONFIG_COMPAT_BINFMT_ELF=y 223CONFIG_COMPAT_BINFMT_ELF=y
223CONFIG_BINFMT_MISC=y 224CONFIG_BINFMT_MISC=y
224CONFIG_FORCE_MAX_ZONEORDER=13
225# CONFIG_IOMMU_VMERGE is not set 225# CONFIG_IOMMU_VMERGE is not set
226CONFIG_IOMMU_HELPER=y 226CONFIG_IOMMU_HELPER=y
227CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 227CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
@@ -255,6 +255,7 @@ CONFIG_BOUNCE=y
255CONFIG_ARCH_MEMORY_PROBE=y 255CONFIG_ARCH_MEMORY_PROBE=y
256# CONFIG_PPC_HAS_HASH_64K is not set 256# CONFIG_PPC_HAS_HASH_64K is not set
257# CONFIG_PPC_64K_PAGES is not set 257# CONFIG_PPC_64K_PAGES is not set
258CONFIG_FORCE_MAX_ZONEORDER=13
258# CONFIG_SCHED_SMT is not set 259# CONFIG_SCHED_SMT is not set
259CONFIG_PROC_DEVICETREE=y 260CONFIG_PROC_DEVICETREE=y
260# CONFIG_CMDLINE_BOOL is not set 261# CONFIG_CMDLINE_BOOL is not set
@@ -272,7 +273,9 @@ CONFIG_GENERIC_ISA_DMA=y
272# CONFIG_PCI_SYSCALL is not set 273# CONFIG_PCI_SYSCALL is not set
273# CONFIG_ARCH_SUPPORTS_MSI is not set 274# CONFIG_ARCH_SUPPORTS_MSI is not set
274# CONFIG_PCCARD is not set 275# CONFIG_PCCARD is not set
276CONFIG_PAGE_OFFSET=0xc000000000000000
275CONFIG_KERNEL_START=0xc000000000000000 277CONFIG_KERNEL_START=0xc000000000000000
278CONFIG_PHYSICAL_START=0x00000000
276 279
277# 280#
278# Networking 281# Networking
@@ -292,7 +295,7 @@ CONFIG_XFRM=y
292# CONFIG_XFRM_STATISTICS is not set 295# CONFIG_XFRM_STATISTICS is not set
293# CONFIG_NET_KEY is not set 296# CONFIG_NET_KEY is not set
294CONFIG_INET=y 297CONFIG_INET=y
295# CONFIG_IP_MULTICAST is not set 298CONFIG_IP_MULTICAST=y
296# CONFIG_IP_ADVANCED_ROUTER is not set 299# CONFIG_IP_ADVANCED_ROUTER is not set
297CONFIG_IP_FIB_HASH=y 300CONFIG_IP_FIB_HASH=y
298CONFIG_IP_PNP=y 301CONFIG_IP_PNP=y
@@ -301,6 +304,7 @@ CONFIG_IP_PNP_DHCP=y
301# CONFIG_IP_PNP_RARP is not set 304# CONFIG_IP_PNP_RARP is not set
302# CONFIG_NET_IPIP is not set 305# CONFIG_NET_IPIP is not set
303# CONFIG_NET_IPGRE is not set 306# CONFIG_NET_IPGRE is not set
307# CONFIG_IP_MROUTE is not set
304# CONFIG_ARPD is not set 308# CONFIG_ARPD is not set
305# CONFIG_SYN_COOKIES is not set 309# CONFIG_SYN_COOKIES is not set
306# CONFIG_INET_AH is not set 310# CONFIG_INET_AH is not set
@@ -332,8 +336,10 @@ CONFIG_INET6_XFRM_MODE_TUNNEL=y
332CONFIG_INET6_XFRM_MODE_BEET=y 336CONFIG_INET6_XFRM_MODE_BEET=y
333# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set 337# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
334CONFIG_IPV6_SIT=y 338CONFIG_IPV6_SIT=y
339CONFIG_IPV6_NDISC_NODETYPE=y
335# CONFIG_IPV6_TUNNEL is not set 340# CONFIG_IPV6_TUNNEL is not set
336# CONFIG_IPV6_MULTIPLE_TABLES is not set 341# CONFIG_IPV6_MULTIPLE_TABLES is not set
342# CONFIG_IPV6_MROUTE is not set
337# CONFIG_NETWORK_SECMARK is not set 343# CONFIG_NETWORK_SECMARK is not set
338# CONFIG_NETFILTER is not set 344# CONFIG_NETFILTER is not set
339# CONFIG_IP_DCCP is not set 345# CONFIG_IP_DCCP is not set
@@ -392,8 +398,6 @@ CONFIG_IEEE80211=m
392CONFIG_IEEE80211_CRYPT_WEP=m 398CONFIG_IEEE80211_CRYPT_WEP=m
393CONFIG_IEEE80211_CRYPT_CCMP=m 399CONFIG_IEEE80211_CRYPT_CCMP=m
394CONFIG_IEEE80211_CRYPT_TKIP=m 400CONFIG_IEEE80211_CRYPT_TKIP=m
395CONFIG_IEEE80211_SOFTMAC=m
396# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
397# CONFIG_RFKILL is not set 401# CONFIG_RFKILL is not set
398# CONFIG_NET_9P is not set 402# CONFIG_NET_9P is not set
399 403
@@ -507,6 +511,7 @@ CONFIG_WLAN_80211=y
507# CONFIG_LIBERTAS is not set 511# CONFIG_LIBERTAS is not set
508# CONFIG_USB_ZD1201 is not set 512# CONFIG_USB_ZD1201 is not set
509# CONFIG_USB_NET_RNDIS_WLAN is not set 513# CONFIG_USB_NET_RNDIS_WLAN is not set
514# CONFIG_IWLWIFI_LEDS is not set
510# CONFIG_HOSTAP is not set 515# CONFIG_HOSTAP is not set
511 516
512# 517#
@@ -578,6 +583,7 @@ CONFIG_INPUT_JOYSTICK=y
578# CONFIG_JOYSTICK_SPACEBALL is not set 583# CONFIG_JOYSTICK_SPACEBALL is not set
579# CONFIG_JOYSTICK_STINGER is not set 584# CONFIG_JOYSTICK_STINGER is not set
580# CONFIG_JOYSTICK_TWIDJOY is not set 585# CONFIG_JOYSTICK_TWIDJOY is not set
586# CONFIG_JOYSTICK_ZHENHUA is not set
581# CONFIG_JOYSTICK_JOYDUMP is not set 587# CONFIG_JOYSTICK_JOYDUMP is not set
582# CONFIG_JOYSTICK_XPAD is not set 588# CONFIG_JOYSTICK_XPAD is not set
583# CONFIG_INPUT_TABLET is not set 589# CONFIG_INPUT_TABLET is not set
@@ -641,6 +647,7 @@ CONFIG_SSB_POSSIBLE=y
641# Multifunction device drivers 647# Multifunction device drivers
642# 648#
643# CONFIG_MFD_SM501 is not set 649# CONFIG_MFD_SM501 is not set
650# CONFIG_HTC_PASIC3 is not set
644 651
645# 652#
646# Multimedia devices 653# Multimedia devices
@@ -761,10 +768,6 @@ CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
761# CONFIG_SND_SOC is not set 768# CONFIG_SND_SOC is not set
762 769
763# 770#
764# SoC Audio support for SuperH
765#
766
767#
768# ALSA SoC audio for Freescale SOCs 771# ALSA SoC audio for Freescale SOCs
769# 772#
770 773
@@ -849,6 +852,7 @@ CONFIG_USB_STORAGE=m
849# CONFIG_USB_STORAGE_ALAUDA is not set 852# CONFIG_USB_STORAGE_ALAUDA is not set
850# CONFIG_USB_STORAGE_ONETOUCH is not set 853# CONFIG_USB_STORAGE_ONETOUCH is not set
851# CONFIG_USB_STORAGE_KARMA is not set 854# CONFIG_USB_STORAGE_KARMA is not set
855# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
852# CONFIG_USB_LIBUSUAL is not set 856# CONFIG_USB_LIBUSUAL is not set
853 857
854# 858#
@@ -893,10 +897,6 @@ CONFIG_USB_MON=y
893# CONFIG_EDAC is not set 897# CONFIG_EDAC is not set
894# CONFIG_RTC_CLASS is not set 898# CONFIG_RTC_CLASS is not set
895# CONFIG_DMADEVICES is not set 899# CONFIG_DMADEVICES is not set
896
897#
898# Userspace I/O
899#
900# CONFIG_UIO is not set 900# CONFIG_UIO is not set
901 901
902# 902#
@@ -986,7 +986,6 @@ CONFIG_NFS_FS=y
986CONFIG_NFS_V3=y 986CONFIG_NFS_V3=y
987# CONFIG_NFS_V3_ACL is not set 987# CONFIG_NFS_V3_ACL is not set
988CONFIG_NFS_V4=y 988CONFIG_NFS_V4=y
989# CONFIG_NFS_DIRECTIO is not set
990# CONFIG_NFSD is not set 989# CONFIG_NFSD is not set
991CONFIG_ROOT_NFS=y 990CONFIG_ROOT_NFS=y
992CONFIG_LOCKD=y 991CONFIG_LOCKD=y
@@ -1059,9 +1058,10 @@ CONFIG_NLS_ISO8859_1=y
1059# Library routines 1058# Library routines
1060# 1059#
1061CONFIG_BITREVERSE=y 1060CONFIG_BITREVERSE=y
1061# CONFIG_GENERIC_FIND_FIRST_BIT is not set
1062# CONFIG_CRC_CCITT is not set 1062# CONFIG_CRC_CCITT is not set
1063# CONFIG_CRC16 is not set 1063# CONFIG_CRC16 is not set
1064# CONFIG_CRC_ITU_T is not set 1064CONFIG_CRC_ITU_T=m
1065CONFIG_CRC32=y 1065CONFIG_CRC32=y
1066# CONFIG_CRC7 is not set 1066# CONFIG_CRC7 is not set
1067# CONFIG_LIBCRC32C is not set 1067# CONFIG_LIBCRC32C is not set
@@ -1071,6 +1071,7 @@ CONFIG_PLIST=y
1071CONFIG_HAS_IOMEM=y 1071CONFIG_HAS_IOMEM=y
1072CONFIG_HAS_IOPORT=y 1072CONFIG_HAS_IOPORT=y
1073CONFIG_HAS_DMA=y 1073CONFIG_HAS_DMA=y
1074CONFIG_HAVE_LMB=y
1074 1075
1075# 1076#
1076# Kernel hacking 1077# Kernel hacking
@@ -1078,6 +1079,7 @@ CONFIG_HAS_DMA=y
1078# CONFIG_PRINTK_TIME is not set 1079# CONFIG_PRINTK_TIME is not set
1079CONFIG_ENABLE_WARN_DEPRECATED=y 1080CONFIG_ENABLE_WARN_DEPRECATED=y
1080CONFIG_ENABLE_MUST_CHECK=y 1081CONFIG_ENABLE_MUST_CHECK=y
1082CONFIG_FRAME_WARN=2048
1081CONFIG_MAGIC_SYSRQ=y 1083CONFIG_MAGIC_SYSRQ=y
1082# CONFIG_UNUSED_SYMBOLS is not set 1084# CONFIG_UNUSED_SYMBOLS is not set
1083# CONFIG_DEBUG_FS is not set 1085# CONFIG_DEBUG_FS is not set
@@ -1093,12 +1095,16 @@ CONFIG_SCHED_DEBUG=y
1093# CONFIG_RT_MUTEX_TESTER is not set 1095# CONFIG_RT_MUTEX_TESTER is not set
1094CONFIG_DEBUG_SPINLOCK=y 1096CONFIG_DEBUG_SPINLOCK=y
1095CONFIG_DEBUG_MUTEXES=y 1097CONFIG_DEBUG_MUTEXES=y
1098# CONFIG_DEBUG_LOCK_ALLOC is not set
1099# CONFIG_PROVE_LOCKING is not set
1100# CONFIG_LOCK_STAT is not set
1096CONFIG_DEBUG_SPINLOCK_SLEEP=y 1101CONFIG_DEBUG_SPINLOCK_SLEEP=y
1097# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1102# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1098# CONFIG_DEBUG_KOBJECT is not set 1103# CONFIG_DEBUG_KOBJECT is not set
1099CONFIG_DEBUG_BUGVERBOSE=y 1104CONFIG_DEBUG_BUGVERBOSE=y
1100CONFIG_DEBUG_INFO=y 1105CONFIG_DEBUG_INFO=y
1101# CONFIG_DEBUG_VM is not set 1106# CONFIG_DEBUG_VM is not set
1107# CONFIG_DEBUG_WRITECOUNT is not set
1102CONFIG_DEBUG_LIST=y 1108CONFIG_DEBUG_LIST=y
1103# CONFIG_DEBUG_SG is not set 1109# CONFIG_DEBUG_SG is not set
1104# CONFIG_BOOT_PRINTK_DELAY is not set 1110# CONFIG_BOOT_PRINTK_DELAY is not set
@@ -1121,51 +1127,81 @@ CONFIG_IRQSTACKS=y
1121# CONFIG_SECURITY is not set 1127# CONFIG_SECURITY is not set
1122# CONFIG_SECURITY_FILE_CAPABILITIES is not set 1128# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1123CONFIG_CRYPTO=y 1129CONFIG_CRYPTO=y
1130
1131#
1132# Crypto core or helper
1133#
1124CONFIG_CRYPTO_ALGAPI=y 1134CONFIG_CRYPTO_ALGAPI=y
1125CONFIG_CRYPTO_AEAD=m 1135CONFIG_CRYPTO_AEAD=m
1126CONFIG_CRYPTO_BLKCIPHER=y 1136CONFIG_CRYPTO_BLKCIPHER=y
1127CONFIG_CRYPTO_SEQIV=m
1128CONFIG_CRYPTO_MANAGER=y 1137CONFIG_CRYPTO_MANAGER=y
1138CONFIG_CRYPTO_GF128MUL=m
1139# CONFIG_CRYPTO_NULL is not set
1140# CONFIG_CRYPTO_CRYPTD is not set
1141# CONFIG_CRYPTO_AUTHENC is not set
1142# CONFIG_CRYPTO_TEST is not set
1143
1144#
1145# Authenticated Encryption with Associated Data
1146#
1147CONFIG_CRYPTO_CCM=m
1148CONFIG_CRYPTO_GCM=m
1149CONFIG_CRYPTO_SEQIV=m
1150
1151#
1152# Block modes
1153#
1154CONFIG_CRYPTO_CBC=y
1155CONFIG_CRYPTO_CTR=m
1156# CONFIG_CRYPTO_CTS is not set
1157CONFIG_CRYPTO_ECB=m
1158# CONFIG_CRYPTO_LRW is not set
1159CONFIG_CRYPTO_PCBC=m
1160# CONFIG_CRYPTO_XTS is not set
1161
1162#
1163# Hash modes
1164#
1129# CONFIG_CRYPTO_HMAC is not set 1165# CONFIG_CRYPTO_HMAC is not set
1130# CONFIG_CRYPTO_XCBC is not set 1166# CONFIG_CRYPTO_XCBC is not set
1131# CONFIG_CRYPTO_NULL is not set 1167
1168#
1169# Digest
1170#
1171# CONFIG_CRYPTO_CRC32C is not set
1132# CONFIG_CRYPTO_MD4 is not set 1172# CONFIG_CRYPTO_MD4 is not set
1133CONFIG_CRYPTO_MD5=y 1173CONFIG_CRYPTO_MD5=y
1174CONFIG_CRYPTO_MICHAEL_MIC=m
1134# CONFIG_CRYPTO_SHA1 is not set 1175# CONFIG_CRYPTO_SHA1 is not set
1135# CONFIG_CRYPTO_SHA256 is not set 1176# CONFIG_CRYPTO_SHA256 is not set
1136# CONFIG_CRYPTO_SHA512 is not set 1177# CONFIG_CRYPTO_SHA512 is not set
1137# CONFIG_CRYPTO_WP512 is not set
1138# CONFIG_CRYPTO_TGR192 is not set 1178# CONFIG_CRYPTO_TGR192 is not set
1139CONFIG_CRYPTO_GF128MUL=m 1179# CONFIG_CRYPTO_WP512 is not set
1140CONFIG_CRYPTO_ECB=m 1180
1141CONFIG_CRYPTO_CBC=y 1181#
1142CONFIG_CRYPTO_PCBC=m 1182# Ciphers
1143# CONFIG_CRYPTO_LRW is not set 1183#
1144# CONFIG_CRYPTO_XTS is not set
1145CONFIG_CRYPTO_CTR=m
1146CONFIG_CRYPTO_GCM=m
1147CONFIG_CRYPTO_CCM=m
1148# CONFIG_CRYPTO_CRYPTD is not set
1149CONFIG_CRYPTO_DES=y
1150# CONFIG_CRYPTO_FCRYPT is not set
1151# CONFIG_CRYPTO_BLOWFISH is not set
1152# CONFIG_CRYPTO_TWOFISH is not set
1153# CONFIG_CRYPTO_SERPENT is not set
1154CONFIG_CRYPTO_AES=m 1184CONFIG_CRYPTO_AES=m
1185# CONFIG_CRYPTO_ANUBIS is not set
1186CONFIG_CRYPTO_ARC4=m
1187# CONFIG_CRYPTO_BLOWFISH is not set
1188# CONFIG_CRYPTO_CAMELLIA is not set
1155# CONFIG_CRYPTO_CAST5 is not set 1189# CONFIG_CRYPTO_CAST5 is not set
1156# CONFIG_CRYPTO_CAST6 is not set 1190# CONFIG_CRYPTO_CAST6 is not set
1157# CONFIG_CRYPTO_TEA is not set 1191CONFIG_CRYPTO_DES=y
1158CONFIG_CRYPTO_ARC4=m 1192# CONFIG_CRYPTO_FCRYPT is not set
1159# CONFIG_CRYPTO_KHAZAD is not set 1193# CONFIG_CRYPTO_KHAZAD is not set
1160# CONFIG_CRYPTO_ANUBIS is not set
1161# CONFIG_CRYPTO_SEED is not set
1162CONFIG_CRYPTO_SALSA20=m 1194CONFIG_CRYPTO_SALSA20=m
1195# CONFIG_CRYPTO_SEED is not set
1196# CONFIG_CRYPTO_SERPENT is not set
1197# CONFIG_CRYPTO_TEA is not set
1198# CONFIG_CRYPTO_TWOFISH is not set
1199
1200#
1201# Compression
1202#
1163# CONFIG_CRYPTO_DEFLATE is not set 1203# CONFIG_CRYPTO_DEFLATE is not set
1164CONFIG_CRYPTO_MICHAEL_MIC=m
1165# CONFIG_CRYPTO_CRC32C is not set
1166# CONFIG_CRYPTO_CAMELLIA is not set
1167# CONFIG_CRYPTO_TEST is not set
1168# CONFIG_CRYPTO_AUTHENC is not set
1169CONFIG_CRYPTO_LZO=m 1204CONFIG_CRYPTO_LZO=m
1170CONFIG_CRYPTO_HW=y 1205CONFIG_CRYPTO_HW=y
1171# CONFIG_PPC_CLOCK is not set 1206# CONFIG_PPC_CLOCK is not set
1207# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index be35ffae10f0..1457aa0a08f1 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -386,6 +386,8 @@ static void __init smp_create_idle(unsigned int cpu)
386 panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); 386 panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
387#ifdef CONFIG_PPC64 387#ifdef CONFIG_PPC64
388 paca[cpu].__current = p; 388 paca[cpu].__current = p;
389 paca[cpu].kstack = (unsigned long) task_thread_info(p)
390 + THREAD_SIZE - STACK_FRAME_OVERHEAD;
389#endif 391#endif
390 current_set[cpu] = task_thread_info(p); 392 current_set[cpu] = task_thread_info(p);
391 task_thread_info(p)->cpu = cpu; 393 task_thread_info(p)->cpu = cpu;
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index e722a4eeb5d0..4fe69ca24481 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -136,23 +136,6 @@ int sys_ipc(uint call, int first, unsigned long second, long third,
136 return ret; 136 return ret;
137} 137}
138 138
139/*
140 * sys_pipe() is the normal C calling standard for creating
141 * a pipe. It's not the way unix traditionally does this, though.
142 */
143int sys_pipe(int __user *fildes)
144{
145 int fd[2];
146 int error;
147
148 error = do_pipe(fd);
149 if (!error) {
150 if (copy_to_user(fildes, fd, 2*sizeof(int)))
151 error = -EFAULT;
152 }
153 return error;
154}
155
156static inline unsigned long do_mmap2(unsigned long addr, size_t len, 139static inline unsigned long do_mmap2(unsigned long addr, size_t len,
157 unsigned long prot, unsigned long flags, 140 unsigned long prot, unsigned long flags,
158 unsigned long fd, unsigned long off, int shift) 141 unsigned long fd, unsigned long off, int shift)
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index 906daeda59a8..cf8705e32d60 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -30,7 +30,7 @@
30#ifdef DEBUG 30#ifdef DEBUG
31#define DBG(fmt...) udbg_printf(fmt) 31#define DBG(fmt...) udbg_printf(fmt)
32#else 32#else
33#define DBG(fmt...) 33#define DBG pr_debug
34#endif 34#endif
35 35
36extern void slb_allocate_realmode(unsigned long ea); 36extern void slb_allocate_realmode(unsigned long ea);
@@ -44,13 +44,13 @@ static void slb_allocate(unsigned long ea)
44 slb_allocate_realmode(ea); 44 slb_allocate_realmode(ea);
45} 45}
46 46
47#define slb_esid_mask(ssize) \
48 (((ssize) == MMU_SEGSIZE_256M)? ESID_MASK: ESID_MASK_1T)
49
47static inline unsigned long mk_esid_data(unsigned long ea, int ssize, 50static inline unsigned long mk_esid_data(unsigned long ea, int ssize,
48 unsigned long slot) 51 unsigned long slot)
49{ 52{
50 unsigned long mask; 53 return (ea & slb_esid_mask(ssize)) | SLB_ESID_V | slot;
51
52 mask = (ssize == MMU_SEGSIZE_256M)? ESID_MASK: ESID_MASK_1T;
53 return (ea & mask) | SLB_ESID_V | slot;
54} 54}
55 55
56#define slb_vsid_shift(ssize) \ 56#define slb_vsid_shift(ssize) \
@@ -279,8 +279,8 @@ void slb_initialize(void)
279 patch_slb_encoding(slb_compare_rr_to_size, 279 patch_slb_encoding(slb_compare_rr_to_size,
280 mmu_slb_size); 280 mmu_slb_size);
281 281
282 DBG("SLB: linear LLP = %04x\n", linear_llp); 282 DBG("SLB: linear LLP = %04lx\n", linear_llp);
283 DBG("SLB: io LLP = %04x\n", io_llp); 283 DBG("SLB: io LLP = %04lx\n", io_llp);
284 } 284 }
285 285
286 get_paca()->stab_rr = SLB_NUM_BOLTED; 286 get_paca()->stab_rr = SLB_NUM_BOLTED;
@@ -301,11 +301,16 @@ void slb_initialize(void)
301 301
302 create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1); 302 create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1);
303 303
304 /* For the boot cpu, we're running on the stack in init_thread_union,
305 * which is in the first segment of the linear mapping, and also
306 * get_paca()->kstack hasn't been initialized yet.
307 * For secondary cpus, we need to bolt the kernel stack entry now.
308 */
304 slb_shadow_clear(2); 309 slb_shadow_clear(2);
310 if (raw_smp_processor_id() != boot_cpuid &&
311 (get_paca()->kstack & slb_esid_mask(mmu_kernel_ssize)) > PAGE_OFFSET)
312 create_shadowed_slbe(get_paca()->kstack,
313 mmu_kernel_ssize, lflags, 2);
305 314
306 /* We don't bolt the stack for the time being - we're in boot,
307 * so the stack is in the bolted segment. By the time it goes
308 * elsewhere, we'll call _switch() which will bolt in the new
309 * one. */
310 asm volatile("isync":::"memory"); 315 asm volatile("isync":::"memory");
311} 316}
diff --git a/arch/powerpc/platforms/ps3/interrupt.c b/arch/powerpc/platforms/ps3/interrupt.c
index a14e5cdc2fed..e59634f7af96 100644
--- a/arch/powerpc/platforms/ps3/interrupt.c
+++ b/arch/powerpc/platforms/ps3/interrupt.c
@@ -167,8 +167,8 @@ static struct irq_chip ps3_irq_chip = {
167 * ps3_private data. 167 * ps3_private data.
168 */ 168 */
169 169
170int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet, 170static int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
171 unsigned int *virq) 171 unsigned int *virq)
172{ 172{
173 int result; 173 int result;
174 struct ps3_private *pd; 174 struct ps3_private *pd;
@@ -217,7 +217,7 @@ fail_create:
217 * Clears chip data and calls irq_dispose_mapping() for the virq. 217 * Clears chip data and calls irq_dispose_mapping() for the virq.
218 */ 218 */
219 219
220int ps3_virq_destroy(unsigned int virq) 220static int ps3_virq_destroy(unsigned int virq)
221{ 221{
222 const struct ps3_private *pd = get_irq_chip_data(virq); 222 const struct ps3_private *pd = get_irq_chip_data(virq);
223 223
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 3d920376f58e..a0fa4ebb39c6 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -176,6 +176,7 @@ struct rio_priv {
176 176
177/** 177/**
178 * fsl_rio_doorbell_send - Send a MPC85xx doorbell message 178 * fsl_rio_doorbell_send - Send a MPC85xx doorbell message
179 * @mport: RapidIO master port info
179 * @index: ID of RapidIO interface 180 * @index: ID of RapidIO interface
180 * @destid: Destination ID of target device 181 * @destid: Destination ID of target device
181 * @data: 16-bit info field of RapidIO doorbell message 182 * @data: 16-bit info field of RapidIO doorbell message
@@ -211,6 +212,7 @@ static int fsl_rio_doorbell_send(struct rio_mport *mport,
211 212
212/** 213/**
213 * fsl_local_config_read - Generate a MPC85xx local config space read 214 * fsl_local_config_read - Generate a MPC85xx local config space read
215 * @mport: RapidIO master port info
214 * @index: ID of RapdiIO interface 216 * @index: ID of RapdiIO interface
215 * @offset: Offset into configuration space 217 * @offset: Offset into configuration space
216 * @len: Length (in bytes) of the maintenance transaction 218 * @len: Length (in bytes) of the maintenance transaction
@@ -232,6 +234,7 @@ static int fsl_local_config_read(struct rio_mport *mport,
232 234
233/** 235/**
234 * fsl_local_config_write - Generate a MPC85xx local config space write 236 * fsl_local_config_write - Generate a MPC85xx local config space write
237 * @mport: RapidIO master port info
235 * @index: ID of RapdiIO interface 238 * @index: ID of RapdiIO interface
236 * @offset: Offset into configuration space 239 * @offset: Offset into configuration space
237 * @len: Length (in bytes) of the maintenance transaction 240 * @len: Length (in bytes) of the maintenance transaction
@@ -254,6 +257,7 @@ static int fsl_local_config_write(struct rio_mport *mport,
254 257
255/** 258/**
256 * fsl_rio_config_read - Generate a MPC85xx read maintenance transaction 259 * fsl_rio_config_read - Generate a MPC85xx read maintenance transaction
260 * @mport: RapidIO master port info
257 * @index: ID of RapdiIO interface 261 * @index: ID of RapdiIO interface
258 * @destid: Destination ID of transaction 262 * @destid: Destination ID of transaction
259 * @hopcount: Number of hops to target device 263 * @hopcount: Number of hops to target device
@@ -295,6 +299,7 @@ fsl_rio_config_read(struct rio_mport *mport, int index, u16 destid,
295 299
296/** 300/**
297 * fsl_rio_config_write - Generate a MPC85xx write maintenance transaction 301 * fsl_rio_config_write - Generate a MPC85xx write maintenance transaction
302 * @mport: RapidIO master port info
298 * @index: ID of RapdiIO interface 303 * @index: ID of RapdiIO interface
299 * @destid: Destination ID of transaction 304 * @destid: Destination ID of transaction
300 * @hopcount: Number of hops to target device 305 * @hopcount: Number of hops to target device
@@ -985,8 +990,8 @@ static inline void fsl_rio_info(struct device *dev, u32 ccsr)
985} 990}
986 991
987/** 992/**
988 * fsl_rio_setup - Setup MPC85xx RapidIO interface 993 * fsl_rio_setup - Setup Freescale PowerPC RapidIO interface
989 * @fsl_rio_setup - Setup Freescale PowerPC RapidIO interface 994 * @dev: of_device pointer
990 * 995 *
991 * Initializes MPC85xx RapidIO hardware interface, configures 996 * Initializes MPC85xx RapidIO hardware interface, configures
992 * master port with system-specific info, and registers the 997 * master port with system-specific info, and registers the
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 324c01b70ddd..3a7054e2bb75 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -389,8 +389,8 @@ static int __init gfar_of_init(void)
389 } 389 }
390 390
391 gfar_data.phy_id = *id; 391 gfar_data.phy_id = *id;
392 snprintf(gfar_data.bus_id, MII_BUS_ID_SIZE, "%x", 392 snprintf(gfar_data.bus_id, MII_BUS_ID_SIZE, "%llx",
393 res.start); 393 (unsigned long long)res.start);
394 394
395 of_node_put(phy); 395 of_node_put(phy);
396 of_node_put(mdio); 396 of_node_put(mdio);
diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c
index ba8eea2bcce0..b7aefd0d45cb 100644
--- a/arch/powerpc/sysdev/xilinx_intc.c
+++ b/arch/powerpc/sysdev/xilinx_intc.c
@@ -107,7 +107,7 @@ xilinx_intc_init(struct device_node *np)
107 } 107 }
108 regs = ioremap(res.start, 32); 108 regs = ioremap(res.start, 32);
109 109
110 printk(KERN_INFO "Xilinx intc at 0x%08X mapped to 0x%p\n", 110 printk(KERN_INFO "Xilinx intc at 0x%08LX mapped to 0x%p\n",
111 res.start, regs); 111 res.start, regs);
112 112
113 /* Setup interrupt controller */ 113 /* Setup interrupt controller */
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c
index 988d0d64c2c8..5fdb799062b7 100644
--- a/arch/s390/kernel/sys_s390.c
+++ b/arch/s390/kernel/sys_s390.c
@@ -32,23 +32,6 @@
32#include <asm/uaccess.h> 32#include <asm/uaccess.h>
33#include "entry.h" 33#include "entry.h"
34 34
35/*
36 * sys_pipe() is the normal C calling standard for creating
37 * a pipe. It's not the way Unix traditionally does this, though.
38 */
39asmlinkage long sys_pipe(unsigned long __user *fildes)
40{
41 int fd[2];
42 int error;
43
44 error = do_pipe(fd);
45 if (!error) {
46 if (copy_to_user(fildes, fd, 2*sizeof(int)))
47 error = -EFAULT;
48 }
49 return error;
50}
51
52/* common code for old and new mmaps */ 35/* common code for old and new mmaps */
53static inline long do_mmap2( 36static inline long do_mmap2(
54 unsigned long addr, unsigned long len, 37 unsigned long addr, unsigned long len,
diff --git a/arch/sh/kernel/sys_sh64.c b/arch/sh/kernel/sys_sh64.c
index 578004d71e02..91fb8445a5a0 100644
--- a/arch/sh/kernel/sys_sh64.c
+++ b/arch/sh/kernel/sys_sh64.c
@@ -31,23 +31,6 @@
31#include <asm/unistd.h> 31#include <asm/unistd.h>
32 32
33/* 33/*
34 * sys_pipe() is the normal C calling standard for creating
35 * a pipe. It's not the way Unix traditionally does this, though.
36 */
37asmlinkage int sys_pipe(unsigned long * fildes)
38{
39 int fd[2];
40 int error;
41
42 error = do_pipe(fd);
43 if (!error) {
44 if (copy_to_user(fildes, fd, 2*sizeof(int)))
45 error = -EFAULT;
46 }
47 return error;
48}
49
50/*
51 * Do a system call from kernel instead of calling sys_execve so we 34 * Do a system call from kernel instead of calling sys_execve so we
52 * end up with proper pt_regs. 35 * end up with proper pt_regs.
53 */ 36 */
diff --git a/arch/sparc/kernel/setup.c b/arch/sparc/kernel/setup.c
index 3c13137685da..8a55c4f0df84 100644
--- a/arch/sparc/kernel/setup.c
+++ b/arch/sparc/kernel/setup.c
@@ -180,11 +180,9 @@ static void __init boot_flags_init(char *commands)
180 180
181/* This routine will in the future do all the nasty prom stuff 181/* This routine will in the future do all the nasty prom stuff
182 * to probe for the mmu type and its parameters, etc. This will 182 * to probe for the mmu type and its parameters, etc. This will
183 * also be where SMP things happen plus the Sparc specific memory 183 * also be where SMP things happen.
184 * physical memory probe as on the alpha.
185 */ 184 */
186 185
187extern int prom_probe_memory(void);
188extern void sun4c_probe_vac(void); 186extern void sun4c_probe_vac(void);
189extern char cputypval; 187extern char cputypval;
190extern unsigned long start, end; 188extern unsigned long start, end;
@@ -268,7 +266,6 @@ void __init setup_arch(char **cmdline_p)
268 if (ARCH_SUN4C_SUN4) 266 if (ARCH_SUN4C_SUN4)
269 sun4c_probe_vac(); 267 sun4c_probe_vac();
270 load_mmu(); 268 load_mmu();
271 (void) prom_probe_memory();
272 269
273 phys_base = 0xffffffffUL; 270 phys_base = 0xffffffffUL;
274 highest_paddr = 0UL; 271 highest_paddr = 0UL;
diff --git a/arch/sparc/mm/fault.c b/arch/sparc/mm/fault.c
index e4d9c8e19df5..abd50795a7b6 100644
--- a/arch/sparc/mm/fault.c
+++ b/arch/sparc/mm/fault.c
@@ -47,64 +47,15 @@ int vac_size, vac_linesize, vac_do_hw_vac_flushes;
47int vac_entries_per_context, vac_entries_per_segment; 47int vac_entries_per_context, vac_entries_per_segment;
48int vac_entries_per_page; 48int vac_entries_per_page;
49 49
50/* Nice, simple, prom library does all the sweating for us. ;) */ 50/* Return how much physical memory we have. */
51int prom_probe_memory (void) 51unsigned long probe_memory(void)
52{ 52{
53 register struct linux_mlist_v0 *mlist; 53 unsigned long total = 0;
54 register unsigned long bytes, base_paddr, tally; 54 int i;
55 register int i;
56
57 i = 0;
58 mlist= *prom_meminfo()->v0_available;
59 bytes = tally = mlist->num_bytes;
60 base_paddr = (unsigned long) mlist->start_adr;
61
62 sp_banks[0].base_addr = base_paddr;
63 sp_banks[0].num_bytes = bytes;
64
65 while (mlist->theres_more != (void *) 0){
66 i++;
67 mlist = mlist->theres_more;
68 bytes = mlist->num_bytes;
69 tally += bytes;
70 if (i > SPARC_PHYS_BANKS-1) {
71 printk ("The machine has more banks than "
72 "this kernel can support\n"
73 "Increase the SPARC_PHYS_BANKS "
74 "setting (currently %d)\n",
75 SPARC_PHYS_BANKS);
76 i = SPARC_PHYS_BANKS-1;
77 break;
78 }
79
80 sp_banks[i].base_addr = (unsigned long) mlist->start_adr;
81 sp_banks[i].num_bytes = mlist->num_bytes;
82 }
83
84 i++;
85 sp_banks[i].base_addr = 0xdeadbeef;
86 sp_banks[i].num_bytes = 0;
87
88 /* Now mask all bank sizes on a page boundary, it is all we can
89 * use anyways.
90 */
91 for(i=0; sp_banks[i].num_bytes != 0; i++)
92 sp_banks[i].num_bytes &= PAGE_MASK;
93
94 return tally;
95}
96
97/* Traverse the memory lists in the prom to see how much physical we
98 * have.
99 */
100unsigned long
101probe_memory(void)
102{
103 int total;
104 55
105 total = prom_probe_memory(); 56 for (i = 0; sp_banks[i].num_bytes; i++)
57 total += sp_banks[i].num_bytes;
106 58
107 /* Oh man, much nicer, keep the dirt in promlib. */
108 return total; 59 return total;
109} 60}
110 61
diff --git a/arch/sparc/prom/init.c b/arch/sparc/prom/init.c
index 50abfb1b880e..2fa3a474e3a2 100644
--- a/arch/sparc/prom/init.c
+++ b/arch/sparc/prom/init.c
@@ -21,8 +21,6 @@ linux_sun4_romvec *sun4_romvec;
21/* The root node of the prom device tree. */ 21/* The root node of the prom device tree. */
22int prom_root_node; 22int prom_root_node;
23 23
24int prom_stdin, prom_stdout;
25
26/* Pointer to the device tree operations structure. */ 24/* Pointer to the device tree operations structure. */
27struct linux_nodeops *prom_nodeops; 25struct linux_nodeops *prom_nodeops;
28 26
@@ -74,11 +72,6 @@ void __init prom_init(struct linux_romvec *rp)
74 (((unsigned long) prom_nodeops) == -1)) 72 (((unsigned long) prom_nodeops) == -1))
75 prom_halt(); 73 prom_halt();
76 74
77 if(prom_vers == PROM_V2 || prom_vers == PROM_V3) {
78 prom_stdout = *romvec->pv_v2bootargs.fd_stdout;
79 prom_stdin = *romvec->pv_v2bootargs.fd_stdin;
80 }
81
82 prom_meminit(); 75 prom_meminit();
83 76
84 prom_ranges_init(); 77 prom_ranges_init();
diff --git a/arch/sparc/prom/memory.c b/arch/sparc/prom/memory.c
index b0c0f9c4fc14..947f047dc95a 100644
--- a/arch/sparc/prom/memory.c
+++ b/arch/sparc/prom/memory.c
@@ -1,215 +1,100 @@
1/* $Id: memory.c,v 1.15 2000/01/29 01:09:12 anton Exp $ 1/* memory.c: Prom routine for acquiring various bits of information
2 * memory.c: Prom routine for acquiring various bits of information
3 * about RAM on the machine, both virtual and physical. 2 * about RAM on the machine, both virtual and physical.
4 * 3 *
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1995, 2008 David S. Miller (davem@davemloft.net)
6 * Copyright (C) 1997 Michael A. Griffith (grif@acm.org) 5 * Copyright (C) 1997 Michael A. Griffith (grif@acm.org)
7 */ 6 */
8 7
9#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/sort.h>
10#include <linux/init.h> 10#include <linux/init.h>
11 11
12#include <asm/openprom.h> 12#include <asm/openprom.h>
13#include <asm/sun4prom.h> 13#include <asm/sun4prom.h>
14#include <asm/oplib.h> 14#include <asm/oplib.h>
15#include <asm/page.h>
15 16
16/* This routine, for consistency, returns the ram parameters in the 17static int __init prom_meminit_v0(void)
17 * V0 prom memory descriptor format. I choose this format because I 18{
18 * think it was the easiest to work with. I feel the religious 19 struct linux_mlist_v0 *p;
19 * arguments now... ;) Also, I return the linked lists sorted to 20 int index;
20 * prevent paging_init() upset stomach as I have not yet written 21
21 * the pepto-bismol kernel module yet. 22 index = 0;
22 */ 23 for (p = *(romvec->pv_v0mem.v0_available); p; p = p->theres_more) {
24 sp_banks[index].base_addr = (unsigned long) p->start_adr;
25 sp_banks[index].num_bytes = p->num_bytes;
26 index++;
27 }
23 28
24struct linux_prom_registers prom_reg_memlist[64]; 29 return index;
25struct linux_prom_registers prom_reg_tmp[64]; 30}
26 31
27struct linux_mlist_v0 prom_phys_total[64]; 32static int __init prom_meminit_v2(void)
28struct linux_mlist_v0 prom_prom_taken[64]; 33{
29struct linux_mlist_v0 prom_phys_avail[64]; 34 struct linux_prom_registers reg[64];
35 int node, size, num_ents, i;
30 36
31struct linux_mlist_v0 *prom_ptot_ptr = prom_phys_total; 37 node = prom_searchsiblings(prom_getchild(prom_root_node), "memory");
32struct linux_mlist_v0 *prom_ptak_ptr = prom_prom_taken; 38 size = prom_getproperty(node, "available", (char *) reg, sizeof(reg));
33struct linux_mlist_v0 *prom_pavl_ptr = prom_phys_avail; 39 num_ents = size / sizeof(struct linux_prom_registers);
34 40
35struct linux_mem_v0 prom_memlist; 41 for (i = 0; i < num_ents; i++) {
42 sp_banks[i].base_addr = reg[i].phys_addr;
43 sp_banks[i].num_bytes = reg[i].reg_size;
44 }
36 45
46 return num_ents;
47}
37 48
38/* Internal Prom library routine to sort a linux_mlist_v0 memory 49static int __init prom_meminit_sun4(void)
39 * list. Used below in initialization.
40 */
41static void __init
42prom_sortmemlist(struct linux_mlist_v0 *thislist)
43{ 50{
44 int swapi = 0; 51#ifdef CONFIG_SUN4
45 int i, mitr, tmpsize; 52 sp_banks[0].base_addr = 0;
46 char *tmpaddr; 53 sp_banks[0].num_bytes = *(sun4_romvec->memoryavail);
47 char *lowest; 54#endif
48 55 return 1;
49 for(i=0; thislist[i].theres_more; i++) { 56}
50 lowest = thislist[i].start_adr; 57
51 for(mitr = i+1; thislist[mitr-1].theres_more; mitr++) 58static int sp_banks_cmp(const void *a, const void *b)
52 if(thislist[mitr].start_adr < lowest) { 59{
53 lowest = thislist[mitr].start_adr; 60 const struct sparc_phys_banks *x = a, *y = b;
54 swapi = mitr;
55 }
56 if(lowest == thislist[i].start_adr) continue;
57 tmpaddr = thislist[swapi].start_adr;
58 tmpsize = thislist[swapi].num_bytes;
59 for(mitr = swapi; mitr > i; mitr--) {
60 thislist[mitr].start_adr = thislist[mitr-1].start_adr;
61 thislist[mitr].num_bytes = thislist[mitr-1].num_bytes;
62 }
63 thislist[i].start_adr = tmpaddr;
64 thislist[i].num_bytes = tmpsize;
65 }
66 61
67 return; 62 if (x->base_addr > y->base_addr)
63 return 1;
64 if (x->base_addr < y->base_addr)
65 return -1;
66 return 0;
68} 67}
69 68
70/* Initialize the memory lists based upon the prom version. */ 69/* Initialize the memory lists based upon the prom version. */
71void __init prom_meminit(void) 70void __init prom_meminit(void)
72{ 71{
73 int node = 0; 72 int i, num_ents = 0;
74 unsigned int iter, num_regs;
75 struct linux_mlist_v0 *mptr; /* ptr for traversal */
76 73
77 switch(prom_vers) { 74 switch (prom_vers) {
78 case PROM_V0: 75 case PROM_V0:
79 /* Nice, kind of easier to do in this case. */ 76 num_ents = prom_meminit_v0();
80 /* First, the total physical descriptors. */
81 for(mptr = (*(romvec->pv_v0mem.v0_totphys)), iter=0;
82 mptr; mptr=mptr->theres_more, iter++) {
83 prom_phys_total[iter].start_adr = mptr->start_adr;
84 prom_phys_total[iter].num_bytes = mptr->num_bytes;
85 prom_phys_total[iter].theres_more = &prom_phys_total[iter+1];
86 }
87 prom_phys_total[iter-1].theres_more = NULL;
88 /* Second, the total prom taken descriptors. */
89 for(mptr = (*(romvec->pv_v0mem.v0_prommap)), iter=0;
90 mptr; mptr=mptr->theres_more, iter++) {
91 prom_prom_taken[iter].start_adr = mptr->start_adr;
92 prom_prom_taken[iter].num_bytes = mptr->num_bytes;
93 prom_prom_taken[iter].theres_more = &prom_prom_taken[iter+1];
94 }
95 prom_prom_taken[iter-1].theres_more = NULL;
96 /* Last, the available physical descriptors. */
97 for(mptr = (*(romvec->pv_v0mem.v0_available)), iter=0;
98 mptr; mptr=mptr->theres_more, iter++) {
99 prom_phys_avail[iter].start_adr = mptr->start_adr;
100 prom_phys_avail[iter].num_bytes = mptr->num_bytes;
101 prom_phys_avail[iter].theres_more = &prom_phys_avail[iter+1];
102 }
103 prom_phys_avail[iter-1].theres_more = NULL;
104 /* Sort all the lists. */
105 prom_sortmemlist(prom_phys_total);
106 prom_sortmemlist(prom_prom_taken);
107 prom_sortmemlist(prom_phys_avail);
108 break; 77 break;
78
109 case PROM_V2: 79 case PROM_V2:
110 case PROM_V3: 80 case PROM_V3:
111 /* Grrr, have to traverse the prom device tree ;( */ 81 num_ents = prom_meminit_v2();
112 node = prom_getchild(prom_root_node);
113 node = prom_searchsiblings(node, "memory");
114 num_regs = prom_getproperty(node, "available",
115 (char *) prom_reg_memlist,
116 sizeof(prom_reg_memlist));
117 num_regs = (num_regs/sizeof(struct linux_prom_registers));
118 for(iter=0; iter<num_regs; iter++) {
119 prom_phys_avail[iter].start_adr =
120 (char *) prom_reg_memlist[iter].phys_addr;
121 prom_phys_avail[iter].num_bytes =
122 (unsigned long) prom_reg_memlist[iter].reg_size;
123 prom_phys_avail[iter].theres_more =
124 &prom_phys_avail[iter+1];
125 }
126 prom_phys_avail[iter-1].theres_more = NULL;
127
128 num_regs = prom_getproperty(node, "reg",
129 (char *) prom_reg_memlist,
130 sizeof(prom_reg_memlist));
131 num_regs = (num_regs/sizeof(struct linux_prom_registers));
132 for(iter=0; iter<num_regs; iter++) {
133 prom_phys_total[iter].start_adr =
134 (char *) prom_reg_memlist[iter].phys_addr;
135 prom_phys_total[iter].num_bytes =
136 (unsigned long) prom_reg_memlist[iter].reg_size;
137 prom_phys_total[iter].theres_more =
138 &prom_phys_total[iter+1];
139 }
140 prom_phys_total[iter-1].theres_more = NULL;
141
142 node = prom_getchild(prom_root_node);
143 node = prom_searchsiblings(node, "virtual-memory");
144 num_regs = prom_getproperty(node, "available",
145 (char *) prom_reg_memlist,
146 sizeof(prom_reg_memlist));
147 num_regs = (num_regs/sizeof(struct linux_prom_registers));
148
149 /* Convert available virtual areas to taken virtual
150 * areas. First sort, then convert.
151 */
152 for(iter=0; iter<num_regs; iter++) {
153 prom_prom_taken[iter].start_adr =
154 (char *) prom_reg_memlist[iter].phys_addr;
155 prom_prom_taken[iter].num_bytes =
156 (unsigned long) prom_reg_memlist[iter].reg_size;
157 prom_prom_taken[iter].theres_more =
158 &prom_prom_taken[iter+1];
159 }
160 prom_prom_taken[iter-1].theres_more = NULL;
161
162 prom_sortmemlist(prom_prom_taken);
163
164 /* Finally, convert. */
165 for(iter=0; iter<num_regs; iter++) {
166 prom_prom_taken[iter].start_adr =
167 prom_prom_taken[iter].start_adr +
168 prom_prom_taken[iter].num_bytes;
169 prom_prom_taken[iter].num_bytes =
170 prom_prom_taken[iter+1].start_adr -
171 prom_prom_taken[iter].start_adr;
172 }
173 prom_prom_taken[iter-1].num_bytes =
174 0xffffffff - (unsigned long) prom_prom_taken[iter-1].start_adr;
175
176 /* Sort the other two lists. */
177 prom_sortmemlist(prom_phys_total);
178 prom_sortmemlist(prom_phys_avail);
179 break; 82 break;
180 83
181 case PROM_SUN4: 84 case PROM_SUN4:
182#ifdef CONFIG_SUN4 85 num_ents = prom_meminit_sun4();
183 /* how simple :) */
184 prom_phys_total[0].start_adr = NULL;
185 prom_phys_total[0].num_bytes = *(sun4_romvec->memorysize);
186 prom_phys_total[0].theres_more = NULL;
187 prom_prom_taken[0].start_adr = NULL;
188 prom_prom_taken[0].num_bytes = 0x0;
189 prom_prom_taken[0].theres_more = NULL;
190 prom_phys_avail[0].start_adr = NULL;
191 prom_phys_avail[0].num_bytes = *(sun4_romvec->memoryavail);
192 prom_phys_avail[0].theres_more = NULL;
193#endif
194 break; 86 break;
195 87
196 default: 88 default:
197 break; 89 break;
198 }; 90 }
199 91 sort(sp_banks, num_ents, sizeof(struct sparc_phys_banks),
200 /* Link all the lists into the top-level descriptor. */ 92 sp_banks_cmp, NULL);
201 prom_memlist.v0_totphys=&prom_ptot_ptr;
202 prom_memlist.v0_prommap=&prom_ptak_ptr;
203 prom_memlist.v0_available=&prom_pavl_ptr;
204 93
205 return; 94 /* Sentinel. */
206} 95 sp_banks[num_ents].base_addr = 0xdeadbeef;
96 sp_banks[num_ents].num_bytes = 0;
207 97
208/* This returns a pointer to our libraries internal v0 format 98 for (i = 0; i < num_ents; i++)
209 * memory descriptor. 99 sp_banks[i].num_bytes &= PAGE_MASK;
210 */
211struct linux_mem_v0 *
212prom_meminfo(void)
213{
214 return &prom_memlist;
215} 100}
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index dbf2fc2f4d87..112b09f16f36 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -350,8 +350,7 @@ static void pci_parse_of_addrs(struct of_device *op,
350 350
351struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, 351struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
352 struct device_node *node, 352 struct device_node *node,
353 struct pci_bus *bus, int devfn, 353 struct pci_bus *bus, int devfn)
354 int host_controller)
355{ 354{
356 struct dev_archdata *sd; 355 struct dev_archdata *sd;
357 struct pci_dev *dev; 356 struct pci_dev *dev;
@@ -390,43 +389,28 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
390 dev->devfn = devfn; 389 dev->devfn = devfn;
391 dev->multifunction = 0; /* maybe a lie? */ 390 dev->multifunction = 0; /* maybe a lie? */
392 391
393 if (host_controller) { 392 dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff);
394 if (tlb_type != hypervisor) { 393 dev->device = of_getintprop_default(node, "device-id", 0xffff);
395 pci_read_config_word(dev, PCI_VENDOR_ID, 394 dev->subsystem_vendor =
396 &dev->vendor); 395 of_getintprop_default(node, "subsystem-vendor-id", 0);
397 pci_read_config_word(dev, PCI_DEVICE_ID, 396 dev->subsystem_device =
398 &dev->device); 397 of_getintprop_default(node, "subsystem-id", 0);
399 } else { 398
400 dev->vendor = PCI_VENDOR_ID_SUN; 399 dev->cfg_size = pci_cfg_space_size(dev);
401 dev->device = 0x80f0; 400
402 } 401 /* We can't actually use the firmware value, we have
403 dev->cfg_size = 256; 402 * to read what is in the register right now. One
404 dev->class = PCI_CLASS_BRIDGE_HOST << 8; 403 * reason is that in the case of IDE interfaces the
405 sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus), 404 * firmware can sample the value before the the IDE
406 0x00, PCI_SLOT(devfn), PCI_FUNC(devfn)); 405 * interface is programmed into native mode.
407 } else { 406 */
408 dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff); 407 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
409 dev->device = of_getintprop_default(node, "device-id", 0xffff); 408 dev->class = class >> 8;
410 dev->subsystem_vendor = 409 dev->revision = class & 0xff;
411 of_getintprop_default(node, "subsystem-vendor-id", 0); 410
412 dev->subsystem_device = 411 sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
413 of_getintprop_default(node, "subsystem-id", 0); 412 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
414
415 dev->cfg_size = pci_cfg_space_size(dev);
416
417 /* We can't actually use the firmware value, we have
418 * to read what is in the register right now. One
419 * reason is that in the case of IDE interfaces the
420 * firmware can sample the value before the the IDE
421 * interface is programmed into native mode.
422 */
423 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class);
424 dev->class = class >> 8;
425 dev->revision = class & 0xff;
426 413
427 sprintf(pci_name(dev), "%04x:%02x:%02x.%d", pci_domain_nr(bus),
428 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn));
429 }
430 if (ofpci_verbose) 414 if (ofpci_verbose)
431 printk(" class: 0x%x device name: %s\n", 415 printk(" class: 0x%x device name: %s\n",
432 dev->class, pci_name(dev)); 416 dev->class, pci_name(dev));
@@ -441,26 +425,21 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
441 dev->current_state = 4; /* unknown power state */ 425 dev->current_state = 4; /* unknown power state */
442 dev->error_state = pci_channel_io_normal; 426 dev->error_state = pci_channel_io_normal;
443 427
444 if (host_controller) { 428 if (!strcmp(type, "pci") || !strcmp(type, "pciex")) {
429 /* a PCI-PCI bridge */
445 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE; 430 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
446 dev->rom_base_reg = PCI_ROM_ADDRESS1; 431 dev->rom_base_reg = PCI_ROM_ADDRESS1;
447 dev->irq = PCI_IRQ_NONE; 432 } else if (!strcmp(type, "cardbus")) {
433 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
448 } else { 434 } else {
449 if (!strcmp(type, "pci") || !strcmp(type, "pciex")) { 435 dev->hdr_type = PCI_HEADER_TYPE_NORMAL;
450 /* a PCI-PCI bridge */ 436 dev->rom_base_reg = PCI_ROM_ADDRESS;
451 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE;
452 dev->rom_base_reg = PCI_ROM_ADDRESS1;
453 } else if (!strcmp(type, "cardbus")) {
454 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS;
455 } else {
456 dev->hdr_type = PCI_HEADER_TYPE_NORMAL;
457 dev->rom_base_reg = PCI_ROM_ADDRESS;
458 437
459 dev->irq = sd->op->irqs[0]; 438 dev->irq = sd->op->irqs[0];
460 if (dev->irq == 0xffffffff) 439 if (dev->irq == 0xffffffff)
461 dev->irq = PCI_IRQ_NONE; 440 dev->irq = PCI_IRQ_NONE;
462 }
463 } 441 }
442
464 pci_parse_of_addrs(sd->op, node, dev); 443 pci_parse_of_addrs(sd->op, node, dev);
465 444
466 if (ofpci_verbose) 445 if (ofpci_verbose)
@@ -749,7 +728,7 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm,
749 prev_devfn = devfn; 728 prev_devfn = devfn;
750 729
751 /* create a new pci_dev for this device */ 730 /* create a new pci_dev for this device */
752 dev = of_create_pci_dev(pbm, child, bus, devfn, 0); 731 dev = of_create_pci_dev(pbm, child, bus, devfn);
753 if (!dev) 732 if (!dev)
754 continue; 733 continue;
755 if (ofpci_verbose) 734 if (ofpci_verbose)
@@ -796,48 +775,9 @@ static void __devinit pci_bus_register_of_sysfs(struct pci_bus *bus)
796 pci_bus_register_of_sysfs(child_bus); 775 pci_bus_register_of_sysfs(child_bus);
797} 776}
798 777
799int pci_host_bridge_read_pci_cfg(struct pci_bus *bus_dev,
800 unsigned int devfn,
801 int where, int size,
802 u32 *value)
803{
804 static u8 fake_pci_config[] = {
805 0x8e, 0x10, /* Vendor: 0x108e (Sun) */
806 0xf0, 0x80, /* Device: 0x80f0 (Fire) */
807 0x46, 0x01, /* Command: 0x0146 (SERR, PARITY, MASTER, MEM) */
808 0xa0, 0x22, /* Status: 0x02a0 (DEVSEL_MED, FB2B, 66MHZ) */
809 0x00, 0x00, 0x00, 0x06, /* Class: 0x06000000 host bridge */
810 0x00, /* Cacheline: 0x00 */
811 0x40, /* Latency: 0x40 */
812 0x00, /* Header-Type: 0x00 normal */
813 };
814
815 *value = 0;
816 if (where >= 0 && where < sizeof(fake_pci_config) &&
817 (where + size) >= 0 &&
818 (where + size) < sizeof(fake_pci_config) &&
819 size <= sizeof(u32)) {
820 while (size--) {
821 *value <<= 8;
822 *value |= fake_pci_config[where + size];
823 }
824 }
825
826 return PCIBIOS_SUCCESSFUL;
827}
828
829int pci_host_bridge_write_pci_cfg(struct pci_bus *bus_dev,
830 unsigned int devfn,
831 int where, int size,
832 u32 value)
833{
834 return PCIBIOS_SUCCESSFUL;
835}
836
837struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm) 778struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm)
838{ 779{
839 struct device_node *node = pbm->prom_node; 780 struct device_node *node = pbm->prom_node;
840 struct pci_dev *host_pdev;
841 struct pci_bus *bus; 781 struct pci_bus *bus;
842 782
843 printk("PCI: Scanning PBM %s\n", node->full_name); 783 printk("PCI: Scanning PBM %s\n", node->full_name);
@@ -855,10 +795,6 @@ struct pci_bus * __devinit pci_scan_one_pbm(struct pci_pbm_info *pbm)
855 bus->resource[0] = &pbm->io_space; 795 bus->resource[0] = &pbm->io_space;
856 bus->resource[1] = &pbm->mem_space; 796 bus->resource[1] = &pbm->mem_space;
857 797
858 /* Create the dummy host bridge and link it in. */
859 host_pdev = of_create_pci_dev(pbm, node, bus, 0x00, 1);
860 bus->self = host_pdev;
861
862 pci_of_scan_bus(pbm, node, bus); 798 pci_of_scan_bus(pbm, node, bus);
863 pci_bus_add_devices(bus); 799 pci_bus_add_devices(bus);
864 pci_bus_register_of_sysfs(bus); 800 pci_bus_register_of_sysfs(bus);
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c
index 923e0bcc3bfd..19fa621d6a60 100644
--- a/arch/sparc64/kernel/pci_common.c
+++ b/arch/sparc64/kernel/pci_common.c
@@ -264,9 +264,6 @@ static int sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
264 unsigned int func = PCI_FUNC(devfn); 264 unsigned int func = PCI_FUNC(devfn);
265 unsigned long ret; 265 unsigned long ret;
266 266
267 if (!bus && devfn == 0x00)
268 return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where,
269 size, value);
270 if (config_out_of_range(pbm, bus, devfn, where)) { 267 if (config_out_of_range(pbm, bus, devfn, where)) {
271 ret = ~0UL; 268 ret = ~0UL;
272 } else { 269 } else {
@@ -300,9 +297,6 @@ static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn,
300 unsigned int func = PCI_FUNC(devfn); 297 unsigned int func = PCI_FUNC(devfn);
301 unsigned long ret; 298 unsigned long ret;
302 299
303 if (!bus && devfn == 0x00)
304 return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where,
305 size, value);
306 if (config_out_of_range(pbm, bus, devfn, where)) { 300 if (config_out_of_range(pbm, bus, devfn, where)) {
307 /* Do nothing. */ 301 /* Do nothing. */
308 } else { 302 } else {
diff --git a/arch/sparc64/kernel/pci_impl.h b/arch/sparc64/kernel/pci_impl.h
index 218bac4ff79b..c385d126be11 100644
--- a/arch/sparc64/kernel/pci_impl.h
+++ b/arch/sparc64/kernel/pci_impl.h
@@ -167,15 +167,6 @@ extern void pci_get_pbm_props(struct pci_pbm_info *pbm);
167extern struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm); 167extern struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm);
168extern void pci_determine_mem_io_space(struct pci_pbm_info *pbm); 168extern void pci_determine_mem_io_space(struct pci_pbm_info *pbm);
169 169
170extern int pci_host_bridge_read_pci_cfg(struct pci_bus *bus_dev,
171 unsigned int devfn,
172 int where, int size,
173 u32 *value);
174extern int pci_host_bridge_write_pci_cfg(struct pci_bus *bus_dev,
175 unsigned int devfn,
176 int where, int size,
177 u32 value);
178
179/* Error reporting support. */ 170/* Error reporting support. */
180extern void pci_scan_for_target_abort(struct pci_pbm_info *, struct pci_bus *); 171extern void pci_scan_for_target_abort(struct pci_pbm_info *, struct pci_bus *);
181extern void pci_scan_for_master_abort(struct pci_pbm_info *, struct pci_bus *); 172extern void pci_scan_for_master_abort(struct pci_pbm_info *, struct pci_bus *);
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 056013749157..500ac6d483a0 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -591,12 +591,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
591 if (clone_flags & CLONE_SETTLS) 591 if (clone_flags & CLONE_SETTLS)
592 t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3]; 592 t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3];
593 593
594 /* We do not want to accidently trigger system call restart
595 * handling in the new thread. Therefore, clear out the trap
596 * type, which will make pt_regs_regs_is_syscall() return false.
597 */
598 pt_regs_clear_trap_type(t->kregs);
599
600 return 0; 594 return 0;
601} 595}
602 596
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c
index f2d88d8f7a42..45d6bf632daa 100644
--- a/arch/sparc64/kernel/signal.c
+++ b/arch/sparc64/kernel/signal.c
@@ -332,6 +332,9 @@ void do_rt_sigreturn(struct pt_regs *regs)
332 regs->tpc = tpc; 332 regs->tpc = tpc;
333 regs->tnpc = tnpc; 333 regs->tnpc = tnpc;
334 334
335 /* Prevent syscall restart. */
336 pt_regs_clear_trap_type(regs);
337
335 sigdelsetmask(&set, ~_BLOCKABLE); 338 sigdelsetmask(&set, ~_BLOCKABLE);
336 spin_lock_irq(&current->sighand->siglock); 339 spin_lock_irq(&current->sighand->siglock);
337 current->blocked = set; 340 current->blocked = set;
@@ -515,7 +518,8 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
515 siginfo_t info; 518 siginfo_t info;
516 int signr; 519 int signr;
517 520
518 if (pt_regs_is_syscall(regs)) { 521 if (pt_regs_is_syscall(regs) &&
522 (regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) {
519 pt_regs_clear_trap_type(regs); 523 pt_regs_clear_trap_type(regs);
520 cookie.restart_syscall = 1; 524 cookie.restart_syscall = 1;
521 } else 525 } else
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index 91f8d0826db1..9415d2c918c5 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -268,6 +268,9 @@ void do_sigreturn32(struct pt_regs *regs)
268 regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC); 268 regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC);
269 regs->tstate |= psr_to_tstate_icc(psr); 269 regs->tstate |= psr_to_tstate_icc(psr);
270 270
271 /* Prevent syscall restart. */
272 pt_regs_clear_trap_type(regs);
273
271 err |= __get_user(fpu_save, &sf->fpu_save); 274 err |= __get_user(fpu_save, &sf->fpu_save);
272 if (fpu_save) 275 if (fpu_save)
273 err |= restore_fpu_state32(regs, &sf->fpu_state); 276 err |= restore_fpu_state32(regs, &sf->fpu_state);
@@ -351,6 +354,9 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
351 regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC); 354 regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC);
352 regs->tstate |= psr_to_tstate_icc(psr); 355 regs->tstate |= psr_to_tstate_icc(psr);
353 356
357 /* Prevent syscall restart. */
358 pt_regs_clear_trap_type(regs);
359
354 err |= __get_user(fpu_save, &sf->fpu_save); 360 err |= __get_user(fpu_save, &sf->fpu_save);
355 if (fpu_save) 361 if (fpu_save)
356 err |= restore_fpu_state32(regs, &sf->fpu_state); 362 err |= restore_fpu_state32(regs, &sf->fpu_state);
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c
index 9cffc628a37e..128ee85bc8d9 100644
--- a/arch/um/kernel/syscall.c
+++ b/arch/um/kernel/syscall.c
@@ -73,23 +73,6 @@ long old_mmap(unsigned long addr, unsigned long len,
73 out: 73 out:
74 return err; 74 return err;
75} 75}
76/*
77 * sys_pipe() is the normal C calling standard for creating
78 * a pipe. It's not the way unix traditionally does this, though.
79 */
80long sys_pipe(unsigned long __user * fildes)
81{
82 int fd[2];
83 long error;
84
85 error = do_pipe(fd);
86 if (!error) {
87 if (copy_to_user(fildes, fd, sizeof(fd)))
88 error = -EFAULT;
89 }
90 return error;
91}
92
93 76
94long sys_uname(struct old_utsname __user * name) 77long sys_uname(struct old_utsname __user * name)
95{ 78{
diff --git a/arch/v850/kernel/syscalls.c b/arch/v850/kernel/syscalls.c
index 003db9c8c44a..1a83daf8e24f 100644
--- a/arch/v850/kernel/syscalls.c
+++ b/arch/v850/kernel/syscalls.c
@@ -132,23 +132,6 @@ sys_ipc (uint call, int first, int second, int third, void *ptr, long fifth)
132 return ret; 132 return ret;
133} 133}
134 134
135/*
136 * sys_pipe() is the normal C calling standard for creating
137 * a pipe. It's not the way unix traditionally does this, though.
138 */
139int sys_pipe (int *fildes)
140{
141 int fd[2];
142 int error;
143
144 error = do_pipe (fd);
145 if (!error) {
146 if (copy_to_user (fildes, fd, 2*sizeof (int)))
147 error = -EFAULT;
148 }
149 return error;
150}
151
152static inline unsigned long 135static inline unsigned long
153do_mmap2 (unsigned long addr, size_t len, 136do_mmap2 (unsigned long addr, size_t len,
154 unsigned long prot, unsigned long flags, 137 unsigned long prot, unsigned long flags,
diff --git a/arch/x86/kernel/sys_i386_32.c b/arch/x86/kernel/sys_i386_32.c
index a86d26f036e1..d2ab52cc1d6b 100644
--- a/arch/x86/kernel/sys_i386_32.c
+++ b/arch/x86/kernel/sys_i386_32.c
@@ -22,23 +22,6 @@
22#include <asm/uaccess.h> 22#include <asm/uaccess.h>
23#include <asm/unistd.h> 23#include <asm/unistd.h>
24 24
25/*
26 * sys_pipe() is the normal C calling standard for creating
27 * a pipe. It's not the way Unix traditionally does this, though.
28 */
29asmlinkage int sys_pipe(unsigned long __user * fildes)
30{
31 int fd[2];
32 int error;
33
34 error = do_pipe(fd);
35 if (!error) {
36 if (copy_to_user(fildes, fd, 2*sizeof(int)))
37 error = -EFAULT;
38 }
39 return error;
40}
41
42asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 25asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
43 unsigned long prot, unsigned long flags, 26 unsigned long prot, unsigned long flags,
44 unsigned long fd, unsigned long pgoff) 27 unsigned long fd, unsigned long pgoff)
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index bd802a5e1aa3..3b360ef33817 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -17,23 +17,6 @@
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/ia32.h> 18#include <asm/ia32.h>
19 19
20/*
21 * sys_pipe() is the normal C calling standard for creating
22 * a pipe. It's not the way Unix traditionally does this, though.
23 */
24asmlinkage long sys_pipe(int __user *fildes)
25{
26 int fd[2];
27 int error;
28
29 error = do_pipe(fd);
30 if (!error) {
31 if (copy_to_user(fildes, fd, 2*sizeof(int)))
32 error = -EFAULT;
33 }
34 return error;
35}
36
37asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, 20asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags,
38 unsigned long fd, unsigned long off) 21 unsigned long fd, unsigned long off)
39{ 22{
diff --git a/block/bsg.c b/block/bsg.c
index fa796b605f55..f0b7cd343216 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -174,7 +174,11 @@ unlock:
174static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq, 174static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
175 struct sg_io_v4 *hdr, int has_write_perm) 175 struct sg_io_v4 *hdr, int has_write_perm)
176{ 176{
177 memset(rq->cmd, 0, BLK_MAX_CDB); /* ATAPI hates garbage after CDB */ 177 if (hdr->request_len > BLK_MAX_CDB) {
178 rq->cmd = kzalloc(hdr->request_len, GFP_KERNEL);
179 if (!rq->cmd)
180 return -ENOMEM;
181 }
178 182
179 if (copy_from_user(rq->cmd, (void *)(unsigned long)hdr->request, 183 if (copy_from_user(rq->cmd, (void *)(unsigned long)hdr->request,
180 hdr->request_len)) 184 hdr->request_len))
@@ -211,8 +215,6 @@ bsg_validate_sgv4_hdr(struct request_queue *q, struct sg_io_v4 *hdr, int *rw)
211 215
212 if (hdr->guard != 'Q') 216 if (hdr->guard != 'Q')
213 return -EINVAL; 217 return -EINVAL;
214 if (hdr->request_len > BLK_MAX_CDB)
215 return -EINVAL;
216 if (hdr->dout_xfer_len > (q->max_sectors << 9) || 218 if (hdr->dout_xfer_len > (q->max_sectors << 9) ||
217 hdr->din_xfer_len > (q->max_sectors << 9)) 219 hdr->din_xfer_len > (q->max_sectors << 9))
218 return -EIO; 220 return -EIO;
@@ -302,6 +304,8 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr)
302 } 304 }
303 return rq; 305 return rq;
304out: 306out:
307 if (rq->cmd != rq->__cmd)
308 kfree(rq->cmd);
305 blk_put_request(rq); 309 blk_put_request(rq);
306 if (next_rq) { 310 if (next_rq) {
307 blk_rq_unmap_user(next_rq->bio); 311 blk_rq_unmap_user(next_rq->bio);
@@ -455,6 +459,8 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
455 ret = rq->errors; 459 ret = rq->errors;
456 460
457 blk_rq_unmap_user(bio); 461 blk_rq_unmap_user(bio);
462 if (rq->cmd != rq->__cmd)
463 kfree(rq->cmd);
458 blk_put_request(rq); 464 blk_put_request(rq);
459 465
460 return ret; 466 return ret;
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index ffa3720e6ca0..78199c08ec92 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -33,13 +33,12 @@
33#include <scsi/scsi_cmnd.h> 33#include <scsi/scsi_cmnd.h>
34 34
35/* Command group 3 is reserved and should never be used. */ 35/* Command group 3 is reserved and should never be used. */
36const unsigned char scsi_command_size[8] = 36const unsigned char scsi_command_size_tbl[8] =
37{ 37{
38 6, 10, 10, 12, 38 6, 10, 10, 12,
39 16, 12, 10, 10 39 16, 12, 10, 10
40}; 40};
41 41EXPORT_SYMBOL(scsi_command_size_tbl);
42EXPORT_SYMBOL(scsi_command_size);
43 42
44#include <scsi/sg.h> 43#include <scsi/sg.h>
45 44
diff --git a/drivers/bluetooth/hci_usb.h b/drivers/bluetooth/hci_usb.h
index 414080a4e8ff..1790cc8e431e 100644
--- a/drivers/bluetooth/hci_usb.h
+++ b/drivers/bluetooth/hci_usb.h
@@ -70,7 +70,8 @@ static inline void _urb_queue_head(struct _urb_queue *q, struct _urb *_urb)
70{ 70{
71 unsigned long flags; 71 unsigned long flags;
72 spin_lock_irqsave(&q->lock, flags); 72 spin_lock_irqsave(&q->lock, flags);
73 list_add(&_urb->list, &q->head); _urb->queue = q; 73 /* _urb_unlink needs to know which spinlock to use, thus mb(). */
74 _urb->queue = q; mb(); list_add(&_urb->list, &q->head);
74 spin_unlock_irqrestore(&q->lock, flags); 75 spin_unlock_irqrestore(&q->lock, flags);
75} 76}
76 77
@@ -78,19 +79,23 @@ static inline void _urb_queue_tail(struct _urb_queue *q, struct _urb *_urb)
78{ 79{
79 unsigned long flags; 80 unsigned long flags;
80 spin_lock_irqsave(&q->lock, flags); 81 spin_lock_irqsave(&q->lock, flags);
81 list_add_tail(&_urb->list, &q->head); _urb->queue = q; 82 /* _urb_unlink needs to know which spinlock to use, thus mb(). */
83 _urb->queue = q; mb(); list_add_tail(&_urb->list, &q->head);
82 spin_unlock_irqrestore(&q->lock, flags); 84 spin_unlock_irqrestore(&q->lock, flags);
83} 85}
84 86
85static inline void _urb_unlink(struct _urb *_urb) 87static inline void _urb_unlink(struct _urb *_urb)
86{ 88{
87 struct _urb_queue *q = _urb->queue; 89 struct _urb_queue *q;
88 unsigned long flags; 90 unsigned long flags;
89 if (q) { 91
90 spin_lock_irqsave(&q->lock, flags); 92 mb();
91 list_del(&_urb->list); _urb->queue = NULL; 93 q = _urb->queue;
92 spin_unlock_irqrestore(&q->lock, flags); 94 /* If q is NULL, it will die at easy-to-debug NULL pointer dereference.
93 } 95 No need to BUG(). */
96 spin_lock_irqsave(&q->lock, flags);
97 list_del(&_urb->list); _urb->queue = NULL;
98 spin_unlock_irqrestore(&q->lock, flags);
94} 99}
95 100
96struct hci_usb { 101struct hci_usb {
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
index dfe6907ae15b..3edf1fc12963 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
@@ -623,8 +623,8 @@ static int __devinit hwicap_setup(struct device *dev, int id,
623 623
624 if (!request_mem_region(drvdata->mem_start, 624 if (!request_mem_region(drvdata->mem_start,
625 drvdata->mem_size, DRIVER_NAME)) { 625 drvdata->mem_size, DRIVER_NAME)) {
626 dev_err(dev, "Couldn't lock memory region at %p\n", 626 dev_err(dev, "Couldn't lock memory region at %Lx\n",
627 (void *)regs_res->start); 627 regs_res->start);
628 retval = -EBUSY; 628 retval = -EBUSY;
629 goto failed1; 629 goto failed1;
630 } 630 }
@@ -643,7 +643,7 @@ static int __devinit hwicap_setup(struct device *dev, int id,
643 mutex_init(&drvdata->sem); 643 mutex_init(&drvdata->sem);
644 drvdata->is_open = 0; 644 drvdata->is_open = 0;
645 645
646 dev_info(dev, "ioremap %lx to %p with size %x\n", 646 dev_info(dev, "ioremap %lx to %p with size %Lx\n",
647 (unsigned long int)drvdata->mem_start, 647 (unsigned long int)drvdata->mem_start,
648 drvdata->base_address, drvdata->mem_size); 648 drvdata->base_address, drvdata->mem_size);
649 649
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c
index 62e3c9190983..b2458bb8e9ca 100644
--- a/drivers/firewire/fw-sbp2.c
+++ b/drivers/firewire/fw-sbp2.c
@@ -1487,7 +1487,7 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
1487 if (scsi_sg_count(cmd) && sbp2_map_scatterlist(orb, device, lu) < 0) 1487 if (scsi_sg_count(cmd) && sbp2_map_scatterlist(orb, device, lu) < 0)
1488 goto out; 1488 goto out;
1489 1489
1490 memcpy(orb->request.command_block, cmd->cmnd, COMMAND_SIZE(*cmd->cmnd)); 1490 memcpy(orb->request.command_block, cmd->cmnd, cmd->cmd_len);
1491 1491
1492 orb->base.callback = complete_command_orb; 1492 orb->base.callback = complete_command_orb;
1493 orb->base.request_bus = 1493 orb->base.request_bus =
diff --git a/drivers/net/8390.c b/drivers/net/8390.c
index a499e867f0f4..dc5d2584bd0c 100644
--- a/drivers/net/8390.c
+++ b/drivers/net/8390.c
@@ -34,7 +34,7 @@ struct net_device *__alloc_ei_netdev(int size)
34 34
35void NS8390_init(struct net_device *dev, int startp) 35void NS8390_init(struct net_device *dev, int startp)
36{ 36{
37 return __NS8390_init(dev, startp); 37 __NS8390_init(dev, startp);
38} 38}
39 39
40EXPORT_SYMBOL(ei_open); 40EXPORT_SYMBOL(ei_open);
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 15853be4680a..4b46e68183e0 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -56,8 +56,8 @@
56 56
57#define DRV_MODULE_NAME "bnx2" 57#define DRV_MODULE_NAME "bnx2"
58#define PFX DRV_MODULE_NAME ": " 58#define PFX DRV_MODULE_NAME ": "
59#define DRV_MODULE_VERSION "1.7.4" 59#define DRV_MODULE_VERSION "1.7.5"
60#define DRV_MODULE_RELDATE "February 18, 2008" 60#define DRV_MODULE_RELDATE "April 29, 2008"
61 61
62#define RUN_AT(x) (jiffies + (x)) 62#define RUN_AT(x) (jiffies + (x))
63 63
@@ -1631,8 +1631,10 @@ bnx2_set_default_remote_link(struct bnx2 *bp)
1631static void 1631static void
1632bnx2_set_default_link(struct bnx2 *bp) 1632bnx2_set_default_link(struct bnx2 *bp)
1633{ 1633{
1634 if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP) 1634 if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP) {
1635 return bnx2_set_default_remote_link(bp); 1635 bnx2_set_default_remote_link(bp);
1636 return;
1637 }
1636 1638
1637 bp->autoneg = AUTONEG_SPEED | AUTONEG_FLOW_CTRL; 1639 bp->autoneg = AUTONEG_SPEED | AUTONEG_FLOW_CTRL;
1638 bp->req_line_speed = 0; 1640 bp->req_line_speed = 0;
@@ -1715,7 +1717,6 @@ bnx2_remote_phy_event(struct bnx2 *bp)
1715 break; 1717 break;
1716 } 1718 }
1717 1719
1718 spin_lock(&bp->phy_lock);
1719 bp->flow_ctrl = 0; 1720 bp->flow_ctrl = 0;
1720 if ((bp->autoneg & (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) != 1721 if ((bp->autoneg & (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) !=
1721 (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) { 1722 (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) {
@@ -1737,7 +1738,6 @@ bnx2_remote_phy_event(struct bnx2 *bp)
1737 if (old_port != bp->phy_port) 1738 if (old_port != bp->phy_port)
1738 bnx2_set_default_link(bp); 1739 bnx2_set_default_link(bp);
1739 1740
1740 spin_unlock(&bp->phy_lock);
1741 } 1741 }
1742 if (bp->link_up != link_up) 1742 if (bp->link_up != link_up)
1743 bnx2_report_link(bp); 1743 bnx2_report_link(bp);
@@ -2222,6 +2222,11 @@ bnx2_init_5709_context(struct bnx2 *bp)
2222 for (i = 0; i < bp->ctx_pages; i++) { 2222 for (i = 0; i < bp->ctx_pages; i++) {
2223 int j; 2223 int j;
2224 2224
2225 if (bp->ctx_blk[i])
2226 memset(bp->ctx_blk[i], 0, BCM_PAGE_SIZE);
2227 else
2228 return -ENOMEM;
2229
2225 REG_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA0, 2230 REG_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA0,
2226 (bp->ctx_blk_mapping[i] & 0xffffffff) | 2231 (bp->ctx_blk_mapping[i] & 0xffffffff) |
2227 BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID); 2232 BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID);
@@ -2445,14 +2450,15 @@ bnx2_phy_event_is_set(struct bnx2 *bp, struct bnx2_napi *bnapi, u32 event)
2445static void 2450static void
2446bnx2_phy_int(struct bnx2 *bp, struct bnx2_napi *bnapi) 2451bnx2_phy_int(struct bnx2 *bp, struct bnx2_napi *bnapi)
2447{ 2452{
2448 if (bnx2_phy_event_is_set(bp, bnapi, STATUS_ATTN_BITS_LINK_STATE)) { 2453 spin_lock(&bp->phy_lock);
2449 spin_lock(&bp->phy_lock); 2454
2455 if (bnx2_phy_event_is_set(bp, bnapi, STATUS_ATTN_BITS_LINK_STATE))
2450 bnx2_set_link(bp); 2456 bnx2_set_link(bp);
2451 spin_unlock(&bp->phy_lock);
2452 }
2453 if (bnx2_phy_event_is_set(bp, bnapi, STATUS_ATTN_BITS_TIMER_ABORT)) 2457 if (bnx2_phy_event_is_set(bp, bnapi, STATUS_ATTN_BITS_TIMER_ABORT))
2454 bnx2_set_remote_link(bp); 2458 bnx2_set_remote_link(bp);
2455 2459
2460 spin_unlock(&bp->phy_lock);
2461
2456} 2462}
2457 2463
2458static inline u16 2464static inline u16
@@ -3174,6 +3180,12 @@ load_rv2p_fw(struct bnx2 *bp, __le32 *rv2p_code, u32 rv2p_code_len,
3174 int i; 3180 int i;
3175 u32 val; 3181 u32 val;
3176 3182
3183 if (rv2p_proc == RV2P_PROC2 && CHIP_NUM(bp) == CHIP_NUM_5709) {
3184 val = le32_to_cpu(rv2p_code[XI_RV2P_PROC2_MAX_BD_PAGE_LOC]);
3185 val &= ~XI_RV2P_PROC2_BD_PAGE_SIZE_MSK;
3186 val |= XI_RV2P_PROC2_BD_PAGE_SIZE;
3187 rv2p_code[XI_RV2P_PROC2_MAX_BD_PAGE_LOC] = cpu_to_le32(val);
3188 }
3177 3189
3178 for (i = 0; i < rv2p_code_len; i += 8) { 3190 for (i = 0; i < rv2p_code_len; i += 8) {
3179 REG_WR(bp, BNX2_RV2P_INSTR_HIGH, le32_to_cpu(*rv2p_code)); 3191 REG_WR(bp, BNX2_RV2P_INSTR_HIGH, le32_to_cpu(*rv2p_code));
@@ -4215,13 +4227,6 @@ bnx2_init_remote_phy(struct bnx2 *bp)
4215 if (netif_running(bp->dev)) { 4227 if (netif_running(bp->dev)) {
4216 u32 sig; 4228 u32 sig;
4217 4229
4218 if (val & BNX2_LINK_STATUS_LINK_UP) {
4219 bp->link_up = 1;
4220 netif_carrier_on(bp->dev);
4221 } else {
4222 bp->link_up = 0;
4223 netif_carrier_off(bp->dev);
4224 }
4225 sig = BNX2_DRV_ACK_CAP_SIGNATURE | 4230 sig = BNX2_DRV_ACK_CAP_SIGNATURE |
4226 BNX2_FW_CAP_REMOTE_PHY_CAPABLE; 4231 BNX2_FW_CAP_REMOTE_PHY_CAPABLE;
4227 bnx2_shmem_wr(bp, BNX2_DRV_ACK_CAP_MB, sig); 4232 bnx2_shmem_wr(bp, BNX2_DRV_ACK_CAP_MB, sig);
@@ -4878,6 +4883,8 @@ bnx2_init_nic(struct bnx2 *bp)
4878 spin_lock_bh(&bp->phy_lock); 4883 spin_lock_bh(&bp->phy_lock);
4879 bnx2_init_phy(bp); 4884 bnx2_init_phy(bp);
4880 bnx2_set_link(bp); 4885 bnx2_set_link(bp);
4886 if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP)
4887 bnx2_remote_phy_event(bp);
4881 spin_unlock_bh(&bp->phy_lock); 4888 spin_unlock_bh(&bp->phy_lock);
4882 return 0; 4889 return 0;
4883} 4890}
@@ -4920,7 +4927,7 @@ bnx2_test_registers(struct bnx2 *bp)
4920 { 0x0c08, BNX2_FL_NOT_5709, 0x0f0ff073, 0x00000000 }, 4927 { 0x0c08, BNX2_FL_NOT_5709, 0x0f0ff073, 0x00000000 },
4921 4928
4922 { 0x1000, 0, 0x00000000, 0x00000001 }, 4929 { 0x1000, 0, 0x00000000, 0x00000001 },
4923 { 0x1004, 0, 0x00000000, 0x000f0001 }, 4930 { 0x1004, BNX2_FL_NOT_5709, 0x00000000, 0x000f0001 },
4924 4931
4925 { 0x1408, 0, 0x01c00800, 0x00000000 }, 4932 { 0x1408, 0, 0x01c00800, 0x00000000 },
4926 { 0x149c, 0, 0x8000ffff, 0x00000000 }, 4933 { 0x149c, 0, 0x8000ffff, 0x00000000 },
diff --git a/drivers/net/bnx2_fw2.h b/drivers/net/bnx2_fw2.h
index e6ffa2769f3d..ed0514cba0ee 100644
--- a/drivers/net/bnx2_fw2.h
+++ b/drivers/net/bnx2_fw2.h
@@ -3173,251 +3173,267 @@ static struct fw_info bnx2_rxp_fw_09 = {
3173}; 3173};
3174 3174
3175static u8 bnx2_xi_rv2p_proc1[] = { 3175static u8 bnx2_xi_rv2p_proc1[] = {
3176 /* Date: 01/14/2008 15:44 */ 3176 /* Date: 04/25/2008 22:02 */
3177 0xc5, 0x56, 0xcd, 0x6b, 0x13, 0x51, 0x10, 0x9f, 0xdd, 0x7c, 0x6c, 0x9a, 3177 0xbd, 0x56, 0x4f, 0x68, 0x1c, 0x55, 0x18, 0xff, 0x76, 0x76, 0x77, 0x66,
3178 0x6c, 0xb2, 0xa1, 0x6a, 0x09, 0x35, 0xd2, 0x58, 0x7a, 0x30, 0x6d, 0xc4, 3178 0x33, 0x3b, 0xbb, 0xb3, 0xd8, 0x34, 0x4c, 0xb7, 0x2b, 0x59, 0x83, 0x97,
3179 0x56, 0x3d, 0x78, 0x28, 0x54, 0x7a, 0x11, 0xac, 0xa7, 0x1e, 0x44, 0xc4, 3179 0xdd, 0x6c, 0x69, 0xa2, 0x15, 0x04, 0x53, 0x5a, 0x72, 0x09, 0xd8, 0x9e,
3180 0xcf, 0x20, 0x05, 0xf5, 0x8f, 0x70, 0x51, 0xab, 0x20, 0x78, 0x28, 0x68, 3180 0x02, 0xb5, 0x52, 0x84, 0xb6, 0x8b, 0xf4, 0x52, 0x5a, 0x28, 0x78, 0x11,
3181 0xb4, 0x7e, 0xa0, 0x27, 0x15, 0xf1, 0x90, 0x1c, 0x04, 0x05, 0x45, 0x50, 3181 0x84, 0x0e, 0x6d, 0x93, 0x82, 0xe8, 0x61, 0xc1, 0x06, 0x12, 0x44, 0xa3,
3182 0xf0, 0xa4, 0x37, 0x41, 0xbd, 0x54, 0xc5, 0x0f, 0xf0, 0xe2, 0x45, 0x8f, 3182 0x07, 0x95, 0x60, 0x61, 0x07, 0x3c, 0x78, 0x10, 0x14, 0x15, 0x11, 0x6c,
3183 0xda, 0xf8, 0xde, 0xcc, 0xef, 0xd9, 0xdd, 0x4d, 0xd2, 0x14, 0x0f, 0x1a, 3183 0x0f, 0x85, 0x88, 0xf6, 0xd2, 0x54, 0x4b, 0x0b, 0x1e, 0x5b, 0x3c, 0xd6,
3184 0x68, 0x7f, 0xec, 0xdb, 0xdf, 0x9b, 0x37, 0xf3, 0x9b, 0x79, 0x33, 0x9b, 3184 0x8c, 0xef, 0xfb, 0xf3, 0x92, 0x99, 0x97, 0x9d, 0x24, 0xa7, 0x2e, 0xb4,
3185 0x27, 0x22, 0x9b, 0xfc, 0xc6, 0x80, 0x42, 0x72, 0xad, 0x58, 0x4a, 0x81, 3185 0x3f, 0xbe, 0x37, 0xdf, 0xbf, 0xf7, 0xfd, 0xf9, 0xbd, 0xd4, 0x00, 0xc0,
3186 0x45, 0x74, 0xcf, 0x65, 0xf4, 0x37, 0x91, 0xfc, 0x46, 0x04, 0xfc, 0x91, 3186 0x82, 0x30, 0x1a, 0x55, 0x08, 0x65, 0x2b, 0x5f, 0x52, 0x90, 0x03, 0xf8,
3187 0xbc, 0xfa, 0xff, 0x9d, 0x26, 0x4a, 0x1a, 0x63, 0x34, 0xb1, 0x5e, 0xe3, 3187 0x1a, 0xf8, 0x57, 0xf4, 0x48, 0x0e, 0x0f, 0x8a, 0x3c, 0xce, 0x10, 0x8e,
3188 0x24, 0x3d, 0x29, 0x15, 0x14, 0xfe, 0x6a, 0x92, 0xaf, 0x9f, 0x87, 0xea, 3188 0xd7, 0xd4, 0xff, 0x17, 0xe0, 0x48, 0x13, 0x31, 0x0f, 0x47, 0x5e, 0x40,
3189 0x0f, 0x1a, 0x19, 0xb6, 0xfb, 0x0e, 0xfb, 0xdf, 0xc4, 0x04, 0xb7, 0x55, 3189 0x3c, 0x0c, 0xdf, 0x37, 0x03, 0x85, 0xff, 0xc5, 0x10, 0xa2, 0x3c, 0xdc,
3190 0x52, 0x62, 0x07, 0x48, 0x1b, 0xf3, 0x0c, 0xaf, 0xe6, 0xf4, 0x73, 0xd1, 3190 0xff, 0x36, 0x2a, 0x93, 0xff, 0x35, 0xb1, 0xff, 0x33, 0xcf, 0xf8, 0x6a,
3191 0xf2, 0x37, 0xe2, 0x7c, 0x5b, 0xd6, 0x17, 0xe6, 0x3c, 0xbd, 0x4e, 0xef, 3191 0xa7, 0xc4, 0x7e, 0x04, 0xe1, 0x40, 0x8d, 0x60, 0xb5, 0x87, 0xf2, 0x89,
3192 0x27, 0xf5, 0xb3, 0x97, 0x3e, 0xdd, 0x48, 0xb1, 0x5d, 0x79, 0xdf, 0x9b, 3192 0x13, 0x60, 0xa3, 0x9f, 0x4f, 0x94, 0x02, 0xca, 0x8d, 0x5c, 0x78, 0x40,
3193 0x3e, 0xcd, 0xfb, 0x5c, 0x4b, 0xec, 0xa9, 0x3f, 0xde, 0xbf, 0x55, 0xd9, 3193 0xf2, 0xb2, 0x58, 0xef, 0x5e, 0xcf, 0xc7, 0x73, 0xb8, 0x3f, 0x8d, 0xf2,
3194 0x81, 0xdf, 0x24, 0x76, 0x0e, 0x96, 0xf4, 0xfa, 0x76, 0xf0, 0xc6, 0xc1, 3194 0x3e, 0xf7, 0x5a, 0x0f, 0x31, 0x80, 0x73, 0x25, 0x8f, 0xef, 0x33, 0xca,
3195 0x2b, 0xb6, 0xf0, 0x16, 0xe6, 0x34, 0x3a, 0x54, 0xad, 0xe8, 0x78, 0x06, 3195 0x6e, 0xd7, 0xda, 0x68, 0xa7, 0x74, 0xdb, 0xe2, 0xb7, 0x88, 0x7e, 0xff,
3196 0x49, 0xe2, 0x49, 0xd0, 0x4c, 0xca, 0x15, 0x9d, 0x06, 0x84, 0xfd, 0x6e, 3196 0x89, 0xd9, 0x2f, 0xfa, 0x4b, 0xfa, 0x69, 0x28, 0x3f, 0x78, 0x6e, 0x4b,
3197 0x58, 0xef, 0x57, 0xbe, 0x0d, 0x6b, 0xde, 0x82, 0x8a, 0xdb, 0xc4, 0x1b, 3197 0x5e, 0xb6, 0x91, 0x97, 0xad, 0xf2, 0x90, 0x3a, 0x80, 0xce, 0x03, 0x71,
3198 0xe6, 0x39, 0x15, 0x63, 0x57, 0xf3, 0xde, 0x2a, 0x9e, 0x89, 0x2f, 0x18, 3198 0xaf, 0x8a, 0x8b, 0x7e, 0x1f, 0xcb, 0xbd, 0x01, 0x4e, 0x37, 0xc5, 0x7f,
3199 0x57, 0x26, 0x10, 0x57, 0x24, 0xde, 0x96, 0xf8, 0x82, 0x7a, 0xa5, 0xda, 3199 0x84, 0xe8, 0xe5, 0xd8, 0x9f, 0xfa, 0x27, 0xf7, 0xd8, 0xea, 0x47, 0xd7,
3200 0xf8, 0xaf, 0xcf, 0x51, 0xbe, 0xf0, 0x39, 0x49, 0xe8, 0x9c, 0x8c, 0xec, 3200 0x29, 0x9d, 0xbf, 0xd3, 0xd1, 0xdf, 0x75, 0x3f, 0x30, 0xce, 0x1d, 0x15,
3201 0x4b, 0x76, 0x88, 0xfb, 0x93, 0x35, 0xb3, 0x21, 0xec, 0x3f, 0x91, 0xb6, 3201 0x27, 0xa9, 0x0f, 0x3b, 0xe8, 0xff, 0xa6, 0xf4, 0xd3, 0x7e, 0xf9, 0xfc,
3202 0xf7, 0x54, 0xf9, 0x8d, 0xf5, 0x72, 0x3b, 0x1d, 0x12, 0xd0, 0xe1, 0x31, 3202 0xd7, 0xcd, 0xf3, 0xd6, 0xa0, 0xba, 0x15, 0x8d, 0xba, 0xfd, 0x28, 0x75,
3203 0xe2, 0x9b, 0xa2, 0x21, 0xbb, 0xc0, 0xef, 0xe3, 0xbc, 0x7f, 0xad, 0xf2, 3203 0x9b, 0x81, 0x17, 0xad, 0x80, 0xf4, 0x0a, 0x80, 0xb8, 0x5f, 0x25, 0x80,
3204 0x47, 0xe3, 0x3a, 0xe0, 0x7a, 0xe0, 0x01, 0xe0, 0x7e, 0xe0, 0x1a, 0xe0, 3204 0xf8, 0xbc, 0xe0, 0x45, 0xc1, 0xcf, 0x04, 0x97, 0x05, 0xf7, 0x0a, 0x0e,
3205 0x6a, 0xe0, 0x2a, 0x60, 0x2f, 0xf0, 0x32, 0x30, 0x0f, 0xf4, 0x80, 0x39, 3205 0x0b, 0xee, 0x11, 0x7c, 0x4e, 0xf0, 0x6f, 0xc1, 0x9a, 0xa0, 0x2f, 0x58,
3206 0xe0, 0x05, 0xa0, 0x0b, 0xcc, 0x00, 0x6b, 0xc0, 0xab, 0xc0, 0x14, 0xf0, 3206 0x15, 0xbc, 0x27, 0xe8, 0x09, 0x96, 0x0d, 0x7f, 0x75, 0xc1, 0x92, 0x60,
3207 0x28, 0xf0, 0x21, 0xf0, 0x31, 0xf0, 0x0b, 0xf0, 0x1c, 0xd0, 0xb1, 0x60, 3207 0x24, 0xf8, 0x9a, 0x61, 0xef, 0xe6, 0x18, 0x57, 0x45, 0x3e, 0x28, 0xf2,
3208 0x0f, 0xa8, 0x7e, 0x3e, 0xee, 0x47, 0x48, 0xa7, 0xeb, 0xa8, 0x7f, 0xad, 3208 0x49, 0x91, 0xb1, 0xa0, 0x32, 0xf7, 0xa9, 0x7a, 0x7d, 0xbe, 0xd1, 0xdf,
3209 0x33, 0xde, 0x97, 0x0d, 0x0f, 0xf9, 0x65, 0x9d, 0x2e, 0x83, 0xd7, 0x5b, 3209 0xd5, 0x9e, 0x7c, 0x6f, 0x69, 0xbd, 0x12, 0xd5, 0x0f, 0xda, 0x49, 0xfd,
3210 0xbf, 0x19, 0xb9, 0x27, 0xa5, 0xae, 0xf7, 0x23, 0x9a, 0x37, 0x8f, 0xe3, 3210 0x8f, 0xb7, 0xd1, 0x67, 0xb5, 0xe9, 0xd6, 0x20, 0xbb, 0x1b, 0x31, 0xe7,
3211 0x39, 0xb4, 0xc3, 0xe3, 0x73, 0x72, 0x49, 0x59, 0x37, 0x6e, 0xed, 0xf1, 3211 0xf1, 0x91, 0xd8, 0x07, 0xfd, 0xef, 0x32, 0xf6, 0x68, 0xaa, 0x63, 0xce,
3212 0x04, 0x8f, 0xa4, 0x05, 0x3f, 0xa7, 0x7b, 0xd4, 0xff, 0x66, 0x73, 0x26, 3212 0xd7, 0xa0, 0x3d, 0x7a, 0x45, 0xf6, 0xe8, 0xd0, 0x96, 0xf9, 0xe5, 0x39,
3213 0x23, 0xcf, 0x87, 0xb3, 0x46, 0x67, 0x63, 0xc7, 0xf8, 0xd3, 0xcd, 0x8f, 3213 0x3d, 0x2a, 0xf6, 0x53, 0x32, 0x9f, 0x8d, 0x0c, 0xbd, 0x30, 0xb1, 0xaf,
3214 0x4e, 0xe7, 0x19, 0xbf, 0xba, 0x9d, 0x2b, 0x58, 0xb5, 0xc3, 0xf1, 0x5f, 3214 0x14, 0x2f, 0x63, 0x1f, 0x6e, 0xe6, 0xba, 0x1d, 0x8c, 0x5b, 0x94, 0xb8,
3215 0x19, 0x15, 0x8c, 0x8f, 0x31, 0x54, 0xdc, 0x64, 0x5c, 0xe3, 0x56, 0xf7, 3215 0x59, 0xf9, 0xa1, 0xbd, 0xcc, 0x6f, 0x4b, 0xcf, 0x71, 0x7a, 0x7e, 0x79,
3216 0xb9, 0x39, 0x47, 0xa3, 0x5b, 0xa8, 0xf1, 0x7d, 0x89, 0x53, 0x2d, 0xa9, 3216 0x0e, 0x6d, 0x63, 0x0e, 0x2f, 0xed, 0xd0, 0x87, 0xb2, 0x51, 0xcf, 0xf3,
3217 0xed, 0xfe, 0x6c, 0x9e, 0x17, 0x5e, 0xff, 0xe1, 0x97, 0x8c, 0x85, 0x2b, 3217 0x4a, 0x9f, 0x45, 0xcb, 0x62, 0x5c, 0x62, 0xec, 0x78, 0x76, 0x01, 0xf1,
3218 0x2f, 0x84, 0xff, 0xba, 0xe4, 0x32, 0xee, 0x1e, 0xa1, 0xc8, 0xcf, 0xbc, 3218 0x90, 0xf7, 0x0b, 0xfb, 0x1b, 0xa5, 0x7b, 0x78, 0xc1, 0x02, 0xed, 0x6d,
3219 0x97, 0xfb, 0xe8, 0xb3, 0xdf, 0x3f, 0x2c, 0xbf, 0x61, 0xce, 0xc1, 0xbe, 3219 0x01, 0x16, 0xec, 0x21, 0x85, 0x4f, 0xe3, 0x0f, 0x59, 0xaf, 0x5e, 0xbc,
3220 0xe3, 0x26, 0x8f, 0x79, 0xf6, 0x73, 0x90, 0xe4, 0x79, 0xba, 0x2c, 0xef, 3220 0x4d, 0x18, 0x2c, 0xdd, 0x62, 0xfd, 0x3f, 0x9a, 0x9c, 0xf7, 0x1b, 0xe3,
3221 0xa7, 0xcb, 0xb8, 0xcf, 0x83, 0xe1, 0x7a, 0x90, 0x7b, 0x11, 0x43, 0xbe, 3221 0x60, 0xfc, 0xf4, 0x77, 0xd9, 0x77, 0x1f, 0xe5, 0x7f, 0x73, 0x61, 0xa4,
3222 0xf7, 0xe2, 0x5e, 0x44, 0xef, 0x71, 0xaa, 0x7e, 0x73, 0x2e, 0x58, 0x2f, 3222 0xe3, 0x88, 0xdd, 0x79, 0xbd, 0x47, 0xfc, 0xbb, 0x62, 0xd7, 0xa8, 0x6e,
3223 0x05, 0xaa, 0x8e, 0xc1, 0x9f, 0x96, 0x3c, 0x9b, 0xbe, 0x6c, 0xea, 0x9d, 3223 0xef, 0x47, 0x24, 0x0e, 0x7b, 0xf3, 0xcc, 0xaf, 0x1f, 0x44, 0xfa, 0x3e,
3224 0x97, 0xeb, 0x7e, 0x2c, 0xa4, 0xdf, 0x76, 0xaa, 0x04, 0xf3, 0x64, 0xb5, 3224 0xc2, 0x2b, 0x6d, 0xb6, 0xab, 0x50, 0x9c, 0x3d, 0xfd, 0x65, 0x63, 0x3e,
3225 0xa9, 0x97, 0x6e, 0xe7, 0x84, 0xec, 0xe5, 0x54, 0x06, 0xa8, 0xb5, 0x8e, 3225 0x9a, 0xbb, 0xe2, 0xd7, 0x27, 0xf1, 0x26, 0xbf, 0x26, 0xef, 0xaf, 0xf9,
3226 0x1d, 0xc4, 0x35, 0x81, 0x3a, 0x5e, 0xdb, 0x52, 0xc7, 0xa6, 0xdf, 0x4b, 3226 0xb5, 0x04, 0x67, 0x66, 0x7c, 0x8a, 0x57, 0xb5, 0xd9, 0xcd, 0x9b, 0x3e,
3227 0x3d, 0x77, 0xea, 0x5f, 0x7f, 0xdf, 0xa7, 0x85, 0xe7, 0x07, 0xea, 0xd3, 3227 0xe3, 0xdb, 0x2e, 0xe3, 0x43, 0x17, 0xeb, 0x13, 0xc7, 0xe7, 0xca, 0x2c,
3228 0xf4, 0x43, 0xe8, 0xe4, 0x30, 0xaf, 0xb8, 0x70, 0x5f, 0xf2, 0x26, 0xfd, 3228 0x9f, 0xad, 0xe8, 0xbd, 0xd6, 0xf6, 0x3a, 0xaf, 0xed, 0xf2, 0xc1, 0xf8,
3229 0x5c, 0x15, 0xa3, 0x1f, 0xf6, 0xd3, 0x31, 0xf1, 0x0d, 0x04, 0xfb, 0xe7, 3229 0x3a, 0x8e, 0xce, 0x43, 0xc7, 0x4b, 0xcf, 0x43, 0x76, 0x5c, 0xc6, 0xae,
3230 0x50, 0x87, 0x7c, 0x05, 0xfb, 0x6e, 0x54, 0x97, 0x70, 0xdd, 0x4b, 0xfe, 3230 0x95, 0xae, 0xc3, 0xd2, 0x04, 0x63, 0x61, 0x12, 0xf3, 0xfa, 0x21, 0xde,
3231 0xd3, 0xd0, 0xa9, 0xbf, 0x4b, 0x5f, 0xe8, 0x01, 0x6f, 0xcd, 0x32, 0x3c, 3231 0xd8, 0xeb, 0x56, 0x8d, 0xf4, 0xc6, 0x80, 0xe5, 0x59, 0x99, 0xbf, 0x59,
3232 0xb1, 0x3b, 0x59, 0x0e, 0xf6, 0x11, 0xaf, 0x89, 0xfe, 0x87, 0x7d, 0x7d, 3232 0xda, 0x47, 0xc5, 0x37, 0x16, 0x62, 0x1d, 0x42, 0x7a, 0x6f, 0x2c, 0xf7,
3233 0xf5, 0x47, 0x1d, 0xf2, 0x30, 0xfe, 0x7f, 0xf3, 0x80, 0xf9, 0x52, 0xb4, 3233 0x67, 0x9a, 0x87, 0xbc, 0x9c, 0xab, 0xfa, 0x8f, 0xa5, 0xf7, 0x78, 0x8d,
3234 0x24, 0x0f, 0x09, 0x5a, 0x99, 0xbe, 0x84, 0xf8, 0xa9, 0x83, 0xbe, 0x49, 3234 0xe7, 0xad, 0x94, 0x9e, 0xd3, 0x46, 0x3c, 0x78, 0xfe, 0xdd, 0xfe, 0x72,
3235 0xe8, 0xf0, 0x6d, 0x71, 0x79, 0x7d, 0x33, 0xe0, 0x7d, 0x0d, 0xf0, 0xb8, 3235 0x6f, 0x50, 0x3f, 0x74, 0x7e, 0x01, 0x74, 0x27, 0xb3, 0xde, 0x09, 0xfd,
3236 0x2e, 0xc6, 0xe5, 0xfe, 0x39, 0xd5, 0x2f, 0x11, 0xdd, 0xc6, 0x2a, 0xba, 3236 0x3e, 0x6b, 0x9e, 0xa4, 0xe3, 0x7e, 0x98, 0x4f, 0xdd, 0xfb, 0x28, 0x74,
3237 0xaf, 0x9c, 0xa0, 0x06, 0xe2, 0x7a, 0x1b, 0x8a, 0x2f, 0xab, 0xfc, 0x93, 3237 0x06, 0xf9, 0xff, 0x46, 0xbf, 0x7b, 0x03, 0xf6, 0x76, 0xa7, 0xb8, 0x29,
3238 0xef, 0x84, 0x3b, 0x0d, 0xa3, 0x83, 0xbc, 0x2e, 0x55, 0x04, 0x6f, 0x33, 3238 0xff, 0x55, 0xb5, 0x39, 0xb0, 0x75, 0xef, 0x1c, 0x63, 0x4f, 0x9f, 0xae,
3239 0x3f, 0x1f, 0xd0, 0x23, 0xac, 0x9b, 0xe8, 0x91, 0xa7, 0x5b, 0x7f, 0xfa, 3239 0xf3, 0x9e, 0x36, 0xb6, 0xcc, 0xa7, 0xe6, 0xaf, 0xe6, 0xb6, 0xfc, 0xf5,
3240 0x8d, 0xc7, 0xf6, 0x46, 0xd1, 0xaf, 0x0f, 0xa1, 0x6f, 0x7e, 0x48, 0x4b, 3240 0xac, 0xf8, 0xca, 0x02, 0xe6, 0x2b, 0x7c, 0x4f, 0xd2, 0x79, 0x3a, 0xfa,
3241 0x5f, 0xae, 0x4e, 0x71, 0xff, 0xa4, 0x3e, 0xf4, 0xcf, 0x6a, 0x56, 0x9e, 3241 0x9e, 0x06, 0x2f, 0xf1, 0xfd, 0xee, 0xaf, 0xef, 0x8e, 0xdf, 0x92, 0x75,
3242 0xfb, 0xb3, 0xf2, 0x1d, 0x36, 0xea, 0xb8, 0xcc, 0xeb, 0xcf, 0x0a, 0xf6, 3242 0x1a, 0xc4, 0x6f, 0xae, 0xc1, 0x57, 0xbf, 0xaf, 0x6f, 0xf2, 0x1b, 0x7e,
3243 0x65, 0xf4, 0xbe, 0x02, 0x7d, 0xdc, 0xc5, 0xf4, 0xca, 0xbc, 0x2b, 0x7d, 3243 0x5f, 0x59, 0xe1, 0xfe, 0xbd, 0x97, 0x98, 0xdf, 0x64, 0xdd, 0x87, 0xa4,
3244 0x74, 0xfe, 0x05, 0xfa, 0xba, 0x67, 0x74, 0x42, 0xbc, 0x5b, 0xf4, 0x7a, 3244 0xee, 0x4a, 0x8f, 0xec, 0x6f, 0x1b, 0xf6, 0xba, 0xff, 0xef, 0x08, 0x6f,
3245 0x1f, 0x7f, 0xf2, 0x2c, 0xe9, 0xab, 0x38, 0xc3, 0xe2, 0xdf, 0x0d, 0x78, 3245 0x5a, 0x53, 0x3c, 0x7f, 0x4e, 0xf7, 0x91, 0xd1, 0x97, 0xc9, 0x0e, 0xee,
3246 0x5f, 0x32, 0xfb, 0x06, 0xb4, 0x9e, 0x4f, 0x16, 0xcd, 0xdc, 0x18, 0xdc, 3246 0xd5, 0x65, 0x88, 0xa4, 0x6e, 0x77, 0x53, 0xf5, 0xab, 0x08, 0x4f, 0x38,
3247 0xa1, 0xfd, 0xf1, 0x28, 0xe7, 0x48, 0x3e, 0x05, 0x15, 0xcf, 0x76, 0xf4, 3247 0xf0, 0x55, 0xa4, 0xeb, 0xac, 0xfb, 0xc8, 0xf8, 0x25, 0xe9, 0xd7, 0x76,
3248 0xb6, 0xe2, 0xac, 0x2d, 0xcf, 0xb3, 0x27, 0xd9, 0xcc, 0xae, 0x59, 0xb3, 3248 0xa8, 0x77, 0x0d, 0xbe, 0xd8, 0xe0, 0x41, 0x9f, 0xfc, 0x4d, 0x08, 0xaf,
3249 0x3e, 0xc9, 0x05, 0x3a, 0x7d, 0xf7, 0x19, 0xaf, 0xe7, 0x1a, 0x31, 0x59, 3249 0x9c, 0x91, 0xfd, 0xfe, 0xcb, 0x65, 0xfe, 0xe8, 0x1e, 0xa3, 0x3d, 0x87,
3250 0x77, 0xa6, 0x8c, 0x1e, 0x1e, 0xc7, 0x57, 0x13, 0x3d, 0xf6, 0x5d, 0x14, 3250 0x11, 0xd9, 0xf3, 0x6e, 0x85, 0xe5, 0x7a, 0x85, 0x79, 0x71, 0xc2, 0xf1,
3251 0xdc, 0x4b, 0x3b, 0x19, 0xd3, 0x35, 0x57, 0xe6, 0xca, 0xbc, 0x9b, 0x62, 3251 0x48, 0xaf, 0x5e, 0x61, 0x1c, 0x29, 0xa3, 0x5d, 0x00, 0x0f, 0x8e, 0x93,
3252 0x24, 0xd6, 0xc3, 0xde, 0x2c, 0xf3, 0x21, 0x81, 0xbe, 0xde, 0x13, 0xc8, 3252 0x7a, 0x67, 0xd1, 0x63, 0x7e, 0x5f, 0xbc, 0x25, 0xfc, 0xe3, 0xeb, 0xfa,
3253 0x53, 0x74, 0xde, 0xae, 0x34, 0x5f, 0xc1, 0x39, 0x60, 0xe6, 0x43, 0xb4, 3253 0xc9, 0x7d, 0x5f, 0xc6, 0xf3, 0x11, 0xb5, 0xcf, 0xc9, 0x7e, 0x28, 0x9d,
3254 0xdf, 0x67, 0x51, 0x67, 0xd7, 0xba, 0xd4, 0xa3, 0xe9, 0x9f, 0x97, 0x16, 3254 0x36, 0xe7, 0xf7, 0xa9, 0x64, 0xdf, 0xf4, 0x93, 0xf5, 0xd6, 0xf3, 0xbd,
3255 0xe5, 0x1e, 0xb4, 0x9b, 0xb3, 0x1a, 0x73, 0x1d, 0xbe, 0x0f, 0x8a, 0xa8, 3255 0x9c, 0xd1, 0xa7, 0x99, 0x58, 0xf3, 0xdf, 0xd8, 0x0c, 0xe6, 0xeb, 0x43,
3256 0x3f, 0x33, 0x0f, 0xdb, 0x7d, 0x07, 0x08, 0x7f, 0x65, 0xf3, 0x3f, 0xdf, 3256 0xd5, 0xe1, 0xf9, 0x60, 0x54, 0x7e, 0x2c, 0x07, 0xcd, 0x1a, 0x73, 0xc2,
3257 0x61, 0xfe, 0xff, 0xb3, 0x39, 0x5f, 0x58, 0xca, 0xa3, 0xa9, 0xd3, 0x60, 3257 0x27, 0x73, 0x57, 0xc8, 0xcd, 0xf1, 0x39, 0x7d, 0x3e, 0x4d, 0x0b, 0x32,
3258 0x1e, 0x83, 0xf5, 0x1a, 0x9d, 0xc3, 0xcb, 0xcd, 0xdf, 0x1c, 0x74, 0x3e, 3258 0xbb, 0xf2, 0x13, 0x9d, 0x57, 0xa3, 0x3c, 0x9f, 0x3b, 0xc7, 0x74, 0xbd,
3259 0x06, 0x9d, 0xe3, 0x94, 0x88, 0xb1, 0x30, 0x6e, 0xfc, 0x14, 0xdb, 0xb5, 3259 0x7c, 0xba, 0xff, 0x02, 0xd7, 0xeb, 0xad, 0x1b, 0x8c, 0xa7, 0xe0, 0x75,
3260 0x67, 0x6d, 0xa6, 0xbb, 0x89, 0x33, 0x96, 0xc6, 0x9c, 0x7b, 0x46, 0x78, 3260 0x42, 0x77, 0xc1, 0x63, 0x7e, 0x5c, 0xf4, 0x4a, 0x84, 0x40, 0xf5, 0xb2,
3261 0x71, 0x59, 0x2f, 0x18, 0x3c, 0x7b, 0x4a, 0xbe, 0xfb, 0x6c, 0xfa, 0x0d, 3261 0x5e, 0xe2, 0x77, 0xad, 0x28, 0xef, 0xd1, 0x50, 0xa2, 0x8f, 0xe6, 0xfb,
3262 0x6d, 0x29, 0x98, 0xe1, 0x30, 0x0d, 0x00, 0x00, 0x00 }; 3262 0xb1, 0xdb, 0x7e, 0x26, 0xf9, 0x54, 0xbf, 0x6b, 0x39, 0xe3, 0xef, 0xc8,
3263 0x8a, 0x31, 0x9f, 0xef, 0x66, 0xcc, 0x67, 0x33, 0x63, 0xbe, 0x4d, 0x5e,
3264 0xb9, 0x24, 0x7b, 0x57, 0x80, 0x62, 0x9e, 0x1e, 0x26, 0xaf, 0x70, 0x95,
3265 0xfa, 0x6b, 0xcd, 0xf1, 0xbb, 0xee, 0x15, 0xe7, 0x73, 0x54, 0x37, 0x6f,
3266 0x9e, 0xf5, 0x0a, 0x7c, 0x1e, 0x68, 0xbc, 0x7e, 0x95, 0xdf, 0x4f, 0x0b,
3267 0xfe, 0x07, 0x89, 0x6e, 0x1e, 0x13, 0x00, 0x0d, 0x00, 0x00, 0x00 };
3263 3268
3264static u8 bnx2_xi_rv2p_proc2[] = { 3269static u8 bnx2_xi_rv2p_proc2[] = {
3265 /* Date: 01/14/2008 15:44 */ 3270 /* Date: 04/25/2008 22:02 */
3266 0xad, 0x58, 0x5d, 0x6c, 0xd3, 0x55, 0x14, 0xbf, 0xfd, 0x58, 0xdb, 0x75, 3271#define XI_RV2P_PROC2_MAX_BD_PAGE_LOC 5
3267 0xff, 0xb6, 0x63, 0x9b, 0xdd, 0xa7, 0x6e, 0x6e, 0x61, 0x6c, 0xd8, 0xcd, 3272#define XI_RV2P_PROC2_BD_PAGE_SIZE_MSK 0xffff
3268 0xd1, 0x8d, 0x4f, 0x4d, 0x5c, 0x86, 0x19, 0x20, 0x26, 0x8c, 0x61, 0xd4, 3273#define XI_RV2P_PROC2_BD_PAGE_SIZE ((PAGE_SIZE / 16) - 1)
3269 0x37, 0xd8, 0x90, 0xb2, 0xb2, 0x8d, 0x2c, 0x8c, 0xf0, 0xc0, 0x8b, 0x0d, 3274 0xad, 0x58, 0x5b, 0x6c, 0x54, 0x55, 0x14, 0x3d, 0xf3, 0xe8, 0xcc, 0xed,
3270 0xd3, 0xf1, 0xd2, 0x07, 0x47, 0xb2, 0x0d, 0x8d, 0xc1, 0x45, 0x7d, 0x40, 3275 0xcc, 0x9d, 0x99, 0xd2, 0xd6, 0xe9, 0x8b, 0x48, 0x69, 0xa5, 0x74, 0x70,
3271 0x9f, 0xec, 0x83, 0x52, 0x30, 0xc6, 0xc4, 0xe8, 0x42, 0xf0, 0x01, 0x48, 3276 0x0a, 0x65, 0x5a, 0x1e, 0x3e, 0x12, 0x49, 0xd1, 0x02, 0x3e, 0x42, 0xa9,
3272 0x30, 0xc6, 0x68, 0x48, 0x08, 0xea, 0x32, 0x10, 0x75, 0x0c, 0xfb, 0x64, 3277 0x86, 0x98, 0x18, 0x03, 0x9d, 0x4a, 0xe9, 0x40, 0x4b, 0x2a, 0x25, 0x7c,
3273 0x98, 0xf7, 0x9e, 0xdf, 0xb9, 0xff, 0xfe, 0xff, 0x5d, 0x27, 0x18, 0xec, 3278 0xf0, 0xe3, 0x84, 0x62, 0xf9, 0x99, 0x44, 0x4b, 0x80, 0x16, 0x63, 0x48,
3274 0x43, 0x4f, 0xef, 0xbd, 0xe7, 0x9e, 0x7b, 0x3e, 0x7e, 0xe7, 0x9c, 0x7b, 3279 0x23, 0x3f, 0xc4, 0xbf, 0x26, 0x28, 0x45, 0x3f, 0x4c, 0x88, 0x36, 0x04,
3275 0x5b, 0x2c, 0x84, 0x70, 0x8a, 0x44, 0xaa, 0x56, 0x52, 0x61, 0x38, 0x5c, 3280 0x3e, 0xc0, 0x44, 0x63, 0xfc, 0x21, 0x12, 0xc4, 0x5a, 0xa0, 0xc1, 0x82,
3276 0x02, 0x9f, 0xb5, 0xc5, 0x44, 0xae, 0xa5, 0x7c, 0xf2, 0xbb, 0x40, 0xbc, 3281 0x36, 0xc6, 0x48, 0xeb, 0x3d, 0x7b, 0xed, 0x73, 0xe7, 0xde, 0xe9, 0x2d,
3277 0xe4, 0xac, 0xa0, 0xb1, 0x5b, 0x28, 0x1a, 0x12, 0x22, 0x61, 0xa5, 0xa5, 3282 0x8f, 0x48, 0x3f, 0x58, 0x9c, 0x73, 0xf7, 0x39, 0x67, 0xef, 0xb5, 0x1f,
3278 0x4c, 0xaf, 0x32, 0xfd, 0x9d, 0xe9, 0xe3, 0x0e, 0xd0, 0x2b, 0x3c, 0xde, 3283 0x67, 0x9f, 0x29, 0x10, 0x42, 0x78, 0x45, 0x7a, 0x64, 0x91, 0x81, 0x22,
3279 0xc2, 0xe3, 0x6b, 0x3c, 0xfe, 0x91, 0xe9, 0x46, 0x9e, 0xdf, 0xcc, 0x34, 3284 0xe8, 0xf6, 0x68, 0x06, 0xcc, 0x0a, 0x91, 0x57, 0x2a, 0xc7, 0xc2, 0x2d,
3280 0xc9, 0x74, 0x3b, 0xaf, 0xa7, 0x99, 0xca, 0x4f, 0xc2, 0x90, 0x5f, 0x72, 3285 0xf8, 0x6f, 0x59, 0x01, 0xc1, 0x0f, 0x23, 0xf2, 0xbb, 0x5f, 0xbc, 0xe5,
3281 0xb9, 0x59, 0xeb, 0x69, 0x60, 0xba, 0x19, 0xfa, 0xee, 0xa9, 0x53, 0x7c, 3286 0xc6, 0x77, 0xaf, 0x90, 0x18, 0x11, 0x22, 0x2d, 0xb1, 0x80, 0x31, 0xc6,
3282 0xf3, 0x4b, 0x59, 0x3e, 0xcc, 0x5f, 0x9f, 0x00, 0xad, 0xc5, 0xae, 0x8f, 3287 0xe8, 0x72, 0x01, 0x4b, 0x18, 0x5f, 0x61, 0x14, 0x8c, 0xba, 0x1b, 0xe8,
3283 0x13, 0x4f, 0xeb, 0xfd, 0x20, 0x7d, 0x01, 0xd0, 0x7e, 0xb6, 0xbf, 0x33, 3288 0x66, 0xf4, 0xaa, 0x79, 0x5e, 0xaf, 0xf1, 0x7c, 0x3b, 0xe3, 0x76, 0x9e,
3284 0x42, 0x24, 0xb9, 0xdf, 0x89, 0x71, 0x77, 0xa3, 0xf2, 0x43, 0x89, 0x70, 3289 0xff, 0xdd, 0x40, 0xa5, 0x97, 0x1c, 0x4f, 0xce, 0x8a, 0xb4, 0x8e, 0x6d,
3285 0x3b, 0x95, 0x9c, 0x56, 0x9f, 0xe7, 0x3c, 0xe6, 0x5f, 0x0d, 0x81, 0xbe, 3290 0x63, 0x6a, 0x5e, 0x27, 0x48, 0xc7, 0xa0, 0xf7, 0x9b, 0x95, 0xb4, 0xce,
3286 0xe6, 0x07, 0xfd, 0xc5, 0x5f, 0x28, 0xbf, 0x97, 0x96, 0x62, 0x45, 0x2c, 3291 0x41, 0x4e, 0xce, 0xdf, 0x98, 0x55, 0xfb, 0x1d, 0xf4, 0xc8, 0xf1, 0x2f,
3287 0xdf, 0x60, 0xb5, 0x8b, 0xb0, 0x7f, 0xd6, 0x80, 0x1e, 0x2f, 0xd7, 0x41, 3292 0xc6, 0xd8, 0x25, 0x87, 0xc5, 0x51, 0x6c, 0x53, 0x5c, 0x9a, 0x91, 0xfb,
3288 0xbf, 0xef, 0x9f, 0x52, 0xf3, 0x2e, 0x91, 0x60, 0x39, 0x42, 0x68, 0x3d, 3293 0x78, 0xc4, 0xd0, 0x80, 0x46, 0xac, 0x1c, 0xd7, 0x31, 0x4e, 0x13, 0x1f,
3289 0x79, 0x7d, 0x10, 0xfb, 0x56, 0xad, 0xc1, 0xea, 0x5b, 0x31, 0x8c, 0xab, 3294 0x2e, 0x63, 0xcc, 0xfb, 0x31, 0x96, 0x85, 0x70, 0xee, 0xd6, 0x4a, 0x9c,
3290 0x3f, 0x28, 0xa6, 0xb8, 0x9c, 0x4e, 0x69, 0xfe, 0x7c, 0x72, 0xdd, 0x52, 3295 0xf7, 0xd3, 0xb3, 0x90, 0x4b, 0x47, 0x14, 0xa1, 0xf8, 0xbe, 0x48, 0xf0,
3291 0x2e, 0xe4, 0x8b, 0x7a, 0x1f, 0x29, 0x93, 0x88, 0x80, 0x8a, 0x96, 0xdc, 3296 0xf7, 0xdd, 0x72, 0x3c, 0xe5, 0x2a, 0x72, 0x81, 0x57, 0xbf, 0x50, 0x7a,
3292 0x73, 0x20, 0x7f, 0x6a, 0xb5, 0x9a, 0x77, 0x8a, 0x5e, 0x97, 0x9a, 0xf7, 3297 0x42, 0xee, 0xea, 0x40, 0xae, 0x3c, 0x0d, 0x3f, 0x4f, 0xaf, 0x50, 0x76,
3293 0x88, 0xde, 0xb8, 0xf6, 0x2f, 0xd6, 0x63, 0x1e, 0x22, 0x15, 0x7d, 0xe3, 3298 0x00, 0xda, 0x42, 0xc0, 0xa4, 0x07, 0xb8, 0x2e, 0x4e, 0x90, 0x69, 0x67,
3294 0xca, 0xce, 0x90, 0xd8, 0xe7, 0x0c, 0x11, 0x3f, 0xfc, 0xe2, 0xf2, 0x19, 3299 0x47, 0x36, 0xd7, 0x48, 0x3d, 0x0a, 0x85, 0xd7, 0x2d, 0xf7, 0x5b, 0xa1,
3295 0x9f, 0x81, 0xff, 0xcb, 0x5a, 0x83, 0x6c, 0x89, 0xb5, 0x63, 0x5f, 0x59, 3300 0xf9, 0xce, 0x61, 0xfe, 0x6d, 0xd6, 0xeb, 0xbd, 0x00, 0xf0, 0x46, 0x20,
3296 0x14, 0x74, 0x32, 0x5a, 0xa0, 0x48, 0x24, 0x36, 0x4a, 0xc3, 0xd6, 0x9b, 3301 0xdf, 0xf8, 0x77, 0x76, 0xb6, 0x23, 0x68, 0xb7, 0x2b, 0x1d, 0xc4, 0xfa,
3297 0xeb, 0x7c, 0xc4, 0x97, 0x68, 0xd1, 0xf1, 0xd3, 0xf1, 0x52, 0x71, 0xfc, 3302 0x31, 0xdd, 0xc9, 0x3e, 0xcf, 0x03, 0xec, 0xc3, 0xba, 0x05, 0x4b, 0xf1,
3298 0x44, 0xc6, 0x91, 0xdd, 0xd2, 0x00, 0xbf, 0xfe, 0xba, 0x5a, 0xf1, 0x4b, 3303 0xf5, 0xe3, 0x0e, 0x8c, 0x2b, 0x4e, 0x49, 0x39, 0x9f, 0x18, 0x1a, 0x71,
3299 0xe7, 0xd6, 0xe3, 0x9c, 0xac, 0x7e, 0xd6, 0xf8, 0x7f, 0xf4, 0x1f, 0xe2, 3304 0xe2, 0x23, 0x77, 0x7f, 0x23, 0x4e, 0x23, 0x38, 0x47, 0x54, 0x69, 0xa4,
3300 0xaf, 0xe4, 0x75, 0xb2, 0x5f, 0xea, 0xa4, 0x5f, 0x14, 0xad, 0x71, 0x24, 3305 0x54, 0x3a, 0x0e, 0x14, 0x75, 0x8e, 0xfc, 0x88, 0xe3, 0x4b, 0xe4, 0xbc,
3301 0x5a, 0xec, 0xf1, 0xb8, 0x3e, 0x11, 0xa2, 0xdf, 0xb7, 0xba, 0x8a, 0xc9, 3306 0x5b, 0xb4, 0x7a, 0x74, 0x3a, 0xa7, 0x35, 0xa5, 0xe2, 0x02, 0xdf, 0x3b,
3302 0xaf, 0xbb, 0x30, 0x7f, 0xaa, 0xfb, 0x1c, 0xe2, 0xb1, 0x83, 0xec, 0x17, 3307 0x7c, 0x04, 0xa5, 0x6d, 0xfd, 0xd2, 0xde, 0x88, 0xd8, 0xee, 0x8e, 0x90,
3303 0xfe, 0x37, 0x3e, 0xc5, 0xae, 0xbe, 0x80, 0x1a, 0xbf, 0xd2, 0x11, 0xbb, 3308 0x3c, 0xf8, 0xf1, 0x68, 0xfa, 0x97, 0x90, 0xff, 0x66, 0x91, 0x4e, 0x36,
3304 0x80, 0xf5, 0x82, 0x31, 0xf8, 0x75, 0x17, 0x4b, 0xdd, 0xe1, 0x72, 0x28, 3309 0x75, 0x34, 0x60, 0x5d, 0x71, 0x02, 0x78, 0x2c, 0x91, 0x27, 0x21, 0xde,
3305 0x92, 0xf4, 0x8c, 0xd1, 0xd0, 0x98, 0xa5, 0x75, 0x43, 0x9c, 0x4c, 0x61, 3310 0xd1, 0x4b, 0xc3, 0xe5, 0xd7, 0x57, 0x6a, 0x24, 0x97, 0xae, 0x53, 0x71,
3306 0xfd, 0x70, 0x91, 0x1a, 0xef, 0x8a, 0xcc, 0x63, 0x1c, 0x89, 0x8f, 0xf3, 3311 0xa7, 0xfc, 0x27, 0xfd, 0x3a, 0x64, 0xc6, 0x99, 0xa8, 0x06, 0xbf, 0xbf,
3307 0x46, 0x27, 0xfc, 0x70, 0xcb, 0x09, 0x79, 0x0c, 0x2f, 0xbf, 0x9b, 0xe2, 3312 0x2d, 0x91, 0xf2, 0x06, 0xc9, 0x55, 0x38, 0x27, 0xab, 0x9f, 0x35, 0x6e,
3308 0xe0, 0x10, 0x46, 0x37, 0xe8, 0x9b, 0xb4, 0xfe, 0xb7, 0x23, 0x49, 0x76, 3313 0x07, 0x2c, 0x71, 0xfb, 0x78, 0xf1, 0xb0, 0x8e, 0xf8, 0x59, 0xc7, 0x3c,
3309 0x77, 0x07, 0xdd, 0xe7, 0xc0, 0xc8, 0xb8, 0x36, 0x71, 0xab, 0x71, 0xff, 3314 0x55, 0x1a, 0x3c, 0x49, 0x5c, 0xe8, 0x4a, 0xd7, 0xd9, 0xfd, 0x74, 0x75,
3310 0xb0, 0xf8, 0x1d, 0x37, 0x34, 0x5e, 0xd9, 0xff, 0xec, 0xdf, 0xf7, 0x44, 3315 0x20, 0x42, 0xff, 0xbf, 0xd9, 0x54, 0x40, 0x3c, 0x6f, 0xc6, 0xfc, 0x91,
3311 0x2e, 0x4e, 0x41, 0xbb, 0x1b, 0x41, 0x3d, 0x0d, 0xb9, 0x78, 0xd5, 0xf8, 3316 0xe6, 0xb3, 0xf0, 0xd3, 0x26, 0xe2, 0x43, 0x04, 0x0e, 0x7d, 0x81, 0x55,
3312 0xb4, 0xfb, 0x99, 0xe3, 0x63, 0xc1, 0x0b, 0x11, 0x89, 0x13, 0x1b, 0x6e, 3317 0x6d, 0x14, 0xdf, 0xdd, 0x8d, 0x1d, 0x5f, 0x61, 0x9c, 0xf4, 0xc8, 0xf1,
3313 0x18, 0xa7, 0x95, 0xd2, 0x5f, 0x3a, 0xfe, 0x4a, 0x90, 0x57, 0x0c, 0xb2, 3318 0x6e, 0xbd, 0x7d, 0x14, 0xf2, 0x79, 0x7d, 0xe0, 0x7d, 0x33, 0x9f, 0xb2,
3314 0xbc, 0x38, 0xdb, 0x35, 0xc4, 0x76, 0xdd, 0xf1, 0x6b, 0xbf, 0x6a, 0x7b, 3319 0xc9, 0x43, 0xf9, 0x94, 0xf1, 0xf5, 0xd1, 0x50, 0x1f, 0xa3, 0xef, 0x05,
3315 0x40, 0x4f, 0xda, 0xec, 0x71, 0x48, 0x3c, 0xd9, 0x71, 0xc8, 0xfa, 0x24, 3320 0xe2, 0xf0, 0x08, 0xbe, 0xef, 0x09, 0x4a, 0x3b, 0xdf, 0x37, 0xf3, 0x2e,
3316 0xbf, 0xa9, 0xc7, 0x8f, 0xea, 0x06, 0x50, 0xd3, 0xce, 0x46, 0xc5, 0xe7, 3321 0xe5, 0xc3, 0xfa, 0xcc, 0x00, 0xf2, 0x66, 0xe2, 0x8c, 0x1c, 0x6f, 0x8b,
3317 0x89, 0x4e, 0xa7, 0xec, 0x38, 0xd4, 0xf9, 0xb8, 0xa7, 0x4e, 0xcb, 0x57, 3322 0x4f, 0x40, 0x3e, 0x9e, 0xea, 0xe7, 0x8d, 0xdd, 0xe0, 0xf1, 0xa6, 0x1b,
3318 0xb8, 0xcc, 0x48, 0x5c, 0x22, 0x6e, 0xa7, 0x53, 0xd6, 0xfc, 0xac, 0xca, 3323 0xf2, 0x1c, 0xa6, 0x01, 0x2f, 0xf9, 0xd1, 0x25, 0xf4, 0x66, 0xe0, 0x87,
3319 0x93, 0x9f, 0xf6, 0xbc, 0xd0, 0x7e, 0x39, 0x1c, 0xa0, 0x02, 0xd5, 0x71, 3324 0xf4, 0xfd, 0x5f, 0x57, 0x86, 0x78, 0xdb, 0x1a, 0xf6, 0x9e, 0x55, 0xfc,
3320 0x79, 0xce, 0x7e, 0x1e, 0xf0, 0xed, 0x35, 0xf1, 0x53, 0xb6, 0x81, 0xfd, 3325 0x30, 0x46, 0x94, 0x5d, 0xc0, 0x47, 0xcd, 0x83, 0xfe, 0x79, 0xf3, 0x80,
3321 0xc7, 0x34, 0xbc, 0x51, 0xc9, 0xeb, 0x61, 0xf9, 0x6d, 0x2c, 0xdf, 0xb0, 3326 0xfd, 0x19, 0x7b, 0x58, 0x1e, 0x00, 0x9b, 0x6b, 0x80, 0xbe, 0x6a, 0x29,
3322 0xe4, 0x9d, 0xd2, 0xaf, 0xcb, 0xcc, 0x37, 0x1d, 0xb7, 0x6c, 0xde, 0x69, 3327 0x9f, 0xff, 0x18, 0xf9, 0xc0, 0x7a, 0xcd, 0xc9, 0x37, 0xcc, 0x66, 0xe3,
3323 0xff, 0xd1, 0xf9, 0x91, 0xcb, 0x73, 0x6a, 0x7f, 0xf5, 0x03, 0xf2, 0x70, 3328 0x94, 0xc0, 0x88, 0x4f, 0x5b, 0xbc, 0x72, 0x7e, 0x2c, 0x36, 0xfc, 0xa0,
3324 0x93, 0x29, 0xef, 0x3b, 0x33, 0xdf, 0xd4, 0x7a, 0x91, 0x78, 0x8e, 0x87, 3329 0xe2, 0x4e, 0x6e, 0xe8, 0x17, 0xbb, 0x79, 0xdf, 0x14, 0xf3, 0xd1, 0xc5,
3325 0xf6, 0x7a, 0xf2, 0xa7, 0xac, 0x27, 0x64, 0x87, 0xcf, 0x38, 0xc7, 0xf5, 3330 0x7c, 0x4c, 0x32, 0xee, 0x09, 0x2a, 0x1e, 0x80, 0x87, 0x75, 0x9c, 0xdb,
3326 0x63, 0x54, 0x9d, 0x53, 0xc1, 0x7a, 0x57, 0xb0, 0xde, 0xb2, 0x5f, 0xb5, 3331 0x9a, 0x92, 0x7e, 0x5c, 0xeb, 0x50, 0x3f, 0x55, 0x9d, 0x84, 0x9f, 0x86,
3327 0x70, 0x9d, 0xd9, 0x6b, 0xad, 0x17, 0x6b, 0x2d, 0x79, 0xaf, 0xc6, 0x4d, 3332 0xd8, 0xaf, 0x27, 0xcc, 0x7a, 0xa9, 0xf8, 0x9d, 0xaf, 0x6e, 0xda, 0xf3,
3328 0x4b, 0xcb, 0xfb, 0x85, 0xcd, 0x9f, 0x09, 0x41, 0xfe, 0xf7, 0x72, 0x7c, 3333 0x29, 0xc7, 0xce, 0xcc, 0x77, 0x55, 0x58, 0x5e, 0x58, 0x0d, 0x34, 0xf9,
3329 0x3c, 0x79, 0xfa, 0x8b, 0xe6, 0x07, 0xbe, 0xb6, 0x11, 0xbf, 0xcf, 0xc4, 3334 0xad, 0xa1, 0x3c, 0x0e, 0x97, 0x8c, 0x2a, 0xfb, 0xa4, 0x7e, 0xb7, 0x55,
3330 0xbf, 0xdd, 0xde, 0xaa, 0x3c, 0x75, 0x27, 0xd7, 0x7e, 0xf8, 0xb3, 0xcf, 3335 0x1e, 0x86, 0x07, 0x0f, 0x12, 0x06, 0x0a, 0x4f, 0xc9, 0x73, 0xca, 0x1d,
3331 0x19, 0x20, 0xbe, 0x1b, 0x23, 0x6a, 0xdf, 0x49, 0x87, 0xf6, 0x53, 0x27, 3336 0xea, 0x8a, 0x3d, 0x9f, 0x73, 0xf9, 0xdd, 0x13, 0xa2, 0x42, 0xdb, 0x78,
3332 0xea, 0x90, 0x03, 0xf6, 0xd6, 0xb0, 0xbd, 0x72, 0xb9, 0x85, 0xf0, 0xef, 3337 0x79, 0xdc, 0x9e, 0xb7, 0xc8, 0x4f, 0xbf, 0x19, 0xdf, 0xc5, 0xab, 0xd9,
3333 0xbb, 0x31, 0x62, 0xb5, 0xd7, 0xf8, 0x97, 0xf3, 0xec, 0xb8, 0x19, 0xe1, 3338 0x0f, 0x8c, 0xd1, 0x35, 0x72, 0xdf, 0x16, 0x3e, 0xa7, 0x9e, 0xcf, 0xd1,
3334 0x3e, 0xd6, 0x8f, 0xbc, 0xf0, 0xed, 0xff, 0x5c, 0xeb, 0xc3, 0xe7, 0x86, 3339 0x2d, 0x75, 0x43, 0xea, 0x59, 0x68, 0xd6, 0x0b, 0x15, 0x1f, 0xd9, 0xba,
3335 0xf4, 0xf9, 0x4a, 0x5e, 0xb5, 0x98, 0x1b, 0x55, 0xfb, 0x1f, 0x13, 0x0c, 3340 0xa1, 0xfc, 0x40, 0xe7, 0xc7, 0x2f, 0x8f, 0xcb, 0xf5, 0x15, 0x0f, 0xa9,
3336 0x33, 0x31, 0xdc, 0x84, 0xfa, 0x77, 0xe7, 0x00, 0xf4, 0x1f, 0x6e, 0xd4, 3341 0x23, 0x9a, 0xb9, 0xdf, 0x8f, 0x66, 0x9d, 0x90, 0xdf, 0x83, 0xe2, 0x25,
3337 0x7d, 0x1c, 0x38, 0x16, 0x5c, 0xff, 0xbf, 0x9e, 0xc8, 0xe7, 0x97, 0x41, 3342 0x1e, 0xda, 0xeb, 0xe1, 0x1f, 0x46, 0x3d, 0x24, 0x3b, 0x34, 0xfd, 0x2c,
3338 0x07, 0xf8, 0xca, 0xd8, 0xae, 0x62, 0xb6, 0x2b, 0x22, 0x72, 0xeb, 0xec, 3343 0xd7, 0xbf, 0x5e, 0x79, 0x4e, 0x29, 0xeb, 0x5d, 0xca, 0x7a, 0x1b, 0xd7,
3339 0x5e, 0xca, 0x97, 0x4e, 0xe6, 0x7b, 0x56, 0xd7, 0xe3, 0x65, 0x7c, 0xb0, 3344 0x73, 0x1d, 0xd7, 0xc9, 0x6d, 0xd6, 0x7a, 0xf7, 0xcf, 0x4c, 0xb6, 0x6e,
3340 0xbf, 0x80, 0xcf, 0xcf, 0xe7, 0xaf, 0x7c, 0x72, 0xd3, 0x8c, 0xa3, 0x01, 3345 0xc9, 0xf1, 0xdf, 0x33, 0x73, 0xef, 0x5f, 0x47, 0x5e, 0xd3, 0x22, 0x82,
3341 0xe6, 0x73, 0xe7, 0xa9, 0xf3, 0x18, 0x65, 0xd6, 0x50, 0x9d, 0x3f, 0x73, 3346 0x3e, 0x23, 0x1d, 0x51, 0x7d, 0x41, 0x6e, 0xfd, 0xcb, 0xb5, 0x03, 0xbc,
3342 0x3c, 0xad, 0xf8, 0x02, 0x26, 0xce, 0xed, 0x76, 0xfd, 0x74, 0xff, 0xd1, 3347 0xb4, 0xb9, 0x43, 0x24, 0x77, 0xad, 0xc7, 0xde, 0x27, 0xa0, 0x0e, 0x56,
3343 0xfd, 0xaf, 0xf8, 0xc2, 0xe2, 0x60, 0x70, 0x25, 0x3f, 0xbb, 0xd5, 0xf4, 3348 0xba, 0xa0, 0xf7, 0x42, 0xd6, 0xdb, 0xd8, 0xaf, 0x8e, 0xf2, 0x41, 0xbb,
3344 0xcc, 0x42, 0x5a, 0xc7, 0xc9, 0x20, 0x3b, 0xe7, 0x46, 0xd5, 0xf9, 0x1f, 3349 0xd6, 0x63, 0xd5, 0xfb, 0xfa, 0xcc, 0xfc, 0xe7, 0x39, 0xc7, 0x41, 0x0f,
3345 0xe6, 0xf8, 0xdf, 0x69, 0xf1, 0x3f, 0xf8, 0x9f, 0x88, 0x3c, 0xaa, 0xdf, 3350 0xdf, 0xaf, 0x49, 0xc4, 0xb1, 0xd6, 0xfe, 0xb5, 0xd2, 0x8b, 0xcf, 0x8f,
3346 0xf3, 0xf5, 0xe5, 0x2f, 0xee, 0x2f, 0xcf, 0x13, 0x35, 0x7f, 0xe1, 0xa1, 3351 0x28, 0x3d, 0x74, 0xf2, 0xd3, 0x78, 0xaf, 0xdc, 0xa7, 0x48, 0x70, 0xd8,
3347 0xfd, 0xb1, 0xbb, 0xdd, 0x6a, 0x7f, 0x83, 0x98, 0x4d, 0x21, 0xbf, 0x7a, 3352 0x88, 0xee, 0x5a, 0xd4, 0xdf, 0xc9, 0x1d, 0xb0, 0xa3, 0xbb, 0x46, 0xea,
3348 0x18, 0x87, 0xfb, 0xb8, 0x5e, 0xdf, 0xf0, 0xab, 0x09, 0x9f, 0xe8, 0xdf, 3353 0x61, 0x78, 0x25, 0x8d, 0x3c, 0x17, 0x7c, 0x1f, 0x7d, 0x3b, 0xe0, 0xe4,
3349 0x49, 0xfe, 0x10, 0xe1, 0x22, 0xf8, 0xa7, 0xff, 0x45, 0xed, 0x4f, 0xcc, 3354 0xd7, 0x4b, 0x2c, 0x57, 0xcc, 0xf6, 0x15, 0xb0, 0x7d, 0x71, 0x91, 0x5b,
3350 0x57, 0x51, 0xbf, 0x75, 0x89, 0x1e, 0xaf, 0x41, 0xfc, 0x55, 0x01, 0xd0, 3355 0xe7, 0xb7, 0x55, 0xd2, 0x7d, 0xc0, 0x72, 0x2f, 0xaa, 0xfb, 0xc0, 0x90,
3351 0x30, 0xd7, 0xf9, 0x59, 0xb3, 0x8f, 0x81, 0x9e, 0xf6, 0xe8, 0xba, 0x8c, 3356 0x93, 0xfb, 0xe4, 0xf1, 0x3e, 0x4e, 0x3c, 0x39, 0xed, 0x33, 0xca, 0x71,
3352 0x7e, 0xfe, 0x95, 0x47, 0x31, 0xc8, 0x20, 0x35, 0xa3, 0x3e, 0x77, 0x35, 3357 0xd0, 0xc9, 0x72, 0x5e, 0x87, 0x7b, 0x05, 0xa3, 0xe9, 0xa5, 0x74, 0xaf,
3353 0x1a, 0xb4, 0xde, 0xdb, 0x0c, 0x3c, 0x89, 0x7a, 0xdd, 0xe7, 0xf0, 0xe1, 3358 0x9c, 0x3c, 0x40, 0xf7, 0x43, 0xc8, 0x8c, 0x53, 0xbb, 0x1d, 0x67, 0x9e,
3354 0x3e, 0x50, 0x95, 0xed, 0x77, 0xd6, 0x7e, 0x58, 0x68, 0xe9, 0x07, 0xfa, 3359 0x20, 0xef, 0x52, 0x3e, 0x2a, 0x76, 0x86, 0xe7, 0xe3, 0xd7, 0x2b, 0xa7,
3355 0x3c, 0xed, 0x47, 0x2d, 0x97, 0x86, 0xb2, 0xaf, 0x58, 0xfb, 0xa1, 0xee, 3360 0x87, 0xa7, 0x46, 0x95, 0x7f, 0x74, 0xb2, 0x77, 0xbc, 0x57, 0xf5, 0xb1,
3356 0x13, 0x8b, 0xdc, 0x27, 0x4a, 0xc5, 0xc5, 0x14, 0xec, 0x9a, 0x4d, 0xe5, 3361 0x56, 0xde, 0xdd, 0x16, 0xde, 0x21, 0xff, 0x74, 0xfc, 0xff, 0xf2, 0xed,
3357 0xe2, 0x4f, 0x9f, 0xa7, 0xe5, 0x41, 0x6f, 0x6d, 0x47, 0x56, 0x3e, 0xce, 3362 0xd4, 0x1f, 0x1c, 0x9d, 0x31, 0xfb, 0x50, 0x9f, 0x53, 0xfd, 0x5f, 0x61,
3358 0x3f, 0xc0, 0x7a, 0xfe, 0x4c, 0xf7, 0xd8, 0x30, 0xdb, 0xa3, 0xe4, 0x62, 3363 0xc6, 0xcb, 0x5e, 0xee, 0xef, 0xa6, 0x75, 0xfa, 0x4f, 0x62, 0x32, 0x43,
3359 0x7e, 0x3b, 0xf7, 0xe7, 0x84, 0x39, 0xb6, 0xf7, 0xd5, 0x1e, 0xd2, 0xab, 3364 0x43, 0xbd, 0xec, 0xb4, 0x94, 0x5b, 0x96, 0xd8, 0xcb, 0x76, 0x5d, 0xf4,
3360 0x84, 0xf1, 0x16, 0xb6, 0xe4, 0x03, 0xf8, 0xcb, 0xda, 0x40, 0x27, 0xdb, 3365 0xc0, 0xee, 0xce, 0x1d, 0x18, 0x5f, 0xe6, 0x7a, 0x7d, 0x97, 0xeb, 0xe3,
3361 0x74, 0x1c, 0x74, 0xbc, 0x74, 0x7c, 0x10, 0xc7, 0xf0, 0x3a, 0x62, 0xeb, 3366 0x16, 0x0d, 0x38, 0x59, 0x4b, 0x7c, 0x24, 0xf6, 0x9e, 0x53, 0xfb, 0xd3,
3362 0xe8, 0x5f, 0x47, 0x7d, 0xa4, 0xad, 0x7f, 0x41, 0xe3, 0x0f, 0xfb, 0x77, 3367 0xbe, 0xfa, 0x34, 0xf3, 0xf9, 0xb2, 0x87, 0xed, 0xac, 0x22, 0x3f, 0x26,
3363 0x47, 0x14, 0xff, 0xeb, 0xe2, 0x2a, 0xe1, 0x50, 0x88, 0x1f, 0x98, 0x66, 3368 0xee, 0x50, 0x3d, 0xf0, 0x8a, 0xa6, 0xc5, 0x12, 0xcb, 0x0c, 0xde, 0x58,
3364 0xfb, 0x15, 0x07, 0xc0, 0xcc, 0x57, 0x8e, 0x5f, 0x01, 0x4f, 0xb7, 0xeb, 3369 0x9f, 0x17, 0x80, 0xad, 0x7e, 0xa6, 0x21, 0x96, 0xeb, 0x67, 0x4c, 0xfb,
3365 0x7a, 0xae, 0xe3, 0x65, 0xcd, 0xd7, 0xd8, 0x32, 0xdc, 0x66, 0xeb, 0xb2, 3370 0xaa, 0x78, 0x7d, 0x1b, 0xc6, 0x7e, 0xae, 0x67, 0x83, 0xac, 0xd7, 0xd1,
3366 0xb6, 0x53, 0xf1, 0x47, 0x18, 0x8f, 0x3e, 0xd1, 0xb5, 0x0d, 0xf7, 0xdc, 3371 0x5a, 0x60, 0x38, 0x86, 0x3e, 0x61, 0x9c, 0xee, 0x85, 0x48, 0xa2, 0x77,
3367 0xa0, 0x17, 0x75, 0x3f, 0xe8, 0xb5, 0xc6, 0x4b, 0xe2, 0xa2, 0xd0, 0xab, 3372 0x14, 0xf6, 0x74, 0xad, 0x87, 0xbd, 0xf7, 0x98, 0x07, 0xc6, 0xf0, 0x89,
3368 0x86, 0x35, 0x25, 0x85, 0x64, 0xcf, 0xa9, 0x4b, 0xdf, 0xd2, 0xf2, 0xfb, 3373 0x3e, 0xba, 0x77, 0xc2, 0xfd, 0xe8, 0x33, 0xc2, 0xbe, 0x3e, 0xd8, 0xd1,
3369 0xd3, 0x45, 0x98, 0x2f, 0xdf, 0x19, 0x22, 0x7f, 0x4c, 0x01, 0xcf, 0xef, 3374 0x35, 0x8d, 0xf1, 0xbd, 0xe7, 0x80, 0x7f, 0x3d, 0x8f, 0x75, 0xfb, 0x0e,
3370 0x4e, 0x82, 0xbe, 0x23, 0x5e, 0xc0, 0xfe, 0x92, 0x13, 0x74, 0x0f, 0xf4, 3375 0x30, 0x3f, 0xeb, 0x9d, 0xd7, 0x75, 0xfe, 0x09, 0xb9, 0xee, 0x5a, 0x79,
3371 0x95, 0x33, 0x3e, 0x2b, 0x50, 0x27, 0x92, 0xd3, 0x74, 0x2f, 0x59, 0x5a, 3376 0xfe, 0xbb, 0xc3, 0xdc, 0x7f, 0x88, 0x14, 0xf5, 0x3b, 0xef, 0xe8, 0xd3,
3372 0x12, 0x01, 0x45, 0x3d, 0x66, 0xbf, 0x01, 0x3e, 0xdd, 0x96, 0x38, 0x3f, 3377 0x3c, 0xde, 0xc5, 0xf7, 0xe2, 0x2d, 0xee, 0x17, 0xba, 0x72, 0xfa, 0x85,
3373 0x08, 0xaf, 0x74, 0xaf, 0x94, 0x78, 0xc4, 0x76, 0xc6, 0xad, 0x2f, 0x17, 3378 0x09, 0xd4, 0xe9, 0xe1, 0xe9, 0x8c, 0x9c, 0x30, 0xea, 0x65, 0xbe, 0x93,
3374 0xb7, 0xda, 0x1f, 0x15, 0xce, 0xbc, 0x38, 0xdd, 0x60, 0xc7, 0xa9, 0x87, 3379 0x7f, 0xf5, 0x44, 0x09, 0xfb, 0xad, 0x78, 0x15, 0xf0, 0xd8, 0x2a, 0xdc,
3375 0x71, 0x7a, 0xcf, 0xec, 0xef, 0xcb, 0xe5, 0xa2, 0xcf, 0x5f, 0xfc, 0xdf, 3380 0xd7, 0x5d, 0xfb, 0x99, 0x9f, 0x46, 0xf2, 0xd3, 0xf2, 0xa9, 0xd1, 0xdc,
3376 0x70, 0x0b, 0xba, 0xbd, 0x41, 0x9d, 0x5f, 0xbe, 0xac, 0x1e, 0xd7, 0xda, 3381 0xf5, 0x32, 0x7e, 0x3a, 0x8d, 0xf8, 0x51, 0xe7, 0x40, 0x3e, 0x19, 0x92,
3377 0xe2, 0xdc, 0x7c, 0x5f, 0xeb, 0x75, 0xc2, 0x63, 0x5d, 0x6f, 0x31, 0xfb, 3382 0xf3, 0xf7, 0xcc, 0xba, 0x3f, 0x41, 0x7a, 0x57, 0x0c, 0x4f, 0xd3, 0xfa,
3378 0xd9, 0x11, 0x7e, 0xe7, 0x65, 0x0c, 0xfa, 0x11, 0xbd, 0x93, 0xa4, 0xa1, 3383 0x72, 0x51, 0x44, 0xf1, 0x57, 0x16, 0x9e, 0x82, 0x1d, 0x89, 0x41, 0xb6,
3379 0x51, 0x79, 0x56, 0xf1, 0x35, 0x45, 0x8f, 0x70, 0xbd, 0xbd, 0xe4, 0x42, 3384 0xbf, 0x67, 0x2d, 0x70, 0x3f, 0xfb, 0x5f, 0xf9, 0xf5, 0xca, 0x1a, 0x9d,
3380 0xbd, 0x19, 0x38, 0x80, 0xf1, 0x65, 0xae, 0x1f, 0x77, 0xd7, 0x50, 0x5d, 3385 0xd6, 0x8d, 0xf7, 0xe2, 0x1c, 0x95, 0x3f, 0xb9, 0xfd, 0xb0, 0x8a, 0x87,
3381 0x8e, 0x1e, 0x39, 0xaf, 0xe5, 0x91, 0x1c, 0x23, 0xc3, 0x75, 0xfd, 0x79, 3386 0xb2, 0x06, 0x1a, 0x8b, 0xce, 0x7d, 0xf2, 0x9c, 0x90, 0xe1, 0x47, 0x19,
3382 0x17, 0xd7, 0x5b, 0xf2, 0x9b, 0x3b, 0xfa, 0x07, 0xdd, 0x67, 0xdc, 0xa2, 3387 0x47, 0x06, 0x47, 0x7c, 0x5f, 0xdb, 0xe3, 0x44, 0xc6, 0x91, 0x8a, 0x57,
3383 0xeb, 0x49, 0x45, 0x2b, 0x65, 0xfd, 0xe6, 0xf3, 0x9f, 0x01, 0xed, 0xf5, 3388 0x6b, 0x7c, 0x59, 0xe3, 0xc7, 0x1e, 0x37, 0x61, 0xba, 0x57, 0x8c, 0x22,
3384 0x82, 0x8a, 0x66, 0x7b, 0x3c, 0x84, 0x69, 0x17, 0x46, 0x9e, 0x7a, 0x96, 3389 0x90, 0xa6, 0x77, 0x44, 0x62, 0x70, 0xe0, 0xc1, 0xfc, 0x9d, 0x00, 0x7f,
3385 0xd3, 0x87, 0xb1, 0x97, 0xef, 0x65, 0xd3, 0xec, 0xa7, 0x20, 0xf9, 0xa3, 3390 0x09, 0xd6, 0x5b, 0x4f, 0x51, 0x1f, 0xfa, 0x94, 0xe8, 0x67, 0x3f, 0x4e,
3386 0x58, 0xda, 0xa9, 0x68, 0x28, 0x3a, 0x9a, 0x86, 0xfe, 0x43, 0x5b, 0x61, 3391 0xd4, 0x72, 0xde, 0x57, 0xc1, 0x8f, 0x3d, 0xcf, 0x40, 0x9f, 0x1e, 0xce,
3387 0xdf, 0x22, 0xdb, 0xcd, 0x34, 0xf8, 0xf6, 0x18, 0xe1, 0x2f, 0x38, 0x8e, 3392 0x9f, 0xdb, 0xdc, 0x5f, 0xc0, 0xff, 0x7e, 0xbd, 0x63, 0x94, 0xfd, 0xcd,
3388 0x77, 0x48, 0xd0, 0x33, 0x06, 0x3b, 0x86, 0x32, 0x18, 0x2f, 0x6e, 0x06, 3393 0x71, 0xb8, 0x8b, 0x79, 0xb8, 0x05, 0x1e, 0x74, 0xc5, 0x43, 0xca, 0xe4,
3389 0xfd, 0x6b, 0x0b, 0xf6, 0x1d, 0x3d, 0xce, 0xfe, 0xd8, 0x9a, 0x7f, 0xdf, 3394 0x41, 0xd5, 0x19, 0xeb, 0x3e, 0x85, 0x46, 0x1c, 0x49, 0x5c, 0xa0, 0x5f,
3390 0xc0, 0x3d, 0xf0, 0x0d, 0x37, 0xa9, 0xf3, 0x07, 0x67, 0xf8, 0xfd, 0x22, 3395 0xa1, 0x3e, 0x2c, 0x8f, 0xed, 0x36, 0xe4, 0x1a, 0xa4, 0x7d, 0x61, 0xb6,
3391 0xe2, 0x2e, 0x35, 0x8e, 0x1b, 0x19, 0x1e, 0x1f, 0xe2, 0xfa, 0x7e, 0x9b, 3396 0x2f, 0x24, 0x76, 0x2e, 0xb7, 0xae, 0x0b, 0xf2, 0xba, 0x80, 0xb1, 0x0e,
3392 0xdf, 0x1b, 0x43, 0x39, 0xef, 0x8d, 0x79, 0xdc, 0x33, 0x67, 0x32, 0x49, 3397 0xf3, 0xc8, 0x53, 0x7d, 0x1e, 0x7e, 0x25, 0x8f, 0x6a, 0xdf, 0xdc, 0x7c,
3393 0xe0, 0x22, 0x51, 0x98, 0xfb, 0x5e, 0x55, 0xe3, 0x9a, 0x68, 0x39, 0xc7, 3398 0xb4, 0xf2, 0x49, 0x15, 0x9a, 0xfe, 0x50, 0x87, 0x0c, 0xbf, 0x51, 0xbd,
3394 0xa9, 0x6c, 0x3d, 0xe8, 0xe4, 0x7a, 0xbc, 0x13, 0x86, 0x8e, 0xb1, 0x5f, 3399 0xd2, 0xcd, 0xfa, 0x73, 0x97, 0xea, 0x79, 0xe0, 0x64, 0x37, 0xea, 0xc5,
3395 0x3a, 0x28, 0x4e, 0xad, 0x0b, 0xe9, 0x95, 0xde, 0xc9, 0xe0, 0x9b, 0xe2, 3400 0xc9, 0xee, 0xd3, 0x7c, 0xff, 0x32, 0x2f, 0x2d, 0xf4, 0x6e, 0x30, 0xb8,
3396 0x73, 0xc3, 0xdc, 0x4f, 0xc2, 0xc8, 0x3f, 0x51, 0x91, 0xe4, 0x77, 0xcb, 3401 0xab, 0xb2, 0xd7, 0x1f, 0xbb, 0x1e, 0x15, 0x16, 0x3d, 0xd4, 0xb9, 0x0f,
3397 0x04, 0xee, 0x9d, 0x53, 0x06, 0x68, 0x38, 0xa0, 0xf5, 0x45, 0x3e, 0x26, 3402 0xeb, 0x0f, 0xd0, 0x9f, 0x6e, 0xa0, 0xfe, 0x40, 0x33, 0xfb, 0x6c, 0xfb,
3398 0x52, 0xc8, 0x3b, 0xac, 0x3b, 0x2c, 0xeb, 0x7c, 0x1f, 0x59, 0xf6, 0xce, 3403 0x3d, 0x72, 0xeb, 0xfe, 0xe3, 0xde, 0x23, 0x5b, 0x1a, 0xac, 0xe7, 0xc5,
3399 0x51, 0x74, 0xd1, 0x51, 0xea, 0xd0, 0x76, 0x62, 0xb5, 0x3f, 0xa0, 0xf0, 3404 0xc4, 0xd8, 0x08, 0xce, 0x69, 0xe1, 0x7b, 0x7b, 0x3b, 0xe7, 0xf7, 0xb5,
3400 0x7b, 0xd3, 0xcc, 0xab, 0x79, 0xf2, 0x5b, 0xf5, 0x4c, 0x86, 0xf4, 0xaf, 3405 0x40, 0x84, 0xce, 0x4d, 0xbe, 0x46, 0xf6, 0x8a, 0x68, 0x10, 0xf6, 0x25,
3401 0x12, 0xa5, 0xd4, 0x87, 0x2b, 0x83, 0x0b, 0xf0, 0x63, 0x74, 0x9a, 0xfd, 3406 0x5f, 0xc7, 0xf7, 0x64, 0x08, 0xf3, 0xe5, 0x21, 0xfc, 0x3e, 0xd0, 0xe2,
3402 0x3f, 0xb2, 0x09, 0xf4, 0x18, 0xe3, 0x4f, 0xe3, 0xea, 0xca, 0x46, 0x83, 3407 0xd7, 0x49, 0xbe, 0x3c, 0x04, 0x8c, 0x72, 0x5d, 0x18, 0x33, 0xdf, 0x11,
3403 0xf6, 0xcd, 0x8d, 0xe2, 0x1c, 0x7d, 0x8f, 0xc8, 0x7d, 0x8f, 0x6b, 0x3c, 3408 0xc0, 0x21, 0xdf, 0x7c, 0xef, 0x08, 0xbc, 0xc7, 0xce, 0xfb, 0x50, 0x37,
3404 0x56, 0xb6, 0xa3, 0x90, 0x0e, 0x1c, 0x55, 0xe7, 0x04, 0x24, 0x8e, 0x94, 3409 0x44, 0x0c, 0xfd, 0x73, 0x53, 0x8d, 0x4e, 0xdf, 0x5b, 0x63, 0xb8, 0x9f,
3405 0xfe, 0xd2, 0x27, 0x9c, 0x8f, 0x76, 0x9c, 0x2a, 0x1c, 0xeb, 0xfc, 0xb0, 3410 0x51, 0x97, 0xe7, 0xda, 0x55, 0x81, 0x78, 0x2d, 0xcf, 0xbe, 0x37, 0xac,
3406 0xe2, 0x3b, 0x37, 0xdf, 0xb3, 0x78, 0x0d, 0xd2, 0xbd, 0x5c, 0x16, 0xb9, 3411 0xef, 0x12, 0x3d, 0x31, 0x68, 0xf6, 0xfd, 0x76, 0x3d, 0x90, 0x67, 0x72,
3407 0x04, 0xbf, 0x9b, 0xf8, 0x7e, 0xb0, 0x52, 0xfc, 0xde, 0x46, 0xfc, 0xa2, 3412 0x7f, 0x1a, 0x1a, 0xfd, 0xf5, 0xa3, 0xbc, 0x47, 0x3c, 0xdc, 0xaf, 0xdd,
3408 0xac, 0xb7, 0x11, 0x1f, 0x43, 0x5f, 0x1c, 0x67, 0x1c, 0xcd, 0x37, 0xf1, 3413 0x99, 0x45, 0xbc, 0x16, 0x89, 0x0b, 0x23, 0xe0, 0x61, 0x6c, 0xc4, 0x29,
3409 0xfd, 0x87, 0xf5, 0xfb, 0x8d, 0xdf, 0x67, 0xc0, 0x9b, 0xd7, 0x88, 0xa5, 3414 0x8f, 0xa5, 0x1e, 0xea, 0x1c, 0xd8, 0xa5, 0xec, 0xcc, 0x9e, 0x0b, 0xbd,
3410 0x19, 0x5f, 0x8c, 0xfb, 0x43, 0x6c, 0xf7, 0x6d, 0xd8, 0x6d, 0x68, 0xbb, 3415 0x76, 0xb0, 0xfe, 0xbf, 0xd2, 0xef, 0x17, 0x51, 0xb6, 0x57, 0xee, 0x8b,
3411 0xe3, 0xa6, 0xdd, 0xfa, 0x7e, 0x65, 0x95, 0x53, 0x22, 0x71, 0xab, 0xe8, 3416 0xf9, 0x8d, 0xf4, 0x6e, 0xca, 0x13, 0x69, 0x73, 0x6c, 0x7f, 0xcf, 0xb4,
3412 0x2a, 0xe3, 0x0a, 0xd5, 0xb3, 0x02, 0xb6, 0x53, 0xf2, 0xb5, 0x2b, 0x7b, 3417 0x90, 0x5e, 0x85, 0x7c, 0xaf, 0x47, 0x2d, 0xfd, 0x07, 0xe4, 0x8b, 0xeb,
3413 0x82, 0x6c, 0x4f, 0x40, 0x1c, 0x6c, 0xb5, 0xee, 0x2b, 0xe2, 0x7d, 0x7e, 3418 0x81, 0xc7, 0xea, 0x95, 0xdf, 0x94, 0x7f, 0x95, 0x3f, 0xe1, 0xf7, 0xe8,
3414 0xb9, 0x0f, 0xf3, 0xa8, 0x0b, 0xc6, 0x0a, 0xfe, 0x54, 0x7e, 0xd3, 0x72, 3419 0x4a, 0x12, 0x6b, 0x4c, 0xae, 0xa4, 0x84, 0xaf, 0x4f, 0x4e, 0xa9, 0x7b,
3415 0x73, 0xf3, 0xde, 0xea, 0x3f, 0xba, 0x91, 0xd2, 0x07, 0xf5, 0x4d, 0xc6, 3420 0x1e, 0xeb, 0xb7, 0xc4, 0xa5, 0xfc, 0x07, 0xe2, 0xfb, 0x38, 0x2e, 0xd6,
3416 0xa9, 0x05, 0xff, 0x1f, 0xe8, 0xfa, 0x76, 0x97, 0xee, 0xaf, 0xfe, 0x33, 3421 0x9f, 0x19, 0xb3, 0xfd, 0xbd, 0xe0, 0x3f, 0xeb, 0x3b, 0xc1, 0x23, 0xce,
3417 0xc3, 0xa8, 0x4f, 0x67, 0x86, 0xcf, 0xf2, 0xbb, 0x83, 0xfd, 0xd2, 0x43, 3422 0xe7, 0xf1, 0x74, 0x83, 0xea, 0x7b, 0xe7, 0x7b, 0xef, 0x48, 0x3b, 0x3e,
3418 0xff, 0x5b, 0xc8, 0xd8, 0xd5, 0xdb, 0xeb, 0x9b, 0x5d, 0x8f, 0x6a, 0x8b, 3423 0xba, 0x9f, 0xdb, 0x47, 0x67, 0xfb, 0x60, 0x65, 0xaf, 0x5c, 0x57, 0xcf,
3419 0x1e, 0xfa, 0xdc, 0x7f, 0x00, 0x5a, 0x33, 0xe6, 0xc0, 0x30, 0x14, 0x00, 3424 0x71, 0xac, 0x89, 0xa6, 0x0d, 0xf8, 0x7d, 0x23, 0xec, 0x47, 0xde, 0x84,
3420 0x00, 0x00 }; 3425 0xfd, 0x4e, 0xef, 0x52, 0x23, 0x8e, 0xf2, 0xa9, 0x60, 0x2c, 0x2c, 0xcc,
3426 0x27, 0xfb, 0x8e, 0x5c, 0xbc, 0x44, 0x62, 0x9f, 0x0d, 0x06, 0x31, 0x5f,
3427 0xd2, 0x84, 0x63, 0xbc, 0x14, 0xf7, 0x1e, 0x71, 0x08, 0x79, 0xf1, 0xe9,
3428 0x31, 0xe0, 0x27, 0xe2, 0x55, 0xec, 0x53, 0x78, 0x90, 0xee, 0x53, 0xad,
3429 0x04, 0x34, 0x67, 0x06, 0x39, 0xde, 0x4b, 0xdd, 0xf4, 0xfb, 0xe2, 0xac,
3430 0x08, 0x49, 0xf4, 0x99, 0xf9, 0x8b, 0xb8, 0xf6, 0x5a, 0xfc, 0xff, 0xa8,
3431 0x71, 0x4e, 0xf5, 0xc9, 0x88, 0x63, 0x6c, 0xc3, 0xf1, 0xae, 0xe5, 0xc6,
3432 0xbb, 0xe2, 0xa9, 0xd4, 0xed, 0x18, 0xdf, 0xab, 0xe7, 0xc6, 0xb7, 0xd2,
3433 0x4f, 0xf2, 0x7d, 0xd7, 0xbc, 0x3f, 0xe7, 0xee, 0x8f, 0xf7, 0xd3, 0x85,
3434 0x27, 0x16, 0xdf, 0xc0, 0x8d, 0xd5, 0xf2, 0xfc, 0x92, 0x39, 0x7d, 0x72,
3435 0x6e, 0xfe, 0xa1, 0xde, 0xbd, 0x61, 0xc4, 0xc3, 0x7f, 0x69, 0x4a, 0x77,
3436 0x8f, 0xc8, 0x15, 0x00, 0x00, 0x00 };
3421 3437
3422static u8 bnx2_TPAT_b09FwText[] = { 3438static u8 bnx2_TPAT_b09FwText[] = {
3423 0xbd, 0x58, 0x5d, 0x6c, 0x1c, 0xd5, 0x15, 0x3e, 0x73, 0x67, 0xd6, 0x3b, 3439 0xbd, 0x58, 0x5d, 0x6c, 0x1c, 0xd5, 0x15, 0x3e, 0x73, 0x67, 0xd6, 0x3b,
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index d21b7ab64bd1..5f9c42e7a7f1 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -43,6 +43,29 @@
43 43
44#define DRIVER_NAME "mpc52xx-fec" 44#define DRIVER_NAME "mpc52xx-fec"
45 45
46#define FEC5200_PHYADDR_NONE (-1)
47#define FEC5200_PHYADDR_7WIRE (-2)
48
49/* Private driver data structure */
50struct mpc52xx_fec_priv {
51 int duplex;
52 int speed;
53 int r_irq;
54 int t_irq;
55 struct mpc52xx_fec __iomem *fec;
56 struct bcom_task *rx_dmatsk;
57 struct bcom_task *tx_dmatsk;
58 spinlock_t lock;
59 int msg_enable;
60
61 /* MDIO link details */
62 int phy_addr;
63 unsigned int phy_speed;
64 struct phy_device *phydev;
65 enum phy_state link;
66};
67
68
46static irqreturn_t mpc52xx_fec_interrupt(int, void *); 69static irqreturn_t mpc52xx_fec_interrupt(int, void *);
47static irqreturn_t mpc52xx_fec_rx_interrupt(int, void *); 70static irqreturn_t mpc52xx_fec_rx_interrupt(int, void *);
48static irqreturn_t mpc52xx_fec_tx_interrupt(int, void *); 71static irqreturn_t mpc52xx_fec_tx_interrupt(int, void *);
@@ -223,7 +246,7 @@ static int mpc52xx_fec_phy_start(struct net_device *dev)
223 struct mpc52xx_fec_priv *priv = netdev_priv(dev); 246 struct mpc52xx_fec_priv *priv = netdev_priv(dev);
224 int err; 247 int err;
225 248
226 if (!priv->has_phy) 249 if (priv->phy_addr < 0)
227 return 0; 250 return 0;
228 251
229 err = mpc52xx_fec_init_phy(dev); 252 err = mpc52xx_fec_init_phy(dev);
@@ -243,7 +266,7 @@ static void mpc52xx_fec_phy_stop(struct net_device *dev)
243{ 266{
244 struct mpc52xx_fec_priv *priv = netdev_priv(dev); 267 struct mpc52xx_fec_priv *priv = netdev_priv(dev);
245 268
246 if (!priv->has_phy) 269 if (!priv->phydev)
247 return; 270 return;
248 271
249 phy_disconnect(priv->phydev); 272 phy_disconnect(priv->phydev);
@@ -255,7 +278,7 @@ static void mpc52xx_fec_phy_stop(struct net_device *dev)
255static int mpc52xx_fec_phy_mii_ioctl(struct mpc52xx_fec_priv *priv, 278static int mpc52xx_fec_phy_mii_ioctl(struct mpc52xx_fec_priv *priv,
256 struct mii_ioctl_data *mii_data, int cmd) 279 struct mii_ioctl_data *mii_data, int cmd)
257{ 280{
258 if (!priv->has_phy) 281 if (!priv->phydev)
259 return -ENOTSUPP; 282 return -ENOTSUPP;
260 283
261 return phy_mii_ioctl(priv->phydev, mii_data, cmd); 284 return phy_mii_ioctl(priv->phydev, mii_data, cmd);
@@ -265,7 +288,7 @@ static void mpc52xx_fec_phy_hw_init(struct mpc52xx_fec_priv *priv)
265{ 288{
266 struct mpc52xx_fec __iomem *fec = priv->fec; 289 struct mpc52xx_fec __iomem *fec = priv->fec;
267 290
268 if (!priv->has_phy) 291 if (priv->phydev)
269 return; 292 return;
270 293
271 out_be32(&fec->mii_speed, priv->phy_speed); 294 out_be32(&fec->mii_speed, priv->phy_speed);
@@ -704,7 +727,7 @@ static void mpc52xx_fec_start(struct net_device *dev)
704 rcntrl = FEC_RX_BUFFER_SIZE << 16; /* max frame length */ 727 rcntrl = FEC_RX_BUFFER_SIZE << 16; /* max frame length */
705 rcntrl |= FEC_RCNTRL_FCE; 728 rcntrl |= FEC_RCNTRL_FCE;
706 729
707 if (priv->has_phy) 730 if (priv->phy_addr != FEC5200_PHYADDR_7WIRE)
708 rcntrl |= FEC_RCNTRL_MII_MODE; 731 rcntrl |= FEC_RCNTRL_MII_MODE;
709 732
710 if (priv->duplex == DUPLEX_FULL) 733 if (priv->duplex == DUPLEX_FULL)
@@ -864,7 +887,10 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
864 struct net_device *ndev; 887 struct net_device *ndev;
865 struct mpc52xx_fec_priv *priv = NULL; 888 struct mpc52xx_fec_priv *priv = NULL;
866 struct resource mem; 889 struct resource mem;
867 const phandle *ph; 890 struct device_node *phy_node;
891 const phandle *phy_handle;
892 const u32 *prop;
893 int prop_size;
868 894
869 phys_addr_t rx_fifo; 895 phys_addr_t rx_fifo;
870 phys_addr_t tx_fifo; 896 phys_addr_t tx_fifo;
@@ -948,26 +974,37 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
948 mpc52xx_fec_get_paddr(ndev, ndev->dev_addr); 974 mpc52xx_fec_get_paddr(ndev, ndev->dev_addr);
949 975
950 priv->msg_enable = netif_msg_init(debug, MPC52xx_MESSAGES_DEFAULT); 976 priv->msg_enable = netif_msg_init(debug, MPC52xx_MESSAGES_DEFAULT);
951 priv->duplex = DUPLEX_FULL;
952
953 /* is the phy present in device tree? */
954 ph = of_get_property(op->node, "phy-handle", NULL);
955 if (ph) {
956 const unsigned int *prop;
957 struct device_node *phy_dn;
958 priv->has_phy = 1;
959 977
960 phy_dn = of_find_node_by_phandle(*ph); 978 /*
961 prop = of_get_property(phy_dn, "reg", NULL); 979 * Link mode configuration
962 priv->phy_addr = *prop; 980 */
963 981
964 of_node_put(phy_dn); 982 /* Start with safe defaults for link connection */
983 priv->phy_addr = FEC5200_PHYADDR_NONE;
984 priv->speed = 100;
985 priv->duplex = DUPLEX_HALF;
986 priv->phy_speed = ((mpc52xx_find_ipb_freq(op->node) >> 20) / 5) << 1;
987
988 /* the 7-wire property means don't use MII mode */
989 if (of_find_property(op->node, "fsl,7-wire-mode", NULL))
990 priv->phy_addr = FEC5200_PHYADDR_7WIRE;
991
992 /* The current speed preconfigures the speed of the MII link */
993 prop = of_get_property(op->node, "current-speed", &prop_size);
994 if (prop && (prop_size >= sizeof(u32) * 2)) {
995 priv->speed = prop[0];
996 priv->duplex = prop[1] ? DUPLEX_FULL : DUPLEX_HALF;
997 }
965 998
966 /* Phy speed */ 999 /* If there is a phy handle, setup link to that phy */
967 priv->phy_speed = ((mpc52xx_find_ipb_freq(op->node) >> 20) / 5) << 1; 1000 phy_handle = of_get_property(op->node, "phy-handle", &prop_size);
968 } else { 1001 if (phy_handle && (prop_size >= sizeof(phandle))) {
969 dev_info(&ndev->dev, "can't find \"phy-handle\" in device" 1002 phy_node = of_find_node_by_phandle(*phy_handle);
970 " tree, using 7-wire mode\n"); 1003 prop = of_get_property(phy_node, "reg", &prop_size);
1004 if (prop && (prop_size >= sizeof(u32)))
1005 if ((*prop >= 0) && (*prop < PHY_MAX_ADDR))
1006 priv->phy_addr = *prop;
1007 of_node_put(phy_node);
971 } 1008 }
972 1009
973 /* Hardware init */ 1010 /* Hardware init */
@@ -982,6 +1019,20 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
982 if (rv < 0) 1019 if (rv < 0)
983 goto probe_error; 1020 goto probe_error;
984 1021
1022 /* Now report the link setup */
1023 switch (priv->phy_addr) {
1024 case FEC5200_PHYADDR_NONE:
1025 dev_info(&ndev->dev, "Fixed speed MII link: %i%cD\n",
1026 priv->speed, priv->duplex ? 'F' : 'H');
1027 break;
1028 case FEC5200_PHYADDR_7WIRE:
1029 dev_info(&ndev->dev, "using 7-wire PHY mode\n");
1030 break;
1031 default:
1032 dev_info(&ndev->dev, "Using PHY at MDIO address %i\n",
1033 priv->phy_addr);
1034 }
1035
985 /* We're done ! */ 1036 /* We're done ! */
986 dev_set_drvdata(&op->dev, ndev); 1037 dev_set_drvdata(&op->dev, ndev);
987 1038
diff --git a/drivers/net/fec_mpc52xx.h b/drivers/net/fec_mpc52xx.h
index 8b1f75397b9a..a227a525bdbb 100644
--- a/drivers/net/fec_mpc52xx.h
+++ b/drivers/net/fec_mpc52xx.h
@@ -26,25 +26,6 @@
26 26
27#define FEC_WATCHDOG_TIMEOUT ((400*HZ)/1000) 27#define FEC_WATCHDOG_TIMEOUT ((400*HZ)/1000)
28 28
29struct mpc52xx_fec_priv {
30 int duplex;
31 int r_irq;
32 int t_irq;
33 struct mpc52xx_fec __iomem *fec;
34 struct bcom_task *rx_dmatsk;
35 struct bcom_task *tx_dmatsk;
36 spinlock_t lock;
37 int msg_enable;
38
39 int has_phy;
40 unsigned int phy_speed;
41 unsigned int phy_addr;
42 struct phy_device *phydev;
43 enum phy_state link;
44 int speed;
45};
46
47
48/* ======================================================================== */ 29/* ======================================================================== */
49/* Hardware register sets & bits */ 30/* Hardware register sets & bits */
50/* ======================================================================== */ 31/* ======================================================================== */
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index b66c75e3b8a1..07b3f77e7626 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.91" 67#define DRV_MODULE_VERSION "3.92"
68#define DRV_MODULE_RELDATE "April 18, 2008" 68#define DRV_MODULE_RELDATE "May 2, 2008"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -1656,12 +1656,76 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
1656 return 0; 1656 return 0;
1657} 1657}
1658 1658
1659/* tp->lock is held. */
1660static void tg3_wait_for_event_ack(struct tg3 *tp)
1661{
1662 int i;
1663
1664 /* Wait for up to 2.5 milliseconds */
1665 for (i = 0; i < 250000; i++) {
1666 if (!(tr32(GRC_RX_CPU_EVENT) & GRC_RX_CPU_DRIVER_EVENT))
1667 break;
1668 udelay(10);
1669 }
1670}
1671
1672/* tp->lock is held. */
1673static void tg3_ump_link_report(struct tg3 *tp)
1674{
1675 u32 reg;
1676 u32 val;
1677
1678 if (!(tp->tg3_flags2 & TG3_FLG2_5780_CLASS) ||
1679 !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF))
1680 return;
1681
1682 tg3_wait_for_event_ack(tp);
1683
1684 tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX, FWCMD_NICDRV_LINK_UPDATE);
1685
1686 tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 14);
1687
1688 val = 0;
1689 if (!tg3_readphy(tp, MII_BMCR, &reg))
1690 val = reg << 16;
1691 if (!tg3_readphy(tp, MII_BMSR, &reg))
1692 val |= (reg & 0xffff);
1693 tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, val);
1694
1695 val = 0;
1696 if (!tg3_readphy(tp, MII_ADVERTISE, &reg))
1697 val = reg << 16;
1698 if (!tg3_readphy(tp, MII_LPA, &reg))
1699 val |= (reg & 0xffff);
1700 tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX + 4, val);
1701
1702 val = 0;
1703 if (!(tp->tg3_flags2 & TG3_FLG2_MII_SERDES)) {
1704 if (!tg3_readphy(tp, MII_CTRL1000, &reg))
1705 val = reg << 16;
1706 if (!tg3_readphy(tp, MII_STAT1000, &reg))
1707 val |= (reg & 0xffff);
1708 }
1709 tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX + 8, val);
1710
1711 if (!tg3_readphy(tp, MII_PHYADDR, &reg))
1712 val = reg << 16;
1713 else
1714 val = 0;
1715 tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX + 12, val);
1716
1717 val = tr32(GRC_RX_CPU_EVENT);
1718 val |= GRC_RX_CPU_DRIVER_EVENT;
1719 tw32_f(GRC_RX_CPU_EVENT, val);
1720}
1721
1659static void tg3_link_report(struct tg3 *tp) 1722static void tg3_link_report(struct tg3 *tp)
1660{ 1723{
1661 if (!netif_carrier_ok(tp->dev)) { 1724 if (!netif_carrier_ok(tp->dev)) {
1662 if (netif_msg_link(tp)) 1725 if (netif_msg_link(tp))
1663 printk(KERN_INFO PFX "%s: Link is down.\n", 1726 printk(KERN_INFO PFX "%s: Link is down.\n",
1664 tp->dev->name); 1727 tp->dev->name);
1728 tg3_ump_link_report(tp);
1665 } else if (netif_msg_link(tp)) { 1729 } else if (netif_msg_link(tp)) {
1666 printk(KERN_INFO PFX "%s: Link is up at %d Mbps, %s duplex.\n", 1730 printk(KERN_INFO PFX "%s: Link is up at %d Mbps, %s duplex.\n",
1667 tp->dev->name, 1731 tp->dev->name,
@@ -1679,6 +1743,7 @@ static void tg3_link_report(struct tg3 *tp)
1679 "on" : "off", 1743 "on" : "off",
1680 (tp->link_config.active_flowctrl & TG3_FLOW_CTRL_RX) ? 1744 (tp->link_config.active_flowctrl & TG3_FLOW_CTRL_RX) ?
1681 "on" : "off"); 1745 "on" : "off");
1746 tg3_ump_link_report(tp);
1682 } 1747 }
1683} 1748}
1684 1749
@@ -2097,9 +2162,11 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
2097 MAC_STATUS_LNKSTATE_CHANGED)); 2162 MAC_STATUS_LNKSTATE_CHANGED));
2098 udelay(40); 2163 udelay(40);
2099 2164
2100 tp->mi_mode = MAC_MI_MODE_BASE; 2165 if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) {
2101 tw32_f(MAC_MI_MODE, tp->mi_mode); 2166 tw32_f(MAC_MI_MODE,
2102 udelay(80); 2167 (tp->mi_mode & ~MAC_MI_MODE_AUTO_POLL));
2168 udelay(80);
2169 }
2103 2170
2104 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x02); 2171 tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x02);
2105 2172
@@ -5498,19 +5565,17 @@ static void tg3_stop_fw(struct tg3 *tp)
5498 if ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) && 5565 if ((tp->tg3_flags & TG3_FLAG_ENABLE_ASF) &&
5499 !(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)) { 5566 !(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)) {
5500 u32 val; 5567 u32 val;
5501 int i; 5568
5569 /* Wait for RX cpu to ACK the previous event. */
5570 tg3_wait_for_event_ack(tp);
5502 5571
5503 tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX, FWCMD_NICDRV_PAUSE_FW); 5572 tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX, FWCMD_NICDRV_PAUSE_FW);
5504 val = tr32(GRC_RX_CPU_EVENT); 5573 val = tr32(GRC_RX_CPU_EVENT);
5505 val |= (1 << 14); 5574 val |= GRC_RX_CPU_DRIVER_EVENT;
5506 tw32(GRC_RX_CPU_EVENT, val); 5575 tw32(GRC_RX_CPU_EVENT, val);
5507 5576
5508 /* Wait for RX cpu to ACK the event. */ 5577 /* Wait for RX cpu to ACK this event. */
5509 for (i = 0; i < 100; i++) { 5578 tg3_wait_for_event_ack(tp);
5510 if (!(tr32(GRC_RX_CPU_EVENT) & (1 << 14)))
5511 break;
5512 udelay(1);
5513 }
5514 } 5579 }
5515} 5580}
5516 5581
@@ -7102,7 +7167,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
7102 tp->link_config.autoneg = tp->link_config.orig_autoneg; 7167 tp->link_config.autoneg = tp->link_config.orig_autoneg;
7103 } 7168 }
7104 7169
7105 tp->mi_mode = MAC_MI_MODE_BASE; 7170 tp->mi_mode &= ~MAC_MI_MODE_AUTO_POLL;
7106 tw32_f(MAC_MI_MODE, tp->mi_mode); 7171 tw32_f(MAC_MI_MODE, tp->mi_mode);
7107 udelay(80); 7172 udelay(80);
7108 7173
@@ -7400,14 +7465,16 @@ static void tg3_timer(unsigned long __opaque)
7400 if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) { 7465 if (tp->tg3_flags & TG3_FLAG_ENABLE_ASF) {
7401 u32 val; 7466 u32 val;
7402 7467
7468 tg3_wait_for_event_ack(tp);
7469
7403 tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX, 7470 tg3_write_mem(tp, NIC_SRAM_FW_CMD_MBOX,
7404 FWCMD_NICDRV_ALIVE3); 7471 FWCMD_NICDRV_ALIVE3);
7405 tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4); 7472 tg3_write_mem(tp, NIC_SRAM_FW_CMD_LEN_MBOX, 4);
7406 /* 5 seconds timeout */ 7473 /* 5 seconds timeout */
7407 tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5); 7474 tg3_write_mem(tp, NIC_SRAM_FW_CMD_DATA_MBOX, 5);
7408 val = tr32(GRC_RX_CPU_EVENT); 7475 val = tr32(GRC_RX_CPU_EVENT);
7409 val |= (1 << 14); 7476 val |= GRC_RX_CPU_DRIVER_EVENT;
7410 tw32(GRC_RX_CPU_EVENT, val); 7477 tw32_f(GRC_RX_CPU_EVENT, val);
7411 } 7478 }
7412 tp->asf_counter = tp->asf_multiplier; 7479 tp->asf_counter = tp->asf_multiplier;
7413 } 7480 }
@@ -9568,14 +9635,9 @@ static int tg3_test_loopback(struct tg3 *tp)
9568 9635
9569 /* Turn off link-based power management. */ 9636 /* Turn off link-based power management. */
9570 cpmuctrl = tr32(TG3_CPMU_CTRL); 9637 cpmuctrl = tr32(TG3_CPMU_CTRL);
9571 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 || 9638 tw32(TG3_CPMU_CTRL,
9572 GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5761_AX) 9639 cpmuctrl & ~(CPMU_CTRL_LINK_SPEED_MODE |
9573 tw32(TG3_CPMU_CTRL, 9640 CPMU_CTRL_LINK_AWARE_MODE));
9574 cpmuctrl & ~(CPMU_CTRL_LINK_SPEED_MODE |
9575 CPMU_CTRL_LINK_AWARE_MODE));
9576 else
9577 tw32(TG3_CPMU_CTRL,
9578 cpmuctrl & ~CPMU_CTRL_LINK_AWARE_MODE);
9579 } 9641 }
9580 9642
9581 if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK)) 9643 if (tg3_run_loopback(tp, TG3_MAC_LOOPBACK))
@@ -9892,7 +9954,7 @@ static void __devinit tg3_get_nvram_size(struct tg3 *tp)
9892 return; 9954 return;
9893 } 9955 }
9894 } 9956 }
9895 tp->nvram_size = 0x80000; 9957 tp->nvram_size = TG3_NVRAM_SIZE_512KB;
9896} 9958}
9897 9959
9898static void __devinit tg3_get_nvram_info(struct tg3 *tp) 9960static void __devinit tg3_get_nvram_info(struct tg3 *tp)
@@ -10033,11 +10095,14 @@ static void __devinit tg3_get_5755_nvram_info(struct tg3 *tp)
10033 tp->nvram_pagesize = 264; 10095 tp->nvram_pagesize = 264;
10034 if (nvcfg1 == FLASH_5755VENDOR_ATMEL_FLASH_1 || 10096 if (nvcfg1 == FLASH_5755VENDOR_ATMEL_FLASH_1 ||
10035 nvcfg1 == FLASH_5755VENDOR_ATMEL_FLASH_5) 10097 nvcfg1 == FLASH_5755VENDOR_ATMEL_FLASH_5)
10036 tp->nvram_size = (protect ? 0x3e200 : 0x80000); 10098 tp->nvram_size = (protect ? 0x3e200 :
10099 TG3_NVRAM_SIZE_512KB);
10037 else if (nvcfg1 == FLASH_5755VENDOR_ATMEL_FLASH_2) 10100 else if (nvcfg1 == FLASH_5755VENDOR_ATMEL_FLASH_2)
10038 tp->nvram_size = (protect ? 0x1f200 : 0x40000); 10101 tp->nvram_size = (protect ? 0x1f200 :
10102 TG3_NVRAM_SIZE_256KB);
10039 else 10103 else
10040 tp->nvram_size = (protect ? 0x1f200 : 0x20000); 10104 tp->nvram_size = (protect ? 0x1f200 :
10105 TG3_NVRAM_SIZE_128KB);
10041 break; 10106 break;
10042 case FLASH_5752VENDOR_ST_M45PE10: 10107 case FLASH_5752VENDOR_ST_M45PE10:
10043 case FLASH_5752VENDOR_ST_M45PE20: 10108 case FLASH_5752VENDOR_ST_M45PE20:
@@ -10047,11 +10112,17 @@ static void __devinit tg3_get_5755_nvram_info(struct tg3 *tp)
10047 tp->tg3_flags2 |= TG3_FLG2_FLASH; 10112 tp->tg3_flags2 |= TG3_FLG2_FLASH;
10048 tp->nvram_pagesize = 256; 10113 tp->nvram_pagesize = 256;
10049 if (nvcfg1 == FLASH_5752VENDOR_ST_M45PE10) 10114 if (nvcfg1 == FLASH_5752VENDOR_ST_M45PE10)
10050 tp->nvram_size = (protect ? 0x10000 : 0x20000); 10115 tp->nvram_size = (protect ?
10116 TG3_NVRAM_SIZE_64KB :
10117 TG3_NVRAM_SIZE_128KB);
10051 else if (nvcfg1 == FLASH_5752VENDOR_ST_M45PE20) 10118 else if (nvcfg1 == FLASH_5752VENDOR_ST_M45PE20)
10052 tp->nvram_size = (protect ? 0x10000 : 0x40000); 10119 tp->nvram_size = (protect ?
10120 TG3_NVRAM_SIZE_64KB :
10121 TG3_NVRAM_SIZE_256KB);
10053 else 10122 else
10054 tp->nvram_size = (protect ? 0x20000 : 0x80000); 10123 tp->nvram_size = (protect ?
10124 TG3_NVRAM_SIZE_128KB :
10125 TG3_NVRAM_SIZE_512KB);
10055 break; 10126 break;
10056 } 10127 }
10057} 10128}
@@ -10145,25 +10216,25 @@ static void __devinit tg3_get_5761_nvram_info(struct tg3 *tp)
10145 case FLASH_5761VENDOR_ATMEL_MDB161D: 10216 case FLASH_5761VENDOR_ATMEL_MDB161D:
10146 case FLASH_5761VENDOR_ST_A_M45PE16: 10217 case FLASH_5761VENDOR_ST_A_M45PE16:
10147 case FLASH_5761VENDOR_ST_M_M45PE16: 10218 case FLASH_5761VENDOR_ST_M_M45PE16:
10148 tp->nvram_size = 0x100000; 10219 tp->nvram_size = TG3_NVRAM_SIZE_2MB;
10149 break; 10220 break;
10150 case FLASH_5761VENDOR_ATMEL_ADB081D: 10221 case FLASH_5761VENDOR_ATMEL_ADB081D:
10151 case FLASH_5761VENDOR_ATMEL_MDB081D: 10222 case FLASH_5761VENDOR_ATMEL_MDB081D:
10152 case FLASH_5761VENDOR_ST_A_M45PE80: 10223 case FLASH_5761VENDOR_ST_A_M45PE80:
10153 case FLASH_5761VENDOR_ST_M_M45PE80: 10224 case FLASH_5761VENDOR_ST_M_M45PE80:
10154 tp->nvram_size = 0x80000; 10225 tp->nvram_size = TG3_NVRAM_SIZE_1MB;
10155 break; 10226 break;
10156 case FLASH_5761VENDOR_ATMEL_ADB041D: 10227 case FLASH_5761VENDOR_ATMEL_ADB041D:
10157 case FLASH_5761VENDOR_ATMEL_MDB041D: 10228 case FLASH_5761VENDOR_ATMEL_MDB041D:
10158 case FLASH_5761VENDOR_ST_A_M45PE40: 10229 case FLASH_5761VENDOR_ST_A_M45PE40:
10159 case FLASH_5761VENDOR_ST_M_M45PE40: 10230 case FLASH_5761VENDOR_ST_M_M45PE40:
10160 tp->nvram_size = 0x40000; 10231 tp->nvram_size = TG3_NVRAM_SIZE_512KB;
10161 break; 10232 break;
10162 case FLASH_5761VENDOR_ATMEL_ADB021D: 10233 case FLASH_5761VENDOR_ATMEL_ADB021D:
10163 case FLASH_5761VENDOR_ATMEL_MDB021D: 10234 case FLASH_5761VENDOR_ATMEL_MDB021D:
10164 case FLASH_5761VENDOR_ST_A_M45PE20: 10235 case FLASH_5761VENDOR_ST_A_M45PE20:
10165 case FLASH_5761VENDOR_ST_M_M45PE20: 10236 case FLASH_5761VENDOR_ST_M_M45PE20:
10166 tp->nvram_size = 0x20000; 10237 tp->nvram_size = TG3_NVRAM_SIZE_256KB;
10167 break; 10238 break;
10168 } 10239 }
10169 } 10240 }
@@ -11764,6 +11835,12 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
11764 tp->phy_otp = TG3_OTP_DEFAULT; 11835 tp->phy_otp = TG3_OTP_DEFAULT;
11765 } 11836 }
11766 11837
11838 if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
11839 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761)
11840 tp->mi_mode = MAC_MI_MODE_500KHZ_CONST;
11841 else
11842 tp->mi_mode = MAC_MI_MODE_BASE;
11843
11767 tp->coalesce_mode = 0; 11844 tp->coalesce_mode = 0;
11768 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX && 11845 if (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_AX &&
11769 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX) 11846 GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5700_BX)
@@ -12692,7 +12769,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
12692 tp->mac_mode = TG3_DEF_MAC_MODE; 12769 tp->mac_mode = TG3_DEF_MAC_MODE;
12693 tp->rx_mode = TG3_DEF_RX_MODE; 12770 tp->rx_mode = TG3_DEF_RX_MODE;
12694 tp->tx_mode = TG3_DEF_TX_MODE; 12771 tp->tx_mode = TG3_DEF_TX_MODE;
12695 tp->mi_mode = MAC_MI_MODE_BASE; 12772
12696 if (tg3_debug > 0) 12773 if (tg3_debug > 0)
12697 tp->msg_enable = tg3_debug; 12774 tp->msg_enable = tg3_debug;
12698 else 12775 else
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index c688c3ac5035..0404f93baa29 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -415,7 +415,7 @@
415#define MAC_MI_MODE_CLK_10MHZ 0x00000001 415#define MAC_MI_MODE_CLK_10MHZ 0x00000001
416#define MAC_MI_MODE_SHORT_PREAMBLE 0x00000002 416#define MAC_MI_MODE_SHORT_PREAMBLE 0x00000002
417#define MAC_MI_MODE_AUTO_POLL 0x00000010 417#define MAC_MI_MODE_AUTO_POLL 0x00000010
418#define MAC_MI_MODE_CORE_CLK_62MHZ 0x00008000 418#define MAC_MI_MODE_500KHZ_CONST 0x00008000
419#define MAC_MI_MODE_BASE 0x000c0000 /* XXX magic values XXX */ 419#define MAC_MI_MODE_BASE 0x000c0000 /* XXX magic values XXX */
420#define MAC_AUTO_POLL_STATUS 0x00000458 420#define MAC_AUTO_POLL_STATUS 0x00000458
421#define MAC_AUTO_POLL_ERROR 0x00000001 421#define MAC_AUTO_POLL_ERROR 0x00000001
@@ -1429,6 +1429,7 @@
1429#define GRC_LCLCTRL_AUTO_SEEPROM 0x01000000 1429#define GRC_LCLCTRL_AUTO_SEEPROM 0x01000000
1430#define GRC_TIMER 0x0000680c 1430#define GRC_TIMER 0x0000680c
1431#define GRC_RX_CPU_EVENT 0x00006810 1431#define GRC_RX_CPU_EVENT 0x00006810
1432#define GRC_RX_CPU_DRIVER_EVENT 0x00004000
1432#define GRC_RX_TIMER_REF 0x00006814 1433#define GRC_RX_TIMER_REF 0x00006814
1433#define GRC_RX_CPU_SEM 0x00006818 1434#define GRC_RX_CPU_SEM 0x00006818
1434#define GRC_REMOTE_RX_CPU_ATTN 0x0000681c 1435#define GRC_REMOTE_RX_CPU_ATTN 0x0000681c
@@ -1676,6 +1677,7 @@
1676#define FWCMD_NICDRV_IPV6ADDR_CHG 0x00000004 1677#define FWCMD_NICDRV_IPV6ADDR_CHG 0x00000004
1677#define FWCMD_NICDRV_FIX_DMAR 0x00000005 1678#define FWCMD_NICDRV_FIX_DMAR 0x00000005
1678#define FWCMD_NICDRV_FIX_DMAW 0x00000006 1679#define FWCMD_NICDRV_FIX_DMAW 0x00000006
1680#define FWCMD_NICDRV_LINK_UPDATE 0x0000000c
1679#define FWCMD_NICDRV_ALIVE2 0x0000000d 1681#define FWCMD_NICDRV_ALIVE2 0x0000000d
1680#define FWCMD_NICDRV_ALIVE3 0x0000000e 1682#define FWCMD_NICDRV_ALIVE3 0x0000000e
1681#define NIC_SRAM_FW_CMD_LEN_MBOX 0x00000b7c 1683#define NIC_SRAM_FW_CMD_LEN_MBOX 0x00000b7c
@@ -2576,6 +2578,13 @@ struct tg3 {
2576 2578
2577 int nvram_lock_cnt; 2579 int nvram_lock_cnt;
2578 u32 nvram_size; 2580 u32 nvram_size;
2581#define TG3_NVRAM_SIZE_64KB 0x00010000
2582#define TG3_NVRAM_SIZE_128KB 0x00020000
2583#define TG3_NVRAM_SIZE_256KB 0x00040000
2584#define TG3_NVRAM_SIZE_512KB 0x00080000
2585#define TG3_NVRAM_SIZE_1MB 0x00100000
2586#define TG3_NVRAM_SIZE_2MB 0x00200000
2587
2579 u32 nvram_pagesize; 2588 u32 nvram_pagesize;
2580 u32 nvram_jedecnum; 2589 u32 nvram_jedecnum;
2581 2590
@@ -2584,10 +2593,10 @@ struct tg3 {
2584#define JEDEC_SAIFUN 0x4f 2593#define JEDEC_SAIFUN 0x4f
2585#define JEDEC_SST 0xbf 2594#define JEDEC_SST 0xbf
2586 2595
2587#define ATMEL_AT24C64_CHIP_SIZE (64 * 1024) 2596#define ATMEL_AT24C64_CHIP_SIZE TG3_NVRAM_SIZE_64KB
2588#define ATMEL_AT24C64_PAGE_SIZE (32) 2597#define ATMEL_AT24C64_PAGE_SIZE (32)
2589 2598
2590#define ATMEL_AT24C512_CHIP_SIZE (512 * 1024) 2599#define ATMEL_AT24C512_CHIP_SIZE TG3_NVRAM_SIZE_512KB
2591#define ATMEL_AT24C512_PAGE_SIZE (128) 2600#define ATMEL_AT24C512_PAGE_SIZE (128)
2592 2601
2593#define ATMEL_AT45DB0X1B_PAGE_POS 9 2602#define ATMEL_AT45DB0X1B_PAGE_POS 9
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index eff2a158a411..37783cdd301a 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -691,6 +691,10 @@ struct b43_wl {
691 691
692 struct mutex mutex; 692 struct mutex mutex;
693 spinlock_t irq_lock; 693 spinlock_t irq_lock;
694 /* R/W lock for data transmission.
695 * Transmissions on 2+ queues can run concurrently, but somebody else
696 * might sync with TX by write_lock_irqsave()'ing. */
697 rwlock_t tx_lock;
694 /* Lock for LEDs access. */ 698 /* Lock for LEDs access. */
695 spinlock_t leds_lock; 699 spinlock_t leds_lock;
696 /* Lock for SHM access. */ 700 /* Lock for SHM access. */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 8c24cd72aaca..8fdba9415c04 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -729,6 +729,7 @@ static void b43_synchronize_irq(struct b43_wldev *dev)
729 */ 729 */
730void b43_dummy_transmission(struct b43_wldev *dev) 730void b43_dummy_transmission(struct b43_wldev *dev)
731{ 731{
732 struct b43_wl *wl = dev->wl;
732 struct b43_phy *phy = &dev->phy; 733 struct b43_phy *phy = &dev->phy;
733 unsigned int i, max_loop; 734 unsigned int i, max_loop;
734 u16 value; 735 u16 value;
@@ -755,6 +756,9 @@ void b43_dummy_transmission(struct b43_wldev *dev)
755 return; 756 return;
756 } 757 }
757 758
759 spin_lock_irq(&wl->irq_lock);
760 write_lock(&wl->tx_lock);
761
758 for (i = 0; i < 5; i++) 762 for (i = 0; i < 5; i++)
759 b43_ram_write(dev, i * 4, buffer[i]); 763 b43_ram_write(dev, i * 4, buffer[i]);
760 764
@@ -795,6 +799,9 @@ void b43_dummy_transmission(struct b43_wldev *dev)
795 } 799 }
796 if (phy->radio_ver == 0x2050 && phy->radio_rev <= 0x5) 800 if (phy->radio_ver == 0x2050 && phy->radio_rev <= 0x5)
797 b43_radio_write16(dev, 0x0051, 0x0037); 801 b43_radio_write16(dev, 0x0051, 0x0037);
802
803 write_unlock(&wl->tx_lock);
804 spin_unlock_irq(&wl->irq_lock);
798} 805}
799 806
800static void key_write(struct b43_wldev *dev, 807static void key_write(struct b43_wldev *dev,
@@ -2840,24 +2847,31 @@ static int b43_op_tx(struct ieee80211_hw *hw,
2840{ 2847{
2841 struct b43_wl *wl = hw_to_b43_wl(hw); 2848 struct b43_wl *wl = hw_to_b43_wl(hw);
2842 struct b43_wldev *dev = wl->current_dev; 2849 struct b43_wldev *dev = wl->current_dev;
2843 int err = -ENODEV; 2850 unsigned long flags;
2851 int err;
2844 2852
2845 if (unlikely(skb->len < 2 + 2 + 6)) { 2853 if (unlikely(skb->len < 2 + 2 + 6)) {
2846 /* Too short, this can't be a valid frame. */ 2854 /* Too short, this can't be a valid frame. */
2847 return -EINVAL; 2855 dev_kfree_skb_any(skb);
2856 return NETDEV_TX_OK;
2848 } 2857 }
2849 B43_WARN_ON(skb_shinfo(skb)->nr_frags); 2858 B43_WARN_ON(skb_shinfo(skb)->nr_frags);
2850
2851 if (unlikely(!dev)) 2859 if (unlikely(!dev))
2852 goto out; 2860 return NETDEV_TX_BUSY;
2853 if (unlikely(b43_status(dev) < B43_STAT_STARTED)) 2861
2854 goto out; 2862 /* Transmissions on seperate queues can run concurrently. */
2855 /* TX is done without a global lock. */ 2863 read_lock_irqsave(&wl->tx_lock, flags);
2856 if (b43_using_pio_transfers(dev)) 2864
2857 err = b43_pio_tx(dev, skb, ctl); 2865 err = -ENODEV;
2858 else 2866 if (likely(b43_status(dev) >= B43_STAT_STARTED)) {
2859 err = b43_dma_tx(dev, skb, ctl); 2867 if (b43_using_pio_transfers(dev))
2860out: 2868 err = b43_pio_tx(dev, skb, ctl);
2869 else
2870 err = b43_dma_tx(dev, skb, ctl);
2871 }
2872
2873 read_unlock_irqrestore(&wl->tx_lock, flags);
2874
2861 if (unlikely(err)) 2875 if (unlikely(err))
2862 return NETDEV_TX_BUSY; 2876 return NETDEV_TX_BUSY;
2863 return NETDEV_TX_OK; 2877 return NETDEV_TX_OK;
@@ -3476,7 +3490,9 @@ static void b43_wireless_core_stop(struct b43_wldev *dev)
3476 spin_unlock_irqrestore(&wl->irq_lock, flags); 3490 spin_unlock_irqrestore(&wl->irq_lock, flags);
3477 b43_synchronize_irq(dev); 3491 b43_synchronize_irq(dev);
3478 3492
3493 write_lock_irqsave(&wl->tx_lock, flags);
3479 b43_set_status(dev, B43_STAT_INITIALIZED); 3494 b43_set_status(dev, B43_STAT_INITIALIZED);
3495 write_unlock_irqrestore(&wl->tx_lock, flags);
3480 3496
3481 b43_pio_stop(dev); 3497 b43_pio_stop(dev);
3482 mutex_unlock(&wl->mutex); 3498 mutex_unlock(&wl->mutex);
@@ -3485,8 +3501,6 @@ static void b43_wireless_core_stop(struct b43_wldev *dev)
3485 cancel_delayed_work_sync(&dev->periodic_work); 3501 cancel_delayed_work_sync(&dev->periodic_work);
3486 mutex_lock(&wl->mutex); 3502 mutex_lock(&wl->mutex);
3487 3503
3488 ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy.
3489
3490 b43_mac_suspend(dev); 3504 b43_mac_suspend(dev);
3491 free_irq(dev->dev->irq, dev); 3505 free_irq(dev->dev->irq, dev);
3492 b43dbg(wl, "Wireless interface stopped\n"); 3506 b43dbg(wl, "Wireless interface stopped\n");
@@ -4326,6 +4340,14 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
4326 err = -EOPNOTSUPP; 4340 err = -EOPNOTSUPP;
4327 goto err_powerdown; 4341 goto err_powerdown;
4328 } 4342 }
4343 if (1 /* disable A-PHY */) {
4344 /* FIXME: For now we disable the A-PHY on multi-PHY devices. */
4345 if (dev->phy.type != B43_PHYTYPE_N) {
4346 have_2ghz_phy = 1;
4347 have_5ghz_phy = 0;
4348 }
4349 }
4350
4329 dev->phy.gmode = have_2ghz_phy; 4351 dev->phy.gmode = have_2ghz_phy;
4330 tmp = dev->phy.gmode ? B43_TMSLOW_GMODE : 0; 4352 tmp = dev->phy.gmode ? B43_TMSLOW_GMODE : 0;
4331 b43_wireless_core_reset(dev, tmp); 4353 b43_wireless_core_reset(dev, tmp);
@@ -4490,6 +4512,7 @@ static int b43_wireless_init(struct ssb_device *dev)
4490 memset(wl, 0, sizeof(*wl)); 4512 memset(wl, 0, sizeof(*wl));
4491 wl->hw = hw; 4513 wl->hw = hw;
4492 spin_lock_init(&wl->irq_lock); 4514 spin_lock_init(&wl->irq_lock);
4515 rwlock_init(&wl->tx_lock);
4493 spin_lock_init(&wl->leds_lock); 4516 spin_lock_init(&wl->leds_lock);
4494 spin_lock_init(&wl->shm_lock); 4517 spin_lock_init(&wl->shm_lock);
4495 mutex_init(&wl->mutex); 4518 mutex_init(&wl->mutex);
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 45c1c5533bf0..c7695a215a39 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -742,7 +742,6 @@ struct iwl3945_priv {
742 u8 direct_ssid_len; 742 u8 direct_ssid_len;
743 u8 direct_ssid[IW_ESSID_MAX_SIZE]; 743 u8 direct_ssid[IW_ESSID_MAX_SIZE];
744 struct iwl3945_scan_cmd *scan; 744 struct iwl3945_scan_cmd *scan;
745 u8 only_active_channel;
746 745
747 /* spinlock */ 746 /* spinlock */
748 spinlock_t lock; /* protect general shared data */ 747 spinlock_t lock; /* protect general shared data */
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h
index 9ed13cb0a2a9..581b98556c86 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.h
@@ -996,7 +996,6 @@ struct iwl_priv {
996 u8 direct_ssid_len; 996 u8 direct_ssid_len;
997 u8 direct_ssid[IW_ESSID_MAX_SIZE]; 997 u8 direct_ssid[IW_ESSID_MAX_SIZE];
998 struct iwl4965_scan_cmd *scan; 998 struct iwl4965_scan_cmd *scan;
999 u8 only_active_channel;
1000 999
1001 /* spinlock */ 1000 /* spinlock */
1002 spinlock_t lock; /* protect general shared data */ 1001 spinlock_t lock; /* protect general shared data */
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index a1a0b3c581f1..13925b627e3b 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -4968,17 +4968,6 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv,
4968 if (channels[i].flags & IEEE80211_CHAN_DISABLED) 4968 if (channels[i].flags & IEEE80211_CHAN_DISABLED)
4969 continue; 4969 continue;
4970 4970
4971 if (channels[i].hw_value ==
4972 le16_to_cpu(priv->active_rxon.channel)) {
4973 if (iwl3945_is_associated(priv)) {
4974 IWL_DEBUG_SCAN
4975 ("Skipping current channel %d\n",
4976 le16_to_cpu(priv->active_rxon.channel));
4977 continue;
4978 }
4979 } else if (priv->only_active_channel)
4980 continue;
4981
4982 scan_ch->channel = channels[i].hw_value; 4971 scan_ch->channel = channels[i].hw_value;
4983 4972
4984 ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel); 4973 ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel);
@@ -6303,12 +6292,17 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6303 priv->direct_ssid, priv->direct_ssid_len); 6292 priv->direct_ssid, priv->direct_ssid_len);
6304 direct_mask = 1; 6293 direct_mask = 1;
6305 } else if (!iwl3945_is_associated(priv) && priv->essid_len) { 6294 } else if (!iwl3945_is_associated(priv) && priv->essid_len) {
6295 IWL_DEBUG_SCAN
6296 ("Kicking off one direct scan for '%s' when not associated\n",
6297 iwl3945_escape_essid(priv->essid, priv->essid_len));
6306 scan->direct_scan[0].id = WLAN_EID_SSID; 6298 scan->direct_scan[0].id = WLAN_EID_SSID;
6307 scan->direct_scan[0].len = priv->essid_len; 6299 scan->direct_scan[0].len = priv->essid_len;
6308 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); 6300 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
6309 direct_mask = 1; 6301 direct_mask = 1;
6310 } else 6302 } else {
6303 IWL_DEBUG_SCAN("Kicking off one indirect scan.\n");
6311 direct_mask = 0; 6304 direct_mask = 0;
6305 }
6312 6306
6313 /* We don't build a direct scan probe request; the uCode will do 6307 /* We don't build a direct scan probe request; the uCode will do
6314 * that based on the direct_mask added to each channel entry */ 6308 * that based on the direct_mask added to each channel entry */
@@ -6346,23 +6340,18 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6346 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) 6340 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR)
6347 scan->filter_flags = RXON_FILTER_PROMISC_MSK; 6341 scan->filter_flags = RXON_FILTER_PROMISC_MSK;
6348 6342
6349 if (direct_mask) { 6343 if (direct_mask)
6350 IWL_DEBUG_SCAN
6351 ("Initiating direct scan for %s.\n",
6352 iwl3945_escape_essid(priv->essid, priv->essid_len));
6353 scan->channel_count = 6344 scan->channel_count =
6354 iwl3945_get_channels_for_scan( 6345 iwl3945_get_channels_for_scan(
6355 priv, band, 1, /* active */ 6346 priv, band, 1, /* active */
6356 direct_mask, 6347 direct_mask,
6357 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 6348 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
6358 } else { 6349 else
6359 IWL_DEBUG_SCAN("Initiating indirect scan.\n");
6360 scan->channel_count = 6350 scan->channel_count =
6361 iwl3945_get_channels_for_scan( 6351 iwl3945_get_channels_for_scan(
6362 priv, band, 0, /* passive */ 6352 priv, band, 0, /* passive */
6363 direct_mask, 6353 direct_mask,
6364 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 6354 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
6365 }
6366 6355
6367 cmd.len += le16_to_cpu(scan->tx_cmd.len) + 6356 cmd.len += le16_to_cpu(scan->tx_cmd.len) +
6368 scan->channel_count * sizeof(struct iwl3945_scan_channel); 6357 scan->channel_count * sizeof(struct iwl3945_scan_channel);
@@ -7314,8 +7303,6 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
7314 return; 7303 return;
7315 } 7304 }
7316 7305
7317 priv->only_active_channel = 0;
7318
7319 iwl3945_set_rate(priv); 7306 iwl3945_set_rate(priv);
7320 7307
7321 mutex_unlock(&priv->mutex); 7308 mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index d0bbcaaeb94c..883b42f7e998 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -4633,17 +4633,6 @@ static int iwl4965_get_channels_for_scan(struct iwl_priv *priv,
4633 if (channels[i].flags & IEEE80211_CHAN_DISABLED) 4633 if (channels[i].flags & IEEE80211_CHAN_DISABLED)
4634 continue; 4634 continue;
4635 4635
4636 if (ieee80211_frequency_to_channel(channels[i].center_freq) ==
4637 le16_to_cpu(priv->active_rxon.channel)) {
4638 if (iwl_is_associated(priv)) {
4639 IWL_DEBUG_SCAN
4640 ("Skipping current channel %d\n",
4641 le16_to_cpu(priv->active_rxon.channel));
4642 continue;
4643 }
4644 } else if (priv->only_active_channel)
4645 continue;
4646
4647 scan_ch->channel = ieee80211_frequency_to_channel(channels[i].center_freq); 4636 scan_ch->channel = ieee80211_frequency_to_channel(channels[i].center_freq);
4648 4637
4649 ch_info = iwl_get_channel_info(priv, band, 4638 ch_info = iwl_get_channel_info(priv, band,
@@ -5824,11 +5813,15 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
5824 priv->direct_ssid, priv->direct_ssid_len); 5813 priv->direct_ssid, priv->direct_ssid_len);
5825 direct_mask = 1; 5814 direct_mask = 1;
5826 } else if (!iwl_is_associated(priv) && priv->essid_len) { 5815 } else if (!iwl_is_associated(priv) && priv->essid_len) {
5816 IWL_DEBUG_SCAN
5817 ("Kicking off one direct scan for '%s' when not associated\n",
5818 iwl4965_escape_essid(priv->essid, priv->essid_len));
5827 scan->direct_scan[0].id = WLAN_EID_SSID; 5819 scan->direct_scan[0].id = WLAN_EID_SSID;
5828 scan->direct_scan[0].len = priv->essid_len; 5820 scan->direct_scan[0].len = priv->essid_len;
5829 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); 5821 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
5830 direct_mask = 1; 5822 direct_mask = 1;
5831 } else { 5823 } else {
5824 IWL_DEBUG_SCAN("Kicking off one indirect scan.\n");
5832 direct_mask = 0; 5825 direct_mask = 0;
5833 } 5826 }
5834 5827
@@ -5881,23 +5874,18 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
5881 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) 5874 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR)
5882 scan->filter_flags = RXON_FILTER_PROMISC_MSK; 5875 scan->filter_flags = RXON_FILTER_PROMISC_MSK;
5883 5876
5884 if (direct_mask) { 5877 if (direct_mask)
5885 IWL_DEBUG_SCAN
5886 ("Initiating direct scan for %s.\n",
5887 iwl4965_escape_essid(priv->essid, priv->essid_len));
5888 scan->channel_count = 5878 scan->channel_count =
5889 iwl4965_get_channels_for_scan( 5879 iwl4965_get_channels_for_scan(
5890 priv, band, 1, /* active */ 5880 priv, band, 1, /* active */
5891 direct_mask, 5881 direct_mask,
5892 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 5882 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
5893 } else { 5883 else
5894 IWL_DEBUG_SCAN("Initiating indirect scan.\n");
5895 scan->channel_count = 5884 scan->channel_count =
5896 iwl4965_get_channels_for_scan( 5885 iwl4965_get_channels_for_scan(
5897 priv, band, 0, /* passive */ 5886 priv, band, 0, /* passive */
5898 direct_mask, 5887 direct_mask,
5899 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 5888 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
5900 }
5901 5889
5902 cmd.len += le16_to_cpu(scan->tx_cmd.len) + 5890 cmd.len += le16_to_cpu(scan->tx_cmd.len) +
5903 scan->channel_count * sizeof(struct iwl4965_scan_channel); 5891 scan->channel_count * sizeof(struct iwl4965_scan_channel);
@@ -7061,8 +7049,6 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
7061 return; 7049 return;
7062 } 7050 }
7063 7051
7064 priv->only_active_channel = 0;
7065
7066 iwl4965_set_rate(priv); 7052 iwl4965_set_rate(priv);
7067 7053
7068 mutex_unlock(&priv->mutex); 7054 mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 1a409fcc80d3..d448c9702a0f 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -298,7 +298,8 @@ static int lbs_do_scan(struct lbs_private *priv, uint8_t bsstype,
298 uint8_t *tlv; /* pointer into our current, growing TLV storage area */ 298 uint8_t *tlv; /* pointer into our current, growing TLV storage area */
299 299
300 lbs_deb_enter_args(LBS_DEB_SCAN, "bsstype %d, chanlist[].chan %d, chan_count %d", 300 lbs_deb_enter_args(LBS_DEB_SCAN, "bsstype %d, chanlist[].chan %d, chan_count %d",
301 bsstype, chan_list[0].channumber, chan_count); 301 bsstype, chan_list ? chan_list[0].channumber : -1,
302 chan_count);
302 303
303 /* create the fixed part for scan command */ 304 /* create the fixed part for scan command */
304 scan_cmd = kzalloc(MAX_SCAN_CFG_ALLOC, GFP_KERNEL); 305 scan_cmd = kzalloc(MAX_SCAN_CFG_ALLOC, GFP_KERNEL);
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index b41187af1306..560b9c73c0b9 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -363,7 +363,7 @@ static void rt2400pci_config_erp(struct rt2x00_dev *rt2x00dev,
363 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg); 363 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg);
364 364
365 rt2x00pci_register_read(rt2x00dev, ARCSR2, &reg); 365 rt2x00pci_register_read(rt2x00dev, ARCSR2, &reg);
366 rt2x00_set_field32(&reg, ARCSR2_SIGNAL, 0x00 | preamble_mask); 366 rt2x00_set_field32(&reg, ARCSR2_SIGNAL, 0x00);
367 rt2x00_set_field32(&reg, ARCSR2_SERVICE, 0x04); 367 rt2x00_set_field32(&reg, ARCSR2_SERVICE, 0x04);
368 rt2x00_set_field32(&reg, ARCSR2_LENGTH, get_duration(ACK_SIZE, 10)); 368 rt2x00_set_field32(&reg, ARCSR2_LENGTH, get_duration(ACK_SIZE, 10));
369 rt2x00pci_register_write(rt2x00dev, ARCSR2, reg); 369 rt2x00pci_register_write(rt2x00dev, ARCSR2, reg);
@@ -1308,7 +1308,7 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
1308 1308
1309 if (value == LED_MODE_TXRX_ACTIVITY) { 1309 if (value == LED_MODE_TXRX_ACTIVITY) {
1310 rt2x00dev->led_qual.rt2x00dev = rt2x00dev; 1310 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
1311 rt2x00dev->led_radio.type = LED_TYPE_ACTIVITY; 1311 rt2x00dev->led_qual.type = LED_TYPE_ACTIVITY;
1312 rt2x00dev->led_qual.led_dev.brightness_set = 1312 rt2x00dev->led_qual.led_dev.brightness_set =
1313 rt2400pci_brightness_set; 1313 rt2400pci_brightness_set;
1314 rt2x00dev->led_qual.led_dev.blink_set = 1314 rt2x00dev->led_qual.led_dev.blink_set =
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 5ade097ed45e..a5ed54b69262 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -370,7 +370,7 @@ static void rt2500pci_config_erp(struct rt2x00_dev *rt2x00dev,
370 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg); 370 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg);
371 371
372 rt2x00pci_register_read(rt2x00dev, ARCSR2, &reg); 372 rt2x00pci_register_read(rt2x00dev, ARCSR2, &reg);
373 rt2x00_set_field32(&reg, ARCSR2_SIGNAL, 0x00 | preamble_mask); 373 rt2x00_set_field32(&reg, ARCSR2_SIGNAL, 0x00);
374 rt2x00_set_field32(&reg, ARCSR2_SERVICE, 0x04); 374 rt2x00_set_field32(&reg, ARCSR2_SERVICE, 0x04);
375 rt2x00_set_field32(&reg, ARCSR2_LENGTH, get_duration(ACK_SIZE, 10)); 375 rt2x00_set_field32(&reg, ARCSR2_LENGTH, get_duration(ACK_SIZE, 10));
376 rt2x00pci_register_write(rt2x00dev, ARCSR2, reg); 376 rt2x00pci_register_write(rt2x00dev, ARCSR2, reg);
@@ -1485,7 +1485,7 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
1485 1485
1486 if (value == LED_MODE_TXRX_ACTIVITY) { 1486 if (value == LED_MODE_TXRX_ACTIVITY) {
1487 rt2x00dev->led_qual.rt2x00dev = rt2x00dev; 1487 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
1488 rt2x00dev->led_radio.type = LED_TYPE_ACTIVITY; 1488 rt2x00dev->led_qual.type = LED_TYPE_ACTIVITY;
1489 rt2x00dev->led_qual.led_dev.brightness_set = 1489 rt2x00dev->led_qual.led_dev.brightness_set =
1490 rt2500pci_brightness_set; 1490 rt2500pci_brightness_set;
1491 rt2x00dev->led_qual.led_dev.blink_set = 1491 rt2x00dev->led_qual.led_dev.blink_set =
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 6bb07b339325..fdbd0ef2be4b 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1394,7 +1394,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1394 1394
1395 if (value == LED_MODE_TXRX_ACTIVITY) { 1395 if (value == LED_MODE_TXRX_ACTIVITY) {
1396 rt2x00dev->led_qual.rt2x00dev = rt2x00dev; 1396 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
1397 rt2x00dev->led_radio.type = LED_TYPE_ACTIVITY; 1397 rt2x00dev->led_qual.type = LED_TYPE_ACTIVITY;
1398 rt2x00dev->led_qual.led_dev.brightness_set = 1398 rt2x00dev->led_qual.led_dev.brightness_set =
1399 rt2500usb_brightness_set; 1399 rt2500usb_brightness_set;
1400 rt2x00dev->led_qual.led_dev.blink_set = 1400 rt2x00dev->led_qual.led_dev.blink_set =
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index f8fe7a139a8a..8d8657fb64dd 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -114,6 +114,7 @@ int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev)
114 return status; 114 return status;
115 115
116 rt2x00leds_led_radio(rt2x00dev, true); 116 rt2x00leds_led_radio(rt2x00dev, true);
117 rt2x00led_led_activity(rt2x00dev, true);
117 118
118 __set_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags); 119 __set_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags);
119 120
@@ -157,6 +158,7 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)
157 * Disable radio. 158 * Disable radio.
158 */ 159 */
159 rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_RADIO_OFF); 160 rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_RADIO_OFF);
161 rt2x00led_led_activity(rt2x00dev, false);
160 rt2x00leds_led_radio(rt2x00dev, false); 162 rt2x00leds_led_radio(rt2x00dev, false);
161} 163}
162 164
diff --git a/drivers/net/wireless/rt2x00/rt2x00leds.c b/drivers/net/wireless/rt2x00/rt2x00leds.c
index 40c1f5c1b805..b362a1cf3f8d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00leds.c
+++ b/drivers/net/wireless/rt2x00/rt2x00leds.c
@@ -72,6 +72,21 @@ void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi)
72 } 72 }
73} 73}
74 74
75void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev, bool enabled)
76{
77 struct rt2x00_led *led = &rt2x00dev->led_qual;
78 unsigned int brightness;
79
80 if ((led->type != LED_TYPE_ACTIVITY) || !(led->flags & LED_REGISTERED))
81 return;
82
83 brightness = enabled ? LED_FULL : LED_OFF;
84 if (brightness != led->led_dev.brightness) {
85 led->led_dev.brightness_set(&led->led_dev, brightness);
86 led->led_dev.brightness = brightness;
87 }
88}
89
75void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled) 90void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled)
76{ 91{
77 struct rt2x00_led *led = &rt2x00dev->led_assoc; 92 struct rt2x00_led *led = &rt2x00dev->led_assoc;
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index 5be32fffc74c..41ee02cd2825 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -185,6 +185,7 @@ static inline void rt2x00rfkill_resume(struct rt2x00_dev *rt2x00dev)
185 */ 185 */
186#ifdef CONFIG_RT2X00_LIB_LEDS 186#ifdef CONFIG_RT2X00_LIB_LEDS
187void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi); 187void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi);
188void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev, bool enabled);
188void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled); 189void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled);
189void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled); 190void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled);
190void rt2x00leds_register(struct rt2x00_dev *rt2x00dev); 191void rt2x00leds_register(struct rt2x00_dev *rt2x00dev);
@@ -197,6 +198,11 @@ static inline void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev,
197{ 198{
198} 199}
199 200
201static inline void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev,
202 bool enabled)
203{
204}
205
200static inline void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, 206static inline void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev,
201 bool enabled) 207 bool enabled)
202{ 208{
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 468a31c8c113..ae12dcdd3c24 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2087,7 +2087,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2087 2087
2088 if (value == LED_MODE_SIGNAL_STRENGTH) { 2088 if (value == LED_MODE_SIGNAL_STRENGTH) {
2089 rt2x00dev->led_qual.rt2x00dev = rt2x00dev; 2089 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
2090 rt2x00dev->led_radio.type = LED_TYPE_QUALITY; 2090 rt2x00dev->led_qual.type = LED_TYPE_QUALITY;
2091 rt2x00dev->led_qual.led_dev.brightness_set = 2091 rt2x00dev->led_qual.led_dev.brightness_set =
2092 rt61pci_brightness_set; 2092 rt61pci_brightness_set;
2093 rt2x00dev->led_qual.led_dev.blink_set = 2093 rt2x00dev->led_qual.led_dev.blink_set =
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index a9efe25f1ea7..da19a3a91f4d 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1647,7 +1647,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1647 1647
1648 if (value == LED_MODE_SIGNAL_STRENGTH) { 1648 if (value == LED_MODE_SIGNAL_STRENGTH) {
1649 rt2x00dev->led_qual.rt2x00dev = rt2x00dev; 1649 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
1650 rt2x00dev->led_radio.type = LED_TYPE_QUALITY; 1650 rt2x00dev->led_qual.type = LED_TYPE_QUALITY;
1651 rt2x00dev->led_qual.led_dev.brightness_set = 1651 rt2x00dev->led_qual.led_dev.brightness_set =
1652 rt73usb_brightness_set; 1652 rt73usb_brightness_set;
1653 rt2x00dev->led_qual.led_dev.blink_set = 1653 rt2x00dev->led_qual.led_dev.blink_set =
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index e62018a36133..8bddff150c70 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1803,7 +1803,7 @@ static void __exit netif_exit(void)
1803 if (is_initial_xendomain()) 1803 if (is_initial_xendomain())
1804 return; 1804 return;
1805 1805
1806 return xenbus_unregister_driver(&netfront); 1806 xenbus_unregister_driver(&netfront);
1807} 1807}
1808module_exit(netif_exit); 1808module_exit(netif_exit);
1809 1809
diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c
index c8aa55b81fd8..82810b7bff9c 100644
--- a/drivers/power/pda_power.c
+++ b/drivers/power/pda_power.c
@@ -209,6 +209,12 @@ static int pda_power_probe(struct platform_device *pdev)
209 209
210 pdata = pdev->dev.platform_data; 210 pdata = pdev->dev.platform_data;
211 211
212 if (pdata->init) {
213 ret = pdata->init(dev);
214 if (ret < 0)
215 goto init_failed;
216 }
217
212 update_status(); 218 update_status();
213 update_charger(); 219 update_charger();
214 220
@@ -298,6 +304,9 @@ ac_irq_failed:
298 if (pdata->is_ac_online) 304 if (pdata->is_ac_online)
299 power_supply_unregister(&pda_psy_ac); 305 power_supply_unregister(&pda_psy_ac);
300ac_supply_failed: 306ac_supply_failed:
307 if (pdata->exit)
308 pdata->exit(dev);
309init_failed:
301wrongid: 310wrongid:
302 return ret; 311 return ret;
303} 312}
@@ -318,6 +327,8 @@ static int pda_power_remove(struct platform_device *pdev)
318 power_supply_unregister(&pda_psy_usb); 327 power_supply_unregister(&pda_psy_usb);
319 if (pdata->is_ac_online) 328 if (pdata->is_ac_online)
320 power_supply_unregister(&pda_psy_ac); 329 power_supply_unregister(&pda_psy_ac);
330 if (pdata->exit)
331 pdata->exit(dev);
321 332
322 return 0; 333 return 0;
323} 334}
diff --git a/drivers/power/pmu_battery.c b/drivers/power/pmu_battery.c
index 60a8cf3a0431..9346a862f1f2 100644
--- a/drivers/power/pmu_battery.c
+++ b/drivers/power/pmu_battery.c
@@ -159,7 +159,7 @@ static int __init pmu_bat_init(void)
159 if (!pbat) 159 if (!pbat)
160 break; 160 break;
161 161
162 sprintf(pbat->name, "PMU battery %d", i); 162 sprintf(pbat->name, "PMU_battery_%d", i);
163 pbat->bat.name = pbat->name; 163 pbat->bat.name = pbat->name;
164 pbat->bat.properties = pmu_bat_props; 164 pbat->bat.properties = pmu_bat_props;
165 pbat->bat.num_properties = ARRAY_SIZE(pmu_bat_props); 165 pbat->bat.num_properties = ARRAY_SIZE(pmu_bat_props);
diff --git a/drivers/ps3/ps3-lpm.c b/drivers/ps3/ps3-lpm.c
index 6c9592ce4996..85edf945ab86 100644
--- a/drivers/ps3/ps3-lpm.c
+++ b/drivers/ps3/ps3-lpm.c
@@ -22,6 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/uaccess.h> 24#include <linux/uaccess.h>
25#include <asm/time.h>
25#include <asm/ps3.h> 26#include <asm/ps3.h>
26#include <asm/lv1call.h> 27#include <asm/lv1call.h>
27#include <asm/cell-pmu.h> 28#include <asm/cell-pmu.h>
diff --git a/drivers/ps3/ps3-sys-manager.c b/drivers/ps3/ps3-sys-manager.c
index 7605453b74fd..f17513dd9d4b 100644
--- a/drivers/ps3/ps3-sys-manager.c
+++ b/drivers/ps3/ps3-sys-manager.c
@@ -184,10 +184,7 @@ enum ps3_sys_manager_next_op {
184 184
185/** 185/**
186 * enum ps3_sys_manager_wake_source - Next-op wakeup source (bit position mask). 186 * enum ps3_sys_manager_wake_source - Next-op wakeup source (bit position mask).
187 * @PS3_SM_WAKE_DEFAULT: Disk insert, power button, eject button, IR 187 * @PS3_SM_WAKE_DEFAULT: Disk insert, power button, eject button.
188 * controller, and bluetooth controller.
189 * @PS3_SM_WAKE_RTC:
190 * @PS3_SM_WAKE_RTC_ERROR:
191 * @PS3_SM_WAKE_W_O_L: Ether or wireless LAN. 188 * @PS3_SM_WAKE_W_O_L: Ether or wireless LAN.
192 * @PS3_SM_WAKE_P_O_R: Power on reset. 189 * @PS3_SM_WAKE_P_O_R: Power on reset.
193 * 190 *
@@ -200,8 +197,6 @@ enum ps3_sys_manager_next_op {
200enum ps3_sys_manager_wake_source { 197enum ps3_sys_manager_wake_source {
201 /* version 3 */ 198 /* version 3 */
202 PS3_SM_WAKE_DEFAULT = 0, 199 PS3_SM_WAKE_DEFAULT = 0,
203 PS3_SM_WAKE_RTC = 0x00000040,
204 PS3_SM_WAKE_RTC_ERROR = 0x00000080,
205 PS3_SM_WAKE_W_O_L = 0x00000400, 200 PS3_SM_WAKE_W_O_L = 0x00000400,
206 PS3_SM_WAKE_P_O_R = 0x80000000, 201 PS3_SM_WAKE_P_O_R = 0x80000000,
207}; 202};
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index 37b85c67b11d..c8bad675dbd1 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -1055,7 +1055,7 @@ static void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level,
1055 rec->scsi_result = scsi_cmnd->result; 1055 rec->scsi_result = scsi_cmnd->result;
1056 rec->scsi_cmnd = (unsigned long)scsi_cmnd; 1056 rec->scsi_cmnd = (unsigned long)scsi_cmnd;
1057 rec->scsi_serial = scsi_cmnd->serial_number; 1057 rec->scsi_serial = scsi_cmnd->serial_number;
1058 memcpy(rec->scsi_opcode, &scsi_cmnd->cmnd, 1058 memcpy(rec->scsi_opcode, scsi_cmnd->cmnd,
1059 min((int)scsi_cmnd->cmd_len, 1059 min((int)scsi_cmnd->cmd_len,
1060 ZFCP_DBF_SCSI_OPCODE)); 1060 ZFCP_DBF_SCSI_OPCODE));
1061 rec->scsi_retries = scsi_cmnd->retries; 1061 rec->scsi_retries = scsi_cmnd->retries;
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 9af2330f07a2..b2ea4ea051f5 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -4014,7 +4014,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
4014 ZFCP_LOG_TRACE("scpnt->result =0x%x, command was:\n", 4014 ZFCP_LOG_TRACE("scpnt->result =0x%x, command was:\n",
4015 scpnt->result); 4015 scpnt->result);
4016 ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, 4016 ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE,
4017 (void *) &scpnt->cmnd, scpnt->cmd_len); 4017 scpnt->cmnd, scpnt->cmd_len);
4018 4018
4019 ZFCP_LOG_TRACE("%i bytes sense data provided by FCP\n", 4019 ZFCP_LOG_TRACE("%i bytes sense data provided by FCP\n",
4020 fcp_rsp_iu->fcp_sns_len); 4020 fcp_rsp_iu->fcp_sns_len);
diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c
index f4c4fe90240a..f5a9addb7050 100644
--- a/drivers/scsi/53c700.c
+++ b/drivers/scsi/53c700.c
@@ -599,7 +599,7 @@ NCR_700_scsi_done(struct NCR_700_Host_Parameters *hostdata,
599 (struct NCR_700_command_slot *)SCp->host_scribble; 599 (struct NCR_700_command_slot *)SCp->host_scribble;
600 600
601 dma_unmap_single(hostdata->dev, slot->pCmd, 601 dma_unmap_single(hostdata->dev, slot->pCmd,
602 sizeof(SCp->cmnd), DMA_TO_DEVICE); 602 MAX_COMMAND_SIZE, DMA_TO_DEVICE);
603 if (slot->flags == NCR_700_FLAG_AUTOSENSE) { 603 if (slot->flags == NCR_700_FLAG_AUTOSENSE) {
604 char *cmnd = NCR_700_get_sense_cmnd(SCp->device); 604 char *cmnd = NCR_700_get_sense_cmnd(SCp->device);
605#ifdef NCR_700_DEBUG 605#ifdef NCR_700_DEBUG
@@ -1004,7 +1004,7 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
1004 * here */ 1004 * here */
1005 NCR_700_unmap(hostdata, SCp, slot); 1005 NCR_700_unmap(hostdata, SCp, slot);
1006 dma_unmap_single(hostdata->dev, slot->pCmd, 1006 dma_unmap_single(hostdata->dev, slot->pCmd,
1007 sizeof(SCp->cmnd), 1007 MAX_COMMAND_SIZE,
1008 DMA_TO_DEVICE); 1008 DMA_TO_DEVICE);
1009 1009
1010 cmnd[0] = REQUEST_SENSE; 1010 cmnd[0] = REQUEST_SENSE;
@@ -1901,7 +1901,7 @@ NCR_700_queuecommand(struct scsi_cmnd *SCp, void (*done)(struct scsi_cmnd *))
1901 } 1901 }
1902 slot->resume_offset = 0; 1902 slot->resume_offset = 0;
1903 slot->pCmd = dma_map_single(hostdata->dev, SCp->cmnd, 1903 slot->pCmd = dma_map_single(hostdata->dev, SCp->cmnd,
1904 sizeof(SCp->cmnd), DMA_TO_DEVICE); 1904 MAX_COMMAND_SIZE, DMA_TO_DEVICE);
1905 NCR_700_start_command(SCp); 1905 NCR_700_start_command(SCp);
1906 return 0; 1906 return 0;
1907} 1907}
diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 99c57b0c1d54..46d7e400c8be 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -504,10 +504,9 @@ config SCSI_AIC7XXX_OLD
504source "drivers/scsi/aic7xxx/Kconfig.aic79xx" 504source "drivers/scsi/aic7xxx/Kconfig.aic79xx"
505source "drivers/scsi/aic94xx/Kconfig" 505source "drivers/scsi/aic94xx/Kconfig"
506 506
507# All the I2O code and drivers do not seem to be 64bit safe.
508config SCSI_DPT_I2O 507config SCSI_DPT_I2O
509 tristate "Adaptec I2O RAID support " 508 tristate "Adaptec I2O RAID support "
510 depends on !64BIT && SCSI && PCI && VIRT_TO_BUS 509 depends on SCSI && PCI && VIRT_TO_BUS
511 help 510 help
512 This driver supports all of Adaptec's I2O based RAID controllers as 511 This driver supports all of Adaptec's I2O based RAID controllers as
513 well as the DPT SmartRaid V cards. This is an Adaptec maintained 512 well as the DPT SmartRaid V cards. This is an Adaptec maintained
diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
index 792b2e807bf3..ced3eebe252c 100644
--- a/drivers/scsi/a100u2w.c
+++ b/drivers/scsi/a100u2w.c
@@ -895,7 +895,7 @@ static void inia100_build_scb(struct orc_host * host, struct orc_scb * scb, stru
895 } else { 895 } else {
896 scb->tag_msg = 0; /* No tag support */ 896 scb->tag_msg = 0; /* No tag support */
897 } 897 }
898 memcpy(&scb->cdb[0], &cmd->cmnd, scb->cdb_len); 898 memcpy(scb->cdb, cmd->cmnd, scb->cdb_len);
899} 899}
900 900
901/** 901/**
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 460d4024c46c..aa4e77c25273 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -498,6 +498,11 @@ static void _aac_probe_container2(void * context, struct fib * fibptr)
498 (le32_to_cpu(dresp->mnt[0].vol) != CT_NONE) && 498 (le32_to_cpu(dresp->mnt[0].vol) != CT_NONE) &&
499 (le32_to_cpu(dresp->mnt[0].state) != FSCS_HIDDEN)) { 499 (le32_to_cpu(dresp->mnt[0].state) != FSCS_HIDDEN)) {
500 fsa_dev_ptr->valid = 1; 500 fsa_dev_ptr->valid = 1;
501 /* sense_key holds the current state of the spin-up */
502 if (dresp->mnt[0].state & cpu_to_le32(FSCS_NOT_READY))
503 fsa_dev_ptr->sense_data.sense_key = NOT_READY;
504 else if (fsa_dev_ptr->sense_data.sense_key == NOT_READY)
505 fsa_dev_ptr->sense_data.sense_key = NO_SENSE;
501 fsa_dev_ptr->type = le32_to_cpu(dresp->mnt[0].vol); 506 fsa_dev_ptr->type = le32_to_cpu(dresp->mnt[0].vol);
502 fsa_dev_ptr->size 507 fsa_dev_ptr->size
503 = ((u64)le32_to_cpu(dresp->mnt[0].capacity)) + 508 = ((u64)le32_to_cpu(dresp->mnt[0].capacity)) +
@@ -1509,20 +1514,35 @@ static void io_callback(void *context, struct fib * fibptr)
1509 scsi_dma_unmap(scsicmd); 1514 scsi_dma_unmap(scsicmd);
1510 1515
1511 readreply = (struct aac_read_reply *)fib_data(fibptr); 1516 readreply = (struct aac_read_reply *)fib_data(fibptr);
1512 if (le32_to_cpu(readreply->status) == ST_OK) 1517 switch (le32_to_cpu(readreply->status)) {
1513 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; 1518 case ST_OK:
1514 else { 1519 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
1520 SAM_STAT_GOOD;
1521 dev->fsa_dev[cid].sense_data.sense_key = NO_SENSE;
1522 break;
1523 case ST_NOT_READY:
1524 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
1525 SAM_STAT_CHECK_CONDITION;
1526 set_sense(&dev->fsa_dev[cid].sense_data, NOT_READY,
1527 SENCODE_BECOMING_READY, ASENCODE_BECOMING_READY, 0, 0);
1528 memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
1529 min_t(size_t, sizeof(dev->fsa_dev[cid].sense_data),
1530 SCSI_SENSE_BUFFERSIZE));
1531 break;
1532 default:
1515#ifdef AAC_DETAILED_STATUS_INFO 1533#ifdef AAC_DETAILED_STATUS_INFO
1516 printk(KERN_WARNING "io_callback: io failed, status = %d\n", 1534 printk(KERN_WARNING "io_callback: io failed, status = %d\n",
1517 le32_to_cpu(readreply->status)); 1535 le32_to_cpu(readreply->status));
1518#endif 1536#endif
1519 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_CHECK_CONDITION; 1537 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
1538 SAM_STAT_CHECK_CONDITION;
1520 set_sense(&dev->fsa_dev[cid].sense_data, 1539 set_sense(&dev->fsa_dev[cid].sense_data,
1521 HARDWARE_ERROR, SENCODE_INTERNAL_TARGET_FAILURE, 1540 HARDWARE_ERROR, SENCODE_INTERNAL_TARGET_FAILURE,
1522 ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0); 1541 ASENCODE_INTERNAL_TARGET_FAILURE, 0, 0);
1523 memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data, 1542 memcpy(scsicmd->sense_buffer, &dev->fsa_dev[cid].sense_data,
1524 min_t(size_t, sizeof(dev->fsa_dev[cid].sense_data), 1543 min_t(size_t, sizeof(dev->fsa_dev[cid].sense_data),
1525 SCSI_SENSE_BUFFERSIZE)); 1544 SCSI_SENSE_BUFFERSIZE));
1545 break;
1526 } 1546 }
1527 aac_fib_complete(fibptr); 1547 aac_fib_complete(fibptr);
1528 aac_fib_free(fibptr); 1548 aac_fib_free(fibptr);
@@ -1863,6 +1883,84 @@ static int aac_synchronize(struct scsi_cmnd *scsicmd)
1863 return SCSI_MLQUEUE_HOST_BUSY; 1883 return SCSI_MLQUEUE_HOST_BUSY;
1864} 1884}
1865 1885
1886static void aac_start_stop_callback(void *context, struct fib *fibptr)
1887{
1888 struct scsi_cmnd *scsicmd = context;
1889
1890 if (!aac_valid_context(scsicmd, fibptr))
1891 return;
1892
1893 BUG_ON(fibptr == NULL);
1894
1895 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
1896
1897 aac_fib_complete(fibptr);
1898 aac_fib_free(fibptr);
1899 scsicmd->scsi_done(scsicmd);
1900}
1901
1902static int aac_start_stop(struct scsi_cmnd *scsicmd)
1903{
1904 int status;
1905 struct fib *cmd_fibcontext;
1906 struct aac_power_management *pmcmd;
1907 struct scsi_device *sdev = scsicmd->device;
1908 struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata;
1909
1910 if (!(aac->supplement_adapter_info.SupportedOptions2 &
1911 AAC_OPTION_POWER_MANAGEMENT)) {
1912 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
1913 SAM_STAT_GOOD;
1914 scsicmd->scsi_done(scsicmd);
1915 return 0;
1916 }
1917
1918 if (aac->in_reset)
1919 return SCSI_MLQUEUE_HOST_BUSY;
1920
1921 /*
1922 * Allocate and initialize a Fib
1923 */
1924 cmd_fibcontext = aac_fib_alloc(aac);
1925 if (!cmd_fibcontext)
1926 return SCSI_MLQUEUE_HOST_BUSY;
1927
1928 aac_fib_init(cmd_fibcontext);
1929
1930 pmcmd = fib_data(cmd_fibcontext);
1931 pmcmd->command = cpu_to_le32(VM_ContainerConfig);
1932 pmcmd->type = cpu_to_le32(CT_POWER_MANAGEMENT);
1933 /* Eject bit ignored, not relevant */
1934 pmcmd->sub = (scsicmd->cmnd[4] & 1) ?
1935 cpu_to_le32(CT_PM_START_UNIT) : cpu_to_le32(CT_PM_STOP_UNIT);
1936 pmcmd->cid = cpu_to_le32(sdev_id(sdev));
1937 pmcmd->parm = (scsicmd->cmnd[1] & 1) ?
1938 cpu_to_le32(CT_PM_UNIT_IMMEDIATE) : 0;
1939
1940 /*
1941 * Now send the Fib to the adapter
1942 */
1943 status = aac_fib_send(ContainerCommand,
1944 cmd_fibcontext,
1945 sizeof(struct aac_power_management),
1946 FsaNormal,
1947 0, 1,
1948 (fib_callback)aac_start_stop_callback,
1949 (void *)scsicmd);
1950
1951 /*
1952 * Check that the command queued to the controller
1953 */
1954 if (status == -EINPROGRESS) {
1955 scsicmd->SCp.phase = AAC_OWNER_FIRMWARE;
1956 return 0;
1957 }
1958
1959 aac_fib_complete(cmd_fibcontext);
1960 aac_fib_free(cmd_fibcontext);
1961 return SCSI_MLQUEUE_HOST_BUSY;
1962}
1963
1866/** 1964/**
1867 * aac_scsi_cmd() - Process SCSI command 1965 * aac_scsi_cmd() - Process SCSI command
1868 * @scsicmd: SCSI command block 1966 * @scsicmd: SCSI command block
@@ -1899,7 +1997,9 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1899 * If the target container doesn't exist, it may have 1997 * If the target container doesn't exist, it may have
1900 * been newly created 1998 * been newly created
1901 */ 1999 */
1902 if ((fsa_dev_ptr[cid].valid & 1) == 0) { 2000 if (((fsa_dev_ptr[cid].valid & 1) == 0) ||
2001 (fsa_dev_ptr[cid].sense_data.sense_key ==
2002 NOT_READY)) {
1903 switch (scsicmd->cmnd[0]) { 2003 switch (scsicmd->cmnd[0]) {
1904 case SERVICE_ACTION_IN: 2004 case SERVICE_ACTION_IN:
1905 if (!(dev->raw_io_interface) || 2005 if (!(dev->raw_io_interface) ||
@@ -2091,8 +2191,8 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
2091 scsi_sg_copy_from_buffer(scsicmd, cp, sizeof(cp)); 2191 scsi_sg_copy_from_buffer(scsicmd, cp, sizeof(cp));
2092 /* Do not cache partition table for arrays */ 2192 /* Do not cache partition table for arrays */
2093 scsicmd->device->removable = 1; 2193 scsicmd->device->removable = 1;
2094 2194 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
2095 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; 2195 SAM_STAT_GOOD;
2096 scsicmd->scsi_done(scsicmd); 2196 scsicmd->scsi_done(scsicmd);
2097 2197
2098 return 0; 2198 return 0;
@@ -2187,15 +2287,32 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
2187 * These commands are all No-Ops 2287 * These commands are all No-Ops
2188 */ 2288 */
2189 case TEST_UNIT_READY: 2289 case TEST_UNIT_READY:
2290 if (fsa_dev_ptr[cid].sense_data.sense_key == NOT_READY) {
2291 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 |
2292 SAM_STAT_CHECK_CONDITION;
2293 set_sense(&dev->fsa_dev[cid].sense_data,
2294 NOT_READY, SENCODE_BECOMING_READY,
2295 ASENCODE_BECOMING_READY, 0, 0);
2296 memcpy(scsicmd->sense_buffer,
2297 &dev->fsa_dev[cid].sense_data,
2298 min_t(size_t,
2299 sizeof(dev->fsa_dev[cid].sense_data),
2300 SCSI_SENSE_BUFFERSIZE));
2301 scsicmd->scsi_done(scsicmd);
2302 return 0;
2303 }
2304 /* FALLTHRU */
2190 case RESERVE: 2305 case RESERVE:
2191 case RELEASE: 2306 case RELEASE:
2192 case REZERO_UNIT: 2307 case REZERO_UNIT:
2193 case REASSIGN_BLOCKS: 2308 case REASSIGN_BLOCKS:
2194 case SEEK_10: 2309 case SEEK_10:
2195 case START_STOP:
2196 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; 2310 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
2197 scsicmd->scsi_done(scsicmd); 2311 scsicmd->scsi_done(scsicmd);
2198 return 0; 2312 return 0;
2313
2314 case START_STOP:
2315 return aac_start_stop(scsicmd);
2199 } 2316 }
2200 2317
2201 switch (scsicmd->cmnd[0]) 2318 switch (scsicmd->cmnd[0])
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 113ca9c8934c..73916adb8f80 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -12,7 +12,7 @@
12 *----------------------------------------------------------------------------*/ 12 *----------------------------------------------------------------------------*/
13 13
14#ifndef AAC_DRIVER_BUILD 14#ifndef AAC_DRIVER_BUILD
15# define AAC_DRIVER_BUILD 2455 15# define AAC_DRIVER_BUILD 2456
16# define AAC_DRIVER_BRANCH "-ms" 16# define AAC_DRIVER_BRANCH "-ms"
17#endif 17#endif
18#define MAXIMUM_NUM_CONTAINERS 32 18#define MAXIMUM_NUM_CONTAINERS 32
@@ -34,8 +34,8 @@
34#define CONTAINER_TO_ID(cont) (cont) 34#define CONTAINER_TO_ID(cont) (cont)
35#define CONTAINER_TO_LUN(cont) (0) 35#define CONTAINER_TO_LUN(cont) (0)
36 36
37#define aac_phys_to_logical(x) (x+1) 37#define aac_phys_to_logical(x) ((x)+1)
38#define aac_logical_to_phys(x) (x?x-1:0) 38#define aac_logical_to_phys(x) ((x)?(x)-1:0)
39 39
40/* #define AAC_DETAILED_STATUS_INFO */ 40/* #define AAC_DETAILED_STATUS_INFO */
41 41
@@ -424,6 +424,8 @@ struct aac_init
424 */ 424 */
425 __le32 InitFlags; /* flags for supported features */ 425 __le32 InitFlags; /* flags for supported features */
426#define INITFLAGS_NEW_COMM_SUPPORTED 0x00000001 426#define INITFLAGS_NEW_COMM_SUPPORTED 0x00000001
427#define INITFLAGS_DRIVER_USES_UTC_TIME 0x00000010
428#define INITFLAGS_DRIVER_SUPPORTS_PM 0x00000020
427 __le32 MaxIoCommands; /* max outstanding commands */ 429 __le32 MaxIoCommands; /* max outstanding commands */
428 __le32 MaxIoSize; /* largest I/O command */ 430 __le32 MaxIoSize; /* largest I/O command */
429 __le32 MaxFibSize; /* largest FIB to adapter */ 431 __le32 MaxFibSize; /* largest FIB to adapter */
@@ -867,8 +869,10 @@ struct aac_supplement_adapter_info
867}; 869};
868#define AAC_FEATURE_FALCON cpu_to_le32(0x00000010) 870#define AAC_FEATURE_FALCON cpu_to_le32(0x00000010)
869#define AAC_FEATURE_JBOD cpu_to_le32(0x08000000) 871#define AAC_FEATURE_JBOD cpu_to_le32(0x08000000)
870#define AAC_OPTION_MU_RESET cpu_to_le32(0x00000001) 872/* SupportedOptions2 */
871#define AAC_OPTION_IGNORE_RESET cpu_to_le32(0x00000002) 873#define AAC_OPTION_MU_RESET cpu_to_le32(0x00000001)
874#define AAC_OPTION_IGNORE_RESET cpu_to_le32(0x00000002)
875#define AAC_OPTION_POWER_MANAGEMENT cpu_to_le32(0x00000004)
872#define AAC_SIS_VERSION_V3 3 876#define AAC_SIS_VERSION_V3 3
873#define AAC_SIS_SLOT_UNKNOWN 0xFF 877#define AAC_SIS_SLOT_UNKNOWN 0xFF
874 878
@@ -1148,6 +1152,7 @@ struct aac_dev
1148#define ST_DQUOT 69 1152#define ST_DQUOT 69
1149#define ST_STALE 70 1153#define ST_STALE 70
1150#define ST_REMOTE 71 1154#define ST_REMOTE 71
1155#define ST_NOT_READY 72
1151#define ST_BADHANDLE 10001 1156#define ST_BADHANDLE 10001
1152#define ST_NOT_SYNC 10002 1157#define ST_NOT_SYNC 10002
1153#define ST_BAD_COOKIE 10003 1158#define ST_BAD_COOKIE 10003
@@ -1269,6 +1274,18 @@ struct aac_synchronize_reply {
1269 u8 data[16]; 1274 u8 data[16];
1270}; 1275};
1271 1276
1277#define CT_POWER_MANAGEMENT 245
1278#define CT_PM_START_UNIT 2
1279#define CT_PM_STOP_UNIT 3
1280#define CT_PM_UNIT_IMMEDIATE 1
1281struct aac_power_management {
1282 __le32 command; /* VM_ContainerConfig */
1283 __le32 type; /* CT_POWER_MANAGEMENT */
1284 __le32 sub; /* CT_PM_* */
1285 __le32 cid;
1286 __le32 parm; /* CT_PM_sub_* */
1287};
1288
1272#define CT_PAUSE_IO 65 1289#define CT_PAUSE_IO 65
1273#define CT_RELEASE_IO 66 1290#define CT_RELEASE_IO 66
1274struct aac_pause { 1291struct aac_pause {
@@ -1536,6 +1553,7 @@ struct aac_mntent {
1536#define FSCS_NOTCLEAN 0x0001 /* fsck is necessary before mounting */ 1553#define FSCS_NOTCLEAN 0x0001 /* fsck is necessary before mounting */
1537#define FSCS_READONLY 0x0002 /* possible result of broken mirror */ 1554#define FSCS_READONLY 0x0002 /* possible result of broken mirror */
1538#define FSCS_HIDDEN 0x0004 /* should be ignored - set during a clear */ 1555#define FSCS_HIDDEN 0x0004 /* should be ignored - set during a clear */
1556#define FSCS_NOT_READY 0x0008 /* Array spinning up to fulfil request */
1539 1557
1540struct aac_query_mount { 1558struct aac_query_mount {
1541 __le32 command; 1559 __le32 command;
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c
index 294a802450be..cbac06355107 100644
--- a/drivers/scsi/aacraid/comminit.c
+++ b/drivers/scsi/aacraid/comminit.c
@@ -97,6 +97,8 @@ static int aac_alloc_comm(struct aac_dev *dev, void **commaddr, unsigned long co
97 init->InitFlags = cpu_to_le32(INITFLAGS_NEW_COMM_SUPPORTED); 97 init->InitFlags = cpu_to_le32(INITFLAGS_NEW_COMM_SUPPORTED);
98 dprintk((KERN_WARNING"aacraid: New Comm Interface enabled\n")); 98 dprintk((KERN_WARNING"aacraid: New Comm Interface enabled\n"));
99 } 99 }
100 init->InitFlags |= cpu_to_le32(INITFLAGS_DRIVER_USES_UTC_TIME |
101 INITFLAGS_DRIVER_SUPPORTS_PM);
100 init->MaxIoCommands = cpu_to_le32(dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); 102 init->MaxIoCommands = cpu_to_le32(dev->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB);
101 init->MaxIoSize = cpu_to_le32(dev->scsi_host_ptr->max_sectors << 9); 103 init->MaxIoSize = cpu_to_le32(dev->scsi_host_ptr->max_sectors << 9);
102 init->MaxFibSize = cpu_to_le32(dev->max_fib_size); 104 init->MaxFibSize = cpu_to_le32(dev->max_fib_size);
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index ef67816a6fe5..289304aab690 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -515,7 +515,7 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
515 } 515 }
516 udelay(5); 516 udelay(5);
517 } 517 }
518 } else if (down_interruptible(&fibptr->event_wait) == 0) { 518 } else if (down_interruptible(&fibptr->event_wait)) {
519 fibptr->done = 2; 519 fibptr->done = 2;
520 up(&fibptr->event_wait); 520 up(&fibptr->event_wait);
521 } 521 }
@@ -906,15 +906,22 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
906 case AifEnAddJBOD: 906 case AifEnAddJBOD:
907 case AifEnDeleteJBOD: 907 case AifEnDeleteJBOD:
908 container = le32_to_cpu(((__le32 *)aifcmd->data)[1]); 908 container = le32_to_cpu(((__le32 *)aifcmd->data)[1]);
909 if ((container >> 28)) 909 if ((container >> 28)) {
910 container = (u32)-1;
910 break; 911 break;
912 }
911 channel = (container >> 24) & 0xF; 913 channel = (container >> 24) & 0xF;
912 if (channel >= dev->maximum_num_channels) 914 if (channel >= dev->maximum_num_channels) {
915 container = (u32)-1;
913 break; 916 break;
917 }
914 id = container & 0xFFFF; 918 id = container & 0xFFFF;
915 if (id >= dev->maximum_num_physicals) 919 if (id >= dev->maximum_num_physicals) {
920 container = (u32)-1;
916 break; 921 break;
922 }
917 lun = (container >> 16) & 0xFF; 923 lun = (container >> 16) & 0xFF;
924 container = (u32)-1;
918 channel = aac_phys_to_logical(channel); 925 channel = aac_phys_to_logical(channel);
919 device_config_needed = 926 device_config_needed =
920 (((__le32 *)aifcmd->data)[0] == 927 (((__le32 *)aifcmd->data)[0] ==
@@ -933,13 +940,18 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
933 case EM_DRIVE_REMOVAL: 940 case EM_DRIVE_REMOVAL:
934 container = le32_to_cpu( 941 container = le32_to_cpu(
935 ((__le32 *)aifcmd->data)[2]); 942 ((__le32 *)aifcmd->data)[2]);
936 if ((container >> 28)) 943 if ((container >> 28)) {
944 container = (u32)-1;
937 break; 945 break;
946 }
938 channel = (container >> 24) & 0xF; 947 channel = (container >> 24) & 0xF;
939 if (channel >= dev->maximum_num_channels) 948 if (channel >= dev->maximum_num_channels) {
949 container = (u32)-1;
940 break; 950 break;
951 }
941 id = container & 0xFFFF; 952 id = container & 0xFFFF;
942 lun = (container >> 16) & 0xFF; 953 lun = (container >> 16) & 0xFF;
954 container = (u32)-1;
943 if (id >= dev->maximum_num_physicals) { 955 if (id >= dev->maximum_num_physicals) {
944 /* legacy dev_t ? */ 956 /* legacy dev_t ? */
945 if ((0x2000 <= id) || lun || channel || 957 if ((0x2000 <= id) || lun || channel ||
@@ -1025,9 +1037,10 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
1025 break; 1037 break;
1026 } 1038 }
1027 1039
1040 container = 0;
1041retry_next:
1028 if (device_config_needed == NOTHING) 1042 if (device_config_needed == NOTHING)
1029 for (container = 0; container < dev->maximum_num_containers; 1043 for (; container < dev->maximum_num_containers; ++container) {
1030 ++container) {
1031 if ((dev->fsa_dev[container].config_waiting_on == 0) && 1044 if ((dev->fsa_dev[container].config_waiting_on == 0) &&
1032 (dev->fsa_dev[container].config_needed != NOTHING) && 1045 (dev->fsa_dev[container].config_needed != NOTHING) &&
1033 time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) { 1046 time_before(jiffies, dev->fsa_dev[container].config_waiting_stamp + AIF_SNIFF_TIMEOUT)) {
@@ -1110,6 +1123,11 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
1110 } 1123 }
1111 if (device_config_needed == ADD) 1124 if (device_config_needed == ADD)
1112 scsi_add_device(dev->scsi_host_ptr, channel, id, lun); 1125 scsi_add_device(dev->scsi_host_ptr, channel, id, lun);
1126 if (channel == CONTAINER_CHANNEL) {
1127 container++;
1128 device_config_needed = NOTHING;
1129 goto retry_next;
1130 }
1113} 1131}
1114 1132
1115static int _aac_reset_adapter(struct aac_dev *aac, int forced) 1133static int _aac_reset_adapter(struct aac_dev *aac, int forced)
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index c109f63f8279..1f7c83607f84 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -401,6 +401,8 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev,
401static int aac_slave_configure(struct scsi_device *sdev) 401static int aac_slave_configure(struct scsi_device *sdev)
402{ 402{
403 struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata; 403 struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata;
404 if (aac->jbod && (sdev->type == TYPE_DISK))
405 sdev->removable = 1;
404 if ((sdev->type == TYPE_DISK) && 406 if ((sdev->type == TYPE_DISK) &&
405 (sdev_channel(sdev) != CONTAINER_CHANNEL) && 407 (sdev_channel(sdev) != CONTAINER_CHANNEL) &&
406 (!aac->jbod || sdev->inq_periph_qual) && 408 (!aac->jbod || sdev->inq_periph_qual) &&
@@ -809,6 +811,12 @@ static ssize_t aac_show_flags(struct device *cdev,
809 "SAI_READ_CAPACITY_16\n"); 811 "SAI_READ_CAPACITY_16\n");
810 if (dev->jbod) 812 if (dev->jbod)
811 len += snprintf(buf + len, PAGE_SIZE - len, "SUPPORTED_JBOD\n"); 813 len += snprintf(buf + len, PAGE_SIZE - len, "SUPPORTED_JBOD\n");
814 if (dev->supplement_adapter_info.SupportedOptions2 &
815 AAC_OPTION_POWER_MANAGEMENT)
816 len += snprintf(buf + len, PAGE_SIZE - len,
817 "SUPPORTED_POWER_MANAGEMENT\n");
818 if (dev->msi)
819 len += snprintf(buf + len, PAGE_SIZE - len, "PCI_HAS_MSI\n");
812 return len; 820 return len;
813} 821}
814 822
@@ -1106,7 +1114,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
1106 aac->pdev = pdev; 1114 aac->pdev = pdev;
1107 aac->name = aac_driver_template.name; 1115 aac->name = aac_driver_template.name;
1108 aac->id = shost->unique_id; 1116 aac->id = shost->unique_id;
1109 aac->cardtype = index; 1117 aac->cardtype = index;
1110 INIT_LIST_HEAD(&aac->entry); 1118 INIT_LIST_HEAD(&aac->entry);
1111 1119
1112 aac->fibs = kmalloc(sizeof(struct fib) * (shost->can_queue + AAC_NUM_MGT_FIB), GFP_KERNEL); 1120 aac->fibs = kmalloc(sizeof(struct fib) * (shost->can_queue + AAC_NUM_MGT_FIB), GFP_KERNEL);
@@ -1146,19 +1154,19 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
1146 goto out_deinit; 1154 goto out_deinit;
1147 1155
1148 /* 1156 /*
1149 * Lets override negotiations and drop the maximum SG limit to 34 1157 * Lets override negotiations and drop the maximum SG limit to 34
1150 */ 1158 */
1151 if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) && 1159 if ((aac_drivers[index].quirks & AAC_QUIRK_34SG) &&
1152 (shost->sg_tablesize > 34)) { 1160 (shost->sg_tablesize > 34)) {
1153 shost->sg_tablesize = 34; 1161 shost->sg_tablesize = 34;
1154 shost->max_sectors = (shost->sg_tablesize * 8) + 112; 1162 shost->max_sectors = (shost->sg_tablesize * 8) + 112;
1155 } 1163 }
1156 1164
1157 if ((aac_drivers[index].quirks & AAC_QUIRK_17SG) && 1165 if ((aac_drivers[index].quirks & AAC_QUIRK_17SG) &&
1158 (shost->sg_tablesize > 17)) { 1166 (shost->sg_tablesize > 17)) {
1159 shost->sg_tablesize = 17; 1167 shost->sg_tablesize = 17;
1160 shost->max_sectors = (shost->sg_tablesize * 8) + 112; 1168 shost->max_sectors = (shost->sg_tablesize * 8) + 112;
1161 } 1169 }
1162 1170
1163 error = pci_set_dma_max_seg_size(pdev, 1171 error = pci_set_dma_max_seg_size(pdev,
1164 (aac->adapter_info.options & AAC_OPT_NEW_COMM) ? 1172 (aac->adapter_info.options & AAC_OPT_NEW_COMM) ?
@@ -1174,7 +1182,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
1174 else 1182 else
1175 aac->printf_enabled = 0; 1183 aac->printf_enabled = 0;
1176 1184
1177 /* 1185 /*
1178 * max channel will be the physical channels plus 1 virtual channel 1186 * max channel will be the physical channels plus 1 virtual channel
1179 * all containers are on the virtual channel 0 (CONTAINER_CHANNEL) 1187 * all containers are on the virtual channel 0 (CONTAINER_CHANNEL)
1180 * physical channels are address by their actual physical number+1 1188 * physical channels are address by their actual physical number+1
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 90f5e0a6f2e3..2a730c470f62 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -529,10 +529,10 @@ static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha)
529/* The first entry, 0, is used for dynamic ids, the rest for devices 529/* The first entry, 0, is used for dynamic ids, the rest for devices
530 * we know about. 530 * we know about.
531 */ 531 */
532static struct asd_pcidev_struct { 532static const struct asd_pcidev_struct {
533 const char * name; 533 const char * name;
534 int (*setup)(struct asd_ha_struct *asd_ha); 534 int (*setup)(struct asd_ha_struct *asd_ha);
535} asd_pcidev_data[] = { 535} asd_pcidev_data[] __devinitconst = {
536 /* Id 0 is used for dynamic ids. */ 536 /* Id 0 is used for dynamic ids. */
537 { .name = "Adaptec AIC-94xx SAS/SATA Host Adapter", 537 { .name = "Adaptec AIC-94xx SAS/SATA Host Adapter",
538 .setup = asd_aic9410_setup 538 .setup = asd_aic9410_setup
@@ -735,7 +735,7 @@ static int asd_unregister_sas_ha(struct asd_ha_struct *asd_ha)
735static int __devinit asd_pci_probe(struct pci_dev *dev, 735static int __devinit asd_pci_probe(struct pci_dev *dev,
736 const struct pci_device_id *id) 736 const struct pci_device_id *id)
737{ 737{
738 struct asd_pcidev_struct *asd_dev; 738 const struct asd_pcidev_struct *asd_dev;
739 unsigned asd_id = (unsigned) id->driver_data; 739 unsigned asd_id = (unsigned) id->driver_data;
740 struct asd_ha_struct *asd_ha; 740 struct asd_ha_struct *asd_ha;
741 struct Scsi_Host *shost; 741 struct Scsi_Host *shost;
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index 403a7f2d8f9b..9785d7384199 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -28,7 +28,6 @@
28#define SERVICE_ACTION_OUT_12 0xa9 28#define SERVICE_ACTION_OUT_12 0xa9
29#define SERVICE_ACTION_IN_16 0x9e 29#define SERVICE_ACTION_IN_16 0x9e
30#define SERVICE_ACTION_OUT_16 0x9f 30#define SERVICE_ACTION_OUT_16 0x9f
31#define VARIABLE_LENGTH_CMD 0x7f
32 31
33 32
34 33
@@ -210,7 +209,7 @@ static void print_opcode_name(unsigned char * cdbp, int cdb_len)
210 cdb0 = cdbp[0]; 209 cdb0 = cdbp[0];
211 switch(cdb0) { 210 switch(cdb0) {
212 case VARIABLE_LENGTH_CMD: 211 case VARIABLE_LENGTH_CMD:
213 len = cdbp[7] + 8; 212 len = scsi_varlen_cdb_length(cdbp);
214 if (len < 10) { 213 if (len < 10) {
215 printk("short variable length command, " 214 printk("short variable length command, "
216 "len=%d ext_len=%d", len, cdb_len); 215 "len=%d ext_len=%d", len, cdb_len);
@@ -300,7 +299,7 @@ static void print_opcode_name(unsigned char * cdbp, int cdb_len)
300 cdb0 = cdbp[0]; 299 cdb0 = cdbp[0];
301 switch(cdb0) { 300 switch(cdb0) {
302 case VARIABLE_LENGTH_CMD: 301 case VARIABLE_LENGTH_CMD:
303 len = cdbp[7] + 8; 302 len = scsi_varlen_cdb_length(cdbp);
304 if (len < 10) { 303 if (len < 10) {
305 printk("short opcode=0x%x command, len=%d " 304 printk("short opcode=0x%x command, len=%d "
306 "ext_len=%d", cdb0, len, cdb_len); 305 "ext_len=%d", cdb0, len, cdb_len);
@@ -335,10 +334,7 @@ void __scsi_print_command(unsigned char *cdb)
335 int k, len; 334 int k, len;
336 335
337 print_opcode_name(cdb, 0); 336 print_opcode_name(cdb, 0);
338 if (VARIABLE_LENGTH_CMD == cdb[0]) 337 len = scsi_command_size(cdb);
339 len = cdb[7] + 8;
340 else
341 len = COMMAND_SIZE(cdb[0]);
342 /* print out all bytes in cdb */ 338 /* print out all bytes in cdb */
343 for (k = 0; k < len; ++k) 339 for (k = 0; k < len; ++k)
344 printk(" %02x", cdb[k]); 340 printk(" %02x", cdb[k]);
diff --git a/drivers/scsi/dpt/dpti_ioctl.h b/drivers/scsi/dpt/dpti_ioctl.h
index cc784e8f6e9d..f60236721e0d 100644
--- a/drivers/scsi/dpt/dpti_ioctl.h
+++ b/drivers/scsi/dpt/dpti_ioctl.h
@@ -89,7 +89,7 @@ typedef struct {
89 int njobs; /* # of jobs sent to HA */ 89 int njobs; /* # of jobs sent to HA */
90 int qdepth; /* Controller queue depth. */ 90 int qdepth; /* Controller queue depth. */
91 int wakebase; /* mpx wakeup base index. */ 91 int wakebase; /* mpx wakeup base index. */
92 uLONG SGsize; /* Scatter/Gather list size. */ 92 uINT SGsize; /* Scatter/Gather list size. */
93 unsigned heads; /* heads for drives on cntlr. */ 93 unsigned heads; /* heads for drives on cntlr. */
94 unsigned sectors; /* sectors for drives on cntlr. */ 94 unsigned sectors; /* sectors for drives on cntlr. */
95 uCHAR do_drive32; /* Flag for Above 16 MB Ability */ 95 uCHAR do_drive32; /* Flag for Above 16 MB Ability */
@@ -97,8 +97,8 @@ typedef struct {
97 char idPAL[4]; /* 4 Bytes Of The ID Pal */ 97 char idPAL[4]; /* 4 Bytes Of The ID Pal */
98 uCHAR primary; /* 1 For Primary, 0 For Secondary */ 98 uCHAR primary; /* 1 For Primary, 0 For Secondary */
99 uCHAR eataVersion; /* EATA Version */ 99 uCHAR eataVersion; /* EATA Version */
100 uLONG cpLength; /* EATA Command Packet Length */ 100 uINT cpLength; /* EATA Command Packet Length */
101 uLONG spLength; /* EATA Status Packet Length */ 101 uINT spLength; /* EATA Status Packet Length */
102 uCHAR drqNum; /* DRQ Index (0,5,6,7) */ 102 uCHAR drqNum; /* DRQ Index (0,5,6,7) */
103 uCHAR flag1; /* EATA Flags 1 (Byte 9) */ 103 uCHAR flag1; /* EATA Flags 1 (Byte 9) */
104 uCHAR flag2; /* EATA Flags 2 (Byte 30) */ 104 uCHAR flag2; /* EATA Flags 2 (Byte 30) */
@@ -107,23 +107,23 @@ typedef struct {
107typedef struct { 107typedef struct {
108 uSHORT length; // Remaining length of this 108 uSHORT length; // Remaining length of this
109 uSHORT drvrHBAnum; // Relative HBA # used by the driver 109 uSHORT drvrHBAnum; // Relative HBA # used by the driver
110 uLONG baseAddr; // Base I/O address 110 uINT baseAddr; // Base I/O address
111 uSHORT blinkState; // Blink LED state (0=Not in blink LED) 111 uSHORT blinkState; // Blink LED state (0=Not in blink LED)
112 uCHAR pciBusNum; // PCI Bus # (Optional) 112 uCHAR pciBusNum; // PCI Bus # (Optional)
113 uCHAR pciDeviceNum; // PCI Device # (Optional) 113 uCHAR pciDeviceNum; // PCI Device # (Optional)
114 uSHORT hbaFlags; // Miscellaneous HBA flags 114 uSHORT hbaFlags; // Miscellaneous HBA flags
115 uSHORT Interrupt; // Interrupt set for this device. 115 uSHORT Interrupt; // Interrupt set for this device.
116# if (defined(_DPT_ARC)) 116# if (defined(_DPT_ARC))
117 uLONG baseLength; 117 uINT baseLength;
118 ADAPTER_OBJECT *AdapterObject; 118 ADAPTER_OBJECT *AdapterObject;
119 LARGE_INTEGER DmaLogicalAddress; 119 LARGE_INTEGER DmaLogicalAddress;
120 PVOID DmaVirtualAddress; 120 PVOID DmaVirtualAddress;
121 LARGE_INTEGER ReplyLogicalAddress; 121 LARGE_INTEGER ReplyLogicalAddress;
122 PVOID ReplyVirtualAddress; 122 PVOID ReplyVirtualAddress;
123# else 123# else
124 uLONG reserved1; // Reserved for future expansion 124 uINT reserved1; // Reserved for future expansion
125 uLONG reserved2; // Reserved for future expansion 125 uINT reserved2; // Reserved for future expansion
126 uLONG reserved3; // Reserved for future expansion 126 uINT reserved3; // Reserved for future expansion
127# endif 127# endif
128} drvrHBAinfo_S; 128} drvrHBAinfo_S;
129 129
diff --git a/drivers/scsi/dpt/dptsig.h b/drivers/scsi/dpt/dptsig.h
index 94bc894d1200..72c8992fdf21 100644
--- a/drivers/scsi/dpt/dptsig.h
+++ b/drivers/scsi/dpt/dptsig.h
@@ -33,11 +33,7 @@
33/* to make sure we are talking the same size under all OS's */ 33/* to make sure we are talking the same size under all OS's */
34typedef unsigned char sigBYTE; 34typedef unsigned char sigBYTE;
35typedef unsigned short sigWORD; 35typedef unsigned short sigWORD;
36#if (defined(_MULTI_DATAMODEL) && defined(sun) && !defined(_ILP32)) 36typedef unsigned int sigINT;
37typedef uint32_t sigLONG;
38#else
39typedef unsigned long sigLONG;
40#endif
41 37
42/* 38/*
43 * use sigWORDLittleEndian for: 39 * use sigWORDLittleEndian for:
@@ -300,7 +296,7 @@ typedef struct dpt_sig {
300 sigBYTE dsFiletype; /* type of file */ 296 sigBYTE dsFiletype; /* type of file */
301 sigBYTE dsFiletypeFlags; /* flags to specify load type, etc. */ 297 sigBYTE dsFiletypeFlags; /* flags to specify load type, etc. */
302 sigBYTE dsOEM; /* OEM file was created for */ 298 sigBYTE dsOEM; /* OEM file was created for */
303 sigLONG dsOS; /* which Operating systems */ 299 sigINT dsOS; /* which Operating systems */
304 sigWORD dsCapabilities; /* RAID levels, etc. */ 300 sigWORD dsCapabilities; /* RAID levels, etc. */
305 sigWORD dsDeviceSupp; /* Types of SCSI devices supported */ 301 sigWORD dsDeviceSupp; /* Types of SCSI devices supported */
306 sigWORD dsAdapterSupp; /* DPT adapter families supported */ 302 sigWORD dsAdapterSupp; /* DPT adapter families supported */
diff --git a/drivers/scsi/dpt/sys_info.h b/drivers/scsi/dpt/sys_info.h
index d23b70c8c768..a90c4cb8ea8b 100644
--- a/drivers/scsi/dpt/sys_info.h
+++ b/drivers/scsi/dpt/sys_info.h
@@ -145,8 +145,8 @@
145 uCHAR smartROMRevision; 145 uCHAR smartROMRevision;
146 uSHORT flags; /* See bit definitions above */ 146 uSHORT flags; /* See bit definitions above */
147 uSHORT conventionalMemSize; /* in KB */ 147 uSHORT conventionalMemSize; /* in KB */
148 uLONG extendedMemSize; /* in KB */ 148 uINT extendedMemSize; /* in KB */
149 uLONG osType; /* Same as DPTSIG's definition */ 149 uINT osType; /* Same as DPTSIG's definition */
150 uCHAR osMajorVersion; 150 uCHAR osMajorVersion;
151 uCHAR osMinorVersion; /* The OS version */ 151 uCHAR osMinorVersion; /* The OS version */
152 uCHAR osRevision; 152 uCHAR osRevision;
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index ac92ac143b46..0fb5bf4c43ac 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -29,11 +29,6 @@
29/*#define DEBUG 1 */ 29/*#define DEBUG 1 */
30/*#define UARTDELAY 1 */ 30/*#define UARTDELAY 1 */
31 31
32/* On the real kernel ADDR32 should always be zero for 2.4. GFP_HIGH allocates
33 high pages. Keep the macro around because of the broken unmerged ia64 tree */
34
35#define ADDR32 (0)
36
37#include <linux/module.h> 32#include <linux/module.h>
38 33
39MODULE_AUTHOR("Deanna Bonds, with _lots_ of help from Mark Salyzyn"); 34MODULE_AUTHOR("Deanna Bonds, with _lots_ of help from Mark Salyzyn");
@@ -108,27 +103,28 @@ static dpt_sig_S DPTI_sig = {
108 103
109static DEFINE_MUTEX(adpt_configuration_lock); 104static DEFINE_MUTEX(adpt_configuration_lock);
110 105
111static struct i2o_sys_tbl *sys_tbl = NULL; 106static struct i2o_sys_tbl *sys_tbl;
112static int sys_tbl_ind = 0; 107static dma_addr_t sys_tbl_pa;
113static int sys_tbl_len = 0; 108static int sys_tbl_ind;
109static int sys_tbl_len;
114 110
115static adpt_hba* hba_chain = NULL; 111static adpt_hba* hba_chain = NULL;
116static int hba_count = 0; 112static int hba_count = 0;
117 113
114static struct class *adpt_sysfs_class;
115
116#ifdef CONFIG_COMPAT
117static long compat_adpt_ioctl(struct file *, unsigned int, unsigned long);
118#endif
119
118static const struct file_operations adpt_fops = { 120static const struct file_operations adpt_fops = {
119 .ioctl = adpt_ioctl, 121 .ioctl = adpt_ioctl,
120 .open = adpt_open, 122 .open = adpt_open,
121 .release = adpt_close 123 .release = adpt_close,
122}; 124#ifdef CONFIG_COMPAT
123 125 .compat_ioctl = compat_adpt_ioctl,
124#ifdef REBOOT_NOTIFIER
125static struct notifier_block adpt_reboot_notifier =
126{
127 adpt_reboot_event,
128 NULL,
129 0
130};
131#endif 126#endif
127};
132 128
133/* Structures and definitions for synchronous message posting. 129/* Structures and definitions for synchronous message posting.
134 * See adpt_i2o_post_wait() for description 130 * See adpt_i2o_post_wait() for description
@@ -151,6 +147,21 @@ static DEFINE_SPINLOCK(adpt_post_wait_lock);
151 *============================================================================ 147 *============================================================================
152 */ 148 */
153 149
150static inline int dpt_dma64(adpt_hba *pHba)
151{
152 return (sizeof(dma_addr_t) > 4 && (pHba)->dma64);
153}
154
155static inline u32 dma_high(dma_addr_t addr)
156{
157 return upper_32_bits(addr);
158}
159
160static inline u32 dma_low(dma_addr_t addr)
161{
162 return (u32)addr;
163}
164
154static u8 adpt_read_blink_led(adpt_hba* host) 165static u8 adpt_read_blink_led(adpt_hba* host)
155{ 166{
156 if (host->FwDebugBLEDflag_P) { 167 if (host->FwDebugBLEDflag_P) {
@@ -178,8 +189,6 @@ static int adpt_detect(struct scsi_host_template* sht)
178 struct pci_dev *pDev = NULL; 189 struct pci_dev *pDev = NULL;
179 adpt_hba* pHba; 190 adpt_hba* pHba;
180 191
181 adpt_init();
182
183 PINFO("Detecting Adaptec I2O RAID controllers...\n"); 192 PINFO("Detecting Adaptec I2O RAID controllers...\n");
184 193
185 /* search for all Adatpec I2O RAID cards */ 194 /* search for all Adatpec I2O RAID cards */
@@ -247,13 +256,29 @@ rebuild_sys_tab:
247 adpt_inquiry(pHba); 256 adpt_inquiry(pHba);
248 } 257 }
249 258
259 adpt_sysfs_class = class_create(THIS_MODULE, "dpt_i2o");
260 if (IS_ERR(adpt_sysfs_class)) {
261 printk(KERN_WARNING"dpti: unable to create dpt_i2o class\n");
262 adpt_sysfs_class = NULL;
263 }
264
250 for (pHba = hba_chain; pHba; pHba = pHba->next) { 265 for (pHba = hba_chain; pHba; pHba = pHba->next) {
251 if( adpt_scsi_register(pHba,sht) < 0){ 266 if (adpt_scsi_host_alloc(pHba, sht) < 0){
252 adpt_i2o_delete_hba(pHba); 267 adpt_i2o_delete_hba(pHba);
253 continue; 268 continue;
254 } 269 }
255 pHba->initialized = TRUE; 270 pHba->initialized = TRUE;
256 pHba->state &= ~DPTI_STATE_RESET; 271 pHba->state &= ~DPTI_STATE_RESET;
272 if (adpt_sysfs_class) {
273 struct device *dev = device_create(adpt_sysfs_class,
274 NULL, MKDEV(DPTI_I2O_MAJOR, pHba->unit),
275 "dpti%d", pHba->unit);
276 if (IS_ERR(dev)) {
277 printk(KERN_WARNING"dpti%d: unable to "
278 "create device in dpt_i2o class\n",
279 pHba->unit);
280 }
281 }
257 } 282 }
258 283
259 // Register our control device node 284 // Register our control device node
@@ -282,7 +307,7 @@ static int adpt_release(struct Scsi_Host *host)
282 307
283static void adpt_inquiry(adpt_hba* pHba) 308static void adpt_inquiry(adpt_hba* pHba)
284{ 309{
285 u32 msg[14]; 310 u32 msg[17];
286 u32 *mptr; 311 u32 *mptr;
287 u32 *lenptr; 312 u32 *lenptr;
288 int direction; 313 int direction;
@@ -290,11 +315,12 @@ static void adpt_inquiry(adpt_hba* pHba)
290 u32 len; 315 u32 len;
291 u32 reqlen; 316 u32 reqlen;
292 u8* buf; 317 u8* buf;
318 dma_addr_t addr;
293 u8 scb[16]; 319 u8 scb[16];
294 s32 rcode; 320 s32 rcode;
295 321
296 memset(msg, 0, sizeof(msg)); 322 memset(msg, 0, sizeof(msg));
297 buf = kmalloc(80,GFP_KERNEL|ADDR32); 323 buf = dma_alloc_coherent(&pHba->pDev->dev, 80, &addr, GFP_KERNEL);
298 if(!buf){ 324 if(!buf){
299 printk(KERN_ERR"%s: Could not allocate buffer\n",pHba->name); 325 printk(KERN_ERR"%s: Could not allocate buffer\n",pHba->name);
300 return; 326 return;
@@ -305,7 +331,10 @@ static void adpt_inquiry(adpt_hba* pHba)
305 direction = 0x00000000; 331 direction = 0x00000000;
306 scsidir =0x40000000; // DATA IN (iop<--dev) 332 scsidir =0x40000000; // DATA IN (iop<--dev)
307 333
308 reqlen = 14; // SINGLE SGE 334 if (dpt_dma64(pHba))
335 reqlen = 17; // SINGLE SGE, 64 bit
336 else
337 reqlen = 14; // SINGLE SGE, 32 bit
309 /* Stick the headers on */ 338 /* Stick the headers on */
310 msg[0] = reqlen<<16 | SGL_OFFSET_12; 339 msg[0] = reqlen<<16 | SGL_OFFSET_12;
311 msg[1] = (0xff<<24|HOST_TID<<12|ADAPTER_TID); 340 msg[1] = (0xff<<24|HOST_TID<<12|ADAPTER_TID);
@@ -338,8 +367,16 @@ static void adpt_inquiry(adpt_hba* pHba)
338 367
339 /* Now fill in the SGList and command */ 368 /* Now fill in the SGList and command */
340 *lenptr = len; 369 *lenptr = len;
341 *mptr++ = 0xD0000000|direction|len; 370 if (dpt_dma64(pHba)) {
342 *mptr++ = virt_to_bus(buf); 371 *mptr++ = (0x7C<<24)+(2<<16)+0x02; /* Enable 64 bit */
372 *mptr++ = 1 << PAGE_SHIFT;
373 *mptr++ = 0xD0000000|direction|len;
374 *mptr++ = dma_low(addr);
375 *mptr++ = dma_high(addr);
376 } else {
377 *mptr++ = 0xD0000000|direction|len;
378 *mptr++ = addr;
379 }
343 380
344 // Send it on it's way 381 // Send it on it's way
345 rcode = adpt_i2o_post_wait(pHba, msg, reqlen<<2, 120); 382 rcode = adpt_i2o_post_wait(pHba, msg, reqlen<<2, 120);
@@ -347,7 +384,7 @@ static void adpt_inquiry(adpt_hba* pHba)
347 sprintf(pHba->detail, "Adaptec I2O RAID"); 384 sprintf(pHba->detail, "Adaptec I2O RAID");
348 printk(KERN_INFO "%s: Inquiry Error (%d)\n",pHba->name,rcode); 385 printk(KERN_INFO "%s: Inquiry Error (%d)\n",pHba->name,rcode);
349 if (rcode != -ETIME && rcode != -EINTR) 386 if (rcode != -ETIME && rcode != -EINTR)
350 kfree(buf); 387 dma_free_coherent(&pHba->pDev->dev, 80, buf, addr);
351 } else { 388 } else {
352 memset(pHba->detail, 0, sizeof(pHba->detail)); 389 memset(pHba->detail, 0, sizeof(pHba->detail));
353 memcpy(&(pHba->detail), "Vendor: Adaptec ", 16); 390 memcpy(&(pHba->detail), "Vendor: Adaptec ", 16);
@@ -356,7 +393,7 @@ static void adpt_inquiry(adpt_hba* pHba)
356 memcpy(&(pHba->detail[40]), " FW: ", 4); 393 memcpy(&(pHba->detail[40]), " FW: ", 4);
357 memcpy(&(pHba->detail[44]), (u8*) &buf[32], 4); 394 memcpy(&(pHba->detail[44]), (u8*) &buf[32], 4);
358 pHba->detail[48] = '\0'; /* precautionary */ 395 pHba->detail[48] = '\0'; /* precautionary */
359 kfree(buf); 396 dma_free_coherent(&pHba->pDev->dev, 80, buf, addr);
360 } 397 }
361 adpt_i2o_status_get(pHba); 398 adpt_i2o_status_get(pHba);
362 return ; 399 return ;
@@ -632,6 +669,91 @@ stop_output:
632 return len; 669 return len;
633} 670}
634 671
672/*
673 * Turn a struct scsi_cmnd * into a unique 32 bit 'context'.
674 */
675static u32 adpt_cmd_to_context(struct scsi_cmnd *cmd)
676{
677 return (u32)cmd->serial_number;
678}
679
680/*
681 * Go from a u32 'context' to a struct scsi_cmnd * .
682 * This could probably be made more efficient.
683 */
684static struct scsi_cmnd *
685 adpt_cmd_from_context(adpt_hba * pHba, u32 context)
686{
687 struct scsi_cmnd * cmd;
688 struct scsi_device * d;
689
690 if (context == 0)
691 return NULL;
692
693 spin_unlock(pHba->host->host_lock);
694 shost_for_each_device(d, pHba->host) {
695 unsigned long flags;
696 spin_lock_irqsave(&d->list_lock, flags);
697 list_for_each_entry(cmd, &d->cmd_list, list) {
698 if (((u32)cmd->serial_number == context)) {
699 spin_unlock_irqrestore(&d->list_lock, flags);
700 scsi_device_put(d);
701 spin_lock(pHba->host->host_lock);
702 return cmd;
703 }
704 }
705 spin_unlock_irqrestore(&d->list_lock, flags);
706 }
707 spin_lock(pHba->host->host_lock);
708
709 return NULL;
710}
711
712/*
713 * Turn a pointer to ioctl reply data into an u32 'context'
714 */
715static u32 adpt_ioctl_to_context(adpt_hba * pHba, void *reply)
716{
717#if BITS_PER_LONG == 32
718 return (u32)(unsigned long)reply;
719#else
720 ulong flags = 0;
721 u32 nr, i;
722
723 spin_lock_irqsave(pHba->host->host_lock, flags);
724 nr = ARRAY_SIZE(pHba->ioctl_reply_context);
725 for (i = 0; i < nr; i++) {
726 if (pHba->ioctl_reply_context[i] == NULL) {
727 pHba->ioctl_reply_context[i] = reply;
728 break;
729 }
730 }
731 spin_unlock_irqrestore(pHba->host->host_lock, flags);
732 if (i >= nr) {
733 kfree (reply);
734 printk(KERN_WARNING"%s: Too many outstanding "
735 "ioctl commands\n", pHba->name);
736 return (u32)-1;
737 }
738
739 return i;
740#endif
741}
742
743/*
744 * Go from an u32 'context' to a pointer to ioctl reply data.
745 */
746static void *adpt_ioctl_from_context(adpt_hba *pHba, u32 context)
747{
748#if BITS_PER_LONG == 32
749 return (void *)(unsigned long)context;
750#else
751 void *p = pHba->ioctl_reply_context[context];
752 pHba->ioctl_reply_context[context] = NULL;
753
754 return p;
755#endif
756}
635 757
636/*=========================================================================== 758/*===========================================================================
637 * Error Handling routines 759 * Error Handling routines
@@ -660,7 +782,7 @@ static int adpt_abort(struct scsi_cmnd * cmd)
660 msg[1] = I2O_CMD_SCSI_ABORT<<24|HOST_TID<<12|dptdevice->tid; 782 msg[1] = I2O_CMD_SCSI_ABORT<<24|HOST_TID<<12|dptdevice->tid;
661 msg[2] = 0; 783 msg[2] = 0;
662 msg[3]= 0; 784 msg[3]= 0;
663 msg[4] = (u32)cmd; 785 msg[4] = adpt_cmd_to_context(cmd);
664 if (pHba->host) 786 if (pHba->host)
665 spin_lock_irq(pHba->host->host_lock); 787 spin_lock_irq(pHba->host->host_lock);
666 rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER); 788 rcode = adpt_i2o_post_wait(pHba, msg, sizeof(msg), FOREVER);
@@ -861,27 +983,6 @@ static void adpt_i2o_sys_shutdown(void)
861 printk(KERN_INFO "Adaptec I2O controllers down.\n"); 983 printk(KERN_INFO "Adaptec I2O controllers down.\n");
862} 984}
863 985
864/*
865 * reboot/shutdown notification.
866 *
867 * - Quiesce each IOP in the system
868 *
869 */
870
871#ifdef REBOOT_NOTIFIER
872static int adpt_reboot_event(struct notifier_block *n, ulong code, void *p)
873{
874
875 if(code != SYS_RESTART && code != SYS_HALT && code != SYS_POWER_OFF)
876 return NOTIFY_DONE;
877
878 adpt_i2o_sys_shutdown();
879
880 return NOTIFY_DONE;
881}
882#endif
883
884
885static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev) 986static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev)
886{ 987{
887 988
@@ -893,6 +994,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
893 u32 hba_map1_area_size = 0; 994 u32 hba_map1_area_size = 0;
894 void __iomem *base_addr_virt = NULL; 995 void __iomem *base_addr_virt = NULL;
895 void __iomem *msg_addr_virt = NULL; 996 void __iomem *msg_addr_virt = NULL;
997 int dma64 = 0;
896 998
897 int raptorFlag = FALSE; 999 int raptorFlag = FALSE;
898 1000
@@ -906,9 +1008,21 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
906 } 1008 }
907 1009
908 pci_set_master(pDev); 1010 pci_set_master(pDev);
909 if (pci_set_dma_mask(pDev, DMA_32BIT_MASK)) 1011
1012 /*
1013 * See if we should enable dma64 mode.
1014 */
1015 if (sizeof(dma_addr_t) > 4 &&
1016 pci_set_dma_mask(pDev, DMA_64BIT_MASK) == 0) {
1017 if (dma_get_required_mask(&pDev->dev) > DMA_32BIT_MASK)
1018 dma64 = 1;
1019 }
1020 if (!dma64 && pci_set_dma_mask(pDev, DMA_32BIT_MASK) != 0)
910 return -EINVAL; 1021 return -EINVAL;
911 1022
1023 /* adapter only supports message blocks below 4GB */
1024 pci_set_consistent_dma_mask(pDev, DMA_32BIT_MASK);
1025
912 base_addr0_phys = pci_resource_start(pDev,0); 1026 base_addr0_phys = pci_resource_start(pDev,0);
913 hba_map0_area_size = pci_resource_len(pDev,0); 1027 hba_map0_area_size = pci_resource_len(pDev,0);
914 1028
@@ -929,6 +1043,25 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
929 raptorFlag = TRUE; 1043 raptorFlag = TRUE;
930 } 1044 }
931 1045
1046#if BITS_PER_LONG == 64
1047 /*
1048 * The original Adaptec 64 bit driver has this comment here:
1049 * "x86_64 machines need more optimal mappings"
1050 *
1051 * I assume some HBAs report ridiculously large mappings
1052 * and we need to limit them on platforms with IOMMUs.
1053 */
1054 if (raptorFlag == TRUE) {
1055 if (hba_map0_area_size > 128)
1056 hba_map0_area_size = 128;
1057 if (hba_map1_area_size > 524288)
1058 hba_map1_area_size = 524288;
1059 } else {
1060 if (hba_map0_area_size > 524288)
1061 hba_map0_area_size = 524288;
1062 }
1063#endif
1064
932 base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); 1065 base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size);
933 if (!base_addr_virt) { 1066 if (!base_addr_virt) {
934 pci_release_regions(pDev); 1067 pci_release_regions(pDev);
@@ -991,16 +1124,22 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
991 pHba->state = DPTI_STATE_RESET; 1124 pHba->state = DPTI_STATE_RESET;
992 pHba->pDev = pDev; 1125 pHba->pDev = pDev;
993 pHba->devices = NULL; 1126 pHba->devices = NULL;
1127 pHba->dma64 = dma64;
994 1128
995 // Initializing the spinlocks 1129 // Initializing the spinlocks
996 spin_lock_init(&pHba->state_lock); 1130 spin_lock_init(&pHba->state_lock);
997 spin_lock_init(&adpt_post_wait_lock); 1131 spin_lock_init(&adpt_post_wait_lock);
998 1132
999 if(raptorFlag == 0){ 1133 if(raptorFlag == 0){
1000 printk(KERN_INFO"Adaptec I2O RAID controller %d at %p size=%x irq=%d\n", 1134 printk(KERN_INFO "Adaptec I2O RAID controller"
1001 hba_count-1, base_addr_virt, hba_map0_area_size, pDev->irq); 1135 " %d at %p size=%x irq=%d%s\n",
1136 hba_count-1, base_addr_virt,
1137 hba_map0_area_size, pDev->irq,
1138 dma64 ? " (64-bit DMA)" : "");
1002 } else { 1139 } else {
1003 printk(KERN_INFO"Adaptec I2O RAID controller %d irq=%d\n",hba_count-1, pDev->irq); 1140 printk(KERN_INFO"Adaptec I2O RAID controller %d irq=%d%s\n",
1141 hba_count-1, pDev->irq,
1142 dma64 ? " (64-bit DMA)" : "");
1004 printk(KERN_INFO" BAR0 %p - size= %x\n",base_addr_virt,hba_map0_area_size); 1143 printk(KERN_INFO" BAR0 %p - size= %x\n",base_addr_virt,hba_map0_area_size);
1005 printk(KERN_INFO" BAR1 %p - size= %x\n",msg_addr_virt,hba_map1_area_size); 1144 printk(KERN_INFO" BAR1 %p - size= %x\n",msg_addr_virt,hba_map1_area_size);
1006 } 1145 }
@@ -1053,10 +1192,26 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
1053 if(pHba->msg_addr_virt != pHba->base_addr_virt){ 1192 if(pHba->msg_addr_virt != pHba->base_addr_virt){
1054 iounmap(pHba->msg_addr_virt); 1193 iounmap(pHba->msg_addr_virt);
1055 } 1194 }
1056 kfree(pHba->hrt); 1195 if(pHba->FwDebugBuffer_P)
1057 kfree(pHba->lct); 1196 iounmap(pHba->FwDebugBuffer_P);
1058 kfree(pHba->status_block); 1197 if(pHba->hrt) {
1059 kfree(pHba->reply_pool); 1198 dma_free_coherent(&pHba->pDev->dev,
1199 pHba->hrt->num_entries * pHba->hrt->entry_len << 2,
1200 pHba->hrt, pHba->hrt_pa);
1201 }
1202 if(pHba->lct) {
1203 dma_free_coherent(&pHba->pDev->dev, pHba->lct_size,
1204 pHba->lct, pHba->lct_pa);
1205 }
1206 if(pHba->status_block) {
1207 dma_free_coherent(&pHba->pDev->dev, sizeof(i2o_status_block),
1208 pHba->status_block, pHba->status_block_pa);
1209 }
1210 if(pHba->reply_pool) {
1211 dma_free_coherent(&pHba->pDev->dev,
1212 pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4,
1213 pHba->reply_pool, pHba->reply_pool_pa);
1214 }
1060 1215
1061 for(d = pHba->devices; d ; d = next){ 1216 for(d = pHba->devices; d ; d = next){
1062 next = d->next; 1217 next = d->next;
@@ -1075,23 +1230,19 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
1075 pci_dev_put(pHba->pDev); 1230 pci_dev_put(pHba->pDev);
1076 kfree(pHba); 1231 kfree(pHba);
1077 1232
1233 if (adpt_sysfs_class)
1234 device_destroy(adpt_sysfs_class,
1235 MKDEV(DPTI_I2O_MAJOR, pHba->unit));
1236
1078 if(hba_count <= 0){ 1237 if(hba_count <= 0){
1079 unregister_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER); 1238 unregister_chrdev(DPTI_I2O_MAJOR, DPT_DRIVER);
1239 if (adpt_sysfs_class) {
1240 class_destroy(adpt_sysfs_class);
1241 adpt_sysfs_class = NULL;
1242 }
1080 } 1243 }
1081} 1244}
1082 1245
1083
1084static int adpt_init(void)
1085{
1086 printk("Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n");
1087#ifdef REBOOT_NOTIFIER
1088 register_reboot_notifier(&adpt_reboot_notifier);
1089#endif
1090
1091 return 0;
1092}
1093
1094
1095static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun) 1246static struct adpt_device* adpt_find_device(adpt_hba* pHba, u32 chan, u32 id, u32 lun)
1096{ 1247{
1097 struct adpt_device* d; 1248 struct adpt_device* d;
@@ -1283,6 +1434,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1283{ 1434{
1284 u32 msg[8]; 1435 u32 msg[8];
1285 u8* status; 1436 u8* status;
1437 dma_addr_t addr;
1286 u32 m = EMPTY_QUEUE ; 1438 u32 m = EMPTY_QUEUE ;
1287 ulong timeout = jiffies + (TMOUT_IOPRESET*HZ); 1439 ulong timeout = jiffies + (TMOUT_IOPRESET*HZ);
1288 1440
@@ -1305,12 +1457,13 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1305 schedule_timeout_uninterruptible(1); 1457 schedule_timeout_uninterruptible(1);
1306 } while (m == EMPTY_QUEUE); 1458 } while (m == EMPTY_QUEUE);
1307 1459
1308 status = kzalloc(4, GFP_KERNEL|ADDR32); 1460 status = dma_alloc_coherent(&pHba->pDev->dev, 4, &addr, GFP_KERNEL);
1309 if(status == NULL) { 1461 if(status == NULL) {
1310 adpt_send_nop(pHba, m); 1462 adpt_send_nop(pHba, m);
1311 printk(KERN_ERR"IOP reset failed - no free memory.\n"); 1463 printk(KERN_ERR"IOP reset failed - no free memory.\n");
1312 return -ENOMEM; 1464 return -ENOMEM;
1313 } 1465 }
1466 memset(status,0,4);
1314 1467
1315 msg[0]=EIGHT_WORD_MSG_SIZE|SGL_OFFSET_0; 1468 msg[0]=EIGHT_WORD_MSG_SIZE|SGL_OFFSET_0;
1316 msg[1]=I2O_CMD_ADAPTER_RESET<<24|HOST_TID<<12|ADAPTER_TID; 1469 msg[1]=I2O_CMD_ADAPTER_RESET<<24|HOST_TID<<12|ADAPTER_TID;
@@ -1318,8 +1471,8 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1318 msg[3]=0; 1471 msg[3]=0;
1319 msg[4]=0; 1472 msg[4]=0;
1320 msg[5]=0; 1473 msg[5]=0;
1321 msg[6]=virt_to_bus(status); 1474 msg[6]=dma_low(addr);
1322 msg[7]=0; 1475 msg[7]=dma_high(addr);
1323 1476
1324 memcpy_toio(pHba->msg_addr_virt+m, msg, sizeof(msg)); 1477 memcpy_toio(pHba->msg_addr_virt+m, msg, sizeof(msg));
1325 wmb(); 1478 wmb();
@@ -1329,7 +1482,10 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1329 while(*status == 0){ 1482 while(*status == 0){
1330 if(time_after(jiffies,timeout)){ 1483 if(time_after(jiffies,timeout)){
1331 printk(KERN_WARNING"%s: IOP Reset Timeout\n",pHba->name); 1484 printk(KERN_WARNING"%s: IOP Reset Timeout\n",pHba->name);
1332 kfree(status); 1485 /* We lose 4 bytes of "status" here, but we cannot
1486 free these because controller may awake and corrupt
1487 those bytes at any time */
1488 /* dma_free_coherent(&pHba->pDev->dev, 4, buf, addr); */
1333 return -ETIMEDOUT; 1489 return -ETIMEDOUT;
1334 } 1490 }
1335 rmb(); 1491 rmb();
@@ -1348,6 +1504,10 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1348 } 1504 }
1349 if(time_after(jiffies,timeout)){ 1505 if(time_after(jiffies,timeout)){
1350 printk(KERN_ERR "%s:Timeout waiting for IOP Reset.\n",pHba->name); 1506 printk(KERN_ERR "%s:Timeout waiting for IOP Reset.\n",pHba->name);
1507 /* We lose 4 bytes of "status" here, but we
1508 cannot free these because controller may
1509 awake and corrupt those bytes at any time */
1510 /* dma_free_coherent(&pHba->pDev->dev, 4, buf, addr); */
1351 return -ETIMEDOUT; 1511 return -ETIMEDOUT;
1352 } 1512 }
1353 schedule_timeout_uninterruptible(1); 1513 schedule_timeout_uninterruptible(1);
@@ -1364,7 +1524,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
1364 PDEBUG("%s: Reset completed.\n", pHba->name); 1524 PDEBUG("%s: Reset completed.\n", pHba->name);
1365 } 1525 }
1366 1526
1367 kfree(status); 1527 dma_free_coherent(&pHba->pDev->dev, 4, status, addr);
1368#ifdef UARTDELAY 1528#ifdef UARTDELAY
1369 // This delay is to allow someone attached to the card through the debug UART to 1529 // This delay is to allow someone attached to the card through the debug UART to
1370 // set up the dump levels that they want before the rest of the initialization sequence 1530 // set up the dump levels that they want before the rest of the initialization sequence
@@ -1636,6 +1796,7 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
1636 u32 i = 0; 1796 u32 i = 0;
1637 u32 rcode = 0; 1797 u32 rcode = 0;
1638 void *p = NULL; 1798 void *p = NULL;
1799 dma_addr_t addr;
1639 ulong flags = 0; 1800 ulong flags = 0;
1640 1801
1641 memset(&msg, 0, MAX_MESSAGE_SIZE*4); 1802 memset(&msg, 0, MAX_MESSAGE_SIZE*4);
@@ -1668,10 +1829,13 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
1668 } 1829 }
1669 sg_offset = (msg[0]>>4)&0xf; 1830 sg_offset = (msg[0]>>4)&0xf;
1670 msg[2] = 0x40000000; // IOCTL context 1831 msg[2] = 0x40000000; // IOCTL context
1671 msg[3] = (u32)reply; 1832 msg[3] = adpt_ioctl_to_context(pHba, reply);
1833 if (msg[3] == (u32)-1)
1834 return -EBUSY;
1835
1672 memset(sg_list,0, sizeof(sg_list[0])*pHba->sg_tablesize); 1836 memset(sg_list,0, sizeof(sg_list[0])*pHba->sg_tablesize);
1673 if(sg_offset) { 1837 if(sg_offset) {
1674 // TODO 64bit fix 1838 // TODO add 64 bit API
1675 struct sg_simple_element *sg = (struct sg_simple_element*) (msg+sg_offset); 1839 struct sg_simple_element *sg = (struct sg_simple_element*) (msg+sg_offset);
1676 sg_count = (size - sg_offset*4) / sizeof(struct sg_simple_element); 1840 sg_count = (size - sg_offset*4) / sizeof(struct sg_simple_element);
1677 if (sg_count > pHba->sg_tablesize){ 1841 if (sg_count > pHba->sg_tablesize){
@@ -1690,7 +1854,7 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
1690 } 1854 }
1691 sg_size = sg[i].flag_count & 0xffffff; 1855 sg_size = sg[i].flag_count & 0xffffff;
1692 /* Allocate memory for the transfer */ 1856 /* Allocate memory for the transfer */
1693 p = kmalloc(sg_size, GFP_KERNEL|ADDR32); 1857 p = dma_alloc_coherent(&pHba->pDev->dev, sg_size, &addr, GFP_KERNEL);
1694 if(!p) { 1858 if(!p) {
1695 printk(KERN_DEBUG"%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n", 1859 printk(KERN_DEBUG"%s: Could not allocate SG buffer - size = %d buffer number %d of %d\n",
1696 pHba->name,sg_size,i,sg_count); 1860 pHba->name,sg_size,i,sg_count);
@@ -1700,15 +1864,15 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
1700 sg_list[sg_index++] = p; // sglist indexed with input frame, not our internal frame. 1864 sg_list[sg_index++] = p; // sglist indexed with input frame, not our internal frame.
1701 /* Copy in the user's SG buffer if necessary */ 1865 /* Copy in the user's SG buffer if necessary */
1702 if(sg[i].flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR*/) { 1866 if(sg[i].flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR*/) {
1703 // TODO 64bit fix 1867 // sg_simple_element API is 32 bit
1704 if (copy_from_user(p,(void __user *)sg[i].addr_bus, sg_size)) { 1868 if (copy_from_user(p,(void __user *)(ulong)sg[i].addr_bus, sg_size)) {
1705 printk(KERN_DEBUG"%s: Could not copy SG buf %d FROM user\n",pHba->name,i); 1869 printk(KERN_DEBUG"%s: Could not copy SG buf %d FROM user\n",pHba->name,i);
1706 rcode = -EFAULT; 1870 rcode = -EFAULT;
1707 goto cleanup; 1871 goto cleanup;
1708 } 1872 }
1709 } 1873 }
1710 //TODO 64bit fix 1874 /* sg_simple_element API is 32 bit, but addr < 4GB */
1711 sg[i].addr_bus = (u32)virt_to_bus(p); 1875 sg[i].addr_bus = addr;
1712 } 1876 }
1713 } 1877 }
1714 1878
@@ -1736,7 +1900,7 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
1736 if(sg_offset) { 1900 if(sg_offset) {
1737 /* Copy back the Scatter Gather buffers back to user space */ 1901 /* Copy back the Scatter Gather buffers back to user space */
1738 u32 j; 1902 u32 j;
1739 // TODO 64bit fix 1903 // TODO add 64 bit API
1740 struct sg_simple_element* sg; 1904 struct sg_simple_element* sg;
1741 int sg_size; 1905 int sg_size;
1742 1906
@@ -1756,14 +1920,14 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
1756 } 1920 }
1757 sg_count = (size - sg_offset*4) / sizeof(struct sg_simple_element); 1921 sg_count = (size - sg_offset*4) / sizeof(struct sg_simple_element);
1758 1922
1759 // TODO 64bit fix 1923 // TODO add 64 bit API
1760 sg = (struct sg_simple_element*)(msg + sg_offset); 1924 sg = (struct sg_simple_element*)(msg + sg_offset);
1761 for (j = 0; j < sg_count; j++) { 1925 for (j = 0; j < sg_count; j++) {
1762 /* Copy out the SG list to user's buffer if necessary */ 1926 /* Copy out the SG list to user's buffer if necessary */
1763 if(! (sg[j].flag_count & 0x4000000 /*I2O_SGL_FLAGS_DIR*/)) { 1927 if(! (sg[j].flag_count & 0x4000000 /*I2O_SGL_FLAGS_DIR*/)) {
1764 sg_size = sg[j].flag_count & 0xffffff; 1928 sg_size = sg[j].flag_count & 0xffffff;
1765 // TODO 64bit fix 1929 // sg_simple_element API is 32 bit
1766 if (copy_to_user((void __user *)sg[j].addr_bus,sg_list[j], sg_size)) { 1930 if (copy_to_user((void __user *)(ulong)sg[j].addr_bus,sg_list[j], sg_size)) {
1767 printk(KERN_WARNING"%s: Could not copy %p TO user %x\n",pHba->name, sg_list[j], sg[j].addr_bus); 1931 printk(KERN_WARNING"%s: Could not copy %p TO user %x\n",pHba->name, sg_list[j], sg[j].addr_bus);
1768 rcode = -EFAULT; 1932 rcode = -EFAULT;
1769 goto cleanup; 1933 goto cleanup;
@@ -1787,12 +1951,17 @@ static int adpt_i2o_passthru(adpt_hba* pHba, u32 __user *arg)
1787 1951
1788 1952
1789cleanup: 1953cleanup:
1790 if (rcode != -ETIME && rcode != -EINTR) 1954 if (rcode != -ETIME && rcode != -EINTR) {
1955 struct sg_simple_element *sg =
1956 (struct sg_simple_element*) (msg +sg_offset);
1791 kfree (reply); 1957 kfree (reply);
1792 while(sg_index) { 1958 while(sg_index) {
1793 if(sg_list[--sg_index]) { 1959 if(sg_list[--sg_index]) {
1794 if (rcode != -ETIME && rcode != -EINTR) 1960 dma_free_coherent(&pHba->pDev->dev,
1795 kfree(sg_list[sg_index]); 1961 sg[sg_index].flag_count & 0xffffff,
1962 sg_list[sg_index],
1963 sg[sg_index].addr_bus);
1964 }
1796 } 1965 }
1797 } 1966 }
1798 return rcode; 1967 return rcode;
@@ -1978,6 +2147,38 @@ static int adpt_ioctl(struct inode *inode, struct file *file, uint cmd,
1978 return error; 2147 return error;
1979} 2148}
1980 2149
2150#ifdef CONFIG_COMPAT
2151static long compat_adpt_ioctl(struct file *file,
2152 unsigned int cmd, unsigned long arg)
2153{
2154 struct inode *inode;
2155 long ret;
2156
2157 inode = file->f_dentry->d_inode;
2158
2159 lock_kernel();
2160
2161 switch(cmd) {
2162 case DPT_SIGNATURE:
2163 case I2OUSRCMD:
2164 case DPT_CTRLINFO:
2165 case DPT_SYSINFO:
2166 case DPT_BLINKLED:
2167 case I2ORESETCMD:
2168 case I2ORESCANCMD:
2169 case (DPT_TARGET_BUSY & 0xFFFF):
2170 case DPT_TARGET_BUSY:
2171 ret = adpt_ioctl(inode, file, cmd, arg);
2172 break;
2173 default:
2174 ret = -ENOIOCTLCMD;
2175 }
2176
2177 unlock_kernel();
2178
2179 return ret;
2180}
2181#endif
1981 2182
1982static irqreturn_t adpt_isr(int irq, void *dev_id) 2183static irqreturn_t adpt_isr(int irq, void *dev_id)
1983{ 2184{
@@ -2009,7 +2210,16 @@ static irqreturn_t adpt_isr(int irq, void *dev_id)
2009 goto out; 2210 goto out;
2010 } 2211 }
2011 } 2212 }
2012 reply = bus_to_virt(m); 2213 if (pHba->reply_pool_pa <= m &&
2214 m < pHba->reply_pool_pa +
2215 (pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4)) {
2216 reply = (u8 *)pHba->reply_pool +
2217 (m - pHba->reply_pool_pa);
2218 } else {
2219 /* Ick, we should *never* be here */
2220 printk(KERN_ERR "dpti: reply frame not from pool\n");
2221 reply = (u8 *)bus_to_virt(m);
2222 }
2013 2223
2014 if (readl(reply) & MSG_FAIL) { 2224 if (readl(reply) & MSG_FAIL) {
2015 u32 old_m = readl(reply+28); 2225 u32 old_m = readl(reply+28);
@@ -2029,7 +2239,7 @@ static irqreturn_t adpt_isr(int irq, void *dev_id)
2029 } 2239 }
2030 context = readl(reply+8); 2240 context = readl(reply+8);
2031 if(context & 0x40000000){ // IOCTL 2241 if(context & 0x40000000){ // IOCTL
2032 void *p = (void *)readl(reply+12); 2242 void *p = adpt_ioctl_from_context(pHba, readl(reply+12));
2033 if( p != NULL) { 2243 if( p != NULL) {
2034 memcpy_fromio(p, reply, REPLY_FRAME_SIZE * 4); 2244 memcpy_fromio(p, reply, REPLY_FRAME_SIZE * 4);
2035 } 2245 }
@@ -2043,15 +2253,17 @@ static irqreturn_t adpt_isr(int irq, void *dev_id)
2043 status = I2O_POST_WAIT_OK; 2253 status = I2O_POST_WAIT_OK;
2044 } 2254 }
2045 if(!(context & 0x40000000)) { 2255 if(!(context & 0x40000000)) {
2046 cmd = (struct scsi_cmnd*) readl(reply+12); 2256 cmd = adpt_cmd_from_context(pHba,
2257 readl(reply+12));
2047 if(cmd != NULL) { 2258 if(cmd != NULL) {
2048 printk(KERN_WARNING"%s: Apparent SCSI cmd in Post Wait Context - cmd=%p context=%x\n", pHba->name, cmd, context); 2259 printk(KERN_WARNING"%s: Apparent SCSI cmd in Post Wait Context - cmd=%p context=%x\n", pHba->name, cmd, context);
2049 } 2260 }
2050 } 2261 }
2051 adpt_i2o_post_wait_complete(context, status); 2262 adpt_i2o_post_wait_complete(context, status);
2052 } else { // SCSI message 2263 } else { // SCSI message
2053 cmd = (struct scsi_cmnd*) readl(reply+12); 2264 cmd = adpt_cmd_from_context (pHba, readl(reply+12));
2054 if(cmd != NULL){ 2265 if(cmd != NULL){
2266 scsi_dma_unmap(cmd);
2055 if(cmd->serial_number != 0) { // If not timedout 2267 if(cmd->serial_number != 0) { // If not timedout
2056 adpt_i2o_to_scsi(reply, cmd); 2268 adpt_i2o_to_scsi(reply, cmd);
2057 } 2269 }
@@ -2072,6 +2284,7 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d
2072 int i; 2284 int i;
2073 u32 msg[MAX_MESSAGE_SIZE]; 2285 u32 msg[MAX_MESSAGE_SIZE];
2074 u32* mptr; 2286 u32* mptr;
2287 u32* lptr;
2075 u32 *lenptr; 2288 u32 *lenptr;
2076 int direction; 2289 int direction;
2077 int scsidir; 2290 int scsidir;
@@ -2079,6 +2292,7 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d
2079 u32 len; 2292 u32 len;
2080 u32 reqlen; 2293 u32 reqlen;
2081 s32 rcode; 2294 s32 rcode;
2295 dma_addr_t addr;
2082 2296
2083 memset(msg, 0 , sizeof(msg)); 2297 memset(msg, 0 , sizeof(msg));
2084 len = scsi_bufflen(cmd); 2298 len = scsi_bufflen(cmd);
@@ -2118,7 +2332,7 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d
2118 // I2O_CMD_SCSI_EXEC 2332 // I2O_CMD_SCSI_EXEC
2119 msg[1] = ((0xff<<24)|(HOST_TID<<12)|d->tid); 2333 msg[1] = ((0xff<<24)|(HOST_TID<<12)|d->tid);
2120 msg[2] = 0; 2334 msg[2] = 0;
2121 msg[3] = (u32)cmd; /* We want the SCSI control block back */ 2335 msg[3] = adpt_cmd_to_context(cmd); /* Want SCSI control block back */
2122 // Our cards use the transaction context as the tag for queueing 2336 // Our cards use the transaction context as the tag for queueing
2123 // Adaptec/DPT Private stuff 2337 // Adaptec/DPT Private stuff
2124 msg[4] = I2O_CMD_SCSI_EXEC|(DPT_ORGANIZATION_ID<<16); 2338 msg[4] = I2O_CMD_SCSI_EXEC|(DPT_ORGANIZATION_ID<<16);
@@ -2136,7 +2350,13 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d
2136 memcpy(mptr, cmd->cmnd, cmd->cmd_len); 2350 memcpy(mptr, cmd->cmnd, cmd->cmd_len);
2137 mptr+=4; 2351 mptr+=4;
2138 lenptr=mptr++; /* Remember me - fill in when we know */ 2352 lenptr=mptr++; /* Remember me - fill in when we know */
2139 reqlen = 14; // SINGLE SGE 2353 if (dpt_dma64(pHba)) {
2354 reqlen = 16; // SINGLE SGE
2355 *mptr++ = (0x7C<<24)+(2<<16)+0x02; /* Enable 64 bit */
2356 *mptr++ = 1 << PAGE_SHIFT;
2357 } else {
2358 reqlen = 14; // SINGLE SGE
2359 }
2140 /* Now fill in the SGList and command */ 2360 /* Now fill in the SGList and command */
2141 2361
2142 nseg = scsi_dma_map(cmd); 2362 nseg = scsi_dma_map(cmd);
@@ -2146,12 +2366,16 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d
2146 2366
2147 len = 0; 2367 len = 0;
2148 scsi_for_each_sg(cmd, sg, nseg, i) { 2368 scsi_for_each_sg(cmd, sg, nseg, i) {
2369 lptr = mptr;
2149 *mptr++ = direction|0x10000000|sg_dma_len(sg); 2370 *mptr++ = direction|0x10000000|sg_dma_len(sg);
2150 len+=sg_dma_len(sg); 2371 len+=sg_dma_len(sg);
2151 *mptr++ = sg_dma_address(sg); 2372 addr = sg_dma_address(sg);
2373 *mptr++ = dma_low(addr);
2374 if (dpt_dma64(pHba))
2375 *mptr++ = dma_high(addr);
2152 /* Make this an end of list */ 2376 /* Make this an end of list */
2153 if (i == nseg - 1) 2377 if (i == nseg - 1)
2154 mptr[-2] = direction|0xD0000000|sg_dma_len(sg); 2378 *lptr = direction|0xD0000000|sg_dma_len(sg);
2155 } 2379 }
2156 reqlen = mptr - msg; 2380 reqlen = mptr - msg;
2157 *lenptr = len; 2381 *lenptr = len;
@@ -2177,13 +2401,13 @@ static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_d
2177} 2401}
2178 2402
2179 2403
2180static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht) 2404static s32 adpt_scsi_host_alloc(adpt_hba* pHba, struct scsi_host_template *sht)
2181{ 2405{
2182 struct Scsi_Host *host = NULL; 2406 struct Scsi_Host *host;
2183 2407
2184 host = scsi_register(sht, sizeof(adpt_hba*)); 2408 host = scsi_host_alloc(sht, sizeof(adpt_hba*));
2185 if (host == NULL) { 2409 if (host == NULL) {
2186 printk ("%s: scsi_register returned NULL\n",pHba->name); 2410 printk("%s: scsi_host_alloc returned NULL\n", pHba->name);
2187 return -1; 2411 return -1;
2188 } 2412 }
2189 host->hostdata[0] = (unsigned long)pHba; 2413 host->hostdata[0] = (unsigned long)pHba;
@@ -2200,7 +2424,7 @@ static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht)
2200 host->max_lun = 256; 2424 host->max_lun = 256;
2201 host->max_channel = pHba->top_scsi_channel + 1; 2425 host->max_channel = pHba->top_scsi_channel + 1;
2202 host->cmd_per_lun = 1; 2426 host->cmd_per_lun = 1;
2203 host->unique_id = (uint) pHba; 2427 host->unique_id = (u32)sys_tbl_pa + pHba->unit;
2204 host->sg_tablesize = pHba->sg_tablesize; 2428 host->sg_tablesize = pHba->sg_tablesize;
2205 host->can_queue = pHba->post_fifo_size; 2429 host->can_queue = pHba->post_fifo_size;
2206 2430
@@ -2640,11 +2864,10 @@ static s32 adpt_send_nop(adpt_hba*pHba,u32 m)
2640static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) 2864static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
2641{ 2865{
2642 u8 *status; 2866 u8 *status;
2867 dma_addr_t addr;
2643 u32 __iomem *msg = NULL; 2868 u32 __iomem *msg = NULL;
2644 int i; 2869 int i;
2645 ulong timeout = jiffies + TMOUT_INITOUTBOUND*HZ; 2870 ulong timeout = jiffies + TMOUT_INITOUTBOUND*HZ;
2646 u32* ptr;
2647 u32 outbound_frame; // This had to be a 32 bit address
2648 u32 m; 2871 u32 m;
2649 2872
2650 do { 2873 do {
@@ -2663,13 +2886,14 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
2663 2886
2664 msg=(u32 __iomem *)(pHba->msg_addr_virt+m); 2887 msg=(u32 __iomem *)(pHba->msg_addr_virt+m);
2665 2888
2666 status = kzalloc(4, GFP_KERNEL|ADDR32); 2889 status = dma_alloc_coherent(&pHba->pDev->dev, 4, &addr, GFP_KERNEL);
2667 if (!status) { 2890 if (!status) {
2668 adpt_send_nop(pHba, m); 2891 adpt_send_nop(pHba, m);
2669 printk(KERN_WARNING"%s: IOP reset failed - no free memory.\n", 2892 printk(KERN_WARNING"%s: IOP reset failed - no free memory.\n",
2670 pHba->name); 2893 pHba->name);
2671 return -ENOMEM; 2894 return -ENOMEM;
2672 } 2895 }
2896 memset(status, 0, 4);
2673 2897
2674 writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]); 2898 writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]);
2675 writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]); 2899 writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]);
@@ -2678,7 +2902,7 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
2678 writel(4096, &msg[4]); /* Host page frame size */ 2902 writel(4096, &msg[4]); /* Host page frame size */
2679 writel((REPLY_FRAME_SIZE)<<16|0x80, &msg[5]); /* Outbound msg frame size and Initcode */ 2903 writel((REPLY_FRAME_SIZE)<<16|0x80, &msg[5]); /* Outbound msg frame size and Initcode */
2680 writel(0xD0000004, &msg[6]); /* Simple SG LE, EOB */ 2904 writel(0xD0000004, &msg[6]); /* Simple SG LE, EOB */
2681 writel(virt_to_bus(status), &msg[7]); 2905 writel((u32)addr, &msg[7]);
2682 2906
2683 writel(m, pHba->post_port); 2907 writel(m, pHba->post_port);
2684 wmb(); 2908 wmb();
@@ -2693,6 +2917,10 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
2693 rmb(); 2917 rmb();
2694 if(time_after(jiffies,timeout)){ 2918 if(time_after(jiffies,timeout)){
2695 printk(KERN_WARNING"%s: Timeout Initializing\n",pHba->name); 2919 printk(KERN_WARNING"%s: Timeout Initializing\n",pHba->name);
2920 /* We lose 4 bytes of "status" here, but we
2921 cannot free these because controller may
2922 awake and corrupt those bytes at any time */
2923 /* dma_free_coherent(&pHba->pDev->dev, 4, status, addr); */
2696 return -ETIMEDOUT; 2924 return -ETIMEDOUT;
2697 } 2925 }
2698 schedule_timeout_uninterruptible(1); 2926 schedule_timeout_uninterruptible(1);
@@ -2701,25 +2929,30 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba)
2701 // If the command was successful, fill the fifo with our reply 2929 // If the command was successful, fill the fifo with our reply
2702 // message packets 2930 // message packets
2703 if(*status != 0x04 /*I2O_EXEC_OUTBOUND_INIT_COMPLETE*/) { 2931 if(*status != 0x04 /*I2O_EXEC_OUTBOUND_INIT_COMPLETE*/) {
2704 kfree(status); 2932 dma_free_coherent(&pHba->pDev->dev, 4, status, addr);
2705 return -2; 2933 return -2;
2706 } 2934 }
2707 kfree(status); 2935 dma_free_coherent(&pHba->pDev->dev, 4, status, addr);
2708 2936
2709 kfree(pHba->reply_pool); 2937 if(pHba->reply_pool != NULL) {
2938 dma_free_coherent(&pHba->pDev->dev,
2939 pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4,
2940 pHba->reply_pool, pHba->reply_pool_pa);
2941 }
2710 2942
2711 pHba->reply_pool = kzalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32); 2943 pHba->reply_pool = dma_alloc_coherent(&pHba->pDev->dev,
2944 pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4,
2945 &pHba->reply_pool_pa, GFP_KERNEL);
2712 if (!pHba->reply_pool) { 2946 if (!pHba->reply_pool) {
2713 printk(KERN_ERR "%s: Could not allocate reply pool\n", pHba->name); 2947 printk(KERN_ERR "%s: Could not allocate reply pool\n", pHba->name);
2714 return -ENOMEM; 2948 return -ENOMEM;
2715 } 2949 }
2950 memset(pHba->reply_pool, 0 , pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4);
2716 2951
2717 ptr = pHba->reply_pool;
2718 for(i = 0; i < pHba->reply_fifo_size; i++) { 2952 for(i = 0; i < pHba->reply_fifo_size; i++) {
2719 outbound_frame = (u32)virt_to_bus(ptr); 2953 writel(pHba->reply_pool_pa + (i * REPLY_FRAME_SIZE * 4),
2720 writel(outbound_frame, pHba->reply_port); 2954 pHba->reply_port);
2721 wmb(); 2955 wmb();
2722 ptr += REPLY_FRAME_SIZE;
2723 } 2956 }
2724 adpt_i2o_status_get(pHba); 2957 adpt_i2o_status_get(pHba);
2725 return 0; 2958 return 0;
@@ -2743,11 +2976,11 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba)
2743 u32 m; 2976 u32 m;
2744 u32 __iomem *msg; 2977 u32 __iomem *msg;
2745 u8 *status_block=NULL; 2978 u8 *status_block=NULL;
2746 ulong status_block_bus;
2747 2979
2748 if(pHba->status_block == NULL) { 2980 if(pHba->status_block == NULL) {
2749 pHba->status_block = (i2o_status_block*) 2981 pHba->status_block = dma_alloc_coherent(&pHba->pDev->dev,
2750 kmalloc(sizeof(i2o_status_block),GFP_KERNEL|ADDR32); 2982 sizeof(i2o_status_block),
2983 &pHba->status_block_pa, GFP_KERNEL);
2751 if(pHba->status_block == NULL) { 2984 if(pHba->status_block == NULL) {
2752 printk(KERN_ERR 2985 printk(KERN_ERR
2753 "dpti%d: Get Status Block failed; Out of memory. \n", 2986 "dpti%d: Get Status Block failed; Out of memory. \n",
@@ -2757,7 +2990,6 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba)
2757 } 2990 }
2758 memset(pHba->status_block, 0, sizeof(i2o_status_block)); 2991 memset(pHba->status_block, 0, sizeof(i2o_status_block));
2759 status_block = (u8*)(pHba->status_block); 2992 status_block = (u8*)(pHba->status_block);
2760 status_block_bus = virt_to_bus(pHba->status_block);
2761 timeout = jiffies+TMOUT_GETSTATUS*HZ; 2993 timeout = jiffies+TMOUT_GETSTATUS*HZ;
2762 do { 2994 do {
2763 rmb(); 2995 rmb();
@@ -2782,8 +3014,8 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba)
2782 writel(0, &msg[3]); 3014 writel(0, &msg[3]);
2783 writel(0, &msg[4]); 3015 writel(0, &msg[4]);
2784 writel(0, &msg[5]); 3016 writel(0, &msg[5]);
2785 writel(((u32)status_block_bus)&0xffffffff, &msg[6]); 3017 writel( dma_low(pHba->status_block_pa), &msg[6]);
2786 writel(0, &msg[7]); 3018 writel( dma_high(pHba->status_block_pa), &msg[7]);
2787 writel(sizeof(i2o_status_block), &msg[8]); // 88 bytes 3019 writel(sizeof(i2o_status_block), &msg[8]); // 88 bytes
2788 3020
2789 //post message 3021 //post message
@@ -2812,7 +3044,17 @@ static s32 adpt_i2o_status_get(adpt_hba* pHba)
2812 } 3044 }
2813 3045
2814 // Calculate the Scatter Gather list size 3046 // Calculate the Scatter Gather list size
2815 pHba->sg_tablesize = (pHba->status_block->inbound_frame_size * 4 -40)/ sizeof(struct sg_simple_element); 3047 if (dpt_dma64(pHba)) {
3048 pHba->sg_tablesize
3049 = ((pHba->status_block->inbound_frame_size * 4
3050 - 14 * sizeof(u32))
3051 / (sizeof(struct sg_simple_element) + sizeof(u32)));
3052 } else {
3053 pHba->sg_tablesize
3054 = ((pHba->status_block->inbound_frame_size * 4
3055 - 12 * sizeof(u32))
3056 / sizeof(struct sg_simple_element));
3057 }
2816 if (pHba->sg_tablesize > SG_LIST_ELEMENTS) { 3058 if (pHba->sg_tablesize > SG_LIST_ELEMENTS) {
2817 pHba->sg_tablesize = SG_LIST_ELEMENTS; 3059 pHba->sg_tablesize = SG_LIST_ELEMENTS;
2818 } 3060 }
@@ -2863,7 +3105,9 @@ static int adpt_i2o_lct_get(adpt_hba* pHba)
2863 } 3105 }
2864 do { 3106 do {
2865 if (pHba->lct == NULL) { 3107 if (pHba->lct == NULL) {
2866 pHba->lct = kmalloc(pHba->lct_size, GFP_KERNEL|ADDR32); 3108 pHba->lct = dma_alloc_coherent(&pHba->pDev->dev,
3109 pHba->lct_size, &pHba->lct_pa,
3110 GFP_KERNEL);
2867 if(pHba->lct == NULL) { 3111 if(pHba->lct == NULL) {
2868 printk(KERN_CRIT "%s: Lct Get failed. Out of memory.\n", 3112 printk(KERN_CRIT "%s: Lct Get failed. Out of memory.\n",
2869 pHba->name); 3113 pHba->name);
@@ -2879,7 +3123,7 @@ static int adpt_i2o_lct_get(adpt_hba* pHba)
2879 msg[4] = 0xFFFFFFFF; /* All devices */ 3123 msg[4] = 0xFFFFFFFF; /* All devices */
2880 msg[5] = 0x00000000; /* Report now */ 3124 msg[5] = 0x00000000; /* Report now */
2881 msg[6] = 0xD0000000|pHba->lct_size; 3125 msg[6] = 0xD0000000|pHba->lct_size;
2882 msg[7] = virt_to_bus(pHba->lct); 3126 msg[7] = (u32)pHba->lct_pa;
2883 3127
2884 if ((ret=adpt_i2o_post_wait(pHba, msg, sizeof(msg), 360))) { 3128 if ((ret=adpt_i2o_post_wait(pHba, msg, sizeof(msg), 360))) {
2885 printk(KERN_ERR "%s: LCT Get failed (status=%#10x.\n", 3129 printk(KERN_ERR "%s: LCT Get failed (status=%#10x.\n",
@@ -2890,7 +3134,8 @@ static int adpt_i2o_lct_get(adpt_hba* pHba)
2890 3134
2891 if ((pHba->lct->table_size << 2) > pHba->lct_size) { 3135 if ((pHba->lct->table_size << 2) > pHba->lct_size) {
2892 pHba->lct_size = pHba->lct->table_size << 2; 3136 pHba->lct_size = pHba->lct->table_size << 2;
2893 kfree(pHba->lct); 3137 dma_free_coherent(&pHba->pDev->dev, pHba->lct_size,
3138 pHba->lct, pHba->lct_pa);
2894 pHba->lct = NULL; 3139 pHba->lct = NULL;
2895 } 3140 }
2896 } while (pHba->lct == NULL); 3141 } while (pHba->lct == NULL);
@@ -2901,13 +3146,19 @@ static int adpt_i2o_lct_get(adpt_hba* pHba)
2901 // I2O_DPT_EXEC_IOP_BUFFERS_GROUP_NO; 3146 // I2O_DPT_EXEC_IOP_BUFFERS_GROUP_NO;
2902 if(adpt_i2o_query_scalar(pHba, 0 , 0x8000, -1, buf, sizeof(buf))>=0) { 3147 if(adpt_i2o_query_scalar(pHba, 0 , 0x8000, -1, buf, sizeof(buf))>=0) {
2903 pHba->FwDebugBufferSize = buf[1]; 3148 pHba->FwDebugBufferSize = buf[1];
2904 pHba->FwDebugBuffer_P = pHba->base_addr_virt + buf[0]; 3149 pHba->FwDebugBuffer_P = ioremap(pHba->base_addr_phys + buf[0],
2905 pHba->FwDebugFlags_P = pHba->FwDebugBuffer_P + FW_DEBUG_FLAGS_OFFSET; 3150 pHba->FwDebugBufferSize);
2906 pHba->FwDebugBLEDvalue_P = pHba->FwDebugBuffer_P + FW_DEBUG_BLED_OFFSET; 3151 if (pHba->FwDebugBuffer_P) {
2907 pHba->FwDebugBLEDflag_P = pHba->FwDebugBLEDvalue_P + 1; 3152 pHba->FwDebugFlags_P = pHba->FwDebugBuffer_P +
2908 pHba->FwDebugStrLength_P = pHba->FwDebugBuffer_P + FW_DEBUG_STR_LENGTH_OFFSET; 3153 FW_DEBUG_FLAGS_OFFSET;
2909 pHba->FwDebugBuffer_P += buf[2]; 3154 pHba->FwDebugBLEDvalue_P = pHba->FwDebugBuffer_P +
2910 pHba->FwDebugFlags = 0; 3155 FW_DEBUG_BLED_OFFSET;
3156 pHba->FwDebugBLEDflag_P = pHba->FwDebugBLEDvalue_P + 1;
3157 pHba->FwDebugStrLength_P = pHba->FwDebugBuffer_P +
3158 FW_DEBUG_STR_LENGTH_OFFSET;
3159 pHba->FwDebugBuffer_P += buf[2];
3160 pHba->FwDebugFlags = 0;
3161 }
2911 } 3162 }
2912 3163
2913 return 0; 3164 return 0;
@@ -2915,25 +3166,30 @@ static int adpt_i2o_lct_get(adpt_hba* pHba)
2915 3166
2916static int adpt_i2o_build_sys_table(void) 3167static int adpt_i2o_build_sys_table(void)
2917{ 3168{
2918 adpt_hba* pHba = NULL; 3169 adpt_hba* pHba = hba_chain;
2919 int count = 0; 3170 int count = 0;
2920 3171
3172 if (sys_tbl)
3173 dma_free_coherent(&pHba->pDev->dev, sys_tbl_len,
3174 sys_tbl, sys_tbl_pa);
3175
2921 sys_tbl_len = sizeof(struct i2o_sys_tbl) + // Header + IOPs 3176 sys_tbl_len = sizeof(struct i2o_sys_tbl) + // Header + IOPs
2922 (hba_count) * sizeof(struct i2o_sys_tbl_entry); 3177 (hba_count) * sizeof(struct i2o_sys_tbl_entry);
2923 3178
2924 kfree(sys_tbl); 3179 sys_tbl = dma_alloc_coherent(&pHba->pDev->dev,
2925 3180 sys_tbl_len, &sys_tbl_pa, GFP_KERNEL);
2926 sys_tbl = kzalloc(sys_tbl_len, GFP_KERNEL|ADDR32);
2927 if (!sys_tbl) { 3181 if (!sys_tbl) {
2928 printk(KERN_WARNING "SysTab Set failed. Out of memory.\n"); 3182 printk(KERN_WARNING "SysTab Set failed. Out of memory.\n");
2929 return -ENOMEM; 3183 return -ENOMEM;
2930 } 3184 }
3185 memset(sys_tbl, 0, sys_tbl_len);
2931 3186
2932 sys_tbl->num_entries = hba_count; 3187 sys_tbl->num_entries = hba_count;
2933 sys_tbl->version = I2OVERSION; 3188 sys_tbl->version = I2OVERSION;
2934 sys_tbl->change_ind = sys_tbl_ind++; 3189 sys_tbl->change_ind = sys_tbl_ind++;
2935 3190
2936 for(pHba = hba_chain; pHba; pHba = pHba->next) { 3191 for(pHba = hba_chain; pHba; pHba = pHba->next) {
3192 u64 addr;
2937 // Get updated Status Block so we have the latest information 3193 // Get updated Status Block so we have the latest information
2938 if (adpt_i2o_status_get(pHba)) { 3194 if (adpt_i2o_status_get(pHba)) {
2939 sys_tbl->num_entries--; 3195 sys_tbl->num_entries--;
@@ -2949,8 +3205,9 @@ static int adpt_i2o_build_sys_table(void)
2949 sys_tbl->iops[count].frame_size = pHba->status_block->inbound_frame_size; 3205 sys_tbl->iops[count].frame_size = pHba->status_block->inbound_frame_size;
2950 sys_tbl->iops[count].last_changed = sys_tbl_ind - 1; // ?? 3206 sys_tbl->iops[count].last_changed = sys_tbl_ind - 1; // ??
2951 sys_tbl->iops[count].iop_capabilities = pHba->status_block->iop_capabilities; 3207 sys_tbl->iops[count].iop_capabilities = pHba->status_block->iop_capabilities;
2952 sys_tbl->iops[count].inbound_low = (u32)virt_to_bus(pHba->post_port); 3208 addr = pHba->base_addr_phys + 0x40;
2953 sys_tbl->iops[count].inbound_high = (u32)((u64)virt_to_bus(pHba->post_port)>>32); 3209 sys_tbl->iops[count].inbound_low = dma_low(addr);
3210 sys_tbl->iops[count].inbound_high = dma_high(addr);
2954 3211
2955 count++; 3212 count++;
2956 } 3213 }
@@ -3086,7 +3343,8 @@ static s32 adpt_i2o_hrt_get(adpt_hba* pHba)
3086 3343
3087 do { 3344 do {
3088 if (pHba->hrt == NULL) { 3345 if (pHba->hrt == NULL) {
3089 pHba->hrt=kmalloc(size, GFP_KERNEL|ADDR32); 3346 pHba->hrt = dma_alloc_coherent(&pHba->pDev->dev,
3347 size, &pHba->hrt_pa, GFP_KERNEL);
3090 if (pHba->hrt == NULL) { 3348 if (pHba->hrt == NULL) {
3091 printk(KERN_CRIT "%s: Hrt Get failed; Out of memory.\n", pHba->name); 3349 printk(KERN_CRIT "%s: Hrt Get failed; Out of memory.\n", pHba->name);
3092 return -ENOMEM; 3350 return -ENOMEM;
@@ -3098,7 +3356,7 @@ static s32 adpt_i2o_hrt_get(adpt_hba* pHba)
3098 msg[2]= 0; 3356 msg[2]= 0;
3099 msg[3]= 0; 3357 msg[3]= 0;
3100 msg[4]= (0xD0000000 | size); /* Simple transaction */ 3358 msg[4]= (0xD0000000 | size); /* Simple transaction */
3101 msg[5]= virt_to_bus(pHba->hrt); /* Dump it here */ 3359 msg[5]= (u32)pHba->hrt_pa; /* Dump it here */
3102 3360
3103 if ((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg),20))) { 3361 if ((ret = adpt_i2o_post_wait(pHba, msg, sizeof(msg),20))) {
3104 printk(KERN_ERR "%s: Unable to get HRT (status=%#10x)\n", pHba->name, ret); 3362 printk(KERN_ERR "%s: Unable to get HRT (status=%#10x)\n", pHba->name, ret);
@@ -3106,8 +3364,10 @@ static s32 adpt_i2o_hrt_get(adpt_hba* pHba)
3106 } 3364 }
3107 3365
3108 if (pHba->hrt->num_entries * pHba->hrt->entry_len << 2 > size) { 3366 if (pHba->hrt->num_entries * pHba->hrt->entry_len << 2 > size) {
3109 size = pHba->hrt->num_entries * pHba->hrt->entry_len << 2; 3367 int newsize = pHba->hrt->num_entries * pHba->hrt->entry_len << 2;
3110 kfree(pHba->hrt); 3368 dma_free_coherent(&pHba->pDev->dev, size,
3369 pHba->hrt, pHba->hrt_pa);
3370 size = newsize;
3111 pHba->hrt = NULL; 3371 pHba->hrt = NULL;
3112 } 3372 }
3113 } while(pHba->hrt == NULL); 3373 } while(pHba->hrt == NULL);
@@ -3121,33 +3381,54 @@ static int adpt_i2o_query_scalar(adpt_hba* pHba, int tid,
3121 int group, int field, void *buf, int buflen) 3381 int group, int field, void *buf, int buflen)
3122{ 3382{
3123 u16 opblk[] = { 1, 0, I2O_PARAMS_FIELD_GET, group, 1, field }; 3383 u16 opblk[] = { 1, 0, I2O_PARAMS_FIELD_GET, group, 1, field };
3124 u8 *resblk; 3384 u8 *opblk_va;
3385 dma_addr_t opblk_pa;
3386 u8 *resblk_va;
3387 dma_addr_t resblk_pa;
3125 3388
3126 int size; 3389 int size;
3127 3390
3128 /* 8 bytes for header */ 3391 /* 8 bytes for header */
3129 resblk = kmalloc(sizeof(u8) * (8+buflen), GFP_KERNEL|ADDR32); 3392 resblk_va = dma_alloc_coherent(&pHba->pDev->dev,
3130 if (resblk == NULL) { 3393 sizeof(u8) * (8 + buflen), &resblk_pa, GFP_KERNEL);
3394 if (resblk_va == NULL) {
3131 printk(KERN_CRIT "%s: query scalar failed; Out of memory.\n", pHba->name); 3395 printk(KERN_CRIT "%s: query scalar failed; Out of memory.\n", pHba->name);
3132 return -ENOMEM; 3396 return -ENOMEM;
3133 } 3397 }
3134 3398
3399 opblk_va = dma_alloc_coherent(&pHba->pDev->dev,
3400 sizeof(opblk), &opblk_pa, GFP_KERNEL);
3401 if (opblk_va == NULL) {
3402 dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen),
3403 resblk_va, resblk_pa);
3404 printk(KERN_CRIT "%s: query operatio failed; Out of memory.\n",
3405 pHba->name);
3406 return -ENOMEM;
3407 }
3135 if (field == -1) /* whole group */ 3408 if (field == -1) /* whole group */
3136 opblk[4] = -1; 3409 opblk[4] = -1;
3137 3410
3411 memcpy(opblk_va, opblk, sizeof(opblk));
3138 size = adpt_i2o_issue_params(I2O_CMD_UTIL_PARAMS_GET, pHba, tid, 3412 size = adpt_i2o_issue_params(I2O_CMD_UTIL_PARAMS_GET, pHba, tid,
3139 opblk, sizeof(opblk), resblk, sizeof(u8)*(8+buflen)); 3413 opblk_va, opblk_pa, sizeof(opblk),
3414 resblk_va, resblk_pa, sizeof(u8)*(8+buflen));
3415 dma_free_coherent(&pHba->pDev->dev, sizeof(opblk), opblk_va, opblk_pa);
3140 if (size == -ETIME) { 3416 if (size == -ETIME) {
3417 dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen),
3418 resblk_va, resblk_pa);
3141 printk(KERN_WARNING "%s: issue params failed; Timed out.\n", pHba->name); 3419 printk(KERN_WARNING "%s: issue params failed; Timed out.\n", pHba->name);
3142 return -ETIME; 3420 return -ETIME;
3143 } else if (size == -EINTR) { 3421 } else if (size == -EINTR) {
3422 dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen),
3423 resblk_va, resblk_pa);
3144 printk(KERN_WARNING "%s: issue params failed; Interrupted.\n", pHba->name); 3424 printk(KERN_WARNING "%s: issue params failed; Interrupted.\n", pHba->name);
3145 return -EINTR; 3425 return -EINTR;
3146 } 3426 }
3147 3427
3148 memcpy(buf, resblk+8, buflen); /* cut off header */ 3428 memcpy(buf, resblk_va+8, buflen); /* cut off header */
3149 3429
3150 kfree(resblk); 3430 dma_free_coherent(&pHba->pDev->dev, sizeof(u8) * (8+buflen),
3431 resblk_va, resblk_pa);
3151 if (size < 0) 3432 if (size < 0)
3152 return size; 3433 return size;
3153 3434
@@ -3164,10 +3445,11 @@ static int adpt_i2o_query_scalar(adpt_hba* pHba, int tid,
3164 * ResultCount, ErrorInfoSize, BlockStatus and BlockSize. 3445 * ResultCount, ErrorInfoSize, BlockStatus and BlockSize.
3165 */ 3446 */
3166static int adpt_i2o_issue_params(int cmd, adpt_hba* pHba, int tid, 3447static int adpt_i2o_issue_params(int cmd, adpt_hba* pHba, int tid,
3167 void *opblk, int oplen, void *resblk, int reslen) 3448 void *opblk_va, dma_addr_t opblk_pa, int oplen,
3449 void *resblk_va, dma_addr_t resblk_pa, int reslen)
3168{ 3450{
3169 u32 msg[9]; 3451 u32 msg[9];
3170 u32 *res = (u32 *)resblk; 3452 u32 *res = (u32 *)resblk_va;
3171 int wait_status; 3453 int wait_status;
3172 3454
3173 msg[0] = NINE_WORD_MSG_SIZE | SGL_OFFSET_5; 3455 msg[0] = NINE_WORD_MSG_SIZE | SGL_OFFSET_5;
@@ -3176,12 +3458,12 @@ static int adpt_i2o_issue_params(int cmd, adpt_hba* pHba, int tid,
3176 msg[3] = 0; 3458 msg[3] = 0;
3177 msg[4] = 0; 3459 msg[4] = 0;
3178 msg[5] = 0x54000000 | oplen; /* OperationBlock */ 3460 msg[5] = 0x54000000 | oplen; /* OperationBlock */
3179 msg[6] = virt_to_bus(opblk); 3461 msg[6] = (u32)opblk_pa;
3180 msg[7] = 0xD0000000 | reslen; /* ResultBlock */ 3462 msg[7] = 0xD0000000 | reslen; /* ResultBlock */
3181 msg[8] = virt_to_bus(resblk); 3463 msg[8] = (u32)resblk_pa;
3182 3464
3183 if ((wait_status = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 20))) { 3465 if ((wait_status = adpt_i2o_post_wait(pHba, msg, sizeof(msg), 20))) {
3184 printk("adpt_i2o_issue_params: post_wait failed (%p)\n", resblk); 3466 printk("adpt_i2o_issue_params: post_wait failed (%p)\n", resblk_va);
3185 return wait_status; /* -DetailedStatus */ 3467 return wait_status; /* -DetailedStatus */
3186 } 3468 }
3187 3469
@@ -3284,7 +3566,7 @@ static int adpt_i2o_systab_send(adpt_hba* pHba)
3284 * Private i/o space declaration 3566 * Private i/o space declaration
3285 */ 3567 */
3286 msg[6] = 0x54000000 | sys_tbl_len; 3568 msg[6] = 0x54000000 | sys_tbl_len;
3287 msg[7] = virt_to_phys(sys_tbl); 3569 msg[7] = (u32)sys_tbl_pa;
3288 msg[8] = 0x54000000 | 0; 3570 msg[8] = 0x54000000 | 0;
3289 msg[9] = 0; 3571 msg[9] = 0;
3290 msg[10] = 0xD4000000 | 0; 3572 msg[10] = 0xD4000000 | 0;
@@ -3323,11 +3605,10 @@ static static void adpt_delay(int millisec)
3323#endif 3605#endif
3324 3606
3325static struct scsi_host_template driver_template = { 3607static struct scsi_host_template driver_template = {
3608 .module = THIS_MODULE,
3326 .name = "dpt_i2o", 3609 .name = "dpt_i2o",
3327 .proc_name = "dpt_i2o", 3610 .proc_name = "dpt_i2o",
3328 .proc_info = adpt_proc_info, 3611 .proc_info = adpt_proc_info,
3329 .detect = adpt_detect,
3330 .release = adpt_release,
3331 .info = adpt_info, 3612 .info = adpt_info,
3332 .queuecommand = adpt_queue, 3613 .queuecommand = adpt_queue,
3333 .eh_abort_handler = adpt_abort, 3614 .eh_abort_handler = adpt_abort,
@@ -3341,5 +3622,48 @@ static struct scsi_host_template driver_template = {
3341 .cmd_per_lun = 1, 3622 .cmd_per_lun = 1,
3342 .use_clustering = ENABLE_CLUSTERING, 3623 .use_clustering = ENABLE_CLUSTERING,
3343}; 3624};
3344#include "scsi_module.c" 3625
3626static int __init adpt_init(void)
3627{
3628 int error;
3629 adpt_hba *pHba, *next;
3630
3631 printk("Loading Adaptec I2O RAID: Version " DPT_I2O_VERSION "\n");
3632
3633 error = adpt_detect(&driver_template);
3634 if (error < 0)
3635 return error;
3636 if (hba_chain == NULL)
3637 return -ENODEV;
3638
3639 for (pHba = hba_chain; pHba; pHba = pHba->next) {
3640 error = scsi_add_host(pHba->host, &pHba->pDev->dev);
3641 if (error)
3642 goto fail;
3643 scsi_scan_host(pHba->host);
3644 }
3645 return 0;
3646fail:
3647 for (pHba = hba_chain; pHba; pHba = next) {
3648 next = pHba->next;
3649 scsi_remove_host(pHba->host);
3650 }
3651 return error;
3652}
3653
3654static void __exit adpt_exit(void)
3655{
3656 adpt_hba *pHba, *next;
3657
3658 for (pHba = hba_chain; pHba; pHba = pHba->next)
3659 scsi_remove_host(pHba->host);
3660 for (pHba = hba_chain; pHba; pHba = next) {
3661 next = pHba->next;
3662 adpt_release(pHba->host);
3663 }
3664}
3665
3666module_init(adpt_init);
3667module_exit(adpt_exit);
3668
3345MODULE_LICENSE("GPL"); 3669MODULE_LICENSE("GPL");
diff --git a/drivers/scsi/dpti.h b/drivers/scsi/dpti.h
index fd79068c5869..924cd5a51676 100644
--- a/drivers/scsi/dpti.h
+++ b/drivers/scsi/dpti.h
@@ -84,7 +84,6 @@ static int adpt_device_reset(struct scsi_cmnd* cmd);
84#define PCI_DPT_DEVICE_ID (0xA501) // DPT PCI I2O Device ID 84#define PCI_DPT_DEVICE_ID (0xA501) // DPT PCI I2O Device ID
85#define PCI_DPT_RAPTOR_DEVICE_ID (0xA511) 85#define PCI_DPT_RAPTOR_DEVICE_ID (0xA511)
86 86
87//#define REBOOT_NOTIFIER 1
88/* Debugging macro from Linux Device Drivers - Rubini */ 87/* Debugging macro from Linux Device Drivers - Rubini */
89#undef PDEBUG 88#undef PDEBUG
90#ifdef DEBUG 89#ifdef DEBUG
@@ -229,14 +228,19 @@ typedef struct _adpt_hba {
229 u32 post_fifo_size; 228 u32 post_fifo_size;
230 u32 reply_fifo_size; 229 u32 reply_fifo_size;
231 u32* reply_pool; 230 u32* reply_pool;
231 dma_addr_t reply_pool_pa;
232 u32 sg_tablesize; // Scatter/Gather List Size. 232 u32 sg_tablesize; // Scatter/Gather List Size.
233 u8 top_scsi_channel; 233 u8 top_scsi_channel;
234 u8 top_scsi_id; 234 u8 top_scsi_id;
235 u8 top_scsi_lun; 235 u8 top_scsi_lun;
236 u8 dma64;
236 237
237 i2o_status_block* status_block; 238 i2o_status_block* status_block;
239 dma_addr_t status_block_pa;
238 i2o_hrt* hrt; 240 i2o_hrt* hrt;
241 dma_addr_t hrt_pa;
239 i2o_lct* lct; 242 i2o_lct* lct;
243 dma_addr_t lct_pa;
240 uint lct_size; 244 uint lct_size;
241 struct i2o_device* devices; 245 struct i2o_device* devices;
242 struct adpt_channel channel[MAX_CHANNEL]; 246 struct adpt_channel channel[MAX_CHANNEL];
@@ -249,6 +253,7 @@ typedef struct _adpt_hba {
249 void __iomem *FwDebugBLEDflag_P;// Virtual Addr Of FW Debug BLED 253 void __iomem *FwDebugBLEDflag_P;// Virtual Addr Of FW Debug BLED
250 void __iomem *FwDebugBLEDvalue_P;// Virtual Addr Of FW Debug BLED 254 void __iomem *FwDebugBLEDvalue_P;// Virtual Addr Of FW Debug BLED
251 u32 FwDebugFlags; 255 u32 FwDebugFlags;
256 u32 *ioctl_reply_context[4];
252} adpt_hba; 257} adpt_hba;
253 258
254struct sg_simple_element { 259struct sg_simple_element {
@@ -264,9 +269,6 @@ static void adpt_i2o_sys_shutdown(void);
264static int adpt_init(void); 269static int adpt_init(void);
265static int adpt_i2o_build_sys_table(void); 270static int adpt_i2o_build_sys_table(void);
266static irqreturn_t adpt_isr(int irq, void *dev_id); 271static irqreturn_t adpt_isr(int irq, void *dev_id);
267#ifdef REBOOT_NOTIFIER
268static int adpt_reboot_event(struct notifier_block *n, ulong code, void *p);
269#endif
270 272
271static void adpt_i2o_report_hba_unit(adpt_hba* pHba, struct i2o_device *d); 273static void adpt_i2o_report_hba_unit(adpt_hba* pHba, struct i2o_device *d);
272static int adpt_i2o_query_scalar(adpt_hba* pHba, int tid, 274static int adpt_i2o_query_scalar(adpt_hba* pHba, int tid,
@@ -275,7 +277,8 @@ static int adpt_i2o_query_scalar(adpt_hba* pHba, int tid,
275static const char *adpt_i2o_get_class_name(int class); 277static const char *adpt_i2o_get_class_name(int class);
276#endif 278#endif
277static int adpt_i2o_issue_params(int cmd, adpt_hba* pHba, int tid, 279static int adpt_i2o_issue_params(int cmd, adpt_hba* pHba, int tid,
278 void *opblk, int oplen, void *resblk, int reslen); 280 void *opblk, dma_addr_t opblk_pa, int oplen,
281 void *resblk, dma_addr_t resblk_pa, int reslen);
279static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout); 282static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout);
280static int adpt_i2o_lct_get(adpt_hba* pHba); 283static int adpt_i2o_lct_get(adpt_hba* pHba);
281static int adpt_i2o_parse_lct(adpt_hba* pHba); 284static int adpt_i2o_parse_lct(adpt_hba* pHba);
@@ -289,7 +292,7 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba);
289static s32 adpt_i2o_hrt_get(adpt_hba* pHba); 292static s32 adpt_i2o_hrt_get(adpt_hba* pHba);
290static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_device* dptdevice); 293static s32 adpt_scsi_to_i2o(adpt_hba* pHba, struct scsi_cmnd* cmd, struct adpt_device* dptdevice);
291static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd); 294static s32 adpt_i2o_to_scsi(void __iomem *reply, struct scsi_cmnd* cmd);
292static s32 adpt_scsi_register(adpt_hba* pHba,struct scsi_host_template * sht); 295static s32 adpt_scsi_host_alloc(adpt_hba* pHba,struct scsi_host_template * sht);
293static s32 adpt_hba_reset(adpt_hba* pHba); 296static s32 adpt_hba_reset(adpt_hba* pHba);
294static s32 adpt_i2o_reset_hba(adpt_hba* pHba); 297static s32 adpt_i2o_reset_hba(adpt_hba* pHba);
295static s32 adpt_rescan(adpt_hba* pHba); 298static s32 adpt_rescan(adpt_hba* pHba);
diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index c6d6e7c6559a..8e2e964af668 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -465,7 +465,7 @@ int __gdth_execute(struct scsi_device *sdev, gdth_cmd_str *gdtcmd, char *cmnd,
465 scp->request = (struct request *)&wait; 465 scp->request = (struct request *)&wait;
466 scp->timeout_per_command = timeout*HZ; 466 scp->timeout_per_command = timeout*HZ;
467 scp->cmd_len = 12; 467 scp->cmd_len = 12;
468 memcpy(scp->cmnd, cmnd, 12); 468 scp->cmnd = cmnd;
469 cmndinfo.priority = IOCTL_PRI; 469 cmndinfo.priority = IOCTL_PRI;
470 cmndinfo.internal_cmd_str = gdtcmd; 470 cmndinfo.internal_cmd_str = gdtcmd;
471 cmndinfo.internal_command = 1; 471 cmndinfo.internal_command = 1;
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c
index 5b7be1e9841c..aaa48e0c8ed0 100644
--- a/drivers/scsi/hptiop.c
+++ b/drivers/scsi/hptiop.c
@@ -763,9 +763,9 @@ static int hptiop_queuecommand(struct scsi_cmnd *scp,
763 scp, 763 scp,
764 host->host_no, scp->device->channel, 764 host->host_no, scp->device->channel,
765 scp->device->id, scp->device->lun, 765 scp->device->id, scp->device->lun,
766 *((u32 *)&scp->cmnd), 766 ((u32 *)scp->cmnd)[0],
767 *((u32 *)&scp->cmnd + 1), 767 ((u32 *)scp->cmnd)[1],
768 *((u32 *)&scp->cmnd + 2), 768 ((u32 *)scp->cmnd)[2],
769 _req->index, _req->req_virt); 769 _req->index, _req->req_virt);
770 770
771 scp->result = 0; 771 scp->result = 0;
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 4a922c57125e..ccfd8aca3765 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -686,7 +686,7 @@ static void handle_cmd_rsp(struct srp_event_struct *evt_struct)
686 } 686 }
687 687
688 if (cmnd) { 688 if (cmnd) {
689 cmnd->result = rsp->status; 689 cmnd->result |= rsp->status;
690 if (((cmnd->result >> 1) & 0x1f) == CHECK_CONDITION) 690 if (((cmnd->result >> 1) & 0x1f) == CHECK_CONDITION)
691 memcpy(cmnd->sense_buffer, 691 memcpy(cmnd->sense_buffer,
692 rsp->data, 692 rsp->data,
@@ -730,6 +730,7 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,
730 u16 lun = lun_from_dev(cmnd->device); 730 u16 lun = lun_from_dev(cmnd->device);
731 u8 out_fmt, in_fmt; 731 u8 out_fmt, in_fmt;
732 732
733 cmnd->result = (DID_OK << 16);
733 evt_struct = get_event_struct(&hostdata->pool); 734 evt_struct = get_event_struct(&hostdata->pool);
734 if (!evt_struct) 735 if (!evt_struct)
735 return SCSI_MLQUEUE_HOST_BUSY; 736 return SCSI_MLQUEUE_HOST_BUSY;
@@ -738,7 +739,7 @@ static int ibmvscsi_queuecommand(struct scsi_cmnd *cmnd,
738 srp_cmd = &evt_struct->iu.srp.cmd; 739 srp_cmd = &evt_struct->iu.srp.cmd;
739 memset(srp_cmd, 0x00, SRP_MAX_IU_LEN); 740 memset(srp_cmd, 0x00, SRP_MAX_IU_LEN);
740 srp_cmd->opcode = SRP_CMD; 741 srp_cmd->opcode = SRP_CMD;
741 memcpy(srp_cmd->cdb, cmnd->cmnd, sizeof(cmnd->cmnd)); 742 memcpy(srp_cmd->cdb, cmnd->cmnd, sizeof(srp_cmd->cdb));
742 srp_cmd->lun = ((u64) lun) << 48; 743 srp_cmd->lun = ((u64) lun) << 48;
743 744
744 if (!map_data_for_srp_cmd(cmnd, evt_struct, srp_cmd, hostdata->dev)) { 745 if (!map_data_for_srp_cmd(cmnd, evt_struct, srp_cmd, hostdata->dev)) {
@@ -1347,6 +1348,8 @@ void ibmvscsi_handle_crq(struct viosrp_crq *crq,
1347 1348
1348 del_timer(&evt_struct->timer); 1349 del_timer(&evt_struct->timer);
1349 1350
1351 if (crq->status != VIOSRP_OK && evt_struct->cmnd)
1352 evt_struct->cmnd->result = DID_ERROR << 16;
1350 if (evt_struct->done) 1353 if (evt_struct->done)
1351 evt_struct->done(evt_struct); 1354 evt_struct->done(evt_struct);
1352 else 1355 else
diff --git a/drivers/scsi/ibmvscsi/viosrp.h b/drivers/scsi/ibmvscsi/viosrp.h
index 90f1a61283ad..4c4aadb3e405 100644
--- a/drivers/scsi/ibmvscsi/viosrp.h
+++ b/drivers/scsi/ibmvscsi/viosrp.h
@@ -59,6 +59,15 @@ enum viosrp_crq_formats {
59 VIOSRP_INLINE_FORMAT = 0x07 59 VIOSRP_INLINE_FORMAT = 0x07
60}; 60};
61 61
62enum viosrp_crq_status {
63 VIOSRP_OK = 0x0,
64 VIOSRP_NONRECOVERABLE_ERR = 0x1,
65 VIOSRP_VIOLATES_MAX_XFER = 0x2,
66 VIOSRP_PARTNER_PANIC = 0x3,
67 VIOSRP_DEVICE_BUSY = 0x8,
68 VIOSRP_ADAPTER_FAIL = 0x10
69};
70
62struct viosrp_crq { 71struct viosrp_crq {
63 u8 valid; /* used by RPA */ 72 u8 valid; /* used by RPA */
64 u8 format; /* SCSI vs out-of-band */ 73 u8 format; /* SCSI vs out-of-band */
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index dbae3fdb8506..e3f739776bad 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -2590,7 +2590,7 @@ static void initio_build_scb(struct initio_host * host, struct scsi_ctrl_blk * c
2590 cblk->hastat = 0; 2590 cblk->hastat = 0;
2591 cblk->tastat = 0; 2591 cblk->tastat = 0;
2592 /* Command the command */ 2592 /* Command the command */
2593 memcpy(&cblk->cdb[0], &cmnd->cmnd, cmnd->cmd_len); 2593 memcpy(cblk->cdb, cmnd->cmnd, cmnd->cmd_len);
2594 2594
2595 /* Set up tags */ 2595 /* Set up tags */
2596 if (cmnd->device->tagged_supported) { /* Tag Support */ 2596 if (cmnd->device->tagged_supported) { /* Tag Support */
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index de5ae6a65029..999e91ea7451 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -2791,7 +2791,7 @@ static ssize_t ipr_store_adapter_state(struct device *dev,
2791 2791
2792static struct device_attribute ipr_ioa_state_attr = { 2792static struct device_attribute ipr_ioa_state_attr = {
2793 .attr = { 2793 .attr = {
2794 .name = "state", 2794 .name = "online_state",
2795 .mode = S_IRUGO | S_IWUSR, 2795 .mode = S_IRUGO | S_IWUSR,
2796 }, 2796 },
2797 .show = ipr_show_adapter_state, 2797 .show = ipr_show_adapter_state,
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 820f91fb63ba..70a0f11f48b2 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -3168,6 +3168,23 @@ megaraid_mbox_support_random_del(adapter_t *adapter)
3168 uint8_t raw_mbox[sizeof(mbox_t)]; 3168 uint8_t raw_mbox[sizeof(mbox_t)];
3169 int rval; 3169 int rval;
3170 3170
3171 /*
3172 * Newer firmware on Dell CERC expect a different
3173 * random deletion handling, so disable it.
3174 */
3175 if (adapter->pdev->vendor == PCI_VENDOR_ID_AMI &&
3176 adapter->pdev->device == PCI_DEVICE_ID_AMI_MEGARAID3 &&
3177 adapter->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
3178 adapter->pdev->subsystem_device == PCI_SUBSYS_ID_CERC_ATA100_4CH &&
3179 (adapter->fw_version[0] > '6' ||
3180 (adapter->fw_version[0] == '6' &&
3181 adapter->fw_version[2] > '6') ||
3182 (adapter->fw_version[0] == '6'
3183 && adapter->fw_version[2] == '6'
3184 && adapter->fw_version[3] > '1'))) {
3185 con_log(CL_DLEVEL1, ("megaraid: disable random deletion\n"));
3186 return 0;
3187 }
3171 3188
3172 mbox = (mbox_t *)raw_mbox; 3189 mbox = (mbox_t *)raw_mbox;
3173 3190
diff --git a/drivers/scsi/megaraid/megaraid_mbox.h b/drivers/scsi/megaraid/megaraid_mbox.h
index 626459d1e902..c1d86d961a92 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.h
+++ b/drivers/scsi/megaraid/megaraid_mbox.h
@@ -88,6 +88,7 @@
88#define PCI_SUBSYS_ID_PERC3_QC 0x0471 88#define PCI_SUBSYS_ID_PERC3_QC 0x0471
89#define PCI_SUBSYS_ID_PERC3_DC 0x0493 89#define PCI_SUBSYS_ID_PERC3_DC 0x0493
90#define PCI_SUBSYS_ID_PERC3_SC 0x0475 90#define PCI_SUBSYS_ID_PERC3_SC 0x0475
91#define PCI_SUBSYS_ID_CERC_ATA100_4CH 0x0511
91 92
92 93
93#define MBOX_MAX_SCSI_CMDS 128 // number of cmds reserved for kernel 94#define MBOX_MAX_SCSI_CMDS 128 // number of cmds reserved for kernel
diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c
index b937e9cddb23..7d84c8bbcf3f 100644
--- a/drivers/scsi/megaraid/megaraid_sas.c
+++ b/drivers/scsi/megaraid/megaraid_sas.c
@@ -10,7 +10,7 @@
10 * 2 of the License, or (at your option) any later version. 10 * 2 of the License, or (at your option) any later version.
11 * 11 *
12 * FILE : megaraid_sas.c 12 * FILE : megaraid_sas.c
13 * Version : v00.00.03.16-rc1 13 * Version : v00.00.03.20-rc1
14 * 14 *
15 * Authors: 15 * Authors:
16 * (email-id : megaraidlinux@lsi.com) 16 * (email-id : megaraidlinux@lsi.com)
@@ -2650,12 +2650,13 @@ static void megasas_shutdown_controller(struct megasas_instance *instance,
2650 return; 2650 return;
2651} 2651}
2652 2652
2653#ifdef CONFIG_PM
2653/** 2654/**
2654 * megasas_suspend - driver suspend entry point 2655 * megasas_suspend - driver suspend entry point
2655 * @pdev: PCI device structure 2656 * @pdev: PCI device structure
2656 * @state: PCI power state to suspend routine 2657 * @state: PCI power state to suspend routine
2657 */ 2658 */
2658static int __devinit 2659static int
2659megasas_suspend(struct pci_dev *pdev, pm_message_t state) 2660megasas_suspend(struct pci_dev *pdev, pm_message_t state)
2660{ 2661{
2661 struct Scsi_Host *host; 2662 struct Scsi_Host *host;
@@ -2687,7 +2688,7 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t state)
2687 * megasas_resume- driver resume entry point 2688 * megasas_resume- driver resume entry point
2688 * @pdev: PCI device structure 2689 * @pdev: PCI device structure
2689 */ 2690 */
2690static int __devinit 2691static int
2691megasas_resume(struct pci_dev *pdev) 2692megasas_resume(struct pci_dev *pdev)
2692{ 2693{
2693 int rval; 2694 int rval;
@@ -2782,12 +2783,16 @@ fail_ready_state:
2782 2783
2783 return -ENODEV; 2784 return -ENODEV;
2784} 2785}
2786#else
2787#define megasas_suspend NULL
2788#define megasas_resume NULL
2789#endif
2785 2790
2786/** 2791/**
2787 * megasas_detach_one - PCI hot"un"plug entry point 2792 * megasas_detach_one - PCI hot"un"plug entry point
2788 * @pdev: PCI device structure 2793 * @pdev: PCI device structure
2789 */ 2794 */
2790static void megasas_detach_one(struct pci_dev *pdev) 2795static void __devexit megasas_detach_one(struct pci_dev *pdev)
2791{ 2796{
2792 int i; 2797 int i;
2793 struct Scsi_Host *host; 2798 struct Scsi_Host *host;
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 3a997eb457bf..b0c41e671702 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -18,9 +18,9 @@
18/* 18/*
19 * MegaRAID SAS Driver meta data 19 * MegaRAID SAS Driver meta data
20 */ 20 */
21#define MEGASAS_VERSION "00.00.03.16-rc1" 21#define MEGASAS_VERSION "00.00.03.20-rc1"
22#define MEGASAS_RELDATE "Nov. 07, 2007" 22#define MEGASAS_RELDATE "March 10, 2008"
23#define MEGASAS_EXT_VERSION "Thu. Nov. 07 10:09:32 PDT 2007" 23#define MEGASAS_EXT_VERSION "Mon. March 10 11:02:31 PDT 2008"
24 24
25/* 25/*
26 * Device IDs 26 * Device IDs
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 09ab3eac1c1a..fa060932d2b4 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -2858,7 +2858,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
2858 2858
2859 /* Load SCSI command packet. */ 2859 /* Load SCSI command packet. */
2860 pkt->cdb_len = cpu_to_le16(CMD_CDBLEN(cmd)); 2860 pkt->cdb_len = cpu_to_le16(CMD_CDBLEN(cmd));
2861 memcpy(pkt->scsi_cdb, &(CMD_CDBP(cmd)), CMD_CDBLEN(cmd)); 2861 memcpy(pkt->scsi_cdb, CMD_CDBP(cmd), CMD_CDBLEN(cmd));
2862 /* dprintk(1, "Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0]); */ 2862 /* dprintk(1, "Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0]); */
2863 2863
2864 /* Set transfer direction. */ 2864 /* Set transfer direction. */
@@ -3127,7 +3127,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
3127 3127
3128 /* Load SCSI command packet. */ 3128 /* Load SCSI command packet. */
3129 pkt->cdb_len = cpu_to_le16(CMD_CDBLEN(cmd)); 3129 pkt->cdb_len = cpu_to_le16(CMD_CDBLEN(cmd));
3130 memcpy(pkt->scsi_cdb, &(CMD_CDBP(cmd)), CMD_CDBLEN(cmd)); 3130 memcpy(pkt->scsi_cdb, CMD_CDBP(cmd), CMD_CDBLEN(cmd));
3131 3131
3132 /*dprintk(1, "Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0]); */ 3132 /*dprintk(1, "Build packet for command[0]=0x%x\n",pkt->scsi_cdb[0]); */
3133 /* Set transfer direction. */ 3133 /* Set transfer direction. */
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 12d69d7c8577..110e776d1a07 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -79,15 +79,6 @@ static void scsi_done(struct scsi_cmnd *cmd);
79#define MIN_RESET_PERIOD (15*HZ) 79#define MIN_RESET_PERIOD (15*HZ)
80 80
81/* 81/*
82 * Macro to determine the size of SCSI command. This macro takes vendor
83 * unique commands into account. SCSI commands in groups 6 and 7 are
84 * vendor unique and we will depend upon the command length being
85 * supplied correctly in cmd_len.
86 */
87#define CDB_SIZE(cmd) (((((cmd)->cmnd[0] >> 5) & 7) < 6) ? \
88 COMMAND_SIZE((cmd)->cmnd[0]) : (cmd)->cmd_len)
89
90/*
91 * Note - the initial logging level can be set here to log events at boot time. 82 * Note - the initial logging level can be set here to log events at boot time.
92 * After the system is up, you may enable logging via the /proc interface. 83 * After the system is up, you may enable logging via the /proc interface.
93 */ 84 */
@@ -469,6 +460,7 @@ int scsi_setup_command_freelist(struct Scsi_Host *shost)
469 cmd = scsi_pool_alloc_command(shost->cmd_pool, gfp_mask); 460 cmd = scsi_pool_alloc_command(shost->cmd_pool, gfp_mask);
470 if (!cmd) { 461 if (!cmd) {
471 scsi_put_host_cmd_pool(gfp_mask); 462 scsi_put_host_cmd_pool(gfp_mask);
463 shost->cmd_pool = NULL;
472 return -ENOMEM; 464 return -ENOMEM;
473 } 465 }
474 list_add(&cmd->list, &shost->free_list); 466 list_add(&cmd->list, &shost->free_list);
@@ -481,6 +473,13 @@ int scsi_setup_command_freelist(struct Scsi_Host *shost)
481 */ 473 */
482void scsi_destroy_command_freelist(struct Scsi_Host *shost) 474void scsi_destroy_command_freelist(struct Scsi_Host *shost)
483{ 475{
476 /*
477 * If cmd_pool is NULL the free list was not initialized, so
478 * do not attempt to release resources.
479 */
480 if (!shost->cmd_pool)
481 return;
482
484 while (!list_empty(&shost->free_list)) { 483 while (!list_empty(&shost->free_list)) {
485 struct scsi_cmnd *cmd; 484 struct scsi_cmnd *cmd;
486 485
@@ -701,9 +700,11 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
701 * Before we queue this command, check if the command 700 * Before we queue this command, check if the command
702 * length exceeds what the host adapter can handle. 701 * length exceeds what the host adapter can handle.
703 */ 702 */
704 if (CDB_SIZE(cmd) > cmd->device->host->max_cmd_len) { 703 if (cmd->cmd_len > cmd->device->host->max_cmd_len) {
705 SCSI_LOG_MLQUEUE(3, 704 SCSI_LOG_MLQUEUE(3,
706 printk("queuecommand : command too long.\n")); 705 printk("queuecommand : command too long. "
706 "cdb_size=%d host->max_cmd_len=%d\n",
707 cmd->cmd_len, cmd->device->host->max_cmd_len));
707 cmd->result = (DID_ABORT << 16); 708 cmd->result = (DID_ABORT << 16);
708 709
709 scsi_done(cmd); 710 scsi_done(cmd);
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 1eaba6cd80f4..eaf5a8add1ba 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -626,7 +626,7 @@ static void scsi_abort_eh_cmnd(struct scsi_cmnd *scmd)
626 * @scmd: SCSI command structure to hijack 626 * @scmd: SCSI command structure to hijack
627 * @ses: structure to save restore information 627 * @ses: structure to save restore information
628 * @cmnd: CDB to send. Can be NULL if no new cmnd is needed 628 * @cmnd: CDB to send. Can be NULL if no new cmnd is needed
629 * @cmnd_size: size in bytes of @cmnd 629 * @cmnd_size: size in bytes of @cmnd (must be <= BLK_MAX_CDB)
630 * @sense_bytes: size of sense data to copy. or 0 (if != 0 @cmnd is ignored) 630 * @sense_bytes: size of sense data to copy. or 0 (if != 0 @cmnd is ignored)
631 * 631 *
632 * This function is used to save a scsi command information before re-execution 632 * This function is used to save a scsi command information before re-execution
@@ -648,12 +648,14 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, struct scsi_eh_save *ses,
648 * command. 648 * command.
649 */ 649 */
650 ses->cmd_len = scmd->cmd_len; 650 ses->cmd_len = scmd->cmd_len;
651 memcpy(ses->cmnd, scmd->cmnd, sizeof(scmd->cmnd)); 651 ses->cmnd = scmd->cmnd;
652 ses->data_direction = scmd->sc_data_direction; 652 ses->data_direction = scmd->sc_data_direction;
653 ses->sdb = scmd->sdb; 653 ses->sdb = scmd->sdb;
654 ses->next_rq = scmd->request->next_rq; 654 ses->next_rq = scmd->request->next_rq;
655 ses->result = scmd->result; 655 ses->result = scmd->result;
656 656
657 scmd->cmnd = ses->eh_cmnd;
658 memset(scmd->cmnd, 0, BLK_MAX_CDB);
657 memset(&scmd->sdb, 0, sizeof(scmd->sdb)); 659 memset(&scmd->sdb, 0, sizeof(scmd->sdb));
658 scmd->request->next_rq = NULL; 660 scmd->request->next_rq = NULL;
659 661
@@ -665,14 +667,13 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, struct scsi_eh_save *ses,
665 scmd->sdb.table.sgl = &ses->sense_sgl; 667 scmd->sdb.table.sgl = &ses->sense_sgl;
666 scmd->sc_data_direction = DMA_FROM_DEVICE; 668 scmd->sc_data_direction = DMA_FROM_DEVICE;
667 scmd->sdb.table.nents = 1; 669 scmd->sdb.table.nents = 1;
668 memset(scmd->cmnd, 0, sizeof(scmd->cmnd));
669 scmd->cmnd[0] = REQUEST_SENSE; 670 scmd->cmnd[0] = REQUEST_SENSE;
670 scmd->cmnd[4] = scmd->sdb.length; 671 scmd->cmnd[4] = scmd->sdb.length;
671 scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]); 672 scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]);
672 } else { 673 } else {
673 scmd->sc_data_direction = DMA_NONE; 674 scmd->sc_data_direction = DMA_NONE;
674 if (cmnd) { 675 if (cmnd) {
675 memset(scmd->cmnd, 0, sizeof(scmd->cmnd)); 676 BUG_ON(cmnd_size > BLK_MAX_CDB);
676 memcpy(scmd->cmnd, cmnd, cmnd_size); 677 memcpy(scmd->cmnd, cmnd, cmnd_size);
677 scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]); 678 scmd->cmd_len = COMMAND_SIZE(scmd->cmnd[0]);
678 } 679 }
@@ -705,7 +706,7 @@ void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd, struct scsi_eh_save *ses)
705 * Restore original data 706 * Restore original data
706 */ 707 */
707 scmd->cmd_len = ses->cmd_len; 708 scmd->cmd_len = ses->cmd_len;
708 memcpy(scmd->cmnd, ses->cmnd, sizeof(scmd->cmnd)); 709 scmd->cmnd = ses->cmnd;
709 scmd->sc_data_direction = ses->data_direction; 710 scmd->sc_data_direction = ses->data_direction;
710 scmd->sdb = ses->sdb; 711 scmd->sdb = ses->sdb;
711 scmd->request->next_rq = ses->next_rq; 712 scmd->request->next_rq = ses->next_rq;
@@ -1775,8 +1776,8 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
1775 scmd->request = &req; 1776 scmd->request = &req;
1776 memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout)); 1777 memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout));
1777 1778
1778 memset(&scmd->cmnd, '\0', sizeof(scmd->cmnd)); 1779 scmd->cmnd = req.cmd;
1779 1780
1780 scmd->scsi_done = scsi_reset_provider_done_command; 1781 scmd->scsi_done = scsi_reset_provider_done_command;
1781 memset(&scmd->sdb, 0, sizeof(scmd->sdb)); 1782 memset(&scmd->sdb, 0, sizeof(scmd->sdb));
1782 1783
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index d545ad1cf47a..a82d2fe80fb5 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -445,7 +445,7 @@ static void scsi_init_cmd_errh(struct scsi_cmnd *cmd)
445 scsi_set_resid(cmd, 0); 445 scsi_set_resid(cmd, 0);
446 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); 446 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
447 if (cmd->cmd_len == 0) 447 if (cmd->cmd_len == 0)
448 cmd->cmd_len = COMMAND_SIZE(cmd->cmnd[0]); 448 cmd->cmd_len = scsi_command_size(cmd->cmnd);
449} 449}
450 450
451void scsi_device_unbusy(struct scsi_device *sdev) 451void scsi_device_unbusy(struct scsi_device *sdev)
@@ -1094,6 +1094,8 @@ static struct scsi_cmnd *scsi_get_cmd_from_req(struct scsi_device *sdev,
1094 cmd->tag = req->tag; 1094 cmd->tag = req->tag;
1095 cmd->request = req; 1095 cmd->request = req;
1096 1096
1097 cmd->cmnd = req->cmd;
1098
1097 return cmd; 1099 return cmd;
1098} 1100}
1099 1101
@@ -1131,8 +1133,6 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req)
1131 req->buffer = NULL; 1133 req->buffer = NULL;
1132 } 1134 }
1133 1135
1134 BUILD_BUG_ON(sizeof(req->cmd) > sizeof(cmd->cmnd));
1135 memcpy(cmd->cmnd, req->cmd, sizeof(cmd->cmnd));
1136 cmd->cmd_len = req->cmd_len; 1136 cmd->cmd_len = req->cmd_len;
1137 if (!req->data_len) 1137 if (!req->data_len)
1138 cmd->sc_data_direction = DMA_NONE; 1138 cmd->sc_data_direction = DMA_NONE;
@@ -1169,6 +1169,7 @@ int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req)
1169 if (unlikely(!cmd)) 1169 if (unlikely(!cmd))
1170 return BLKPREP_DEFER; 1170 return BLKPREP_DEFER;
1171 1171
1172 memset(cmd->cmnd, 0, BLK_MAX_CDB);
1172 return scsi_init_io(cmd, GFP_ATOMIC); 1173 return scsi_init_io(cmd, GFP_ATOMIC);
1173} 1174}
1174EXPORT_SYMBOL(scsi_setup_fs_cmnd); 1175EXPORT_SYMBOL(scsi_setup_fs_cmnd);
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index ee8496aa0336..257e097c39af 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -107,6 +107,8 @@ struct scsi_cmnd *scsi_host_get_command(struct Scsi_Host *shost,
107 cmd->jiffies_at_alloc = jiffies; 107 cmd->jiffies_at_alloc = jiffies;
108 cmd->request = rq; 108 cmd->request = rq;
109 109
110 cmd->cmnd = rq->cmd;
111
110 rq->special = cmd; 112 rq->special = cmd;
111 rq->cmd_type = REQ_TYPE_SPECIAL; 113 rq->cmd_type = REQ_TYPE_SPECIAL;
112 rq->cmd_flags |= REQ_TYPE_BLOCK_PC; 114 rq->cmd_flags |= REQ_TYPE_BLOCK_PC;
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
index 640333b1e75c..329eb8780e74 100644
--- a/drivers/scsi/u14-34f.c
+++ b/drivers/scsi/u14-34f.c
@@ -744,7 +744,8 @@ static int wait_on_busy(unsigned long iobase, unsigned int loop) {
744static int board_inquiry(unsigned int j) { 744static int board_inquiry(unsigned int j) {
745 struct mscp *cpp; 745 struct mscp *cpp;
746 dma_addr_t id_dma_addr; 746 dma_addr_t id_dma_addr;
747 unsigned int time, limit = 0; 747 unsigned int limit = 0;
748 unsigned long time;
748 749
749 id_dma_addr = pci_map_single(HD(j)->pdev, HD(j)->board_id, 750 id_dma_addr = pci_map_single(HD(j)->pdev, HD(j)->board_id,
750 sizeof(HD(j)->board_id), PCI_DMA_BIDIRECTIONAL); 751 sizeof(HD(j)->board_id), PCI_DMA_BIDIRECTIONAL);
@@ -1392,7 +1393,8 @@ static int u14_34f_eh_abort(struct scsi_cmnd *SCarg) {
1392} 1393}
1393 1394
1394static int u14_34f_eh_host_reset(struct scsi_cmnd *SCarg) { 1395static int u14_34f_eh_host_reset(struct scsi_cmnd *SCarg) {
1395 unsigned int i, j, time, k, c, limit = 0; 1396 unsigned int i, j, k, c, limit = 0;
1397 unsigned long time;
1396 int arg_done = FALSE; 1398 int arg_done = FALSE;
1397 struct scsi_cmnd *SCpnt; 1399 struct scsi_cmnd *SCpnt;
1398 1400
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 7a3625f52a03..efc971d9647b 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -783,7 +783,9 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
783 } 783 }
784 } 784 }
785 785
786 spin_unlock(&port->lock);
786 tty_flip_buffer_push(tty); 787 tty_flip_buffer_push(tty);
788 spin_lock(&port->lock);
787 789
788 return psc_ops->raw_rx_rdy(port); 790 return psc_ops->raw_rx_rdy(port);
789} 791}
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index be0fe152891b..145c0281495d 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -392,7 +392,7 @@ static struct uart_ops sunhv_pops = {
392 392
393static struct uart_driver sunhv_reg = { 393static struct uart_driver sunhv_reg = {
394 .owner = THIS_MODULE, 394 .owner = THIS_MODULE,
395 .driver_name = "serial", 395 .driver_name = "sunhv",
396 .dev_name = "ttyS", 396 .dev_name = "ttyS",
397 .major = TTY_MAJOR, 397 .major = TTY_MAJOR,
398}; 398};
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index 543f93741e6f..9ff5b38f3bee 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -826,7 +826,7 @@ static struct uart_ops sunsab_pops = {
826 826
827static struct uart_driver sunsab_reg = { 827static struct uart_driver sunsab_reg = {
828 .owner = THIS_MODULE, 828 .owner = THIS_MODULE,
829 .driver_name = "serial", 829 .driver_name = "sunsab",
830 .dev_name = "ttyS", 830 .dev_name = "ttyS",
831 .major = TTY_MAJOR, 831 .major = TTY_MAJOR,
832}; 832};
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 4e2302d43ab1..03806a935209 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1173,7 +1173,7 @@ out:
1173 1173
1174static struct uart_driver sunsu_reg = { 1174static struct uart_driver sunsu_reg = {
1175 .owner = THIS_MODULE, 1175 .owner = THIS_MODULE,
1176 .driver_name = "serial", 1176 .driver_name = "sunsu",
1177 .dev_name = "ttyS", 1177 .dev_name = "ttyS",
1178 .major = TTY_MAJOR, 1178 .major = TTY_MAJOR,
1179}; 1179};
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 90a20a152ebf..7e9fa5ef0eb7 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1023,7 +1023,7 @@ static struct uart_sunzilog_port *sunzilog_irq_chain;
1023 1023
1024static struct uart_driver sunzilog_reg = { 1024static struct uart_driver sunzilog_reg = {
1025 .owner = THIS_MODULE, 1025 .owner = THIS_MODULE,
1026 .driver_name = "ttyS", 1026 .driver_name = "sunzilog",
1027 .dev_name = "ttyS", 1027 .dev_name = "ttyS",
1028 .major = TTY_MAJOR, 1028 .major = TTY_MAJOR,
1029}; 1029};
diff --git a/drivers/usb/storage/cypress_atacb.c b/drivers/usb/storage/cypress_atacb.c
index d88824b3511c..898e67d30e56 100644
--- a/drivers/usb/storage/cypress_atacb.c
+++ b/drivers/usb/storage/cypress_atacb.c
@@ -46,7 +46,7 @@ void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us)
46 } 46 }
47 47
48 memcpy(save_cmnd, srb->cmnd, sizeof(save_cmnd)); 48 memcpy(save_cmnd, srb->cmnd, sizeof(save_cmnd));
49 memset(srb->cmnd, 0, sizeof(srb->cmnd)); 49 memset(srb->cmnd, 0, MAX_COMMAND_SIZE);
50 50
51 /* check if we support the command */ 51 /* check if we support the command */
52 if (save_cmnd[1] >> 5) /* MULTIPLE_COUNT */ 52 if (save_cmnd[1] >> 5) /* MULTIPLE_COUNT */
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
index 971d13dd5e65..3addcd8f827b 100644
--- a/drivers/usb/storage/isd200.c
+++ b/drivers/usb/storage/isd200.c
@@ -292,6 +292,7 @@ struct isd200_info {
292 292
293 /* maximum number of LUNs supported */ 293 /* maximum number of LUNs supported */
294 unsigned char MaxLUNs; 294 unsigned char MaxLUNs;
295 unsigned char cmnd[BLK_MAX_CDB];
295 struct scsi_cmnd srb; 296 struct scsi_cmnd srb;
296 struct scatterlist sg; 297 struct scatterlist sg;
297}; 298};
@@ -450,6 +451,7 @@ static int isd200_action( struct us_data *us, int action,
450 451
451 memset(&ata, 0, sizeof(ata)); 452 memset(&ata, 0, sizeof(ata));
452 memset(&srb_dev, 0, sizeof(srb_dev)); 453 memset(&srb_dev, 0, sizeof(srb_dev));
454 srb->cmnd = info->cmnd;
453 srb->device = &srb_dev; 455 srb->device = &srb_dev;
454 ++srb->serial_number; 456 ++srb->serial_number;
455 457
diff --git a/fs/ocfs2/cluster/sys.c b/fs/ocfs2/cluster/sys.c
index 98429fd68499..bc702dab5d1f 100644
--- a/fs/ocfs2/cluster/sys.c
+++ b/fs/ocfs2/cluster/sys.c
@@ -65,7 +65,7 @@ int o2cb_sys_init(void)
65{ 65{
66 int ret; 66 int ret;
67 67
68 o2cb_kset = kset_create_and_add("o2cb", NULL, NULL); 68 o2cb_kset = kset_create_and_add("o2cb", NULL, fs_kobj);
69 if (!o2cb_kset) 69 if (!o2cb_kset)
70 return -ENOMEM; 70 return -ENOMEM;
71 71
diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
index 5f6d858770a2..1b81dcba175d 100644
--- a/fs/ocfs2/dlm/dlmdebug.c
+++ b/fs/ocfs2/dlm/dlmdebug.c
@@ -44,7 +44,8 @@
44#define MLOG_MASK_PREFIX ML_DLM 44#define MLOG_MASK_PREFIX ML_DLM
45#include "cluster/masklog.h" 45#include "cluster/masklog.h"
46 46
47int stringify_lockname(const char *lockname, int locklen, char *buf, int len); 47static int stringify_lockname(const char *lockname, int locklen, char *buf,
48 int len);
48 49
49void dlm_print_one_lock_resource(struct dlm_lock_resource *res) 50void dlm_print_one_lock_resource(struct dlm_lock_resource *res)
50{ 51{
@@ -251,7 +252,8 @@ EXPORT_SYMBOL_GPL(dlm_errname);
251 * 252 *
252 * For more on lockname formats, please refer to dlmglue.c and ocfs2_lockid.h. 253 * For more on lockname formats, please refer to dlmglue.c and ocfs2_lockid.h.
253 */ 254 */
254int stringify_lockname(const char *lockname, int locklen, char *buf, int len) 255static int stringify_lockname(const char *lockname, int locklen, char *buf,
256 int len)
255{ 257{
256 int out = 0; 258 int out = 0;
257 __be64 inode_blkno_be; 259 __be64 inode_blkno_be;
@@ -368,7 +370,7 @@ static void dlm_debug_free(struct kref *kref)
368 kfree(dc); 370 kfree(dc);
369} 371}
370 372
371void dlm_debug_put(struct dlm_debug_ctxt *dc) 373static void dlm_debug_put(struct dlm_debug_ctxt *dc)
372{ 374{
373 if (dc) 375 if (dc)
374 kref_put(&dc->debug_refcnt, dlm_debug_free); 376 kref_put(&dc->debug_refcnt, dlm_debug_free);
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 9154c82d3258..57e0d30cde98 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1048,6 +1048,10 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
1048 mlog_entry("(0x%p, '%.*s')\n", dentry, 1048 mlog_entry("(0x%p, '%.*s')\n", dentry,
1049 dentry->d_name.len, dentry->d_name.name); 1049 dentry->d_name.len, dentry->d_name.name);
1050 1050
1051 /* ensuring we don't even attempt to truncate a symlink */
1052 if (S_ISLNK(inode->i_mode))
1053 attr->ia_valid &= ~ATTR_SIZE;
1054
1051 if (attr->ia_valid & ATTR_MODE) 1055 if (attr->ia_valid & ATTR_MODE)
1052 mlog(0, "mode change: %d\n", attr->ia_mode); 1056 mlog(0, "mode change: %d\n", attr->ia_mode);
1053 if (attr->ia_valid & ATTR_UID) 1057 if (attr->ia_valid & ATTR_UID)
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
index ce0dc147602a..be774bdc8b36 100644
--- a/fs/ocfs2/localalloc.c
+++ b/fs/ocfs2/localalloc.c
@@ -260,7 +260,7 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb)
260 bh = osb->local_alloc_bh; 260 bh = osb->local_alloc_bh;
261 alloc = (struct ocfs2_dinode *) bh->b_data; 261 alloc = (struct ocfs2_dinode *) bh->b_data;
262 262
263 alloc_copy = kmalloc(bh->b_size, GFP_KERNEL); 263 alloc_copy = kmalloc(bh->b_size, GFP_NOFS);
264 if (!alloc_copy) { 264 if (!alloc_copy) {
265 status = -ENOMEM; 265 status = -ENOMEM;
266 goto out_commit; 266 goto out_commit;
@@ -931,7 +931,7 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb,
931 * local alloc shutdown won't try to double free main bitmap 931 * local alloc shutdown won't try to double free main bitmap
932 * bits. Make a copy so the sync function knows which bits to 932 * bits. Make a copy so the sync function knows which bits to
933 * free. */ 933 * free. */
934 alloc_copy = kmalloc(osb->local_alloc_bh->b_size, GFP_KERNEL); 934 alloc_copy = kmalloc(osb->local_alloc_bh->b_size, GFP_NOFS);
935 if (!alloc_copy) { 935 if (!alloc_copy) {
936 status = -ENOMEM; 936 status = -ENOMEM;
937 mlog_errno(status); 937 mlog_errno(status);
diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c
index ac1d74c63bf5..bbd1667aa7d3 100644
--- a/fs/ocfs2/stack_o2cb.c
+++ b/fs/ocfs2/stack_o2cb.c
@@ -385,7 +385,7 @@ static int o2cb_cluster_this_node(unsigned int *node)
385 return 0; 385 return 0;
386} 386}
387 387
388struct ocfs2_stack_operations o2cb_stack_ops = { 388static struct ocfs2_stack_operations o2cb_stack_ops = {
389 .connect = o2cb_cluster_connect, 389 .connect = o2cb_cluster_connect,
390 .disconnect = o2cb_cluster_disconnect, 390 .disconnect = o2cb_cluster_disconnect,
391 .hangup = o2cb_cluster_hangup, 391 .hangup = o2cb_cluster_hangup,
diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
index 7428663f9cbb..b503772cd0ec 100644
--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -635,7 +635,7 @@ static const struct file_operations ocfs2_control_fops = {
635 .owner = THIS_MODULE, 635 .owner = THIS_MODULE,
636}; 636};
637 637
638struct miscdevice ocfs2_control_device = { 638static struct miscdevice ocfs2_control_device = {
639 .minor = MISC_DYNAMIC_MINOR, 639 .minor = MISC_DYNAMIC_MINOR,
640 .name = "ocfs2_control", 640 .name = "ocfs2_control",
641 .fops = &ocfs2_control_fops, 641 .fops = &ocfs2_control_fops,
diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c
index 7134007ba22f..ba9dbb51d25b 100644
--- a/fs/ocfs2/symlink.c
+++ b/fs/ocfs2/symlink.c
@@ -167,9 +167,11 @@ const struct inode_operations ocfs2_symlink_inode_operations = {
167 .readlink = page_readlink, 167 .readlink = page_readlink,
168 .follow_link = ocfs2_follow_link, 168 .follow_link = ocfs2_follow_link,
169 .getattr = ocfs2_getattr, 169 .getattr = ocfs2_getattr,
170 .setattr = ocfs2_setattr,
170}; 171};
171const struct inode_operations ocfs2_fast_symlink_inode_operations = { 172const struct inode_operations ocfs2_fast_symlink_inode_operations = {
172 .readlink = ocfs2_readlink, 173 .readlink = ocfs2_readlink,
173 .follow_link = ocfs2_follow_link, 174 .follow_link = ocfs2_follow_link,
174 .getattr = ocfs2_getattr, 175 .getattr = ocfs2_getattr,
176 .setattr = ocfs2_setattr,
175}; 177};
diff --git a/fs/pipe.c b/fs/pipe.c
index f73492b6817e..3499f9ff6316 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -1076,6 +1076,23 @@ int do_pipe(int *fd)
1076} 1076}
1077 1077
1078/* 1078/*
1079 * sys_pipe() is the normal C calling standard for creating
1080 * a pipe. It's not the way Unix traditionally does this, though.
1081 */
1082asmlinkage long __weak sys_pipe(int __user *fildes)
1083{
1084 int fd[2];
1085 int error;
1086
1087 error = do_pipe(fd);
1088 if (!error) {
1089 if (copy_to_user(fildes, fd, sizeof(fd)))
1090 error = -EFAULT;
1091 }
1092 return error;
1093}
1094
1095/*
1079 * pipefs should _never_ be mounted by userland - too much of security hassle, 1096 * pipefs should _never_ be mounted by userland - too much of security hassle,
1080 * no real gain from having the whole whorehouse mounted. So we don't need 1097 * no real gain from having the whole whorehouse mounted. So we don't need
1081 * any operations on the root directory. However, we need a non-trivial 1098 * any operations on the root directory. However, we need a non-trivial
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 9d53b39a9cf8..43e54e86cefd 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -641,6 +641,23 @@ struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode,
641 return ent; 641 return ent;
642} 642}
643 643
644struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
645 struct proc_dir_entry *parent)
646{
647 struct proc_dir_entry *ent;
648
649 ent = __proc_create(&parent, name, S_IFDIR | S_IRUGO | S_IXUGO, 2);
650 if (ent) {
651 ent->data = net;
652 if (proc_register(parent, ent) < 0) {
653 kfree(ent);
654 ent = NULL;
655 }
656 }
657 return ent;
658}
659EXPORT_SYMBOL_GPL(proc_net_mkdir);
660
644struct proc_dir_entry *proc_mkdir(const char *name, 661struct proc_dir_entry *proc_mkdir(const char *name,
645 struct proc_dir_entry *parent) 662 struct proc_dir_entry *parent)
646{ 663{
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
index 13cd7835d0df..83f357b30d71 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -159,17 +159,6 @@ struct net *get_proc_net(const struct inode *inode)
159} 159}
160EXPORT_SYMBOL_GPL(get_proc_net); 160EXPORT_SYMBOL_GPL(get_proc_net);
161 161
162struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
163 struct proc_dir_entry *parent)
164{
165 struct proc_dir_entry *pde;
166 pde = proc_mkdir_mode(name, S_IRUGO | S_IXUGO, parent);
167 if (pde != NULL)
168 pde->data = net;
169 return pde;
170}
171EXPORT_SYMBOL_GPL(proc_net_mkdir);
172
173static __net_init int proc_net_ns_init(struct net *net) 162static __net_init int proc_net_ns_init(struct net *net)
174{ 163{
175 struct proc_dir_entry *netd, *net_statd; 164 struct proc_dir_entry *netd, *net_statd;
diff --git a/include/asm-alpha/types.h b/include/asm-alpha/types.h
index f5716139ec89..a9e34ca4d463 100644
--- a/include/asm-alpha/types.h
+++ b/include/asm-alpha/types.h
@@ -8,28 +8,12 @@
8 * not a major issue. However, for interoperability, libraries still 8 * not a major issue. However, for interoperability, libraries still
9 * need to be careful to avoid a name clashes. 9 * need to be careful to avoid a name clashes.
10 */ 10 */
11#include <asm-generic/int-l64.h>
11 12
12#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
13 14
14typedef unsigned int umode_t; 15typedef unsigned int umode_t;
15 16
16/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30typedef __signed__ long __s64;
31typedef unsigned long __u64;
32
33#endif /* __ASSEMBLY__ */ 17#endif /* __ASSEMBLY__ */
34 18
35/* 19/*
@@ -39,23 +23,5 @@ typedef unsigned long __u64;
39 23
40#define BITS_PER_LONG 64 24#define BITS_PER_LONG 64
41 25
42#ifndef __ASSEMBLY__
43
44typedef signed char s8;
45typedef unsigned char u8;
46
47typedef signed short s16;
48typedef unsigned short u16;
49
50typedef signed int s32;
51typedef unsigned int u32;
52
53typedef signed long s64;
54typedef unsigned long u64;
55
56typedef u64 dma_addr_t;
57typedef u64 dma64_addr_t;
58
59#endif /* __ASSEMBLY__ */
60#endif /* __KERNEL__ */ 26#endif /* __KERNEL__ */
61#endif /* _ALPHA_TYPES_H */ 27#endif /* _ALPHA_TYPES_H */
diff --git a/include/asm-arm/types.h b/include/asm-arm/types.h
index 3141451a9bd6..345df01534a4 100644
--- a/include/asm-arm/types.h
+++ b/include/asm-arm/types.h
@@ -1,29 +1,12 @@
1#ifndef __ASM_ARM_TYPES_H 1#ifndef __ASM_ARM_TYPES_H
2#define __ASM_ARM_TYPES_H 2#define __ASM_ARM_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__)
23__extension__ typedef __signed__ long long __s64;
24__extension__ typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
28 11
29/* 12/*
@@ -35,18 +18,6 @@ __extension__ typedef unsigned long long __u64;
35 18
36#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
37 20
38typedef signed char s8;
39typedef unsigned char u8;
40
41typedef signed short s16;
42typedef unsigned short u16;
43
44typedef signed int s32;
45typedef unsigned int u32;
46
47typedef signed long long s64;
48typedef unsigned long long u64;
49
50/* Dma addresses are 32-bits wide. */ 21/* Dma addresses are 32-bits wide. */
51 22
52typedef u32 dma_addr_t; 23typedef u32 dma_addr_t;
diff --git a/include/asm-avr32/types.h b/include/asm-avr32/types.h
index 8999a3819403..9cefda6f534a 100644
--- a/include/asm-avr32/types.h
+++ b/include/asm-avr32/types.h
@@ -8,28 +8,12 @@
8#ifndef __ASM_AVR32_TYPES_H 8#ifndef __ASM_AVR32_TYPES_H
9#define __ASM_AVR32_TYPES_H 9#define __ASM_AVR32_TYPES_H
10 10
11#include <asm-generic/int-ll64.h>
12
11#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
12 14
13typedef unsigned short umode_t; 15typedef unsigned short umode_t;
14 16
15/*
16 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
17 * header files exported to user space
18 */
19typedef __signed__ char __s8;
20typedef unsigned char __u8;
21
22typedef __signed__ short __s16;
23typedef unsigned short __u16;
24
25typedef __signed__ int __s32;
26typedef unsigned int __u32;
27
28#if defined(__GNUC__)
29__extension__ typedef __signed__ long long __s64;
30__extension__ typedef unsigned long long __u64;
31#endif
32
33#endif /* __ASSEMBLY__ */ 17#endif /* __ASSEMBLY__ */
34 18
35/* 19/*
@@ -41,18 +25,6 @@ __extension__ typedef unsigned long long __u64;
41 25
42#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
43 27
44typedef signed char s8;
45typedef unsigned char u8;
46
47typedef signed short s16;
48typedef unsigned short u16;
49
50typedef signed int s32;
51typedef unsigned int u32;
52
53typedef signed long long s64;
54typedef unsigned long long u64;
55
56/* Dma addresses are 32-bits wide. */ 28/* Dma addresses are 32-bits wide. */
57 29
58typedef u32 dma_addr_t; 30typedef u32 dma_addr_t;
diff --git a/include/asm-blackfin/types.h b/include/asm-blackfin/types.h
index 9785a6d531c6..8441cbc2bf9e 100644
--- a/include/asm-blackfin/types.h
+++ b/include/asm-blackfin/types.h
@@ -8,30 +8,12 @@
8 * not a major issue. However, for interoperability, libraries still 8 * not a major issue. However, for interoperability, libraries still
9 * need to be careful to avoid a name clashes. 9 * need to be careful to avoid a name clashes.
10 */ 10 */
11#include <asm-generic/int-ll64.h>
12
11#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
12 14
13typedef unsigned short umode_t; 15typedef unsigned short umode_t;
14 16
15/*
16 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
17 * header files exported to user space
18 */
19
20typedef __signed__ char __s8;
21typedef unsigned char __u8;
22
23typedef __signed__ short __s16;
24typedef unsigned short __u16;
25
26typedef __signed__ int __s32;
27typedef unsigned int __u32;
28
29/* HK0617 -- Changes to unsigned long temporarily */
30#if defined(__GNUC__)
31__extension__ typedef __signed__ long long __s64;
32__extension__ typedef unsigned long long __u64;
33#endif
34
35#endif /* __ASSEMBLY__ */ 17#endif /* __ASSEMBLY__ */
36/* 18/*
37 * These aren't exported outside the kernel to avoid name space clashes 19 * These aren't exported outside the kernel to avoid name space clashes
@@ -42,18 +24,6 @@ __extension__ typedef unsigned long long __u64;
42 24
43#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
44 26
45typedef signed char s8;
46typedef unsigned char u8;
47
48typedef signed short s16;
49typedef unsigned short u16;
50
51typedef signed int s32;
52typedef unsigned int u32;
53
54typedef signed long long s64;
55typedef unsigned long long u64;
56
57/* Dma addresses are 32-bits wide. */ 27/* Dma addresses are 32-bits wide. */
58 28
59typedef u32 dma_addr_t; 29typedef u32 dma_addr_t;
diff --git a/include/asm-cris/types.h b/include/asm-cris/types.h
index 5a21c42bc6c5..5790262cbe8a 100644
--- a/include/asm-cris/types.h
+++ b/include/asm-cris/types.h
@@ -1,29 +1,12 @@
1#ifndef _ETRAX_TYPES_H 1#ifndef _ETRAX_TYPES_H
2#define _ETRAX_TYPES_H 2#define _ETRAX_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__)
23__extension__ typedef __signed__ long long __s64;
24__extension__ typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
28 11
29/* 12/*
@@ -35,18 +18,6 @@ __extension__ typedef unsigned long long __u64;
35 18
36#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
37 20
38typedef signed char s8;
39typedef unsigned char u8;
40
41typedef signed short s16;
42typedef unsigned short u16;
43
44typedef signed int s32;
45typedef unsigned int u32;
46
47typedef signed long long s64;
48typedef unsigned long long u64;
49
50/* Dma addresses are 32-bits wide, just like our other addresses. */ 21/* Dma addresses are 32-bits wide, just like our other addresses. */
51 22
52typedef u32 dma_addr_t; 23typedef u32 dma_addr_t;
diff --git a/include/asm-frv/types.h b/include/asm-frv/types.h
index 767e5ed71c4b..613bf1e962f0 100644
--- a/include/asm-frv/types.h
+++ b/include/asm-frv/types.h
@@ -12,29 +12,12 @@
12#ifndef _ASM_TYPES_H 12#ifndef _ASM_TYPES_H
13#define _ASM_TYPES_H 13#define _ASM_TYPES_H
14 14
15#include <asm-generic/int-ll64.h>
16
15#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
16 18
17typedef unsigned short umode_t; 19typedef unsigned short umode_t;
18 20
19/*
20 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
21 * header files exported to user space
22 */
23
24typedef __signed__ char __s8;
25typedef unsigned char __u8;
26
27typedef __signed__ short __s16;
28typedef unsigned short __u16;
29
30typedef __signed__ int __s32;
31typedef unsigned int __u32;
32
33#if defined(__GNUC__)
34__extension__ typedef __signed__ long long __s64;
35__extension__ typedef unsigned long long __u64;
36#endif
37
38#endif /* __ASSEMBLY__ */ 21#endif /* __ASSEMBLY__ */
39 22
40/* 23/*
@@ -46,19 +29,6 @@ __extension__ typedef unsigned long long __u64;
46 29
47#ifndef __ASSEMBLY__ 30#ifndef __ASSEMBLY__
48 31
49
50typedef signed char s8;
51typedef unsigned char u8;
52
53typedef signed short s16;
54typedef unsigned short u16;
55
56typedef signed int s32;
57typedef unsigned int u32;
58
59typedef signed long long s64;
60typedef unsigned long long u64;
61
62/* Dma addresses are 32-bits wide. */ 32/* Dma addresses are 32-bits wide. */
63 33
64typedef u32 dma_addr_t; 34typedef u32 dma_addr_t;
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
index c18110ee30f1..4c9932a2503f 100644
--- a/include/asm-generic/Kbuild
+++ b/include/asm-generic/Kbuild
@@ -7,5 +7,7 @@ header-y += poll.h
7header-y += signal.h 7header-y += signal.h
8header-y += statfs.h 8header-y += statfs.h
9 9
10unifdef-y += int-l64.h
11unifdef-y += int-ll64.h
10unifdef-y += resource.h 12unifdef-y += resource.h
11unifdef-y += siginfo.h 13unifdef-y += siginfo.h
diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h
new file mode 100644
index 000000000000..2af9b75d77db
--- /dev/null
+++ b/include/asm-generic/int-l64.h
@@ -0,0 +1,71 @@
1/*
2 * asm-generic/int-l64.h
3 *
4 * Integer declarations for architectures which use "long"
5 * for 64-bit types.
6 */
7
8#ifndef _ASM_GENERIC_INT_L64_H
9#define _ASM_GENERIC_INT_L64_H
10
11#ifndef __ASSEMBLY__
12/*
13 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
14 * header files exported to user space
15 */
16
17typedef __signed__ char __s8;
18typedef unsigned char __u8;
19
20typedef __signed__ short __s16;
21typedef unsigned short __u16;
22
23typedef __signed__ int __s32;
24typedef unsigned int __u32;
25
26typedef __signed__ long __s64;
27typedef unsigned long __u64;
28
29#endif /* __ASSEMBLY__ */
30
31#ifdef __KERNEL__
32
33#ifndef __ASSEMBLY__
34
35typedef signed char s8;
36typedef unsigned char u8;
37
38typedef signed short s16;
39typedef unsigned short u16;
40
41typedef signed int s32;
42typedef unsigned int u32;
43
44typedef signed long s64;
45typedef unsigned long u64;
46
47#define S8_C(x) x
48#define U8_C(x) x ## U
49#define S16_C(x) x
50#define U16_C(x) x ## U
51#define S32_C(x) x
52#define U32_C(x) x ## U
53#define S64_C(x) x ## L
54#define U64_C(x) x ## UL
55
56#else /* __ASSEMBLY__ */
57
58#define S8_C(x) x
59#define U8_C(x) x
60#define S16_C(x) x
61#define U16_C(x) x
62#define S32_C(x) x
63#define U32_C(x) x
64#define S64_C(x) x
65#define U64_C(x) x
66
67#endif /* __ASSEMBLY__ */
68
69#endif /* __KERNEL__ */
70
71#endif /* _ASM_GENERIC_INT_L64_H */
diff --git a/include/asm-generic/int-ll64.h b/include/asm-generic/int-ll64.h
new file mode 100644
index 000000000000..260948905e4e
--- /dev/null
+++ b/include/asm-generic/int-ll64.h
@@ -0,0 +1,76 @@
1/*
2 * asm-generic/int-ll64.h
3 *
4 * Integer declarations for architectures which use "long long"
5 * for 64-bit types.
6 */
7
8#ifndef _ASM_GENERIC_INT_LL64_H
9#define _ASM_GENERIC_INT_LL64_H
10
11#ifndef __ASSEMBLY__
12/*
13 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
14 * header files exported to user space
15 */
16
17typedef __signed__ char __s8;
18typedef unsigned char __u8;
19
20typedef __signed__ short __s16;
21typedef unsigned short __u16;
22
23typedef __signed__ int __s32;
24typedef unsigned int __u32;
25
26#ifdef __GNUC__
27__extension__ typedef __signed__ long long __s64;
28__extension__ typedef unsigned long long __u64;
29#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
30typedef __signed__ long long __s64;
31typedef unsigned long long __u64;
32#endif
33
34#endif /* __ASSEMBLY__ */
35
36#ifdef __KERNEL__
37
38#ifndef __ASSEMBLY__
39
40typedef signed char s8;
41typedef unsigned char u8;
42
43typedef signed short s16;
44typedef unsigned short u16;
45
46typedef signed int s32;
47typedef unsigned int u32;
48
49typedef signed long long s64;
50typedef unsigned long long u64;
51
52#define S8_C(x) x
53#define U8_C(x) x ## U
54#define S16_C(x) x
55#define U16_C(x) x ## U
56#define S32_C(x) x
57#define U32_C(x) x ## U
58#define S64_C(x) x ## LL
59#define U64_C(x) x ## ULL
60
61#else /* __ASSEMBLY__ */
62
63#define S8_C(x) x
64#define U8_C(x) x
65#define S16_C(x) x
66#define U16_C(x) x
67#define S32_C(x) x
68#define U32_C(x) x
69#define S64_C(x) x
70#define U64_C(x) x
71
72#endif /* __ASSEMBLY__ */
73
74#endif /* __KERNEL__ */
75
76#endif /* _ASM_GENERIC_INT_LL64_H */
diff --git a/include/asm-h8300/types.h b/include/asm-h8300/types.h
index 56566e2a09fd..12875190b156 100644
--- a/include/asm-h8300/types.h
+++ b/include/asm-h8300/types.h
@@ -1,6 +1,8 @@
1#ifndef _H8300_TYPES_H 1#ifndef _H8300_TYPES_H
2#define _H8300_TYPES_H 2#define _H8300_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#if !defined(__ASSEMBLY__) 6#if !defined(__ASSEMBLY__)
5 7
6/* 8/*
@@ -14,41 +16,10 @@
14typedef unsigned short umode_t; 16typedef unsigned short umode_t;
15 17
16/* 18/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30#if defined(__GNUC__)
31__extension__ typedef __signed__ long long __s64;
32__extension__ typedef unsigned long long __u64;
33#endif
34
35/*
36 * These aren't exported outside the kernel to avoid name space clashes 19 * These aren't exported outside the kernel to avoid name space clashes
37 */ 20 */
38#ifdef __KERNEL__ 21#ifdef __KERNEL__
39 22
40typedef signed char s8;
41typedef unsigned char u8;
42
43typedef signed short s16;
44typedef unsigned short u16;
45
46typedef signed int s32;
47typedef unsigned int u32;
48
49typedef signed long long s64;
50typedef unsigned long long u64;
51
52#define BITS_PER_LONG 32 23#define BITS_PER_LONG 32
53 24
54/* Dma addresses are 32-bits wide. */ 25/* Dma addresses are 32-bits wide. */
diff --git a/include/asm-ia64/types.h b/include/asm-ia64/types.h
index 902850d12424..e36b3716e718 100644
--- a/include/asm-ia64/types.h
+++ b/include/asm-ia64/types.h
@@ -13,6 +13,8 @@
13 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co 13 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
14 */ 14 */
15 15
16#include <asm-generic/int-l64.h>
17
16#ifdef __ASSEMBLY__ 18#ifdef __ASSEMBLY__
17# define __IA64_UL(x) (x) 19# define __IA64_UL(x) (x)
18# define __IA64_UL_CONST(x) x 20# define __IA64_UL_CONST(x) x
@@ -28,39 +30,10 @@
28typedef unsigned int umode_t; 30typedef unsigned int umode_t;
29 31
30/* 32/*
31 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
32 * header files exported to user space
33 */
34
35typedef __signed__ char __s8;
36typedef unsigned char __u8;
37
38typedef __signed__ short __s16;
39typedef unsigned short __u16;
40
41typedef __signed__ int __s32;
42typedef unsigned int __u32;
43
44typedef __signed__ long __s64;
45typedef unsigned long __u64;
46
47/*
48 * These aren't exported outside the kernel to avoid name space clashes 33 * These aren't exported outside the kernel to avoid name space clashes
49 */ 34 */
50# ifdef __KERNEL__ 35# ifdef __KERNEL__
51 36
52typedef __s8 s8;
53typedef __u8 u8;
54
55typedef __s16 s16;
56typedef __u16 u16;
57
58typedef __s32 s32;
59typedef __u32 u32;
60
61typedef __s64 s64;
62typedef __u64 u64;
63
64#define BITS_PER_LONG 64 37#define BITS_PER_LONG 64
65 38
66/* DMA addresses are 64-bits wide, in general. */ 39/* DMA addresses are 64-bits wide, in general. */
diff --git a/include/asm-m32r/types.h b/include/asm-m32r/types.h
index b64c16639a7b..bc9f7fff0ac3 100644
--- a/include/asm-m32r/types.h
+++ b/include/asm-m32r/types.h
@@ -1,28 +1,12 @@
1#ifndef _ASM_M32R_TYPES_H 1#ifndef _ASM_M32R_TYPES_H
2#define _ASM_M32R_TYPES_H 2#define _ASM_M32R_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__)
23__extension__ typedef __signed__ long long __s64;
24__extension__ typedef unsigned long long __u64;
25#endif
26#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
27 11
28/* 12/*
@@ -34,18 +18,6 @@ __extension__ typedef unsigned long long __u64;
34 18
35#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
36 20
37typedef signed char s8;
38typedef unsigned char u8;
39
40typedef signed short s16;
41typedef unsigned short u16;
42
43typedef signed int s32;
44typedef unsigned int u32;
45
46typedef signed long long s64;
47typedef unsigned long long u64;
48
49/* DMA addresses are 32-bits wide. */ 21/* DMA addresses are 32-bits wide. */
50 22
51typedef u32 dma_addr_t; 23typedef u32 dma_addr_t;
diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h
index c35c09d93b66..6441cb5f8e7c 100644
--- a/include/asm-m68k/types.h
+++ b/include/asm-m68k/types.h
@@ -8,30 +8,12 @@
8 * not a major issue. However, for interoperability, libraries still 8 * not a major issue. However, for interoperability, libraries still
9 * need to be careful to avoid a name clashes. 9 * need to be careful to avoid a name clashes.
10 */ 10 */
11#include <asm-generic/int-ll64.h>
11 12
12#ifndef __ASSEMBLY__ 13#ifndef __ASSEMBLY__
13 14
14typedef unsigned short umode_t; 15typedef unsigned short umode_t;
15 16
16/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30#if defined(__GNUC__)
31__extension__ typedef __signed__ long long __s64;
32__extension__ typedef unsigned long long __u64;
33#endif
34
35#endif /* __ASSEMBLY__ */ 17#endif /* __ASSEMBLY__ */
36 18
37/* 19/*
@@ -43,18 +25,6 @@ __extension__ typedef unsigned long long __u64;
43 25
44#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
45 27
46typedef signed char s8;
47typedef unsigned char u8;
48
49typedef signed short s16;
50typedef unsigned short u16;
51
52typedef signed int s32;
53typedef unsigned int u32;
54
55typedef signed long long s64;
56typedef unsigned long long u64;
57
58/* DMA addresses are always 32-bits wide */ 28/* DMA addresses are always 32-bits wide */
59 29
60typedef u32 dma_addr_t; 30typedef u32 dma_addr_t;
diff --git a/include/asm-mips/types.h b/include/asm-mips/types.h
index 2dd147f519d1..7a2ee4f40131 100644
--- a/include/asm-mips/types.h
+++ b/include/asm-mips/types.h
@@ -9,36 +9,16 @@
9#ifndef _ASM_TYPES_H 9#ifndef _ASM_TYPES_H
10#define _ASM_TYPES_H 10#define _ASM_TYPES_H
11 11
12#if _MIPS_SZLONG == 64
13# include <asm-generic/int-l64.h>
14#else
15# include <asm-generic/int-ll64.h>
16#endif
17
12#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
13 19
14typedef unsigned short umode_t; 20typedef unsigned short umode_t;
15 21
16/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30#if (_MIPS_SZLONG == 64)
31
32typedef __signed__ long __s64;
33typedef unsigned long __u64;
34
35#else
36
37#if defined(__GNUC__)
38__extension__ typedef __signed__ long long __s64;
39__extension__ typedef unsigned long long __u64;
40#endif
41
42#endif 22#endif
43 23
44#endif /* __ASSEMBLY__ */ 24#endif /* __ASSEMBLY__ */
@@ -52,30 +32,6 @@ __extension__ typedef unsigned long long __u64;
52 32
53#ifndef __ASSEMBLY__ 33#ifndef __ASSEMBLY__
54 34
55
56typedef __signed char s8;
57typedef unsigned char u8;
58
59typedef __signed short s16;
60typedef unsigned short u16;
61
62typedef __signed int s32;
63typedef unsigned int u32;
64
65#if (_MIPS_SZLONG == 64)
66
67typedef __signed__ long s64;
68typedef unsigned long u64;
69
70#else
71
72#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
73typedef __signed__ long long s64;
74typedef unsigned long long u64;
75#endif
76
77#endif
78
79#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \ 35#if (defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) \
80 || defined(CONFIG_64BIT) 36 || defined(CONFIG_64BIT)
81typedef u64 dma_addr_t; 37typedef u64 dma_addr_t;
diff --git a/include/asm-mn10300/types.h b/include/asm-mn10300/types.h
index d40ea7628bfc..7b9f01042fd4 100644
--- a/include/asm-mn10300/types.h
+++ b/include/asm-mn10300/types.h
@@ -11,29 +11,12 @@
11#ifndef _ASM_TYPES_H 11#ifndef _ASM_TYPES_H
12#define _ASM_TYPES_H 12#define _ASM_TYPES_H
13 13
14#include <asm-generic/int-ll64.h>
15
14#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
15 17
16typedef unsigned short umode_t; 18typedef unsigned short umode_t;
17 19
18/*
19 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
20 * header files exported to user space
21 */
22
23typedef __signed__ char __s8;
24typedef unsigned char __u8;
25
26typedef __signed__ short __s16;
27typedef unsigned short __u16;
28
29typedef __signed__ int __s32;
30typedef unsigned int __u32;
31
32#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
33typedef __signed__ long long __s64;
34typedef unsigned long long __u64;
35#endif
36
37#endif /* __ASSEMBLY__ */ 20#endif /* __ASSEMBLY__ */
38 21
39/* 22/*
@@ -45,18 +28,6 @@ typedef unsigned long long __u64;
45 28
46#ifndef __ASSEMBLY__ 29#ifndef __ASSEMBLY__
47 30
48typedef signed char s8;
49typedef unsigned char u8;
50
51typedef signed short s16;
52typedef unsigned short u16;
53
54typedef signed int s32;
55typedef unsigned int u32;
56
57typedef signed long long s64;
58typedef unsigned long long u64;
59
60/* Dma addresses are 32-bits wide. */ 31/* Dma addresses are 32-bits wide. */
61typedef u32 dma_addr_t; 32typedef u32 dma_addr_t;
62 33
diff --git a/include/asm-parisc/types.h b/include/asm-parisc/types.h
index 56c84802da59..7f5a39bfb4ce 100644
--- a/include/asm-parisc/types.h
+++ b/include/asm-parisc/types.h
@@ -1,29 +1,12 @@
1#ifndef _PARISC_TYPES_H 1#ifndef _PARISC_TYPES_H
2#define _PARISC_TYPES_H 2#define _PARISC_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__)
23__extension__ typedef __signed__ long long __s64;
24__extension__ typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
28 11
29/* 12/*
@@ -41,18 +24,6 @@ __extension__ typedef unsigned long long __u64;
41 24
42#ifndef __ASSEMBLY__ 25#ifndef __ASSEMBLY__
43 26
44typedef signed char s8;
45typedef unsigned char u8;
46
47typedef signed short s16;
48typedef unsigned short u16;
49
50typedef signed int s32;
51typedef unsigned int u32;
52
53typedef signed long long s64;
54typedef unsigned long long u64;
55
56/* Dma addresses are 32-bits wide. */ 27/* Dma addresses are 32-bits wide. */
57 28
58typedef u32 dma_addr_t; 29typedef u32 dma_addr_t;
diff --git a/include/asm-powerpc/ps3.h b/include/asm-powerpc/ps3.h
index 9e8ed6824e15..81ffe3b3c1ce 100644
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -178,9 +178,6 @@ enum ps3_cpu_binding {
178 PS3_BINDING_CPU_1 = 1, 178 PS3_BINDING_CPU_1 = 1,
179}; 179};
180 180
181int ps3_virq_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
182 unsigned int *virq);
183int ps3_virq_destroy(unsigned int virq);
184int ps3_irq_plug_setup(enum ps3_cpu_binding cpu, unsigned long outlet, 181int ps3_irq_plug_setup(enum ps3_cpu_binding cpu, unsigned long outlet,
185 unsigned int *virq); 182 unsigned int *virq);
186int ps3_irq_plug_destroy(unsigned int virq); 183int ps3_irq_plug_destroy(unsigned int virq);
diff --git a/include/asm-powerpc/syscalls.h b/include/asm-powerpc/syscalls.h
index b3ca41fc8bb1..2b8a458f990a 100644
--- a/include/asm-powerpc/syscalls.h
+++ b/include/asm-powerpc/syscalls.h
@@ -30,7 +30,7 @@ asmlinkage int sys_fork(unsigned long p1, unsigned long p2,
30asmlinkage int sys_vfork(unsigned long p1, unsigned long p2, 30asmlinkage int sys_vfork(unsigned long p1, unsigned long p2,
31 unsigned long p3, unsigned long p4, unsigned long p5, 31 unsigned long p3, unsigned long p4, unsigned long p5,
32 unsigned long p6, struct pt_regs *regs); 32 unsigned long p6, struct pt_regs *regs);
33asmlinkage int sys_pipe(int __user *fildes); 33asmlinkage long sys_pipe(int __user *fildes);
34asmlinkage long sys_rt_sigaction(int sig, 34asmlinkage long sys_rt_sigaction(int sig,
35 const struct sigaction __user *act, 35 const struct sigaction __user *act,
36 struct sigaction __user *oact, size_t sigsetsize); 36 struct sigaction __user *oact, size_t sigsetsize);
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index c243a6ac60e5..d3374bc865ba 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -1,6 +1,12 @@
1#ifndef _ASM_POWERPC_TYPES_H 1#ifndef _ASM_POWERPC_TYPES_H
2#define _ASM_POWERPC_TYPES_H 2#define _ASM_POWERPC_TYPES_H
3 3
4#ifdef __powerpc64__
5# include <asm-generic/int-l64.h>
6#else
7# include <asm-generic/int-ll64.h>
8#endif
9
4#ifndef __ASSEMBLY__ 10#ifndef __ASSEMBLY__
5 11
6/* 12/*
@@ -22,30 +28,6 @@ typedef unsigned int umode_t;
22typedef unsigned short umode_t; 28typedef unsigned short umode_t;
23#endif 29#endif
24 30
25/*
26 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
27 * header files exported to user space
28 */
29
30typedef __signed__ char __s8;
31typedef unsigned char __u8;
32
33typedef __signed__ short __s16;
34typedef unsigned short __u16;
35
36typedef __signed__ int __s32;
37typedef unsigned int __u32;
38
39#ifdef __powerpc64__
40typedef __signed__ long __s64;
41typedef unsigned long __u64;
42#else
43#if defined(__GNUC__)
44__extension__ typedef __signed__ long long __s64;
45__extension__ typedef unsigned long long __u64;
46#endif
47#endif /* __powerpc64__ */
48
49typedef struct { 31typedef struct {
50 __u32 u[4]; 32 __u32 u[4];
51} __attribute__((aligned(16))) __vector128; 33} __attribute__((aligned(16))) __vector128;
@@ -64,24 +46,6 @@ typedef struct {
64 46
65#ifndef __ASSEMBLY__ 47#ifndef __ASSEMBLY__
66 48
67
68typedef signed char s8;
69typedef unsigned char u8;
70
71typedef signed short s16;
72typedef unsigned short u16;
73
74typedef signed int s32;
75typedef unsigned int u32;
76
77#ifdef __powerpc64__
78typedef signed long s64;
79typedef unsigned long u64;
80#else
81typedef signed long long s64;
82typedef unsigned long long u64;
83#endif
84
85typedef __vector128 vector128; 49typedef __vector128 vector128;
86 50
87/* Physical address used by some IO functions */ 51/* Physical address used by some IO functions */
diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h
index 2c5879ae90ca..78dda038dd47 100644
--- a/include/asm-s390/types.h
+++ b/include/asm-s390/types.h
@@ -9,34 +9,16 @@
9#ifndef _S390_TYPES_H 9#ifndef _S390_TYPES_H
10#define _S390_TYPES_H 10#define _S390_TYPES_H
11 11
12#ifndef __s390x__
13# include <asm-generic/int-l64.h>
14#else
15# include <asm-generic/int-ll64.h>
16#endif
17
12#ifndef __ASSEMBLY__ 18#ifndef __ASSEMBLY__
13 19
14typedef unsigned short umode_t; 20typedef unsigned short umode_t;
15 21
16/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30#ifndef __s390x__
31#if defined(__GNUC__)
32__extension__ typedef __signed__ long long __s64;
33__extension__ typedef unsigned long long __u64;
34#endif
35#else /* __s390x__ */
36typedef __signed__ long __s64;
37typedef unsigned long __u64;
38#endif
39
40/* A address type so that arithmetic can be done on it & it can be upgraded to 22/* A address type so that arithmetic can be done on it & it can be upgraded to
41 64 bit when necessary 23 64 bit when necessary
42*/ 24*/
@@ -58,24 +40,6 @@ typedef __signed__ long saddr_t;
58 40
59#ifndef __ASSEMBLY__ 41#ifndef __ASSEMBLY__
60 42
61
62typedef signed char s8;
63typedef unsigned char u8;
64
65typedef signed short s16;
66typedef unsigned short u16;
67
68typedef signed int s32;
69typedef unsigned int u32;
70
71#ifndef __s390x__
72typedef signed long long s64;
73typedef unsigned long long u64;
74#else /* __s390x__ */
75typedef signed long s64;
76typedef unsigned long u64;
77#endif /* __s390x__ */
78
79typedef u32 dma_addr_t; 43typedef u32 dma_addr_t;
80 44
81#ifndef __s390x__ 45#ifndef __s390x__
diff --git a/include/asm-sh/types.h b/include/asm-sh/types.h
index a6e1d4126e67..beea4e6f8dfd 100644
--- a/include/asm-sh/types.h
+++ b/include/asm-sh/types.h
@@ -1,29 +1,12 @@
1#ifndef __ASM_SH_TYPES_H 1#ifndef __ASM_SH_TYPES_H
2#define __ASM_SH_TYPES_H 2#define __ASM_SH_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#if defined(__GNUC__)
23__extension__ typedef __signed__ long long __s64;
24__extension__ typedef unsigned long long __u64;
25#endif
26
27#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
28 11
29/* 12/*
@@ -35,19 +18,6 @@ __extension__ typedef unsigned long long __u64;
35 18
36#ifndef __ASSEMBLY__ 19#ifndef __ASSEMBLY__
37 20
38
39typedef __signed__ char s8;
40typedef unsigned char u8;
41
42typedef __signed__ short s16;
43typedef unsigned short u16;
44
45typedef __signed__ int s32;
46typedef unsigned int u32;
47
48typedef __signed__ long long s64;
49typedef unsigned long long u64;
50
51/* Dma addresses are 32-bits wide. */ 21/* Dma addresses are 32-bits wide. */
52 22
53typedef u32 dma_addr_t; 23typedef u32 dma_addr_t;
diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h
index 17ba82ee220a..7becc846544a 100644
--- a/include/asm-sparc/oplib.h
+++ b/include/asm-sparc/oplib.h
@@ -34,9 +34,6 @@ extern unsigned int prom_rev, prom_prev;
34 */ 34 */
35extern int prom_root_node; 35extern int prom_root_node;
36 36
37/* PROM stdin and stdout */
38extern int prom_stdin, prom_stdout;
39
40/* Pointer to prom structure containing the device tree traversal 37/* Pointer to prom structure containing the device tree traversal
41 * and usage utility functions. Only prom-lib should use these, 38 * and usage utility functions. Only prom-lib should use these,
42 * users use the interface defined by the library only! 39 * users use the interface defined by the library only!
@@ -84,20 +81,6 @@ extern int prom_devclose(int device_handle);
84extern void prom_seek(int device_handle, unsigned int seek_hival, 81extern void prom_seek(int device_handle, unsigned int seek_hival,
85 unsigned int seek_lowval); 82 unsigned int seek_lowval);
86 83
87/* Machine memory configuration routine. */
88
89/* This function returns a V0 format memory descriptor table, it has three
90 * entries. One for the total amount of physical ram on the machine, one
91 * for the amount of physical ram available, and one describing the virtual
92 * areas which are allocated by the prom. So, in a sense the physical
93 * available is a calculation of the total physical minus the physical mapped
94 * by the prom with virtual mappings.
95 *
96 * These lists are returned pre-sorted, this should make your life easier
97 * since the prom itself is way too lazy to do such nice things.
98 */
99extern struct linux_mem_v0 *prom_meminfo(void);
100
101/* Miscellaneous routines, don't really fit in any category per se. */ 84/* Miscellaneous routines, don't really fit in any category per se. */
102 85
103/* Reboot the machine with the command line passed. */ 86/* Reboot the machine with the command line passed. */
diff --git a/include/asm-sparc/page.h b/include/asm-sparc/page.h
index 39ccf2da297c..1625a8c3e0d2 100644
--- a/include/asm-sparc/page.h
+++ b/include/asm-sparc/page.h
@@ -38,12 +38,11 @@
38 38
39/* The following structure is used to hold the physical 39/* The following structure is used to hold the physical
40 * memory configuration of the machine. This is filled in 40 * memory configuration of the machine. This is filled in
41 * probe_memory() and is later used by mem_init() to set up 41 * prom_meminit() and is later used by mem_init() to set up
42 * mem_map[]. We statically allocate SPARC_PHYS_BANKS of 42 * mem_map[]. We statically allocate SPARC_PHYS_BANKS+1 of
43 * these structs, this is arbitrary. The entry after the 43 * these structs, this is arbitrary. The entry after the
44 * last valid one has num_bytes==0. 44 * last valid one has num_bytes==0.
45 */ 45 */
46
47struct sparc_phys_banks { 46struct sparc_phys_banks {
48 unsigned long base_addr; 47 unsigned long base_addr;
49 unsigned long num_bytes; 48 unsigned long num_bytes;
diff --git a/include/asm-sparc/types.h b/include/asm-sparc/types.h
index 42fc6ed98156..1b08ef860a66 100644
--- a/include/asm-sparc/types.h
+++ b/include/asm-sparc/types.h
@@ -3,34 +3,18 @@
3#define _SPARC_TYPES_H 3#define _SPARC_TYPES_H
4 4
5/* 5/*
6 * _xx is ok: it doesn't pollute the POSIX namespace. Use these in the
7 * header files exported to user space.
8 */
9
10/*
11 * This file is never included by application software unless 6 * This file is never included by application software unless
12 * explicitly requested (e.g., via linux/types.h) in which case the 7 * explicitly requested (e.g., via linux/types.h) in which case the
13 * application is Linux specific so (user-) name space pollution is 8 * application is Linux specific so (user-) name space pollution is
14 * not a major issue. However, for interoperability, libraries still 9 * not a major issue. However, for interoperability, libraries still
15 * need to be careful to avoid a name clashes. 10 * need to be careful to avoid a name clashes.
16 */ 11 */
12#include <asm-generic/int-ll64.h>
17 13
18#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
19 15
20typedef unsigned short umode_t; 16typedef unsigned short umode_t;
21 17
22typedef __signed__ char __s8;
23typedef unsigned char __u8;
24
25typedef __signed__ short __s16;
26typedef unsigned short __u16;
27
28typedef __signed__ int __s32;
29typedef unsigned int __u32;
30
31typedef __signed__ long long __s64;
32typedef unsigned long long __u64;
33
34#endif /* __ASSEMBLY__ */ 18#endif /* __ASSEMBLY__ */
35 19
36#ifdef __KERNEL__ 20#ifdef __KERNEL__
@@ -39,18 +23,6 @@ typedef unsigned long long __u64;
39 23
40#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
41 25
42typedef __signed__ char s8;
43typedef unsigned char u8;
44
45typedef __signed__ short s16;
46typedef unsigned short u16;
47
48typedef __signed__ int s32;
49typedef unsigned int u32;
50
51typedef __signed__ long long s64;
52typedef unsigned long long u64;
53
54typedef u32 dma_addr_t; 26typedef u32 dma_addr_t;
55typedef u32 dma64_addr_t; 27typedef u32 dma64_addr_t;
56 28
diff --git a/include/asm-sparc64/types.h b/include/asm-sparc64/types.h
index d0ee7f105838..5dbe04f4044a 100644
--- a/include/asm-sparc64/types.h
+++ b/include/asm-sparc64/types.h
@@ -9,28 +9,12 @@
9 * not a major issue. However, for interoperability, libraries still 9 * not a major issue. However, for interoperability, libraries still
10 * need to be careful to avoid a name clashes. 10 * need to be careful to avoid a name clashes.
11 */ 11 */
12#include <asm-generic/int-l64.h>
12 13
13#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
14 15
15typedef unsigned short umode_t; 16typedef unsigned short umode_t;
16 17
17/*
18 * _xx is ok: it doesn't pollute the POSIX namespace. Use these in the
19 * header files exported to user space.
20 */
21
22typedef __signed__ char __s8;
23typedef unsigned char __u8;
24
25typedef __signed__ short __s16;
26typedef unsigned short __u16;
27
28typedef __signed__ int __s32;
29typedef unsigned int __u32;
30
31typedef __signed__ long __s64;
32typedef unsigned long __u64;
33
34#endif /* __ASSEMBLY__ */ 18#endif /* __ASSEMBLY__ */
35 19
36#ifdef __KERNEL__ 20#ifdef __KERNEL__
@@ -39,18 +23,6 @@ typedef unsigned long __u64;
39 23
40#ifndef __ASSEMBLY__ 24#ifndef __ASSEMBLY__
41 25
42typedef __signed__ char s8;
43typedef unsigned char u8;
44
45typedef __signed__ short s16;
46typedef unsigned short u16;
47
48typedef __signed__ int s32;
49typedef unsigned int u32;
50
51typedef __signed__ long s64;
52typedef unsigned long u64;
53
54/* Dma addresses come in generic and 64-bit flavours. */ 26/* Dma addresses come in generic and 64-bit flavours. */
55 27
56typedef u32 dma_addr_t; 28typedef u32 dma_addr_t;
diff --git a/include/asm-v850/types.h b/include/asm-v850/types.h
index 284bda882112..89f735ee41dd 100644
--- a/include/asm-v850/types.h
+++ b/include/asm-v850/types.h
@@ -10,28 +10,10 @@
10 * not a major issue. However, for interoperability, libraries still 10 * not a major issue. However, for interoperability, libraries still
11 * need to be careful to avoid a name clashes. 11 * need to be careful to avoid a name clashes.
12 */ 12 */
13#include <asm-generic/int-ll64.h>
13 14
14typedef unsigned short umode_t; 15typedef unsigned short umode_t;
15 16
16/*
17 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
18 * header files exported to user space
19 */
20
21typedef __signed__ char __s8;
22typedef unsigned char __u8;
23
24typedef __signed__ short __s16;
25typedef unsigned short __u16;
26
27typedef __signed__ int __s32;
28typedef unsigned int __u32;
29
30#if defined(__GNUC__)
31__extension__ typedef __signed__ long long __s64;
32__extension__ typedef unsigned long long __u64;
33#endif
34
35#endif /* !__ASSEMBLY__ */ 17#endif /* !__ASSEMBLY__ */
36 18
37/* 19/*
@@ -43,18 +25,6 @@ __extension__ typedef unsigned long long __u64;
43 25
44#ifndef __ASSEMBLY__ 26#ifndef __ASSEMBLY__
45 27
46typedef signed char s8;
47typedef unsigned char u8;
48
49typedef signed short s16;
50typedef unsigned short u16;
51
52typedef signed int s32;
53typedef unsigned int u32;
54
55typedef signed long long s64;
56typedef unsigned long long u64;
57
58/* Dma addresses are 32-bits wide. */ 28/* Dma addresses are 32-bits wide. */
59 29
60typedef u32 dma_addr_t; 30typedef u32 dma_addr_t;
diff --git a/include/asm-x86/types.h b/include/asm-x86/types.h
index 63733f315688..1ac80cd9acf8 100644
--- a/include/asm-x86/types.h
+++ b/include/asm-x86/types.h
@@ -1,34 +1,12 @@
1#ifndef _ASM_X86_TYPES_H 1#ifndef _ASM_X86_TYPES_H
2#define _ASM_X86_TYPES_H 2#define _ASM_X86_TYPES_H
3 3
4#include <asm-generic/int-ll64.h>
5
4#ifndef __ASSEMBLY__ 6#ifndef __ASSEMBLY__
5 7
6typedef unsigned short umode_t; 8typedef unsigned short umode_t;
7 9
8/*
9 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
10 * header files exported to user space
11 */
12
13typedef __signed__ char __s8;
14typedef unsigned char __u8;
15
16typedef __signed__ short __s16;
17typedef unsigned short __u16;
18
19typedef __signed__ int __s32;
20typedef unsigned int __u32;
21
22#ifdef __i386__
23# ifdef __GNUC__
24__extension__ typedef __signed__ long long __s64;
25__extension__ typedef unsigned long long __u64;
26# endif
27#else
28typedef __signed__ long long __s64;
29typedef unsigned long long __u64;
30#endif
31
32#endif /* __ASSEMBLY__ */ 10#endif /* __ASSEMBLY__ */
33 11
34/* 12/*
@@ -44,18 +22,6 @@ typedef unsigned long long __u64;
44 22
45#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
46 24
47typedef signed char s8;
48typedef unsigned char u8;
49
50typedef signed short s16;
51typedef unsigned short u16;
52
53typedef signed int s32;
54typedef unsigned int u32;
55
56typedef signed long long s64;
57typedef unsigned long long u64;
58
59typedef u64 dma64_addr_t; 25typedef u64 dma64_addr_t;
60#if defined(CONFIG_X86_64) || defined(CONFIG_HIGHMEM64G) 26#if defined(CONFIG_X86_64) || defined(CONFIG_HIGHMEM64G)
61/* DMA addresses come in 32-bit and 64-bit flavours. */ 27/* DMA addresses come in 32-bit and 64-bit flavours. */
diff --git a/include/asm-xtensa/types.h b/include/asm-xtensa/types.h
index b27d841a8eb7..c89569a8da0c 100644
--- a/include/asm-xtensa/types.h
+++ b/include/asm-xtensa/types.h
@@ -11,6 +11,7 @@
11#ifndef _XTENSA_TYPES_H 11#ifndef _XTENSA_TYPES_H
12#define _XTENSA_TYPES_H 12#define _XTENSA_TYPES_H
13 13
14#include <asm-generic/int-ll64.h>
14 15
15#ifdef __ASSEMBLY__ 16#ifdef __ASSEMBLY__
16# define __XTENSA_UL(x) (x) 17# define __XTENSA_UL(x) (x)
@@ -25,42 +26,10 @@
25typedef unsigned short umode_t; 26typedef unsigned short umode_t;
26 27
27/* 28/*
28 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
29 * header files exported to user space
30 */
31
32typedef __signed__ char __s8;
33typedef unsigned char __u8;
34
35typedef __signed__ short __s16;
36typedef unsigned short __u16;
37
38typedef __signed__ int __s32;
39typedef unsigned int __u32;
40
41#if defined(__GNUC__)
42__extension__ typedef __signed__ long long __s64;
43__extension__ typedef unsigned long long __u64;
44#endif
45
46/*
47 * These aren't exported outside the kernel to avoid name space clashes 29 * These aren't exported outside the kernel to avoid name space clashes
48 */ 30 */
49#ifdef __KERNEL__ 31#ifdef __KERNEL__
50 32
51typedef __signed__ char s8;
52typedef unsigned char u8;
53
54typedef __signed__ short s16;
55typedef unsigned short u16;
56
57typedef __signed__ int s32;
58typedef unsigned int u32;
59
60typedef __signed__ long long s64;
61typedef unsigned long long u64;
62
63
64#define BITS_PER_LONG 32 33#define BITS_PER_LONG 32
65 34
66/* Dma addresses are 32-bits wide. */ 35/* Dma addresses are 32-bits wide. */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 529f301d9372..0b5e03eae6d2 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -113,7 +113,7 @@ struct ieee80211_hdr {
113struct ieee80211s_hdr { 113struct ieee80211s_hdr {
114 u8 flags; 114 u8 flags;
115 u8 ttl; 115 u8 ttl;
116 u8 seqnum[3]; 116 __le32 seqnum;
117 u8 eaddr1[6]; 117 u8 eaddr1[6];
118 u8 eaddr2[6]; 118 u8 eaddr2[6];
119 u8 eaddr3[6]; 119 u8 eaddr3[6];
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 58e43e566457..950e13d09e06 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -97,7 +97,9 @@ struct __fdb_entry
97 __u8 port_no; 97 __u8 port_no;
98 __u8 is_local; 98 __u8 is_local;
99 __u32 ageing_timer_value; 99 __u32 ageing_timer_value;
100 __u32 unused; 100 __u8 port_hi;
101 __u8 pad0;
102 __u16 unused;
101}; 103};
102 104
103#ifdef __KERNEL__ 105#ifdef __KERNEL__
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h
index 225beb136807..cb7d10f30763 100644
--- a/include/linux/pda_power.h
+++ b/include/linux/pda_power.h
@@ -16,10 +16,14 @@
16#define PDA_POWER_CHARGE_AC (1 << 0) 16#define PDA_POWER_CHARGE_AC (1 << 0)
17#define PDA_POWER_CHARGE_USB (1 << 1) 17#define PDA_POWER_CHARGE_USB (1 << 1)
18 18
19struct device;
20
19struct pda_power_pdata { 21struct pda_power_pdata {
22 int (*init)(struct device *dev);
20 int (*is_ac_online)(void); 23 int (*is_ac_online)(void);
21 int (*is_usb_online)(void); 24 int (*is_usb_online)(void);
22 void (*set_charge)(int flags); 25 void (*set_charge)(int flags);
26 void (*exit)(struct device *dev);
23 27
24 char **supplied_to; 28 char **supplied_to;
25 size_t num_supplicants; 29 size_t num_supplicants;
diff --git a/include/linux/rio.h b/include/linux/rio.h
index c1c99c9643d3..dc0c75556c63 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -161,6 +161,8 @@ enum rio_phy_type {
161 * @ops: configuration space functions 161 * @ops: configuration space functions
162 * @id: Port ID, unique among all ports 162 * @id: Port ID, unique among all ports
163 * @index: Port index, unique among all port interfaces of the same type 163 * @index: Port index, unique among all port interfaces of the same type
164 * @sys_size: RapidIO common transport system size
165 * @phy_type: RapidIO phy type
164 * @name: Port name string 166 * @name: Port name string
165 * @priv: Master port private data 167 * @priv: Master port private data
166 */ 168 */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index 2864b1699ecc..0a9b5b41ed67 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -69,14 +69,9 @@
69 69
70/***************************** INCLUDES *****************************/ 70/***************************** INCLUDES *****************************/
71 71
72/* This header is used in user-space, therefore need to be sanitised 72#include <linux/types.h> /* for __u* and __s* typedefs */
73 * for that purpose. Those includes are usually not compatible with glibc.
74 * To know which includes to use in user-space, check iwlib.h. */
75#ifdef __KERNEL__
76#include <linux/types.h> /* for "caddr_t" et al */
77#include <linux/socket.h> /* for "struct sockaddr" et al */ 73#include <linux/socket.h> /* for "struct sockaddr" et al */
78#include <linux/if.h> /* for IFNAMSIZ and co... */ 74#include <linux/if.h> /* for IFNAMSIZ and co... */
79#endif /* __KERNEL__ */
80 75
81/***************************** VERSION *****************************/ 76/***************************** VERSION *****************************/
82/* 77/*
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 1f74bcd603fe..32742c4563de 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -30,13 +30,6 @@
30#endif 30#endif
31 31
32/* 32/*
33 * SCSI command lengths
34 */
35
36extern const unsigned char scsi_command_size[8];
37#define COMMAND_SIZE(opcode) scsi_command_size[((opcode) >> 5) & 7]
38
39/*
40 * Special value for scanning to specify scanning or rescanning of all 33 * Special value for scanning to specify scanning or rescanning of all
41 * possible channels, (target) ids, or luns on a given shost. 34 * possible channels, (target) ids, or luns on a given shost.
42 */ 35 */
@@ -109,6 +102,7 @@ extern const unsigned char scsi_command_size[8];
109#define MODE_SENSE_10 0x5a 102#define MODE_SENSE_10 0x5a
110#define PERSISTENT_RESERVE_IN 0x5e 103#define PERSISTENT_RESERVE_IN 0x5e
111#define PERSISTENT_RESERVE_OUT 0x5f 104#define PERSISTENT_RESERVE_OUT 0x5f
105#define VARIABLE_LENGTH_CMD 0x7f
112#define REPORT_LUNS 0xa0 106#define REPORT_LUNS 0xa0
113#define MAINTENANCE_IN 0xa3 107#define MAINTENANCE_IN 0xa3
114#define MOVE_MEDIUM 0xa5 108#define MOVE_MEDIUM 0xa5
@@ -136,6 +130,38 @@ extern const unsigned char scsi_command_size[8];
136#define ATA_12 0xa1 /* 12-byte pass-thru */ 130#define ATA_12 0xa1 /* 12-byte pass-thru */
137 131
138/* 132/*
133 * SCSI command lengths
134 */
135
136#define SCSI_MAX_VARLEN_CDB_SIZE 260
137
138/* defined in T10 SCSI Primary Commands-2 (SPC2) */
139struct scsi_varlen_cdb_hdr {
140 u8 opcode; /* opcode always == VARIABLE_LENGTH_CMD */
141 u8 control;
142 u8 misc[5];
143 u8 additional_cdb_length; /* total cdb length - 8 */
144 __be16 service_action;
145 /* service specific data follows */
146};
147
148static inline unsigned
149scsi_varlen_cdb_length(const void *hdr)
150{
151 return ((struct scsi_varlen_cdb_hdr *)hdr)->additional_cdb_length + 8;
152}
153
154extern const unsigned char scsi_command_size_tbl[8];
155#define COMMAND_SIZE(opcode) scsi_command_size_tbl[((opcode) >> 5) & 7]
156
157static inline unsigned
158scsi_command_size(const unsigned char *cmnd)
159{
160 return (cmnd[0] == VARIABLE_LENGTH_CMD) ?
161 scsi_varlen_cdb_length(cmnd) : COMMAND_SIZE(cmnd[0]);
162}
163
164/*
139 * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft 165 * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
140 * T10/1561-D Revision 4 Draft dated 7th November 2002. 166 * T10/1561-D Revision 4 Draft dated 7th November 2002.
141 */ 167 */
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 8d20e60a94b7..3e46dfae8194 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -7,10 +7,28 @@
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/timer.h> 8#include <linux/timer.h>
9#include <linux/scatterlist.h> 9#include <linux/scatterlist.h>
10#include <linux/blkdev.h>
10 11
11struct Scsi_Host; 12struct Scsi_Host;
12struct scsi_device; 13struct scsi_device;
13 14
15/*
16 * MAX_COMMAND_SIZE is:
17 * The longest fixed-length SCSI CDB as per the SCSI standard.
18 * fixed-length means: commands that their size can be determined
19 * by their opcode and the CDB does not carry a length specifier, (unlike
20 * the VARIABLE_LENGTH_CMD(0x7f) command). This is actually not exactly
21 * true and the SCSI standard also defines extended commands and
22 * vendor specific commands that can be bigger than 16 bytes. The kernel
23 * will support these using the same infrastructure used for VARLEN CDB's.
24 * So in effect MAX_COMMAND_SIZE means the maximum size command scsi-ml
25 * supports without specifying a cmd_len by ULD's
26 */
27#define MAX_COMMAND_SIZE 16
28#if (MAX_COMMAND_SIZE > BLK_MAX_CDB)
29# error MAX_COMMAND_SIZE can not be bigger than BLK_MAX_CDB
30#endif
31
14struct scsi_data_buffer { 32struct scsi_data_buffer {
15 struct sg_table table; 33 struct sg_table table;
16 unsigned length; 34 unsigned length;
@@ -60,12 +78,11 @@ struct scsi_cmnd {
60 int allowed; 78 int allowed;
61 int timeout_per_command; 79 int timeout_per_command;
62 80
63 unsigned char cmd_len; 81 unsigned short cmd_len;
64 enum dma_data_direction sc_data_direction; 82 enum dma_data_direction sc_data_direction;
65 83
66 /* These elements define the operation we are about to perform */ 84 /* These elements define the operation we are about to perform */
67#define MAX_COMMAND_SIZE 16 85 unsigned char *cmnd;
68 unsigned char cmnd[MAX_COMMAND_SIZE];
69 86
70 struct timer_list eh_timeout; /* Used to time out the command. */ 87 struct timer_list eh_timeout; /* Used to time out the command. */
71 88
diff --git a/include/scsi/scsi_eh.h b/include/scsi/scsi_eh.h
index d3a133b4a072..2a9add21267d 100644
--- a/include/scsi/scsi_eh.h
+++ b/include/scsi/scsi_eh.h
@@ -75,11 +75,11 @@ struct scsi_eh_save {
75 int result; 75 int result;
76 enum dma_data_direction data_direction; 76 enum dma_data_direction data_direction;
77 unsigned char cmd_len; 77 unsigned char cmd_len;
78 unsigned char cmnd[MAX_COMMAND_SIZE]; 78 unsigned char *cmnd;
79 struct scsi_data_buffer sdb; 79 struct scsi_data_buffer sdb;
80 struct request *next_rq; 80 struct request *next_rq;
81
82 /* new command support */ 81 /* new command support */
82 unsigned char eh_cmnd[BLK_MAX_CDB];
83 struct scatterlist sense_sgl; 83 struct scatterlist sense_sgl;
84}; 84};
85 85
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index d967d6dc7a28..1834fdfe82a7 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -573,13 +573,11 @@ struct Scsi_Host {
573 /* 573 /*
574 * The maximum length of SCSI commands that this host can accept. 574 * The maximum length of SCSI commands that this host can accept.
575 * Probably 12 for most host adapters, but could be 16 for others. 575 * Probably 12 for most host adapters, but could be 16 for others.
576 * or 260 if the driver supports variable length cdbs.
576 * For drivers that don't set this field, a value of 12 is 577 * For drivers that don't set this field, a value of 12 is
577 * assumed. I am leaving this as a number rather than a bit 578 * assumed.
578 * because you never know what subsequent SCSI standards might do
579 * (i.e. could there be a 20 byte or a 24-byte command a few years
580 * down the road?).
581 */ 579 */
582 unsigned char max_cmd_len; 580 unsigned short max_cmd_len;
583 581
584 int this_id; 582 int this_id;
585 int can_queue; 583 int can_queue;
diff --git a/init/Kconfig b/init/Kconfig
index 3e7b257fc05f..6a44defac3ec 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -720,7 +720,7 @@ config VM_EVENT_COUNTERS
720config SLUB_DEBUG 720config SLUB_DEBUG
721 default y 721 default y
722 bool "Enable SLUB debugging support" if EMBEDDED 722 bool "Enable SLUB debugging support" if EMBEDDED
723 depends on SLUB 723 depends on SLUB && SYSFS
724 help 724 help
725 SLUB has extensive debug support features. Disabling these can 725 SLUB has extensive debug support features. Disabling these can
726 result in significant savings in code size. This also disables 726 result in significant savings in code size. This also disables
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 94fd3b08fb77..b3b69fd51330 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -673,7 +673,7 @@ asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode,
673 if (IS_ERR(name = getname(u_name))) 673 if (IS_ERR(name = getname(u_name)))
674 return PTR_ERR(name); 674 return PTR_ERR(name);
675 675
676 fd = get_unused_fd(); 676 fd = get_unused_fd_flags(O_CLOEXEC);
677 if (fd < 0) 677 if (fd < 0)
678 goto out_putname; 678 goto out_putname;
679 679
@@ -709,7 +709,6 @@ asmlinkage long sys_mq_open(const char __user *u_name, int oflag, mode_t mode,
709 goto out_putfd; 709 goto out_putfd;
710 } 710 }
711 711
712 set_close_on_exec(fd, 1);
713 fd_install(fd, filp); 712 fd_install(fd, filp);
714 goto out_upsem; 713 goto out_upsem;
715 714
diff --git a/kernel/time.c b/kernel/time.c
index cbe0d5a222ff..6a08660b4fac 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -246,7 +246,7 @@ unsigned int inline jiffies_to_msecs(const unsigned long j)
246 return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC); 246 return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC);
247#else 247#else
248# if BITS_PER_LONG == 32 248# if BITS_PER_LONG == 32
249 return ((u64)HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32; 249 return (HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32;
250# else 250# else
251 return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN; 251 return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN;
252# endif 252# endif
@@ -262,7 +262,7 @@ unsigned int inline jiffies_to_usecs(const unsigned long j)
262 return (j + (HZ / USEC_PER_SEC) - 1)/(HZ / USEC_PER_SEC); 262 return (j + (HZ / USEC_PER_SEC) - 1)/(HZ / USEC_PER_SEC);
263#else 263#else
264# if BITS_PER_LONG == 32 264# if BITS_PER_LONG == 32
265 return ((u64)HZ_TO_USEC_MUL32 * j) >> HZ_TO_USEC_SHR32; 265 return (HZ_TO_USEC_MUL32 * j) >> HZ_TO_USEC_SHR32;
266# else 266# else
267 return (j * HZ_TO_USEC_NUM) / HZ_TO_USEC_DEN; 267 return (j * HZ_TO_USEC_NUM) / HZ_TO_USEC_DEN;
268# endif 268# endif
@@ -476,7 +476,7 @@ unsigned long msecs_to_jiffies(const unsigned int m)
476 if (HZ > MSEC_PER_SEC && m > jiffies_to_msecs(MAX_JIFFY_OFFSET)) 476 if (HZ > MSEC_PER_SEC && m > jiffies_to_msecs(MAX_JIFFY_OFFSET))
477 return MAX_JIFFY_OFFSET; 477 return MAX_JIFFY_OFFSET;
478 478
479 return ((u64)MSEC_TO_HZ_MUL32 * m + MSEC_TO_HZ_ADJ32) 479 return (MSEC_TO_HZ_MUL32 * m + MSEC_TO_HZ_ADJ32)
480 >> MSEC_TO_HZ_SHR32; 480 >> MSEC_TO_HZ_SHR32;
481#endif 481#endif
482} 482}
@@ -491,7 +491,7 @@ unsigned long usecs_to_jiffies(const unsigned int u)
491#elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC) 491#elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC)
492 return u * (HZ / USEC_PER_SEC); 492 return u * (HZ / USEC_PER_SEC);
493#else 493#else
494 return ((u64)USEC_TO_HZ_MUL32 * u + USEC_TO_HZ_ADJ32) 494 return (USEC_TO_HZ_MUL32 * u + USEC_TO_HZ_ADJ32)
495 >> USEC_TO_HZ_SHR32; 495 >> USEC_TO_HZ_SHR32;
496#endif 496#endif
497} 497}
diff --git a/kernel/timeconst.pl b/kernel/timeconst.pl
index 41468035473c..eb51d76e058a 100644
--- a/kernel/timeconst.pl
+++ b/kernel/timeconst.pl
@@ -1,7 +1,7 @@
1#!/usr/bin/perl 1#!/usr/bin/perl
2# ----------------------------------------------------------------------- 2# -----------------------------------------------------------------------
3# 3#
4# Copyright 2007 rPath, Inc. - All Rights Reserved 4# Copyright 2007-2008 rPath, Inc. - All Rights Reserved
5# 5#
6# This file is part of the Linux kernel, and is made available under 6# This file is part of the Linux kernel, and is made available under
7# the terms of the GNU General Public License version 2 or (at your 7# the terms of the GNU General Public License version 2 or (at your
@@ -20,198 +20,138 @@
20%canned_values = ( 20%canned_values = (
21 24 => [ 21 24 => [
22 '0xa6aaaaab','0x2aaaaaa',26, 22 '0xa6aaaaab','0x2aaaaaa',26,
23 '0xa6aaaaaaaaaaaaab','0x2aaaaaaaaaaaaaa',58,
24 125,3, 23 125,3,
25 '0xc49ba5e4','0x1fbe76c8b4',37, 24 '0xc49ba5e4','0x1fbe76c8b4',37,
26 '0xc49ba5e353f7ceda','0x1fbe76c8b439581062',69,
27 3,125, 25 3,125,
28 '0xa2c2aaab','0xaaaa',16, 26 '0xa2c2aaab','0xaaaa',16,
29 '0xa2c2aaaaaaaaaaab','0xaaaaaaaaaaaa',48,
30 125000,3, 27 125000,3,
31 '0xc9539b89','0x7fffbce4217d',47, 28 '0xc9539b89','0x7fffbce4217d',47,
32 '0xc9539b8887229e91','0x7fffbce4217d2849cb25',79,
33 3,125000, 29 3,125000,
34 ], 32 => [ 30 ], 32 => [
35 '0xfa000000','0x6000000',27, 31 '0xfa000000','0x6000000',27,
36 '0xfa00000000000000','0x600000000000000',59,
37 125,4, 32 125,4,
38 '0x83126e98','0xfdf3b645a',36, 33 '0x83126e98','0xfdf3b645a',36,
39 '0x83126e978d4fdf3c','0xfdf3b645a1cac0831',68,
40 4,125, 34 4,125,
41 '0xf4240000','0x0',17, 35 '0xf4240000','0x0',17,
42 '0xf424000000000000','0x0',49,
43 31250,1, 36 31250,1,
44 '0x8637bd06','0x3fff79c842fa',46, 37 '0x8637bd06','0x3fff79c842fa',46,
45 '0x8637bd05af6c69b6','0x3fff79c842fa5093964a',78,
46 1,31250, 38 1,31250,
47 ], 48 => [ 39 ], 48 => [
48 '0xa6aaaaab','0x6aaaaaa',27, 40 '0xa6aaaaab','0x6aaaaaa',27,
49 '0xa6aaaaaaaaaaaaab','0x6aaaaaaaaaaaaaa',59,
50 125,6, 41 125,6,
51 '0xc49ba5e4','0xfdf3b645a',36, 42 '0xc49ba5e4','0xfdf3b645a',36,
52 '0xc49ba5e353f7ceda','0xfdf3b645a1cac0831',68,
53 6,125, 43 6,125,
54 '0xa2c2aaab','0x15555',17, 44 '0xa2c2aaab','0x15555',17,
55 '0xa2c2aaaaaaaaaaab','0x1555555555555',49,
56 62500,3, 45 62500,3,
57 '0xc9539b89','0x3fffbce4217d',46, 46 '0xc9539b89','0x3fffbce4217d',46,
58 '0xc9539b8887229e91','0x3fffbce4217d2849cb25',78,
59 3,62500, 47 3,62500,
60 ], 64 => [ 48 ], 64 => [
61 '0xfa000000','0xe000000',28, 49 '0xfa000000','0xe000000',28,
62 '0xfa00000000000000','0xe00000000000000',60,
63 125,8, 50 125,8,
64 '0x83126e98','0x7ef9db22d',35, 51 '0x83126e98','0x7ef9db22d',35,
65 '0x83126e978d4fdf3c','0x7ef9db22d0e560418',67,
66 8,125, 52 8,125,
67 '0xf4240000','0x0',18, 53 '0xf4240000','0x0',18,
68 '0xf424000000000000','0x0',50,
69 15625,1, 54 15625,1,
70 '0x8637bd06','0x1fff79c842fa',45, 55 '0x8637bd06','0x1fff79c842fa',45,
71 '0x8637bd05af6c69b6','0x1fff79c842fa5093964a',77,
72 1,15625, 56 1,15625,
73 ], 100 => [ 57 ], 100 => [
74 '0xa0000000','0x0',28, 58 '0xa0000000','0x0',28,
75 '0xa000000000000000','0x0',60,
76 10,1, 59 10,1,
77 '0xcccccccd','0x733333333',35, 60 '0xcccccccd','0x733333333',35,
78 '0xcccccccccccccccd','0x73333333333333333',67,
79 1,10, 61 1,10,
80 '0x9c400000','0x0',18, 62 '0x9c400000','0x0',18,
81 '0x9c40000000000000','0x0',50,
82 10000,1, 63 10000,1,
83 '0xd1b71759','0x1fff2e48e8a7',45, 64 '0xd1b71759','0x1fff2e48e8a7',45,
84 '0xd1b71758e219652c','0x1fff2e48e8a71de69ad4',77,
85 1,10000, 65 1,10000,
86 ], 122 => [ 66 ], 122 => [
87 '0x8325c53f','0xfbcda3a',28, 67 '0x8325c53f','0xfbcda3a',28,
88 '0x8325c53ef368eb05','0xfbcda3ac10c9714',60,
89 500,61, 68 500,61,
90 '0xf9db22d1','0x7fbe76c8b',35, 69 '0xf9db22d1','0x7fbe76c8b',35,
91 '0xf9db22d0e560418a','0x7fbe76c8b43958106',67,
92 61,500, 70 61,500,
93 '0x8012e2a0','0x3ef36',18, 71 '0x8012e2a0','0x3ef36',18,
94 '0x8012e29f79b47583','0x3ef368eb04325',50,
95 500000,61, 72 500000,61,
96 '0xffda4053','0x1ffffbce4217',45, 73 '0xffda4053','0x1ffffbce4217',45,
97 '0xffda4052d666a983','0x1ffffbce4217d2849cb2',77,
98 61,500000, 74 61,500000,
99 ], 128 => [ 75 ], 128 => [
100 '0xfa000000','0x1e000000',29, 76 '0xfa000000','0x1e000000',29,
101 '0xfa00000000000000','0x1e00000000000000',61,
102 125,16, 77 125,16,
103 '0x83126e98','0x3f7ced916',34, 78 '0x83126e98','0x3f7ced916',34,
104 '0x83126e978d4fdf3c','0x3f7ced916872b020c',66,
105 16,125, 79 16,125,
106 '0xf4240000','0x40000',19, 80 '0xf4240000','0x40000',19,
107 '0xf424000000000000','0x4000000000000',51,
108 15625,2, 81 15625,2,
109 '0x8637bd06','0xfffbce4217d',44, 82 '0x8637bd06','0xfffbce4217d',44,
110 '0x8637bd05af6c69b6','0xfffbce4217d2849cb25',76,
111 2,15625, 83 2,15625,
112 ], 200 => [ 84 ], 200 => [
113 '0xa0000000','0x0',29, 85 '0xa0000000','0x0',29,
114 '0xa000000000000000','0x0',61,
115 5,1, 86 5,1,
116 '0xcccccccd','0x333333333',34, 87 '0xcccccccd','0x333333333',34,
117 '0xcccccccccccccccd','0x33333333333333333',66,
118 1,5, 88 1,5,
119 '0x9c400000','0x0',19, 89 '0x9c400000','0x0',19,
120 '0x9c40000000000000','0x0',51,
121 5000,1, 90 5000,1,
122 '0xd1b71759','0xfff2e48e8a7',44, 91 '0xd1b71759','0xfff2e48e8a7',44,
123 '0xd1b71758e219652c','0xfff2e48e8a71de69ad4',76,
124 1,5000, 92 1,5000,
125 ], 250 => [ 93 ], 250 => [
126 '0x80000000','0x0',29, 94 '0x80000000','0x0',29,
127 '0x8000000000000000','0x0',61,
128 4,1, 95 4,1,
129 '0x80000000','0x180000000',33, 96 '0x80000000','0x180000000',33,
130 '0x8000000000000000','0x18000000000000000',65,
131 1,4, 97 1,4,
132 '0xfa000000','0x0',20, 98 '0xfa000000','0x0',20,
133 '0xfa00000000000000','0x0',52,
134 4000,1, 99 4000,1,
135 '0x83126e98','0x7ff7ced9168',43, 100 '0x83126e98','0x7ff7ced9168',43,
136 '0x83126e978d4fdf3c','0x7ff7ced916872b020c4',75,
137 1,4000, 101 1,4000,
138 ], 256 => [ 102 ], 256 => [
139 '0xfa000000','0x3e000000',30, 103 '0xfa000000','0x3e000000',30,
140 '0xfa00000000000000','0x3e00000000000000',62,
141 125,32, 104 125,32,
142 '0x83126e98','0x1fbe76c8b',33, 105 '0x83126e98','0x1fbe76c8b',33,
143 '0x83126e978d4fdf3c','0x1fbe76c8b43958106',65,
144 32,125, 106 32,125,
145 '0xf4240000','0xc0000',20, 107 '0xf4240000','0xc0000',20,
146 '0xf424000000000000','0xc000000000000',52,
147 15625,4, 108 15625,4,
148 '0x8637bd06','0x7ffde7210be',43, 109 '0x8637bd06','0x7ffde7210be',43,
149 '0x8637bd05af6c69b6','0x7ffde7210be9424e592',75,
150 4,15625, 110 4,15625,
151 ], 300 => [ 111 ], 300 => [
152 '0xd5555556','0x2aaaaaaa',30, 112 '0xd5555556','0x2aaaaaaa',30,
153 '0xd555555555555556','0x2aaaaaaaaaaaaaaa',62,
154 10,3, 113 10,3,
155 '0x9999999a','0x1cccccccc',33, 114 '0x9999999a','0x1cccccccc',33,
156 '0x999999999999999a','0x1cccccccccccccccc',65,
157 3,10, 115 3,10,
158 '0xd0555556','0xaaaaa',20, 116 '0xd0555556','0xaaaaa',20,
159 '0xd055555555555556','0xaaaaaaaaaaaaa',52,
160 10000,3, 117 10000,3,
161 '0x9d495183','0x7ffcb923a29',43, 118 '0x9d495183','0x7ffcb923a29',43,
162 '0x9d495182a9930be1','0x7ffcb923a29c779a6b5',75,
163 3,10000, 119 3,10000,
164 ], 512 => [ 120 ], 512 => [
165 '0xfa000000','0x7e000000',31, 121 '0xfa000000','0x7e000000',31,
166 '0xfa00000000000000','0x7e00000000000000',63,
167 125,64, 122 125,64,
168 '0x83126e98','0xfdf3b645',32, 123 '0x83126e98','0xfdf3b645',32,
169 '0x83126e978d4fdf3c','0xfdf3b645a1cac083',64,
170 64,125, 124 64,125,
171 '0xf4240000','0x1c0000',21, 125 '0xf4240000','0x1c0000',21,
172 '0xf424000000000000','0x1c000000000000',53,
173 15625,8, 126 15625,8,
174 '0x8637bd06','0x3ffef39085f',42, 127 '0x8637bd06','0x3ffef39085f',42,
175 '0x8637bd05af6c69b6','0x3ffef39085f4a1272c9',74,
176 8,15625, 128 8,15625,
177 ], 1000 => [ 129 ], 1000 => [
178 '0x80000000','0x0',31, 130 '0x80000000','0x0',31,
179 '0x8000000000000000','0x0',63,
180 1,1, 131 1,1,
181 '0x80000000','0x0',31, 132 '0x80000000','0x0',31,
182 '0x8000000000000000','0x0',63,
183 1,1, 133 1,1,
184 '0xfa000000','0x0',22, 134 '0xfa000000','0x0',22,
185 '0xfa00000000000000','0x0',54,
186 1000,1, 135 1000,1,
187 '0x83126e98','0x1ff7ced9168',41, 136 '0x83126e98','0x1ff7ced9168',41,
188 '0x83126e978d4fdf3c','0x1ff7ced916872b020c4',73,
189 1,1000, 137 1,1000,
190 ], 1024 => [ 138 ], 1024 => [
191 '0xfa000000','0xfe000000',32, 139 '0xfa000000','0xfe000000',32,
192 '0xfa00000000000000','0xfe00000000000000',64,
193 125,128, 140 125,128,
194 '0x83126e98','0x7ef9db22',31, 141 '0x83126e98','0x7ef9db22',31,
195 '0x83126e978d4fdf3c','0x7ef9db22d0e56041',63,
196 128,125, 142 128,125,
197 '0xf4240000','0x3c0000',22, 143 '0xf4240000','0x3c0000',22,
198 '0xf424000000000000','0x3c000000000000',54,
199 15625,16, 144 15625,16,
200 '0x8637bd06','0x1fff79c842f',41, 145 '0x8637bd06','0x1fff79c842f',41,
201 '0x8637bd05af6c69b6','0x1fff79c842fa5093964',73,
202 16,15625, 146 16,15625,
203 ], 1200 => [ 147 ], 1200 => [
204 '0xd5555556','0xd5555555',32, 148 '0xd5555556','0xd5555555',32,
205 '0xd555555555555556','0xd555555555555555',64,
206 5,6, 149 5,6,
207 '0x9999999a','0x66666666',31, 150 '0x9999999a','0x66666666',31,
208 '0x999999999999999a','0x6666666666666666',63,
209 6,5, 151 6,5,
210 '0xd0555556','0x2aaaaa',22, 152 '0xd0555556','0x2aaaaa',22,
211 '0xd055555555555556','0x2aaaaaaaaaaaaa',54,
212 2500,3, 153 2500,3,
213 '0x9d495183','0x1ffcb923a29',41, 154 '0x9d495183','0x1ffcb923a29',41,
214 '0x9d495182a9930be1','0x1ffcb923a29c779a6b5',73,
215 3,2500, 155 3,2500,
216 ] 156 ]
217); 157);
@@ -264,6 +204,15 @@ sub fmuls($$$) {
264 return 0; 204 return 0;
265} 205}
266 206
207# Generate a hex value if the result fits in 64 bits;
208# otherwise skip.
209sub bignum_hex($) {
210 my($x) = @_;
211 my $s = $x->as_hex();
212
213 return (length($s) > 18) ? undef : $s;
214}
215
267# Provides mul, adj, and shr factors for a specific 216# Provides mul, adj, and shr factors for a specific
268# (bit, time, hz) combination 217# (bit, time, hz) combination
269sub muladj($$$) { 218sub muladj($$$) {
@@ -271,7 +220,7 @@ sub muladj($$$) {
271 my $s = fmuls($b, $t, $hz); 220 my $s = fmuls($b, $t, $hz);
272 my $m = fmul($s, $t, $hz); 221 my $m = fmul($s, $t, $hz);
273 my $a = fadj($s, $t, $hz); 222 my $a = fadj($s, $t, $hz);
274 return ($m->as_hex(), $a->as_hex(), $s); 223 return (bignum_hex($m), bignum_hex($a), $s);
275} 224}
276 225
277# Provides numerator, denominator values 226# Provides numerator, denominator values
@@ -288,12 +237,10 @@ sub conversions($$) {
288 237
289 # HZ_TO_xx 238 # HZ_TO_xx
290 push(@val, muladj(32, $t, $hz)); 239 push(@val, muladj(32, $t, $hz));
291 push(@val, muladj(64, $t, $hz));
292 push(@val, numden($t, $hz)); 240 push(@val, numden($t, $hz));
293 241
294 # xx_TO_HZ 242 # xx_TO_HZ
295 push(@val, muladj(32, $hz, $t)); 243 push(@val, muladj(32, $hz, $t));
296 push(@val, muladj(64, $hz, $t));
297 push(@val, numden($hz, $t)); 244 push(@val, numden($hz, $t));
298 245
299 return @val; 246 return @val;
@@ -318,6 +265,19 @@ sub compute_values($) {
318 return @val; 265 return @val;
319} 266}
320 267
268sub outputval($$)
269{
270 my($name, $val) = @_;
271 my $csuf;
272
273 if (defined($val)) {
274 if ($name !~ /SHR/) {
275 $val = "U64_C($val)";
276 }
277 printf "#define %-23s %s\n", $name.$csuf, $val.$csuf;
278 }
279}
280
321sub output($@) 281sub output($@)
322{ 282{
323 my($hz, @val) = @_; 283 my($hz, @val) = @_;
@@ -331,6 +291,7 @@ sub output($@)
331 print "\n"; 291 print "\n";
332 292
333 print "#include <linux/param.h>\n"; 293 print "#include <linux/param.h>\n";
294 print "#include <linux/types.h>\n";
334 295
335 print "\n"; 296 print "\n";
336 print "#if HZ != $hz\n"; 297 print "#if HZ != $hz\n";
@@ -340,15 +301,13 @@ sub output($@)
340 301
341 foreach $pfx ('HZ_TO_MSEC','MSEC_TO_HZ', 302 foreach $pfx ('HZ_TO_MSEC','MSEC_TO_HZ',
342 'HZ_TO_USEC','USEC_TO_HZ') { 303 'HZ_TO_USEC','USEC_TO_HZ') {
343 foreach $bit (32, 64) { 304 foreach $bit (32) {
344 foreach $suf ('MUL', 'ADJ', 'SHR') { 305 foreach $suf ('MUL', 'ADJ', 'SHR') {
345 printf "#define %-23s %s\n", 306 outputval("${pfx}_$suf$bit", shift(@val));
346 "${pfx}_$suf$bit", shift(@val);
347 } 307 }
348 } 308 }
349 foreach $suf ('NUM', 'DEN') { 309 foreach $suf ('NUM', 'DEN') {
350 printf "#define %-23s %s\n", 310 outputval("${pfx}_$suf", shift(@val));
351 "${pfx}_$suf", shift(@val);
352 } 311 }
353 } 312 }
354 313
@@ -356,6 +315,23 @@ sub output($@)
356 print "#endif /* KERNEL_TIMECONST_H */\n"; 315 print "#endif /* KERNEL_TIMECONST_H */\n";
357} 316}
358 317
318# Pretty-print Perl values
319sub perlvals(@) {
320 my $v;
321 my @l = ();
322
323 foreach $v (@_) {
324 if (!defined($v)) {
325 push(@l, 'undef');
326 } elsif ($v =~ /^0x/) {
327 push(@l, "\'".$v."\'");
328 } else {
329 push(@l, $v.'');
330 }
331 }
332 return join(',', @l);
333}
334
359($hz) = @ARGV; 335($hz) = @ARGV;
360 336
361# Use this to generate the %canned_values structure 337# Use this to generate the %canned_values structure
@@ -373,15 +349,15 @@ if ($hz eq '--can') {
373 print "$pf$hz => [\n"; 349 print "$pf$hz => [\n";
374 while (scalar(@values)) { 350 while (scalar(@values)) {
375 my $bit; 351 my $bit;
376 foreach $bit (32, 64) { 352 foreach $bit (32) {
377 my $m = shift(@values); 353 my $m = shift(@values);
378 my $a = shift(@values); 354 my $a = shift(@values);
379 my $s = shift(@values); 355 my $s = shift(@values);
380 print "\t\t\'",$m,"\',\'",$a,"\',",$s,",\n"; 356 print "\t\t", perlvals($m,$a,$s), ",\n";
381 } 357 }
382 my $n = shift(@values); 358 my $n = shift(@values);
383 my $d = shift(@values); 359 my $d = shift(@values);
384 print "\t\t",$n,',',$d,",\n"; 360 print "\t\t", perlvals($n,$d), ",\n";
385 } 361 }
386 print "\t]"; 362 print "\t]";
387 $pf = ', '; 363 $pf = ', ';
diff --git a/mm/slub.c b/mm/slub.c
index 32b62623846a..d379b782fc83 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -217,7 +217,7 @@ struct track {
217 217
218enum track_item { TRACK_ALLOC, TRACK_FREE }; 218enum track_item { TRACK_ALLOC, TRACK_FREE };
219 219
220#if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG) 220#ifdef CONFIG_SLUB_DEBUG
221static int sysfs_slab_add(struct kmem_cache *); 221static int sysfs_slab_add(struct kmem_cache *);
222static int sysfs_slab_alias(struct kmem_cache *, const char *); 222static int sysfs_slab_alias(struct kmem_cache *, const char *);
223static void sysfs_slab_remove(struct kmem_cache *); 223static void sysfs_slab_remove(struct kmem_cache *);
@@ -814,7 +814,8 @@ static int on_freelist(struct kmem_cache *s, struct page *page, void *search)
814 return search == NULL; 814 return search == NULL;
815} 815}
816 816
817static void trace(struct kmem_cache *s, struct page *page, void *object, int alloc) 817static void trace(struct kmem_cache *s, struct page *page, void *object,
818 int alloc)
818{ 819{
819 if (s->flags & SLAB_TRACE) { 820 if (s->flags & SLAB_TRACE) {
820 printk(KERN_INFO "TRACE %s %s 0x%p inuse=%d fp=0x%p\n", 821 printk(KERN_INFO "TRACE %s %s 0x%p inuse=%d fp=0x%p\n",
@@ -1267,8 +1268,7 @@ static void add_partial(struct kmem_cache_node *n,
1267 spin_unlock(&n->list_lock); 1268 spin_unlock(&n->list_lock);
1268} 1269}
1269 1270
1270static void remove_partial(struct kmem_cache *s, 1271static void remove_partial(struct kmem_cache *s, struct page *page)
1271 struct page *page)
1272{ 1272{
1273 struct kmem_cache_node *n = get_node(s, page_to_nid(page)); 1273 struct kmem_cache_node *n = get_node(s, page_to_nid(page));
1274 1274
@@ -1283,7 +1283,8 @@ static void remove_partial(struct kmem_cache *s,
1283 * 1283 *
1284 * Must hold list_lock. 1284 * Must hold list_lock.
1285 */ 1285 */
1286static inline int lock_and_freeze_slab(struct kmem_cache_node *n, struct page *page) 1286static inline int lock_and_freeze_slab(struct kmem_cache_node *n,
1287 struct page *page)
1287{ 1288{
1288 if (slab_trylock(page)) { 1289 if (slab_trylock(page)) {
1289 list_del(&page->lru); 1290 list_del(&page->lru);
@@ -1420,8 +1421,8 @@ static void unfreeze_slab(struct kmem_cache *s, struct page *page, int tail)
1420 * so that the others get filled first. That way the 1421 * so that the others get filled first. That way the
1421 * size of the partial list stays small. 1422 * size of the partial list stays small.
1422 * 1423 *
1423 * kmem_cache_shrink can reclaim any empty slabs from the 1424 * kmem_cache_shrink can reclaim any empty slabs from
1424 * partial list. 1425 * the partial list.
1425 */ 1426 */
1426 add_partial(n, page, 1); 1427 add_partial(n, page, 1);
1427 slab_unlock(page); 1428 slab_unlock(page);
@@ -2909,7 +2910,7 @@ static int slab_mem_going_online_callback(void *arg)
2909 return 0; 2910 return 0;
2910 2911
2911 /* 2912 /*
2912 * We are bringing a node online. No memory is availabe yet. We must 2913 * We are bringing a node online. No memory is available yet. We must
2913 * allocate a kmem_cache_node structure in order to bring the node 2914 * allocate a kmem_cache_node structure in order to bring the node
2914 * online. 2915 * online.
2915 */ 2916 */
@@ -3246,7 +3247,7 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
3246 return slab_alloc(s, gfpflags, node, caller); 3247 return slab_alloc(s, gfpflags, node, caller);
3247} 3248}
3248 3249
3249#if (defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)) || defined(CONFIG_SLABINFO) 3250#ifdef CONFIG_SLUB_DEBUG
3250static unsigned long count_partial(struct kmem_cache_node *n, 3251static unsigned long count_partial(struct kmem_cache_node *n,
3251 int (*get_count)(struct page *)) 3252 int (*get_count)(struct page *))
3252{ 3253{
@@ -3275,9 +3276,7 @@ static int count_free(struct page *page)
3275{ 3276{
3276 return page->objects - page->inuse; 3277 return page->objects - page->inuse;
3277} 3278}
3278#endif
3279 3279
3280#if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)
3281static int validate_slab(struct kmem_cache *s, struct page *page, 3280static int validate_slab(struct kmem_cache *s, struct page *page,
3282 unsigned long *map) 3281 unsigned long *map)
3283{ 3282{
@@ -3812,7 +3811,12 @@ SLAB_ATTR_RO(objs_per_slab);
3812static ssize_t order_store(struct kmem_cache *s, 3811static ssize_t order_store(struct kmem_cache *s,
3813 const char *buf, size_t length) 3812 const char *buf, size_t length)
3814{ 3813{
3815 int order = simple_strtoul(buf, NULL, 10); 3814 unsigned long order;
3815 int err;
3816
3817 err = strict_strtoul(buf, 10, &order);
3818 if (err)
3819 return err;
3816 3820
3817 if (order > slub_max_order || order < slub_min_order) 3821 if (order > slub_max_order || order < slub_min_order)
3818 return -EINVAL; 3822 return -EINVAL;
@@ -4065,10 +4069,16 @@ static ssize_t remote_node_defrag_ratio_show(struct kmem_cache *s, char *buf)
4065static ssize_t remote_node_defrag_ratio_store(struct kmem_cache *s, 4069static ssize_t remote_node_defrag_ratio_store(struct kmem_cache *s,
4066 const char *buf, size_t length) 4070 const char *buf, size_t length)
4067{ 4071{
4068 int n = simple_strtoul(buf, NULL, 10); 4072 unsigned long ratio;
4073 int err;
4074
4075 err = strict_strtoul(buf, 10, &ratio);
4076 if (err)
4077 return err;
4078
4079 if (ratio < 100)
4080 s->remote_node_defrag_ratio = ratio * 10;
4069 4081
4070 if (n < 100)
4071 s->remote_node_defrag_ratio = n * 10;
4072 return length; 4082 return length;
4073} 4083}
4074SLAB_ATTR(remote_node_defrag_ratio); 4084SLAB_ATTR(remote_node_defrag_ratio);
@@ -4425,8 +4435,8 @@ __initcall(slab_sysfs_init);
4425 */ 4435 */
4426#ifdef CONFIG_SLABINFO 4436#ifdef CONFIG_SLABINFO
4427 4437
4428ssize_t slabinfo_write(struct file *file, const char __user * buffer, 4438ssize_t slabinfo_write(struct file *file, const char __user *buffer,
4429 size_t count, loff_t *ppos) 4439 size_t count, loff_t *ppos)
4430{ 4440{
4431 return -EINVAL; 4441 return -EINVAL;
4432} 4442}
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index daad0064e2c2..08b54b593d56 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -176,12 +176,11 @@ int vlan_proc_add_dev(struct net_device *vlandev)
176 struct vlan_dev_info *dev_info = vlan_dev_info(vlandev); 176 struct vlan_dev_info *dev_info = vlan_dev_info(vlandev);
177 struct vlan_net *vn = net_generic(dev_net(vlandev), vlan_net_id); 177 struct vlan_net *vn = net_generic(dev_net(vlandev), vlan_net_id);
178 178
179 dev_info->dent = proc_create(vlandev->name, S_IFREG|S_IRUSR|S_IWUSR, 179 dev_info->dent =
180 vn->proc_vlan_dir, &vlandev_fops); 180 proc_create_data(vlandev->name, S_IFREG|S_IRUSR|S_IWUSR,
181 vn->proc_vlan_dir, &vlandev_fops, vlandev);
181 if (!dev_info->dent) 182 if (!dev_info->dent)
182 return -ENOBUFS; 183 return -ENOBUFS;
183
184 dev_info->dent->data = vlandev;
185 return 0; 184 return 0;
186} 185}
187 186
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 5c9f3d148135..49487b313f22 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -417,12 +417,10 @@ int atm_proc_dev_register(struct atm_dev *dev)
417 goto err_out; 417 goto err_out;
418 sprintf(dev->proc_name,"%s:%d",dev->type, dev->number); 418 sprintf(dev->proc_name,"%s:%d",dev->type, dev->number);
419 419
420 dev->proc_entry = proc_create(dev->proc_name, 0, atm_proc_root, 420 dev->proc_entry = proc_create_data(dev->proc_name, 0, atm_proc_root,
421 &proc_atm_dev_ops); 421 &proc_atm_dev_ops, dev);
422 if (!dev->proc_entry) 422 if (!dev->proc_entry)
423 goto err_free_name; 423 goto err_free_name;
424 dev->proc_entry->data = dev;
425 dev->proc_entry->owner = THIS_MODULE;
426 return 0; 424 return 0;
427err_free_name: 425err_free_name:
428 kfree(dev->proc_name); 426 kfree(dev->proc_name);
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c
index 347e935faaf0..f85d94643aaf 100644
--- a/net/bluetooth/bnep/core.c
+++ b/net/bluetooth/bnep/core.c
@@ -135,7 +135,7 @@ static int bnep_ctrl_set_netfilter(struct bnep_session *s, __be16 *data, int len
135 if (len < 2) 135 if (len < 2)
136 return -EILSEQ; 136 return -EILSEQ;
137 137
138 n = ntohs(get_unaligned(data)); 138 n = get_unaligned_be16(data);
139 data++; len -= 2; 139 data++; len -= 2;
140 140
141 if (len < n) 141 if (len < n)
@@ -150,8 +150,8 @@ static int bnep_ctrl_set_netfilter(struct bnep_session *s, __be16 *data, int len
150 int i; 150 int i;
151 151
152 for (i = 0; i < n; i++) { 152 for (i = 0; i < n; i++) {
153 f[i].start = ntohs(get_unaligned(data++)); 153 f[i].start = get_unaligned_be16(data++);
154 f[i].end = ntohs(get_unaligned(data++)); 154 f[i].end = get_unaligned_be16(data++);
155 155
156 BT_DBG("proto filter start %d end %d", 156 BT_DBG("proto filter start %d end %d",
157 f[i].start, f[i].end); 157 f[i].start, f[i].end);
@@ -180,7 +180,7 @@ static int bnep_ctrl_set_mcfilter(struct bnep_session *s, u8 *data, int len)
180 if (len < 2) 180 if (len < 2)
181 return -EILSEQ; 181 return -EILSEQ;
182 182
183 n = ntohs(get_unaligned((__be16 *) data)); 183 n = get_unaligned_be16(data);
184 data += 2; len -= 2; 184 data += 2; len -= 2;
185 185
186 if (len < n) 186 if (len < n)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 46df2e403df8..6aef8f24e581 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -129,8 +129,7 @@ static void hci_cc_write_link_policy(struct hci_dev *hdev, struct sk_buff *skb)
129 129
130 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle)); 130 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(rp->handle));
131 if (conn) { 131 if (conn) {
132 __le16 policy = get_unaligned((__le16 *) (sent + 2)); 132 conn->link_policy = get_unaligned_le16(sent + 2);
133 conn->link_policy = __le16_to_cpu(policy);
134 } 133 }
135 134
136 hci_dev_unlock(hdev); 135 hci_dev_unlock(hdev);
@@ -313,7 +312,7 @@ static void hci_cc_write_voice_setting(struct hci_dev *hdev, struct sk_buff *skb
313 return; 312 return;
314 313
315 if (!status) { 314 if (!status) {
316 __u16 setting = __le16_to_cpu(get_unaligned((__le16 *) sent)); 315 __u16 setting = get_unaligned_le16(sent);
317 316
318 if (hdev->voice_setting != setting) { 317 if (hdev->voice_setting != setting) {
319 hdev->voice_setting = setting; 318 hdev->voice_setting = setting;
@@ -1152,8 +1151,8 @@ static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *s
1152 struct hci_conn *conn; 1151 struct hci_conn *conn;
1153 __u16 handle, count; 1152 __u16 handle, count;
1154 1153
1155 handle = __le16_to_cpu(get_unaligned(ptr++)); 1154 handle = get_unaligned_le16(ptr++);
1156 count = __le16_to_cpu(get_unaligned(ptr++)); 1155 count = get_unaligned_le16(ptr++);
1157 1156
1158 conn = hci_conn_hash_lookup_handle(hdev, handle); 1157 conn = hci_conn_hash_lookup_handle(hdev, handle);
1159 if (conn) { 1158 if (conn) {
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 1d36c093523b..747fabd735d2 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -440,7 +440,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
440 skb->dev = (void *) hdev; 440 skb->dev = (void *) hdev;
441 441
442 if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) { 442 if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) {
443 u16 opcode = __le16_to_cpu(get_unaligned((__le16 *) skb->data)); 443 u16 opcode = get_unaligned_le16(skb->data);
444 u16 ogf = hci_opcode_ogf(opcode); 444 u16 ogf = hci_opcode_ogf(opcode);
445 u16 ocf = hci_opcode_ocf(opcode); 445 u16 ocf = hci_opcode_ocf(opcode);
446 446
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index a4849f2c1d81..6e180d255505 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1827,7 +1827,7 @@ static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cm
1827 del_timer(&conn->info_timer); 1827 del_timer(&conn->info_timer);
1828 1828
1829 if (type == L2CAP_IT_FEAT_MASK) 1829 if (type == L2CAP_IT_FEAT_MASK)
1830 conn->feat_mask = __le32_to_cpu(get_unaligned((__le32 *) rsp->data)); 1830 conn->feat_mask = get_unaligned_le32(rsp->data);
1831 1831
1832 l2cap_conn_start(conn); 1832 l2cap_conn_start(conn);
1833 1833
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index 9326c377822e..72c5976a5ce3 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -285,7 +285,11 @@ int br_fdb_fillbuf(struct net_bridge *br, void *buf,
285 285
286 /* convert from internal format to API */ 286 /* convert from internal format to API */
287 memcpy(fe->mac_addr, f->addr.addr, ETH_ALEN); 287 memcpy(fe->mac_addr, f->addr.addr, ETH_ALEN);
288
289 /* due to ABI compat need to split into hi/lo */
288 fe->port_no = f->dst->port_no; 290 fe->port_no = f->dst->port_no;
291 fe->port_hi = f->dst->port_no >> 8;
292
289 fe->is_local = f->is_local; 293 fe->is_local = f->is_local;
290 if (!f->is_static) 294 if (!f->is_static)
291 fe->ageing_timer_value = jiffies_to_clock_t(jiffies - f->ageing_timer); 295 fe->ageing_timer_value = jiffies_to_clock_t(jiffies - f->ageing_timer);
diff --git a/net/bridge/br_stp_bpdu.c b/net/bridge/br_stp_bpdu.c
index 8deab645ef75..ddeb6e5d45d6 100644
--- a/net/bridge/br_stp_bpdu.c
+++ b/net/bridge/br_stp_bpdu.c
@@ -58,12 +58,12 @@ static inline void br_set_ticks(unsigned char *dest, int j)
58{ 58{
59 unsigned long ticks = (STP_HZ * j)/ HZ; 59 unsigned long ticks = (STP_HZ * j)/ HZ;
60 60
61 put_unaligned(htons(ticks), (__be16 *)dest); 61 put_unaligned_be16(ticks, dest);
62} 62}
63 63
64static inline int br_get_ticks(const unsigned char *src) 64static inline int br_get_ticks(const unsigned char *src)
65{ 65{
66 unsigned long ticks = ntohs(get_unaligned((__be16 *)src)); 66 unsigned long ticks = get_unaligned_be16(src);
67 67
68 return DIV_ROUND_UP(ticks * HZ, STP_HZ); 68 return DIV_ROUND_UP(ticks * HZ, STP_HZ);
69} 69}
diff --git a/net/core/dev.c b/net/core/dev.c
index ed49da592051..d334446a8eaf 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -162,7 +162,7 @@ struct net_dma {
162 struct dma_client client; 162 struct dma_client client;
163 spinlock_t lock; 163 spinlock_t lock;
164 cpumask_t channel_mask; 164 cpumask_t channel_mask;
165 struct dma_chan *channels[NR_CPUS]; 165 struct dma_chan **channels;
166}; 166};
167 167
168static enum dma_state_client 168static enum dma_state_client
@@ -2444,7 +2444,7 @@ static struct netif_rx_stats *softnet_get_online(loff_t *pos)
2444{ 2444{
2445 struct netif_rx_stats *rc = NULL; 2445 struct netif_rx_stats *rc = NULL;
2446 2446
2447 while (*pos < NR_CPUS) 2447 while (*pos < nr_cpu_ids)
2448 if (cpu_online(*pos)) { 2448 if (cpu_online(*pos)) {
2449 rc = &per_cpu(netdev_rx_stat, *pos); 2449 rc = &per_cpu(netdev_rx_stat, *pos);
2450 break; 2450 break;
@@ -3776,6 +3776,7 @@ int register_netdevice(struct net_device *dev)
3776 } 3776 }
3777 } 3777 }
3778 3778
3779 netdev_initialize_kobject(dev);
3779 ret = netdev_register_kobject(dev); 3780 ret = netdev_register_kobject(dev);
3780 if (ret) 3781 if (ret)
3781 goto err_uninit; 3782 goto err_uninit;
@@ -4208,7 +4209,8 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
4208 } 4209 }
4209 4210
4210 /* Fixup kobjects */ 4211 /* Fixup kobjects */
4211 err = device_rename(&dev->dev, dev->name); 4212 netdev_unregister_kobject(dev);
4213 err = netdev_register_kobject(dev);
4212 WARN_ON(err); 4214 WARN_ON(err);
4213 4215
4214 /* Add the device back in the hashes */ 4216 /* Add the device back in the hashes */
@@ -4324,7 +4326,7 @@ netdev_dma_event(struct dma_client *client, struct dma_chan *chan,
4324 spin_lock(&net_dma->lock); 4326 spin_lock(&net_dma->lock);
4325 switch (state) { 4327 switch (state) {
4326 case DMA_RESOURCE_AVAILABLE: 4328 case DMA_RESOURCE_AVAILABLE:
4327 for (i = 0; i < NR_CPUS; i++) 4329 for (i = 0; i < nr_cpu_ids; i++)
4328 if (net_dma->channels[i] == chan) { 4330 if (net_dma->channels[i] == chan) {
4329 found = 1; 4331 found = 1;
4330 break; 4332 break;
@@ -4339,7 +4341,7 @@ netdev_dma_event(struct dma_client *client, struct dma_chan *chan,
4339 } 4341 }
4340 break; 4342 break;
4341 case DMA_RESOURCE_REMOVED: 4343 case DMA_RESOURCE_REMOVED:
4342 for (i = 0; i < NR_CPUS; i++) 4344 for (i = 0; i < nr_cpu_ids; i++)
4343 if (net_dma->channels[i] == chan) { 4345 if (net_dma->channels[i] == chan) {
4344 found = 1; 4346 found = 1;
4345 pos = i; 4347 pos = i;
@@ -4366,6 +4368,13 @@ netdev_dma_event(struct dma_client *client, struct dma_chan *chan,
4366 */ 4368 */
4367static int __init netdev_dma_register(void) 4369static int __init netdev_dma_register(void)
4368{ 4370{
4371 net_dma.channels = kzalloc(nr_cpu_ids * sizeof(struct net_dma),
4372 GFP_KERNEL);
4373 if (unlikely(!net_dma.channels)) {
4374 printk(KERN_NOTICE
4375 "netdev_dma: no memory for net_dma.channels\n");
4376 return -ENOMEM;
4377 }
4369 spin_lock_init(&net_dma.lock); 4378 spin_lock_init(&net_dma.lock);
4370 dma_cap_set(DMA_MEMCPY, net_dma.client.cap_mask); 4379 dma_cap_set(DMA_MEMCPY, net_dma.client.cap_mask);
4371 dma_async_client_register(&net_dma.client); 4380 dma_async_client_register(&net_dma.client);
diff --git a/net/core/filter.c b/net/core/filter.c
index f5f3cf603064..4f8369729a4e 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -213,7 +213,7 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
213load_w: 213load_w:
214 ptr = load_pointer(skb, k, 4, &tmp); 214 ptr = load_pointer(skb, k, 4, &tmp);
215 if (ptr != NULL) { 215 if (ptr != NULL) {
216 A = ntohl(get_unaligned((__be32 *)ptr)); 216 A = get_unaligned_be32(ptr);
217 continue; 217 continue;
218 } 218 }
219 break; 219 break;
@@ -222,7 +222,7 @@ load_w:
222load_h: 222load_h:
223 ptr = load_pointer(skb, k, 2, &tmp); 223 ptr = load_pointer(skb, k, 2, &tmp);
224 if (ptr != NULL) { 224 if (ptr != NULL) {
225 A = ntohs(get_unaligned((__be16 *)ptr)); 225 A = get_unaligned_be16(ptr);
226 continue; 226 continue;
227 } 227 }
228 break; 228 break;
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 75075c303c44..5d9d7130bd6e 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1430,11 +1430,10 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl)
1430 panic("cannot create neighbour cache statistics"); 1430 panic("cannot create neighbour cache statistics");
1431 1431
1432#ifdef CONFIG_PROC_FS 1432#ifdef CONFIG_PROC_FS
1433 tbl->pde = proc_create(tbl->id, 0, init_net.proc_net_stat, 1433 tbl->pde = proc_create_data(tbl->id, 0, init_net.proc_net_stat,
1434 &neigh_stat_seq_fops); 1434 &neigh_stat_seq_fops, tbl);
1435 if (!tbl->pde) 1435 if (!tbl->pde)
1436 panic("cannot create neighbour proc dir entry"); 1436 panic("cannot create neighbour proc dir entry");
1437 tbl->pde->data = tbl;
1438#endif 1437#endif
1439 1438
1440 tbl->hash_mask = 1; 1439 tbl->hash_mask = 1;
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 4e7b847347f7..90e2177af081 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -449,7 +449,6 @@ int netdev_register_kobject(struct net_device *net)
449 struct device *dev = &(net->dev); 449 struct device *dev = &(net->dev);
450 struct attribute_group **groups = net->sysfs_groups; 450 struct attribute_group **groups = net->sysfs_groups;
451 451
452 device_initialize(dev);
453 dev->class = &net_class; 452 dev->class = &net_class;
454 dev->platform_data = net; 453 dev->platform_data = net;
455 dev->groups = groups; 454 dev->groups = groups;
@@ -470,6 +469,12 @@ int netdev_register_kobject(struct net_device *net)
470 return device_add(dev); 469 return device_add(dev);
471} 470}
472 471
472void netdev_initialize_kobject(struct net_device *net)
473{
474 struct device *device = &(net->dev);
475 device_initialize(device);
476}
477
473int netdev_kobject_init(void) 478int netdev_kobject_init(void)
474{ 479{
475 return class_register(&net_class); 480 return class_register(&net_class);
diff --git a/net/core/net-sysfs.h b/net/core/net-sysfs.h
index f5f108db3924..14e7524260b3 100644
--- a/net/core/net-sysfs.h
+++ b/net/core/net-sysfs.h
@@ -4,5 +4,5 @@
4int netdev_kobject_init(void); 4int netdev_kobject_init(void);
5int netdev_register_kobject(struct net_device *); 5int netdev_register_kobject(struct net_device *);
6void netdev_unregister_kobject(struct net_device *); 6void netdev_unregister_kobject(struct net_device *);
7 7void netdev_initialize_kobject(struct net_device *);
8#endif 8#endif
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index a803b442234c..8dca21110493 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3570,15 +3570,14 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
3570 if (err) 3570 if (err)
3571 goto out1; 3571 goto out1;
3572 3572
3573 pkt_dev->entry = proc_create(ifname, 0600, 3573 pkt_dev->entry = proc_create_data(ifname, 0600, pg_proc_dir,
3574 pg_proc_dir, &pktgen_if_fops); 3574 &pktgen_if_fops, pkt_dev);
3575 if (!pkt_dev->entry) { 3575 if (!pkt_dev->entry) {
3576 printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", 3576 printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n",
3577 PG_PROC_DIR, ifname); 3577 PG_PROC_DIR, ifname);
3578 err = -EINVAL; 3578 err = -EINVAL;
3579 goto out2; 3579 goto out2;
3580 } 3580 }
3581 pkt_dev->entry->data = pkt_dev;
3582#ifdef CONFIG_XFRM 3581#ifdef CONFIG_XFRM
3583 pkt_dev->ipsmode = XFRM_MODE_TRANSPORT; 3582 pkt_dev->ipsmode = XFRM_MODE_TRANSPORT;
3584 pkt_dev->ipsproto = IPPROTO_ESP; 3583 pkt_dev->ipsproto = IPPROTO_ESP;
@@ -3628,7 +3627,8 @@ static int __init pktgen_create_thread(int cpu)
3628 kthread_bind(p, cpu); 3627 kthread_bind(p, cpu);
3629 t->tsk = p; 3628 t->tsk = p;
3630 3629
3631 pe = proc_create(t->tsk->comm, 0600, pg_proc_dir, &pktgen_thread_fops); 3630 pe = proc_create_data(t->tsk->comm, 0600, pg_proc_dir,
3631 &pktgen_thread_fops, t);
3632 if (!pe) { 3632 if (!pe) {
3633 printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", 3633 printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n",
3634 PG_PROC_DIR, t->tsk->comm); 3634 PG_PROC_DIR, t->tsk->comm);
@@ -3638,8 +3638,6 @@ static int __init pktgen_create_thread(int cpu)
3638 return -EINVAL; 3638 return -EINVAL;
3639 } 3639 }
3640 3640
3641 pe->data = t;
3642
3643 wake_up_process(p); 3641 wake_up_process(p);
3644 3642
3645 return 0; 3643 return 0;
@@ -3716,8 +3714,6 @@ static int __init pg_init(void)
3716 return -EINVAL; 3714 return -EINVAL;
3717 } 3715 }
3718 3716
3719 pe->data = NULL;
3720
3721 /* Register us to receive netdevice events */ 3717 /* Register us to receive netdevice events */
3722 register_netdevice_notifier(&pktgen_notifier_block); 3718 register_netdevice_notifier(&pktgen_notifier_block);
3723 3719
diff --git a/net/core/sock.c b/net/core/sock.c
index 5dbb81bc9673..fa76f04fa9c6 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -228,11 +228,12 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen)
228 static int warned __read_mostly; 228 static int warned __read_mostly;
229 229
230 *timeo_p = 0; 230 *timeo_p = 0;
231 if (warned < 10 && net_ratelimit()) 231 if (warned < 10 && net_ratelimit()) {
232 warned++; 232 warned++;
233 printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) " 233 printk(KERN_INFO "sock_set_timeout: `%s' (pid %d) "
234 "tries to set negative timeout\n", 234 "tries to set negative timeout\n",
235 current->comm, task_pid_nr(current)); 235 current->comm, task_pid_nr(current));
236 }
236 return 0; 237 return 0;
237 } 238 }
238 *timeo_p = MAX_SCHEDULE_TIMEOUT; 239 *timeo_p = MAX_SCHEDULE_TIMEOUT;
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index b5b52ebb2693..8e9580874216 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -716,7 +716,7 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
716 * packets for new connections, following the rules from [RFC3390]". 716 * packets for new connections, following the rules from [RFC3390]".
717 * We need to convert the bytes of RFC3390 into the packets of RFC 4341. 717 * We need to convert the bytes of RFC3390 into the packets of RFC 4341.
718 */ 718 */
719 hctx->ccid2hctx_cwnd = min(4U, max(2U, 4380U / dp->dccps_mss_cache)); 719 hctx->ccid2hctx_cwnd = clamp(4380U / dp->dccps_mss_cache, 2U, 4U);
720 720
721 /* Make sure that Ack Ratio is enabled and within bounds. */ 721 /* Make sure that Ack Ratio is enabled and within bounds. */
722 max_ratio = DIV_ROUND_UP(hctx->ccid2hctx_cwnd, 2); 722 max_ratio = DIV_ROUND_UP(hctx->ccid2hctx_cwnd, 2);
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index e76f460af0ea..cd61dea2eea1 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -88,8 +88,8 @@ static void ccid3_hc_tx_set_state(struct sock *sk,
88static inline u64 rfc3390_initial_rate(struct sock *sk) 88static inline u64 rfc3390_initial_rate(struct sock *sk)
89{ 89{
90 const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk); 90 const struct ccid3_hc_tx_sock *hctx = ccid3_hc_tx_sk(sk);
91 const __u32 w_init = min_t(__u32, 4 * hctx->ccid3hctx_s, 91 const __u32 w_init = clamp_t(__u32, 4380U,
92 max_t(__u32, 2 * hctx->ccid3hctx_s, 4380)); 92 2 * hctx->ccid3hctx_s, 4 * hctx->ccid3hctx_s);
93 93
94 return scaled_div(w_init << 6, hctx->ccid3hctx_rtt); 94 return scaled_div(w_init << 6, hctx->ccid3hctx_rtt);
95} 95}
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 4637ded3dba8..05afb576d935 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -983,7 +983,7 @@ static int cipso_v4_map_cat_enum_valid(const struct cipso_v4_doi *doi_def,
983 return -EFAULT; 983 return -EFAULT;
984 984
985 for (iter = 0; iter < enumcat_len; iter += 2) { 985 for (iter = 0; iter < enumcat_len; iter += 2) {
986 cat = ntohs(get_unaligned((__be16 *)&enumcat[iter])); 986 cat = get_unaligned_be16(&enumcat[iter]);
987 if (cat <= cat_prev) 987 if (cat <= cat_prev)
988 return -EFAULT; 988 return -EFAULT;
989 cat_prev = cat; 989 cat_prev = cat;
@@ -1052,7 +1052,7 @@ static int cipso_v4_map_cat_enum_ntoh(const struct cipso_v4_doi *doi_def,
1052 1052
1053 for (iter = 0; iter < net_cat_len; iter += 2) { 1053 for (iter = 0; iter < net_cat_len; iter += 2) {
1054 ret_val = netlbl_secattr_catmap_setbit(secattr->attr.mls.cat, 1054 ret_val = netlbl_secattr_catmap_setbit(secattr->attr.mls.cat,
1055 ntohs(get_unaligned((__be16 *)&net_cat[iter])), 1055 get_unaligned_be16(&net_cat[iter]),
1056 GFP_ATOMIC); 1056 GFP_ATOMIC);
1057 if (ret_val != 0) 1057 if (ret_val != 0)
1058 return ret_val; 1058 return ret_val;
@@ -1086,10 +1086,9 @@ static int cipso_v4_map_cat_rng_valid(const struct cipso_v4_doi *doi_def,
1086 return -EFAULT; 1086 return -EFAULT;
1087 1087
1088 for (iter = 0; iter < rngcat_len; iter += 4) { 1088 for (iter = 0; iter < rngcat_len; iter += 4) {
1089 cat_high = ntohs(get_unaligned((__be16 *)&rngcat[iter])); 1089 cat_high = get_unaligned_be16(&rngcat[iter]);
1090 if ((iter + 4) <= rngcat_len) 1090 if ((iter + 4) <= rngcat_len)
1091 cat_low = ntohs( 1091 cat_low = get_unaligned_be16(&rngcat[iter + 2]);
1092 get_unaligned((__be16 *)&rngcat[iter + 2]));
1093 else 1092 else
1094 cat_low = 0; 1093 cat_low = 0;
1095 1094
@@ -1188,10 +1187,9 @@ static int cipso_v4_map_cat_rng_ntoh(const struct cipso_v4_doi *doi_def,
1188 u16 cat_high; 1187 u16 cat_high;
1189 1188
1190 for (net_iter = 0; net_iter < net_cat_len; net_iter += 4) { 1189 for (net_iter = 0; net_iter < net_cat_len; net_iter += 4) {
1191 cat_high = ntohs(get_unaligned((__be16 *)&net_cat[net_iter])); 1190 cat_high = get_unaligned_be16(&net_cat[net_iter]);
1192 if ((net_iter + 4) <= net_cat_len) 1191 if ((net_iter + 4) <= net_cat_len)
1193 cat_low = ntohs( 1192 cat_low = get_unaligned_be16(&net_cat[net_iter + 2]);
1194 get_unaligned((__be16 *)&net_cat[net_iter + 2]));
1195 else 1193 else
1196 cat_low = 0; 1194 cat_low = 0;
1197 1195
@@ -1562,7 +1560,7 @@ int cipso_v4_validate(unsigned char **option)
1562 } 1560 }
1563 1561
1564 rcu_read_lock(); 1562 rcu_read_lock();
1565 doi_def = cipso_v4_doi_search(ntohl(get_unaligned((__be32 *)&opt[2]))); 1563 doi_def = cipso_v4_doi_search(get_unaligned_be32(&opt[2]));
1566 if (doi_def == NULL) { 1564 if (doi_def == NULL) {
1567 err_offset = 2; 1565 err_offset = 2;
1568 goto validate_return_locked; 1566 goto validate_return_locked;
@@ -1843,7 +1841,7 @@ static int cipso_v4_getattr(const unsigned char *cipso,
1843 if (cipso_v4_cache_check(cipso, cipso[1], secattr) == 0) 1841 if (cipso_v4_cache_check(cipso, cipso[1], secattr) == 0)
1844 return 0; 1842 return 0;
1845 1843
1846 doi = ntohl(get_unaligned((__be32 *)&cipso[2])); 1844 doi = get_unaligned_be32(&cipso[2]);
1847 rcu_read_lock(); 1845 rcu_read_lock();
1848 doi_def = cipso_v4_doi_search(doi); 1846 doi_def = cipso_v4_doi_search(doi);
1849 if (doi_def == NULL) 1847 if (doi_def == NULL)
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
index 22d8e7cd9197..1819ad7ab910 100644
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
+++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -169,14 +169,14 @@ clusterip_config_init(const struct ipt_clusterip_tgt_info *i, __be32 ip,
169 169
170 /* create proc dir entry */ 170 /* create proc dir entry */
171 sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip)); 171 sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip));
172 c->pde = proc_create(buffer, S_IWUSR|S_IRUSR, 172 c->pde = proc_create_data(buffer, S_IWUSR|S_IRUSR,
173 clusterip_procdir, &clusterip_proc_fops); 173 clusterip_procdir,
174 &clusterip_proc_fops, c);
174 if (!c->pde) { 175 if (!c->pde) {
175 kfree(c); 176 kfree(c);
176 return NULL; 177 return NULL;
177 } 178 }
178 } 179 }
179 c->pde->data = c;
180#endif 180#endif
181 181
182 write_lock_bh(&clusterip_lock); 182 write_lock_bh(&clusterip_lock);
diff --git a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c
index 44618b675916..bfcbd148a89d 100644
--- a/net/ipv4/tcp_hybla.c
+++ b/net/ipv4/tcp_hybla.c
@@ -101,8 +101,10 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
101 if (!tcp_is_cwnd_limited(sk, in_flight)) 101 if (!tcp_is_cwnd_limited(sk, in_flight))
102 return; 102 return;
103 103
104 if (!ca->hybla_en) 104 if (!ca->hybla_en) {
105 return tcp_reno_cong_avoid(sk, ack, in_flight); 105 tcp_reno_cong_avoid(sk, ack, in_flight);
106 return;
107 }
106 108
107 if (ca->rho == 0) 109 if (ca->rho == 0)
108 hybla_recalc_param(sk); 110 hybla_recalc_param(sk);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 0298f80681f2..eda4f4a233f3 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1172,8 +1172,8 @@ static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb,
1172 struct tcp_sack_block_wire *sp, int num_sacks, 1172 struct tcp_sack_block_wire *sp, int num_sacks,
1173 u32 prior_snd_una) 1173 u32 prior_snd_una)
1174{ 1174{
1175 u32 start_seq_0 = ntohl(get_unaligned(&sp[0].start_seq)); 1175 u32 start_seq_0 = get_unaligned_be32(&sp[0].start_seq);
1176 u32 end_seq_0 = ntohl(get_unaligned(&sp[0].end_seq)); 1176 u32 end_seq_0 = get_unaligned_be32(&sp[0].end_seq);
1177 int dup_sack = 0; 1177 int dup_sack = 0;
1178 1178
1179 if (before(start_seq_0, TCP_SKB_CB(ack_skb)->ack_seq)) { 1179 if (before(start_seq_0, TCP_SKB_CB(ack_skb)->ack_seq)) {
@@ -1181,8 +1181,8 @@ static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb,
1181 tcp_dsack_seen(tp); 1181 tcp_dsack_seen(tp);
1182 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); 1182 NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV);
1183 } else if (num_sacks > 1) { 1183 } else if (num_sacks > 1) {
1184 u32 end_seq_1 = ntohl(get_unaligned(&sp[1].end_seq)); 1184 u32 end_seq_1 = get_unaligned_be32(&sp[1].end_seq);
1185 u32 start_seq_1 = ntohl(get_unaligned(&sp[1].start_seq)); 1185 u32 start_seq_1 = get_unaligned_be32(&sp[1].start_seq);
1186 1186
1187 if (!after(end_seq_0, end_seq_1) && 1187 if (!after(end_seq_0, end_seq_1) &&
1188 !before(start_seq_0, start_seq_1)) { 1188 !before(start_seq_0, start_seq_1)) {
@@ -1453,8 +1453,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
1453 for (i = 0; i < num_sacks; i++) { 1453 for (i = 0; i < num_sacks; i++) {
1454 int dup_sack = !i && found_dup_sack; 1454 int dup_sack = !i && found_dup_sack;
1455 1455
1456 sp[used_sacks].start_seq = ntohl(get_unaligned(&sp_wire[i].start_seq)); 1456 sp[used_sacks].start_seq = get_unaligned_be32(&sp_wire[i].start_seq);
1457 sp[used_sacks].end_seq = ntohl(get_unaligned(&sp_wire[i].end_seq)); 1457 sp[used_sacks].end_seq = get_unaligned_be32(&sp_wire[i].end_seq);
1458 1458
1459 if (!tcp_is_sackblock_valid(tp, dup_sack, 1459 if (!tcp_is_sackblock_valid(tp, dup_sack,
1460 sp[used_sacks].start_seq, 1460 sp[used_sacks].start_seq,
@@ -3340,7 +3340,7 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx,
3340 switch (opcode) { 3340 switch (opcode) {
3341 case TCPOPT_MSS: 3341 case TCPOPT_MSS:
3342 if (opsize == TCPOLEN_MSS && th->syn && !estab) { 3342 if (opsize == TCPOLEN_MSS && th->syn && !estab) {
3343 u16 in_mss = ntohs(get_unaligned((__be16 *)ptr)); 3343 u16 in_mss = get_unaligned_be16(ptr);
3344 if (in_mss) { 3344 if (in_mss) {
3345 if (opt_rx->user_mss && 3345 if (opt_rx->user_mss &&
3346 opt_rx->user_mss < in_mss) 3346 opt_rx->user_mss < in_mss)
@@ -3369,8 +3369,8 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx,
3369 ((estab && opt_rx->tstamp_ok) || 3369 ((estab && opt_rx->tstamp_ok) ||
3370 (!estab && sysctl_tcp_timestamps))) { 3370 (!estab && sysctl_tcp_timestamps))) {
3371 opt_rx->saw_tstamp = 1; 3371 opt_rx->saw_tstamp = 1;
3372 opt_rx->rcv_tsval = ntohl(get_unaligned((__be32 *)ptr)); 3372 opt_rx->rcv_tsval = get_unaligned_be32(ptr);
3373 opt_rx->rcv_tsecr = ntohl(get_unaligned((__be32 *)(ptr+4))); 3373 opt_rx->rcv_tsecr = get_unaligned_be32(ptr + 4);
3374 } 3374 }
3375 break; 3375 break;
3376 case TCPOPT_SACK_PERM: 3376 case TCPOPT_SACK_PERM:
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 0e9bc120707d..cd601a866c2f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -2214,9 +2214,6 @@ static int tcp_seq_open(struct inode *inode, struct file *file)
2214 struct tcp_iter_state *s; 2214 struct tcp_iter_state *s;
2215 int err; 2215 int err;
2216 2216
2217 if (unlikely(afinfo == NULL))
2218 return -EINVAL;
2219
2220 err = seq_open_net(inode, file, &afinfo->seq_ops, 2217 err = seq_open_net(inode, file, &afinfo->seq_ops,
2221 sizeof(struct tcp_iter_state)); 2218 sizeof(struct tcp_iter_state));
2222 if (err < 0) 2219 if (err < 0)
@@ -2241,10 +2238,9 @@ int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo)
2241 afinfo->seq_ops.next = tcp_seq_next; 2238 afinfo->seq_ops.next = tcp_seq_next;
2242 afinfo->seq_ops.stop = tcp_seq_stop; 2239 afinfo->seq_ops.stop = tcp_seq_stop;
2243 2240
2244 p = proc_net_fops_create(net, afinfo->name, S_IRUGO, &afinfo->seq_fops); 2241 p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net,
2245 if (p) 2242 &afinfo->seq_fops, afinfo);
2246 p->data = afinfo; 2243 if (!p)
2247 else
2248 rc = -ENOMEM; 2244 rc = -ENOMEM;
2249 return rc; 2245 return rc;
2250} 2246}
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index 0e1a8c91f78e..14504dada116 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -167,8 +167,10 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
167 struct tcp_sock *tp = tcp_sk(sk); 167 struct tcp_sock *tp = tcp_sk(sk);
168 struct vegas *vegas = inet_csk_ca(sk); 168 struct vegas *vegas = inet_csk_ca(sk);
169 169
170 if (!vegas->doing_vegas_now) 170 if (!vegas->doing_vegas_now) {
171 return tcp_reno_cong_avoid(sk, ack, in_flight); 171 tcp_reno_cong_avoid(sk, ack, in_flight);
172 return;
173 }
172 174
173 /* The key players are v_beg_snd_una and v_beg_snd_nxt. 175 /* The key players are v_beg_snd_una and v_beg_snd_nxt.
174 * 176 *
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c
index 2bf618a3b00b..d08b2e855c22 100644
--- a/net/ipv4/tcp_veno.c
+++ b/net/ipv4/tcp_veno.c
@@ -119,8 +119,10 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
119 struct tcp_sock *tp = tcp_sk(sk); 119 struct tcp_sock *tp = tcp_sk(sk);
120 struct veno *veno = inet_csk_ca(sk); 120 struct veno *veno = inet_csk_ca(sk);
121 121
122 if (!veno->doing_veno_now) 122 if (!veno->doing_veno_now) {
123 return tcp_reno_cong_avoid(sk, ack, in_flight); 123 tcp_reno_cong_avoid(sk, ack, in_flight);
124 return;
125 }
124 126
125 /* limited by applications */ 127 /* limited by applications */
126 if (!tcp_is_cwnd_limited(sk, in_flight)) 128 if (!tcp_is_cwnd_limited(sk, in_flight))
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 1f535e315188..db1cb7c96d63 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1605,10 +1605,9 @@ int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo)
1605 afinfo->seq_ops.next = udp_seq_next; 1605 afinfo->seq_ops.next = udp_seq_next;
1606 afinfo->seq_ops.stop = udp_seq_stop; 1606 afinfo->seq_ops.stop = udp_seq_stop;
1607 1607
1608 p = proc_net_fops_create(net, afinfo->name, S_IRUGO, &afinfo->seq_fops); 1608 p = proc_create_data(afinfo->name, S_IRUGO, net->proc_net,
1609 if (p) 1609 &afinfo->seq_fops, afinfo);
1610 p->data = afinfo; 1610 if (!p)
1611 else
1612 rc = -ENOMEM; 1611 rc = -ENOMEM;
1613 return rc; 1612 return rc;
1614} 1613}
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index ca8b82f96fe5..df0736a4cafa 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -247,13 +247,11 @@ int snmp6_register_dev(struct inet6_dev *idev)
247 if (!proc_net_devsnmp6) 247 if (!proc_net_devsnmp6)
248 return -ENOENT; 248 return -ENOENT;
249 249
250 p = proc_create(idev->dev->name, S_IRUGO, 250 p = proc_create_data(idev->dev->name, S_IRUGO,
251 proc_net_devsnmp6, &snmp6_seq_fops); 251 proc_net_devsnmp6, &snmp6_seq_fops, idev);
252 if (!p) 252 if (!p)
253 return -ENOMEM; 253 return -ENOMEM;
254 254
255 p->data = idev;
256
257 idev->stats.proc_dir_entry = p; 255 idev->stats.proc_dir_entry = p;
258 return 0; 256 return 0;
259} 257}
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 7b247e3a16fe..798cabc7535b 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -197,6 +197,7 @@ static void ip6_frag_expire(unsigned long data)
197{ 197{
198 struct frag_queue *fq; 198 struct frag_queue *fq;
199 struct net_device *dev = NULL; 199 struct net_device *dev = NULL;
200 struct net *net;
200 201
201 fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q); 202 fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q);
202 203
@@ -207,7 +208,8 @@ static void ip6_frag_expire(unsigned long data)
207 208
208 fq_kill(fq); 209 fq_kill(fq);
209 210
210 dev = dev_get_by_index(&init_net, fq->iif); 211 net = container_of(fq->q.net, struct net, ipv6.frags);
212 dev = dev_get_by_index(net, fq->iif);
211 if (!dev) 213 if (!dev)
212 goto out; 214 goto out;
213 215
diff --git a/net/irda/iriap.c b/net/irda/iriap.c
index 9e15c82960fe..4a105dc32dcd 100644
--- a/net/irda/iriap.c
+++ b/net/irda/iriap.c
@@ -451,12 +451,14 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
451 n = 2; 451 n = 2;
452 452
453 /* Get length, MSB first */ 453 /* Get length, MSB first */
454 len = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); n += 2; 454 len = get_unaligned_be16(fp + n);
455 n += 2;
455 456
456 IRDA_DEBUG(4, "%s(), len=%d\n", __func__, len); 457 IRDA_DEBUG(4, "%s(), len=%d\n", __func__, len);
457 458
458 /* Get object ID, MSB first */ 459 /* Get object ID, MSB first */
459 obj_id = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); n += 2; 460 obj_id = get_unaligned_be16(fp + n);
461 n += 2;
460 462
461 type = fp[n++]; 463 type = fp[n++];
462 IRDA_DEBUG(4, "%s(), Value type = %d\n", __func__, type); 464 IRDA_DEBUG(4, "%s(), Value type = %d\n", __func__, type);
@@ -506,7 +508,7 @@ static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
506 value = irias_new_string_value(fp+n); 508 value = irias_new_string_value(fp+n);
507 break; 509 break;
508 case IAS_OCT_SEQ: 510 case IAS_OCT_SEQ:
509 value_len = be16_to_cpu(get_unaligned((__be16 *)(fp+n))); 511 value_len = get_unaligned_be16(fp + n);
510 n += 2; 512 n += 2;
511 513
512 /* Will truncate to IAS_MAX_OCTET_STRING bytes */ 514 /* Will truncate to IAS_MAX_OCTET_STRING bytes */
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 8e53ce7ed444..c7314bf4bec2 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -354,7 +354,7 @@ struct ieee80211_if_sta {
354 int preq_queue_len; 354 int preq_queue_len;
355 struct mesh_stats mshstats; 355 struct mesh_stats mshstats;
356 struct mesh_config mshcfg; 356 struct mesh_config mshcfg;
357 u8 mesh_seqnum[3]; 357 u32 mesh_seqnum;
358 bool accepting_plinks; 358 bool accepting_plinks;
359#endif 359#endif
360 u16 aid; 360 u16 aid;
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index e9a978979d38..9ad4e3631b6b 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -255,22 +255,8 @@ static int ieee80211_open(struct net_device *dev)
255 255
256 switch (sdata->vif.type) { 256 switch (sdata->vif.type) {
257 case IEEE80211_IF_TYPE_WDS: 257 case IEEE80211_IF_TYPE_WDS:
258 if (is_zero_ether_addr(sdata->u.wds.remote_addr)) 258 if (!is_valid_ether_addr(sdata->u.wds.remote_addr))
259 return -ENOLINK; 259 return -ENOLINK;
260
261 /* Create STA entry for the WDS peer */
262 sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
263 GFP_KERNEL);
264 if (!sta)
265 return -ENOMEM;
266
267 sta->flags |= WLAN_STA_AUTHORIZED;
268
269 res = sta_info_insert(sta);
270 if (res) {
271 /* STA has been freed */
272 return res;
273 }
274 break; 260 break;
275 case IEEE80211_IF_TYPE_VLAN: 261 case IEEE80211_IF_TYPE_VLAN:
276 if (!sdata->u.vlan.ap) 262 if (!sdata->u.vlan.ap)
@@ -337,10 +323,8 @@ static int ieee80211_open(struct net_device *dev)
337 conf.type = sdata->vif.type; 323 conf.type = sdata->vif.type;
338 conf.mac_addr = dev->dev_addr; 324 conf.mac_addr = dev->dev_addr;
339 res = local->ops->add_interface(local_to_hw(local), &conf); 325 res = local->ops->add_interface(local_to_hw(local), &conf);
340 if (res && !local->open_count && local->ops->stop)
341 local->ops->stop(local_to_hw(local));
342 if (res) 326 if (res)
343 return res; 327 goto err_stop;
344 328
345 ieee80211_if_config(dev); 329 ieee80211_if_config(dev);
346 ieee80211_reset_erp_info(dev); 330 ieee80211_reset_erp_info(dev);
@@ -353,9 +337,29 @@ static int ieee80211_open(struct net_device *dev)
353 netif_carrier_on(dev); 337 netif_carrier_on(dev);
354 } 338 }
355 339
340 if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) {
341 /* Create STA entry for the WDS peer */
342 sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr,
343 GFP_KERNEL);
344 if (!sta) {
345 res = -ENOMEM;
346 goto err_del_interface;
347 }
348
349 sta->flags |= WLAN_STA_AUTHORIZED;
350
351 res = sta_info_insert(sta);
352 if (res) {
353 /* STA has been freed */
354 goto err_del_interface;
355 }
356 }
357
356 if (local->open_count == 0) { 358 if (local->open_count == 0) {
357 res = dev_open(local->mdev); 359 res = dev_open(local->mdev);
358 WARN_ON(res); 360 WARN_ON(res);
361 if (res)
362 goto err_del_interface;
359 tasklet_enable(&local->tx_pending_tasklet); 363 tasklet_enable(&local->tx_pending_tasklet);
360 tasklet_enable(&local->tasklet); 364 tasklet_enable(&local->tasklet);
361 } 365 }
@@ -390,6 +394,12 @@ static int ieee80211_open(struct net_device *dev)
390 netif_start_queue(dev); 394 netif_start_queue(dev);
391 395
392 return 0; 396 return 0;
397 err_del_interface:
398 local->ops->remove_interface(local_to_hw(local), &conf);
399 err_stop:
400 if (!local->open_count && local->ops->stop)
401 local->ops->stop(local_to_hw(local));
402 return res;
393} 403}
394 404
395static int ieee80211_stop(struct net_device *dev) 405static int ieee80211_stop(struct net_device *dev)
@@ -975,6 +985,7 @@ static int __ieee80211_if_config(struct net_device *dev,
975 conf.ssid_len = sdata->u.sta.ssid_len; 985 conf.ssid_len = sdata->u.sta.ssid_len;
976 } else if (ieee80211_vif_is_mesh(&sdata->vif)) { 986 } else if (ieee80211_vif_is_mesh(&sdata->vif)) {
977 conf.beacon = beacon; 987 conf.beacon = beacon;
988 conf.beacon_control = control;
978 ieee80211_start_mesh(dev); 989 ieee80211_start_mesh(dev);
979 } else if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { 990 } else if (sdata->vif.type == IEEE80211_IF_TYPE_AP) {
980 conf.ssid = sdata->u.ap.ssid; 991 conf.ssid = sdata->u.ap.ssid;
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 594a3356a508..f76bc26ae4d2 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -8,6 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <asm/unaligned.h>
11#include "ieee80211_i.h" 12#include "ieee80211_i.h"
12#include "mesh.h" 13#include "mesh.h"
13 14
@@ -167,8 +168,8 @@ int mesh_rmc_check(u8 *sa, struct ieee80211s_hdr *mesh_hdr,
167 struct rmc_entry *p, *n; 168 struct rmc_entry *p, *n;
168 169
169 /* Don't care about endianness since only match matters */ 170 /* Don't care about endianness since only match matters */
170 memcpy(&seqnum, mesh_hdr->seqnum, sizeof(mesh_hdr->seqnum)); 171 memcpy(&seqnum, &mesh_hdr->seqnum, sizeof(mesh_hdr->seqnum));
171 idx = mesh_hdr->seqnum[0] & rmc->idx_mask; 172 idx = le32_to_cpu(mesh_hdr->seqnum) & rmc->idx_mask;
172 list_for_each_entry_safe(p, n, &rmc->bucket[idx].list, list) { 173 list_for_each_entry_safe(p, n, &rmc->bucket[idx].list, list) {
173 ++entries; 174 ++entries;
174 if (time_after(jiffies, p->exp_time) || 175 if (time_after(jiffies, p->exp_time) ||
@@ -393,16 +394,8 @@ int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr,
393{ 394{
394 meshhdr->flags = 0; 395 meshhdr->flags = 0;
395 meshhdr->ttl = sdata->u.sta.mshcfg.dot11MeshTTL; 396 meshhdr->ttl = sdata->u.sta.mshcfg.dot11MeshTTL;
396 397 put_unaligned(cpu_to_le32(sdata->u.sta.mesh_seqnum), &meshhdr->seqnum);
397 meshhdr->seqnum[0] = sdata->u.sta.mesh_seqnum[0]++; 398 sdata->u.sta.mesh_seqnum++;
398 meshhdr->seqnum[1] = sdata->u.sta.mesh_seqnum[1];
399 meshhdr->seqnum[2] = sdata->u.sta.mesh_seqnum[2];
400
401 if (sdata->u.sta.mesh_seqnum[0] == 0) {
402 sdata->u.sta.mesh_seqnum[1]++;
403 if (sdata->u.sta.mesh_seqnum[1] == 0)
404 sdata->u.sta.mesh_seqnum[2]++;
405 }
406 399
407 return 5; 400 return 5;
408} 401}
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 9ee3affab346..2e161f6d8288 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -140,7 +140,7 @@ struct rmc_entry {
140 140
141struct mesh_rmc { 141struct mesh_rmc {
142 struct rmc_entry bucket[RMC_BUCKETS]; 142 struct rmc_entry bucket[RMC_BUCKETS];
143 u8 idx_mask; 143 u32 idx_mask;
144}; 144};
145 145
146 146
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index dddbfd60f351..09093da24af6 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -230,10 +230,8 @@ void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
230 230
231 iv16 = data[hdr_len] << 8; 231 iv16 = data[hdr_len] << 8;
232 iv16 += data[hdr_len + 2]; 232 iv16 += data[hdr_len + 2];
233 iv32 = data[hdr_len + 4] + 233 iv32 = data[hdr_len + 4] | (data[hdr_len + 5] << 8) |
234 (data[hdr_len + 5] >> 8) + 234 (data[hdr_len + 6] << 16) | (data[hdr_len + 7] << 24);
235 (data[hdr_len + 6] >> 16) +
236 (data[hdr_len + 7] >> 24);
237 235
238#ifdef CONFIG_TKIP_DEBUG 236#ifdef CONFIG_TKIP_DEBUG
239 printk(KERN_DEBUG "TKIP encrypt: iv16 = 0x%04x, iv32 = 0x%08x\n", 237 printk(KERN_DEBUG "TKIP encrypt: iv16 = 0x%04x, iv32 = 0x%08x\n",
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index b59871f6bdda..46ea542d0df9 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -296,11 +296,11 @@ static int nf_conntrack_standalone_init_proc(void)
296 pde = proc_net_fops_create(&init_net, "nf_conntrack", 0440, &ct_file_ops); 296 pde = proc_net_fops_create(&init_net, "nf_conntrack", 0440, &ct_file_ops);
297 if (!pde) 297 if (!pde)
298 goto out_nf_conntrack; 298 goto out_nf_conntrack;
299 pde = create_proc_entry("nf_conntrack", S_IRUGO, init_net.proc_net_stat); 299
300 pde = proc_create("nf_conntrack", S_IRUGO, init_net.proc_net_stat,
301 &ct_cpu_seq_fops);
300 if (!pde) 302 if (!pde)
301 goto out_stat_nf_conntrack; 303 goto out_stat_nf_conntrack;
302 pde->proc_fops = &ct_cpu_seq_fops;
303 pde->owner = THIS_MODULE;
304 return 0; 304 return 0;
305 305
306out_stat_nf_conntrack: 306out_stat_nf_conntrack:
diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
index 11b22abc2b70..5d75cd86ebb3 100644
--- a/net/netfilter/x_tables.c
+++ b/net/netfilter/x_tables.c
@@ -936,25 +936,24 @@ int xt_proto_init(struct net *net, int af)
936#ifdef CONFIG_PROC_FS 936#ifdef CONFIG_PROC_FS
937 strlcpy(buf, xt_prefix[af], sizeof(buf)); 937 strlcpy(buf, xt_prefix[af], sizeof(buf));
938 strlcat(buf, FORMAT_TABLES, sizeof(buf)); 938 strlcat(buf, FORMAT_TABLES, sizeof(buf));
939 proc = proc_net_fops_create(net, buf, 0440, &xt_table_ops); 939 proc = proc_create_data(buf, 0440, net->proc_net, &xt_table_ops,
940 (void *)(unsigned long)af);
940 if (!proc) 941 if (!proc)
941 goto out; 942 goto out;
942 proc->data = (void *)(unsigned long)af;
943
944 943
945 strlcpy(buf, xt_prefix[af], sizeof(buf)); 944 strlcpy(buf, xt_prefix[af], sizeof(buf));
946 strlcat(buf, FORMAT_MATCHES, sizeof(buf)); 945 strlcat(buf, FORMAT_MATCHES, sizeof(buf));
947 proc = proc_net_fops_create(net, buf, 0440, &xt_match_ops); 946 proc = proc_create_data(buf, 0440, net->proc_net, &xt_match_ops,
947 (void *)(unsigned long)af);
948 if (!proc) 948 if (!proc)
949 goto out_remove_tables; 949 goto out_remove_tables;
950 proc->data = (void *)(unsigned long)af;
951 950
952 strlcpy(buf, xt_prefix[af], sizeof(buf)); 951 strlcpy(buf, xt_prefix[af], sizeof(buf));
953 strlcat(buf, FORMAT_TARGETS, sizeof(buf)); 952 strlcat(buf, FORMAT_TARGETS, sizeof(buf));
954 proc = proc_net_fops_create(net, buf, 0440, &xt_target_ops); 953 proc = proc_create_data(buf, 0440, net->proc_net, &xt_target_ops,
954 (void *)(unsigned long)af);
955 if (!proc) 955 if (!proc)
956 goto out_remove_matches; 956 goto out_remove_matches;
957 proc->data = (void *)(unsigned long)af;
958#endif 957#endif
959 958
960 return 0; 959 return 0;
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 40d344b21453..6809af542a2c 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -237,15 +237,15 @@ static int htable_create_v0(struct xt_hashlimit_info *minfo, int family)
237 hinfo->family = family; 237 hinfo->family = family;
238 hinfo->rnd_initialized = 0; 238 hinfo->rnd_initialized = 0;
239 spin_lock_init(&hinfo->lock); 239 spin_lock_init(&hinfo->lock);
240 hinfo->pde = proc_create(minfo->name, 0, 240 hinfo->pde =
241 proc_create_data(minfo->name, 0,
241 family == AF_INET ? hashlimit_procdir4 : 242 family == AF_INET ? hashlimit_procdir4 :
242 hashlimit_procdir6, 243 hashlimit_procdir6,
243 &dl_file_ops); 244 &dl_file_ops, hinfo);
244 if (!hinfo->pde) { 245 if (!hinfo->pde) {
245 vfree(hinfo); 246 vfree(hinfo);
246 return -1; 247 return -1;
247 } 248 }
248 hinfo->pde->data = hinfo;
249 249
250 setup_timer(&hinfo->timer, htable_gc, (unsigned long )hinfo); 250 setup_timer(&hinfo->timer, htable_gc, (unsigned long )hinfo);
251 hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); 251 hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval);
@@ -301,15 +301,15 @@ static int htable_create(struct xt_hashlimit_mtinfo1 *minfo,
301 hinfo->rnd_initialized = 0; 301 hinfo->rnd_initialized = 0;
302 spin_lock_init(&hinfo->lock); 302 spin_lock_init(&hinfo->lock);
303 303
304 hinfo->pde = proc_create(minfo->name, 0, 304 hinfo->pde =
305 proc_create_data(minfo->name, 0,
305 family == AF_INET ? hashlimit_procdir4 : 306 family == AF_INET ? hashlimit_procdir4 :
306 hashlimit_procdir6, 307 hashlimit_procdir6,
307 &dl_file_ops); 308 &dl_file_ops, hinfo);
308 if (hinfo->pde == NULL) { 309 if (hinfo->pde == NULL) {
309 vfree(hinfo); 310 vfree(hinfo);
310 return -1; 311 return -1;
311 } 312 }
312 hinfo->pde->data = hinfo;
313 313
314 setup_timer(&hinfo->timer, htable_gc, (unsigned long)hinfo); 314 setup_timer(&hinfo->timer, htable_gc, (unsigned long)hinfo);
315 hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval); 315 hinfo->timer.expires = jiffies + msecs_to_jiffies(hinfo->cfg.gc_interval);
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index 5053a53ba24f..bd593871c81e 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -1066,12 +1066,12 @@ out:
1066#ifdef CONFIG_PROC_FS 1066#ifdef CONFIG_PROC_FS
1067 1067
1068static void *rose_node_start(struct seq_file *seq, loff_t *pos) 1068static void *rose_node_start(struct seq_file *seq, loff_t *pos)
1069 __acquires(rose_neigh_list_lock) 1069 __acquires(rose_node_list_lock)
1070{ 1070{
1071 struct rose_node *rose_node; 1071 struct rose_node *rose_node;
1072 int i = 1; 1072 int i = 1;
1073 1073
1074 spin_lock_bh(&rose_neigh_list_lock); 1074 spin_lock_bh(&rose_node_list_lock);
1075 if (*pos == 0) 1075 if (*pos == 0)
1076 return SEQ_START_TOKEN; 1076 return SEQ_START_TOKEN;
1077 1077
@@ -1090,9 +1090,9 @@ static void *rose_node_next(struct seq_file *seq, void *v, loff_t *pos)
1090} 1090}
1091 1091
1092static void rose_node_stop(struct seq_file *seq, void *v) 1092static void rose_node_stop(struct seq_file *seq, void *v)
1093 __releases(rose_neigh_list_lock) 1093 __releases(rose_node_list_lock)
1094{ 1094{
1095 spin_unlock_bh(&rose_neigh_list_lock); 1095 spin_unlock_bh(&rose_node_list_lock);
1096} 1096}
1097 1097
1098static int rose_node_show(struct seq_file *seq, void *v) 1098static int rose_node_show(struct seq_file *seq, void *v)
diff --git a/net/rxrpc/ar-transport.c b/net/rxrpc/ar-transport.c
index bb282a6a19f0..64069c8769a5 100644
--- a/net/rxrpc/ar-transport.c
+++ b/net/rxrpc/ar-transport.c
@@ -184,12 +184,13 @@ void rxrpc_put_transport(struct rxrpc_transport *trans)
184 ASSERTCMP(atomic_read(&trans->usage), >, 0); 184 ASSERTCMP(atomic_read(&trans->usage), >, 0);
185 185
186 trans->put_time = get_seconds(); 186 trans->put_time = get_seconds();
187 if (unlikely(atomic_dec_and_test(&trans->usage))) 187 if (unlikely(atomic_dec_and_test(&trans->usage))) {
188 _debug("zombie"); 188 _debug("zombie");
189 /* let the reaper determine the timeout to avoid a race with 189 /* let the reaper determine the timeout to avoid a race with
190 * overextending the timeout if the reaper is running at the 190 * overextending the timeout if the reaper is running at the
191 * same time */ 191 * same time */
192 rxrpc_queue_delayed_work(&rxrpc_transport_reap, 0); 192 rxrpc_queue_delayed_work(&rxrpc_transport_reap, 0);
193 }
193 _leave(""); 194 _leave("");
194} 195}
195 196
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index b741618e4d54..d355e5e47fe3 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -219,6 +219,7 @@ static void dev_watchdog(unsigned long arg)
219 printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n", 219 printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n",
220 dev->name); 220 dev->name);
221 dev->tx_timeout(dev); 221 dev->tx_timeout(dev);
222 WARN_ON_ONCE(1);
222 } 223 }
223 if (!mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + dev->watchdog_timeo))) 224 if (!mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + dev->watchdog_timeo)))
224 dev_hold(dev); 225 dev_hold(dev);
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index d75530ff2a6d..c9966713282a 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -316,31 +316,28 @@ static int create_cache_proc_entries(struct cache_detail *cd)
316 cd->proc_ent->owner = cd->owner; 316 cd->proc_ent->owner = cd->owner;
317 cd->channel_ent = cd->content_ent = NULL; 317 cd->channel_ent = cd->content_ent = NULL;
318 318
319 p = proc_create("flush", S_IFREG|S_IRUSR|S_IWUSR, 319 p = proc_create_data("flush", S_IFREG|S_IRUSR|S_IWUSR,
320 cd->proc_ent, &cache_flush_operations); 320 cd->proc_ent, &cache_flush_operations, cd);
321 cd->flush_ent = p; 321 cd->flush_ent = p;
322 if (p == NULL) 322 if (p == NULL)
323 goto out_nomem; 323 goto out_nomem;
324 p->owner = cd->owner; 324 p->owner = cd->owner;
325 p->data = cd;
326 325
327 if (cd->cache_request || cd->cache_parse) { 326 if (cd->cache_request || cd->cache_parse) {
328 p = proc_create("channel", S_IFREG|S_IRUSR|S_IWUSR, 327 p = proc_create_data("channel", S_IFREG|S_IRUSR|S_IWUSR,
329 cd->proc_ent, &cache_file_operations); 328 cd->proc_ent, &cache_file_operations, cd);
330 cd->channel_ent = p; 329 cd->channel_ent = p;
331 if (p == NULL) 330 if (p == NULL)
332 goto out_nomem; 331 goto out_nomem;
333 p->owner = cd->owner; 332 p->owner = cd->owner;
334 p->data = cd;
335 } 333 }
336 if (cd->cache_show) { 334 if (cd->cache_show) {
337 p = proc_create("content", S_IFREG|S_IRUSR|S_IWUSR, 335 p = proc_create_data("content", S_IFREG|S_IRUSR|S_IWUSR,
338 cd->proc_ent, &content_file_operations); 336 cd->proc_ent, &content_file_operations, cd);
339 cd->content_ent = p; 337 cd->content_ent = p;
340 if (p == NULL) 338 if (p == NULL)
341 goto out_nomem; 339 goto out_nomem;
342 p->owner = cd->owner; 340 p->owner = cd->owner;
343 p->data = cd;
344 } 341 }
345 return 0; 342 return 0;
346out_nomem: 343out_nomem:
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index c6061a4346c8..50b049c6598a 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -224,16 +224,10 @@ EXPORT_SYMBOL_GPL(rpc_print_iostats);
224static inline struct proc_dir_entry * 224static inline struct proc_dir_entry *
225do_register(const char *name, void *data, const struct file_operations *fops) 225do_register(const char *name, void *data, const struct file_operations *fops)
226{ 226{
227 struct proc_dir_entry *ent;
228
229 rpc_proc_init(); 227 rpc_proc_init();
230 dprintk("RPC: registering /proc/net/rpc/%s\n", name); 228 dprintk("RPC: registering /proc/net/rpc/%s\n", name);
231 229
232 ent = proc_create(name, 0, proc_net_rpc, fops); 230 return proc_create_data(name, 0, proc_net_rpc, fops, data);
233 if (ent) {
234 ent->data = data;
235 }
236 return ent;
237} 231}
238 232
239struct proc_dir_entry * 233struct proc_dir_entry *
diff --git a/net/sysctl_net.c b/net/sysctl_net.c
index 665e856675a4..b4f0525f91af 100644
--- a/net/sysctl_net.c
+++ b/net/sysctl_net.c
@@ -82,6 +82,6 @@ EXPORT_SYMBOL_GPL(register_net_sysctl_table);
82 82
83void unregister_net_sysctl_table(struct ctl_table_header *header) 83void unregister_net_sysctl_table(struct ctl_table_header *header)
84{ 84{
85 return unregister_sysctl_table(header); 85 unregister_sysctl_table(header);
86} 86}
87EXPORT_SYMBOL_GPL(unregister_net_sysctl_table); 87EXPORT_SYMBOL_GPL(unregister_net_sysctl_table);